Repository navigation
fix(tasks): tell Windows users why a task file was skipped - #12324
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughThe change enables Windows diagnostics for non-executable task files. It adds platform-specific executable guidance, preserves non-Windows behavior, and adds isolated Windows end-to-end coverage for task listing and execution. ChangesCross-platform task diagnostics
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to This change improves Windows task-file diagnostics without changing task execution behavior, and no actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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. Comment |
Greptile SummaryThis PR enables platform-appropriate diagnostics when Windows skips task-directory files that lack a recognized extension or shebang.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Important Files Changed
Reviews (5): Last reviewed commit: "fix(tasks): tell Windows users why a tas..." | Re-trigger Greptile |
600becd to
cdfda27
Compare
8514d8a to
94723b8
Compare
94723b8 to
5bc167f
Compare
### 🚀 Features - **(bootstrap)** add package plugin uninstall support by @jdx in [#12332](#12332) ### 🐛 Bug Fixes - **(brew-cask)** recognize Homebrew-owned casks by @donbeave in [#12346](#12346) - **(cli)** report a cd target it cannot enter instead of panicking by @JamBalaya56562 in [#12314](#12314) - **(config)** skip disabled idiomatic tracked configs by @xqm32 in [#12194](#12194) - **(config)** keep comments when saving from mise edit by @Marukome0743 in [#12319](#12319) - **(config)** strip a byte-order mark before reading a version file by @JamBalaya56562 in [#12325](#12325) - **(doctor)** report installs that provide no executables by @Marukome0743 in [#12321](#12321) - **(env)** say why an age SSH identity could not be used by @Marukome0743 in [#12339](#12339) - **(env)** name the key and file behind an unexpanded $VAR by @Marukome0743 in [#12316](#12316) - **(go)** don't hand go install a GOROOT from another Go by @Marukome0743 in [#12342](#12342) - **(task)** treat a SIGINT-killed child as an interruption by @Marukome0743 in [#12323](#12323) - **(task)** preserve string type for usage value flags by @jdx in [#12355](#12355) - **(tasks)** tell Windows users why a task file was skipped by @JamBalaya56562 in [#12324](#12324) - **(tool-stub)** keep env_with_path instead of rebuilding PATH by @tmkx in [#12322](#12322) - **(watch)** restore the controlling terminal from a drop guard by @Marukome0743 in [#12328](#12328) ### 🚜 Refactor - **(cli)** keep one copy of the task-flag escape rule by @JamBalaya56562 in [#12343](#12343) ### 📚 Documentation - **(tasks)** point extensionless pwsh tasks at MISE_TASK_DIR by @JamBalaya56562 in [#12313](#12313) ### 📦️ Dependency Updates - update rust crate aube-registry to v2.1.0 by @renovate[bot] in [#12348](#12348) - bump aube to 2.1.0 by @jdx in [#12351](#12351) - bump usage to 6.2.0 by @jdx in [#12354](#12354) ### 📦 Registry - fix usage version test by @jdx in [#12349](#12349) - install oc from a channel directory by @Marukome0743 in [#12326](#12326) ### Chore - **(ci)** use github runners for fork prs by @jdx in [#12345](#12345) - **(ci)** prevent cache warmer starvation by @jdx in [#12350](#12350) ### New Contributors - @tmkx made their first contribution in [#12322](#12322)
On Windows a task file with neither a known extension nor a shebang is skipped — correctly, since
is_executablehas no permission bit to consult there — but nothing says so. Measured onWindows 2026.8.10 against Linux 2026.8.3 as the control:
mise tasks lsno tasks found, but non-executable files exist … Run chmod +x …mise run <name>, no other tasksno tasks defined in …. Are you in a project directory?mise run <name>, other tasks presentno task X found, but a non-executable file exists at <path>Three diagnostics, all excluded on Windows by
cfg!(windows).The exclusion is left-over, and the correct wording already exists
chmod +x, which is meaninglesson Windows, so Windows was excluded from the start.
file::make_executable_hint— the one place that knows the remedy per platform — and applied itin
cli/run.rsandcli/tasks/validate.rs.#11923 was mine and it did not touch
cli/tasks/ls.rsortask/task_list.rs. It removed thereason for the exclusion and left the exclusion.
find_non_executable_task_filesalready works onWindows (
is_executablehas a Windows arm), so all that was missing was dropping the gates andusing the wording that is already there.
"not executable" stays as the phrasing: #11923 already settled on it as platform-neutral, and
e2e-win/task.Tests.ps1pins it. Only the remedy clause changes.What changed
cli/tasks/ls.rs— gate dropped; thechmod +xsentence becomesmake_executable_hintforthe first offending file.
task/task_list.rs, the no-tasks-at-all error — same. One deliberate trade on unix: theold text listed up to five files (
e.g.:\n chmod +x a b c) and now names one. The count and thedirectories are still reported, and keeping a single owner of the remedy is worth more than the
list.
task/task_list.rs,make_task_executable— the function returned early on Windows beforedoing anything. Only the prompt is genuinely inapplicable (
make_executablecannot changewhether Windows runs a file, so a "yes" would be accepted and change nothing), so the early
return moved below the warning, and on Windows the warning carries the hint instead of handing
off to a prompt. This matters most: when the project has other tasks, that warning is the only
thing that names the file.
Cost: Windows now walks the task directories on a failed task lookup. That is the error path
only, and the same walk
err_no_taskalready does elsewhere.Tests
e2e-win/task.Tests.ps1gets one newContextcovering all three sites. The existinga task file Windows cannot executecontext is a different path — a TOMLfile =task, whichresolves and is then rejected by
validate_task(what #11923 fixed). Here nothing resolves at all.The fixture lives outside
$TestDriveon purpose: the config at the TestDrive root includes atasks directory, and a project that inherits those tasks never reaches the two diagnostics that
only fire when nothing resolved.
MISE_CONFIG_DIRis pointed at an empty directory for the samereason — this suite does not otherwise isolate global tasks. Each case also asserts
-Not -BeLike '*chmod*', which is the original defect.The third case runs the working sibling first as a control, so a failure there cannot be mistaken
for an empty project.
No unix e2e was added.
e2e/tasks/test_task_non_executable_errorande2e/tasks/test_task_validateare the regression net; both assert
non-executableandchmod +x, whichRun: chmod +x <path>still satisfies, and neither pins the five-file listing.
Verification
The three new cases were run against the released 2026.8.10 binary first and fail for exactly the
reported reasons — empty output, the generic "Are you in a project directory?", and the missing
warning line. The two unix suites were run against the released Linux binary to establish the
before-state; both pass.
cargo fmt --allis clean.cargo checkdoes not run on this machine (libz-ng-syswantscmake,not installed), so type-checking and the full
e2e-winrun are left to CI — nothing here isreported as having been compiled locally.
Summary by CodeRabbit
Bug Fixes
chmodadvice from Windows messages.Tests