Skip to content

fix(task): skip mise configs in task include dirs#10500

Merged
jdx merged 2 commits into
mainfrom
codex/skip-mise-config-task-includes
Jun 17, 2026
Merged

fix(task): skip mise configs in task include dirs#10500
jdx merged 2 commits into
mainfrom
codex/skip-mise-config-task-includes

Conversation

@jdx

@jdx jdx commented Jun 17, 2026

Copy link
Copy Markdown
Owner

Summary

  • skip mise config TOML files when walking directory task includes
  • keep colocated task TOML files, such as tasks.toml, loadable from those directories
  • add a monorepo regression case for task_config.includes = ["."]

Context

Directory task includes started loading .toml files in v2026.6.1, which means an include like includes = ["."] could accidentally parse the child project's own mise.toml as a task TOML file. That breaks colocated monorepo file-task layouts like the one reported in discussion #10499.

Validation

  • mise run format
  • cargo fmt --all -- --check
  • cargo check --all-features
  • git diff --check
  • mise run test:e2e e2e/tasks/test_task_monorepo_includes

Refs #10499

This PR was generated by an AI coding assistant.


Note

Medium Risk
Changes core task discovery for directory includes; wrong glob matching could hide legitimate task TOMLs or still mis-parse configs, though scope is limited to the include walk filter.

Overview
Fixes directory task includes (task_config.includes pointing at a folder or ".") so they no longer treat mise platform/config TOMLs (e.g. mise.toml, .mise/config.toml) as standalone task definition files—a regression from loading all .toml files in include dirs.

When walking an include directory, TOML paths are now skipped if they match the same glob patterns used for normal config discovery (TOML_CONFIG_MATCHERS + is_mise_config_file_in_task_include). Colocated task TOMLs like tasks.toml, executable file tasks, and inline [tasks.*] in the project mise.toml still load as before.

Adds an e2e monorepo case for includes = ["."] asserting no bogus tasks such as task_config or nested-config tasks from parsed config files.

Reviewed by Cursor Bugbot for commit 67f5035. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by CodeRabbit

  • Bug Fixes

    • Improved task discovery for directory-based task includes to avoid mistakenly treating mise/config TOML files (and related platform/config TOMLs) as task include definitions.
  • Tests

    • Added an end-to-end test covering colocated monorepo includes (task_config.includes = ["."]) with nested TOMLs and an executable task, asserting the exact set of discovered tasks and verifying expected output for each runnable task.

@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 7ccba15a-b4c4-4bc8-a55e-cd35b5e03dfc

📥 Commits

Reviewing files that changed from the base of the PR and between 4c9775d and 67f5035.

📒 Files selected for processing (2)
  • e2e/tasks/test_task_monorepo_includes
  • src/config/mod.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • e2e/tasks/test_task_monorepo_includes

📝 Walkthrough

Walkthrough

In src/config/mod.rs, a new TOML_CONFIG_MATCHERS lazy static compiles TOML_CONFIG_FILENAMES into glob matchers, and load_tasks_includes now skips TOML files that match known mise/config filename patterns via a new is_mise_config_file_in_task_include helper. A colocated e2e test scenario validates this fix using task_config.includes = ["."].

Changes

Task include TOML exclusion fix

Layer / File(s) Summary
Glob matchers and task-include file classification
src/config/mod.rs
Adds TOML_CONFIG_MATCHERS lazy static compiled from TOML_CONFIG_FILENAMES, updates file classification in load_tasks_includes to skip TOML files matching known mise/config patterns, and adds is_mise_config_file_in_task_include to perform root-relative, slash-normalized glob matching.
E2E colocated monorepo test
e2e/tasks/test_task_monorepo_includes
Adds a projects/colocated scenario with includes = ["."], a tasks.toml, and an executable file task; asserts mise tasks ls --all discovers config-task, toml-task, and file-task and that mise run executes each correctly.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • jdx/mise#10219: Modifies the same load_tasks_includes code path in src/config/mod.rs to change how TOML files are detected inside included directories.
  • jdx/mise#10312: Also touches load_tasks_includes and included TOML task-file handling in src/config/mod.rs, threading template resolution into included tasks.
  • jdx/mise#10355: Changes task-include loading in src/config/mod.rs by adding trust-gating checks during the same include discovery and loading path.

