Skip to content

fix(task): mark global config file tasks as global - #11106

Merged
jdx merged 2 commits into
jdx:mainfrom
risu729:codex-20260718-071649-048df8
Jul 18, 2026
Merged

jdx merged 2 commits into
jdx:mainfrom
risu729:codex-20260718-071649-048df8

Conversation

@risu729

@risu729 risu729 commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • mark file tasks loaded by user-global or system configs as global regardless of their physical include path
  • preserve the existing behavior that treats scripts in standard global task directories as global
  • cover custom user-global and system task includes in task listing and project-root behavior

Root cause

File tasks were classified as global solely from the resolved include path. A user-global or system config could load scripts from a custom directory such as ~/dotfiles/tasks or an administrator-managed path, but those tasks retained global = false, causing incorrect --global/--local filtering and project-root selection.

User impact

Custom scripts included by user-global and system configs now remain available globally, appear under mise tasks --global, stay out of mise tasks --local, and use the invoking local project root.

Validation

  • mise run test:e2e test_task_ls_global
  • mise run lint-fix

Summary by CodeRabbit

  • Bug Fixes
    • Global task files included via the global configuration are now correctly recognized as global tasks.
    • Task listing now includes all configured global tasks alongside local tasks.
    • Running an included global task now correctly sets MISE_PROJECT_ROOT.
  • Tests
    • Updated end-to-end coverage to validate global and system-scoped task configuration behavior and expected task outputs.

@coderabbitai

coderabbitai Bot commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Global task loading now marks tasks included by global configuration files as global. The end-to-end test adds user and system global include directories and verifies task listing, filtering, and MISE_PROJECT_ROOT execution behavior.

Changes

Global task includes

Layer / File(s) Summary
Mark tasks from global configs
src/config/mod.rs
load_file_tasks marks tasks from included paths as global when their owning config file is global.
Validate included global tasks
e2e/tasks/test_task_ls_global
The test creates user and system global task include locations, then verifies task listings and execution output for customglobalfile and systemglobalfile.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant mise
  participant load_file_tasks
  participant GlobalTaskFiles
  User->>mise: Run task listing or execution
  mise->>load_file_tasks: Load task_config.includes
  load_file_tasks->>GlobalTaskFiles: Read included global task files
  load_file_tasks-->>mise: Mark included tasks as global
  mise-->>User: List or run global tasks
Loading

Possibly related PRs

  • jdx/mise#10225: Modifies task include processing in src/config/mod.rs.
  • jdx/mise#11103: Touches global task discovery and marking in src/config/mod.rs.

Poem

I hop through configs, tidy and bright,
Global tasks bloom in morning light.
Includes point onward, scripts hum and run,
Project roots print beneath the sun.
System and custom tasks join the parade—
A bunny-approved upgrade!

🚥 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
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: tasks loaded from global config files are now marked as global.

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.

@greptile-apps

greptile-apps Bot commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes file tasks loaded via custom includes inside a global config (~/.config/mise/config.toml, system config) being incorrectly classified as local. The root cause was that mark_tasks_as_global was only triggered by the physical include path (is_global_task_include_path), so any directory outside the standard ~/.config/mise/tasks hierarchy kept global = false.

  • src/config/mod.rs: In load_file_tasks, captures is_global_config(cf.get_path()) once and ORs it with is_global_task_include_path(&path) — tasks from any include of a global config are now marked global.
  • e2e/tasks/test_task_ls_global: Adds a ~/dotfiles/tasks/customglobalfile include via task_config.includes, a faked system config with an absolute-path task dir, and assertions for --global/--local filtering and correct MISE_PROJECT_ROOT when running those tasks.

Confidence Score: 5/5

Safe to merge — a two-line logic change with a targeted e2e test that exercises the new and pre-existing global-task paths.

The fix is surgical: one new boolean computed from the already-public is_global_config function, ORed into an existing guard. The pre-existing is_global_task_include_path branch is preserved unchanged, so standard global task directories continue to work. The e2e test covers custom global includes, system-config includes, --global/--local filtering, and MISE_PROJECT_ROOT propagation — all the scenarios the bug affected.

No files require special attention.

Important Files Changed

Filename Overview
src/config/mod.rs Adds is_global_config check before marking file tasks as global so that tasks loaded via custom includes in a global config are correctly flagged, regardless of their physical path. Two-line change: capture is_global early and OR it with the existing is_global_task_include_path guard.
e2e/tasks/test_task_ls_global Extends the e2e test to cover custom global task includes (~/dotfiles/tasks) and a faked system config with absolute-path includes; asserts correct task listing under --global/--local filters and verifies MISE_PROJECT_ROOT is the local project directory when running those global tasks.

Reviews (2): Last reviewed commit: "test(task): cover system config custom t..." | Re-trigger Greptile

@risu729
risu729 marked this pull request as ready for review July 18, 2026 16:36
@jdx
jdx merged commit 126e775 into jdx:main Jul 18, 2026
33 checks passed
@risu729
risu729 deleted the codex-20260718-071649-048df8 branch July 18, 2026 16:46
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.

2 participants