Poem

🐇 In the toml maze I hopped one day,
A mise.toml wandered into the fray.
"You're not a task!" I twitched my nose,
A glob matcher bloomed like a springtime rose.
Now config files stay where they belong,
And every mise run sings the right song! 🎵

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main fix: skipping mise config files when processing task include directories, which addresses the core regression.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps

greptile-apps Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes a regression from v2026.6.1 where task_config.includes pointing at a directory (including ".") would accidentally parse mise config TOMLs (e.g. mise.toml, mise.local.toml, mise/config.toml) as task definition files, breaking colocated monorepo layouts.

  • Introduces TOML_CONFIG_MATCHERS (compiled globs from TOML_CONFIG_FILENAMES) and a new is_mise_config_file_in_task_include predicate that checks both the relative path from the include root and the bare filename, so nested configs like packages/foo/mise.toml are also caught.
  • Adds an e2e test that exercises includes = ["."] with a colocated tasks.toml, a nested mise.toml, and an executable file task, asserting the exact set of discovered tasks and including negative assertions that task_config and nested-config-task do not appear.

Confidence Score: 5/5

Safe to merge — the filter is narrowly scoped to the task include walk, colocated task TOMLs (tasks.toml) are unaffected, and the e2e test covers both the fixed case and the negative regression.

The change is well-contained: it only touches the file-classification step inside the directory task include walk. The filename-based check in is_mise_config_file_in_task_include correctly handles both root-level and nested mise config files. Colocated task TOMLs (tasks.toml) are not in TOML_CONFIG_FILENAMES and pass through untouched. The e2e test adds positive assertions for all expected tasks and negative assertions that verify mise.toml entries are not misinterpreted as tasks.

No files require special attention.

Important Files Changed

Filename Overview
src/config/mod.rs Adds TOML_CONFIG_MATCHERS static and is_mise_config_file_in_task_include to filter mise config TOMLs from directory task include walks; both relative-path and filename checks are applied to catch nested config files.
e2e/tasks/test_task_monorepo_includes Adds a colocated monorepo regression test for includes=["."] with positive assertions for expected tasks and negative assertions verifying mise.toml and nested config files are not parsed as task TOMLs.

Reviews (2): Last reviewed commit: "fix(task): skip nested config task inclu..." | Re-trigger Greptile

Comment thread src/config/mod.rs
Comment thread src/config/mod.rs
Comment thread e2e/tasks/test_task_monorepo_includes
@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown

Hyperfine Performance

mise x -- echo

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.6.11 x -- echo 27.9 ± 3.2 20.2 36.6 1.00
mise x -- echo 28.5 ± 3.0 22.2 40.8 1.02 ± 0.16

mise env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.6.11 env 25.7 ± 2.2 20.4 32.8 1.00
mise env 27.1 ± 2.8 22.0 39.4 1.05 ± 0.14

mise hook-env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.6.11 hook-env 26.6 ± 2.5 21.2 35.9 1.00
mise hook-env 28.2 ± 2.7 22.0 37.0 1.06 ± 0.14

mise ls

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.6.11 ls 22.8 ± 2.6 16.9 39.0 1.00
mise ls 23.7 ± 2.4 17.9 31.7 1.04 ± 0.16

xtasks/test/perf

Command mise-2026.6.11 mise Variance
install (cached) 174ms 177ms -1%
ls (cached) 81ms 86ms -5%
bin-paths (cached) 93ms 90ms +3%
task-ls (cached) 172ms 171ms +0%

@jdx

jdx commented Jun 17, 2026

Copy link
Copy Markdown
Owner Author

@greptileai

@jdx jdx merged commit 11395e0 into main Jun 17, 2026
62 of 66 checks passed
@jdx jdx deleted the codex/skip-mise-config-task-includes branch June 17, 2026 23:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant