Skip to content

fix(tasks): tell Windows users why a task file was skipped - #12324

Merged
jdx merged 1 commit into
jdx:mainfrom
JamBalaya56562:fix/task-windows-executable-diagnostics
Aug 24, 2026
Merged

jdx merged 1 commit into
jdx:mainfrom
JamBalaya56562:fix/task-windows-executable-diagnostics

Conversation

@JamBalaya56562

@JamBalaya56562 JamBalaya56562 commented Aug 23, 2026 •

Copy link
Copy Markdown
Contributor

On Windows a task file with neither a known extension nor a shebang is skipped — correctly, since
is_executable has no permission bit to consult there — but nothing says so. Measured on
Windows 2026.8.10 against Linux 2026.8.3 as the control:

Linux (control) Windows
mise tasks ls no tasks found, but non-executable files exist … Run chmod +x … no output at all
mise run <name>, no other tasks names the file and the directory no tasks defined in …. Are you in a project directory?
mise run <name>, other tasks present no task X found, but a non-executable file exists at <path> that line is absent

Three diagnostics, all excluded on Windows by cfg!(windows).

The exclusion is left-over, and the correct wording already exists

#11923 was mine and it did not touch cli/tasks/ls.rs or task/task_list.rs. It removed the
reason for the exclusion and left the exclusion. find_non_executable_task_files already works on
Windows (is_executable has a Windows arm), so all that was missing was dropping the gates and
using 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.ps1 pins it. Only the remedy clause changes.

What changed

  • cli/tasks/ls.rs — gate dropped; the chmod +x sentence becomes make_executable_hint for
    the first offending file.

  • task/task_list.rs, the no-tasks-at-all error — same. One deliberate trade on unix: the
    old text listed up to five files (e.g.:\n chmod +x a b c) and now names one. The count and the
    directories 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 before
    doing anything. Only the prompt is genuinely inapplicable (make_executable cannot change
    whether 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_task already does elsewhere.

Tests

e2e-win/task.Tests.ps1 gets one new Context covering all three sites. The existing
a task file Windows cannot execute context is a different path — a TOML file = task, which
resolves and is then rejected by validate_task (what #11923 fixed). Here nothing resolves at all.

The fixture lives outside $TestDrive on purpose: the config at the TestDrive root includes a
tasks directory, and a project that inherits those tasks never reaches the two diagnostics that
only fire when nothing resolved. MISE_CONFIG_DIR is pointed at an empty directory for the same
reason — 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_error and e2e/tasks/test_task_validate
are the regression net; both assert non-executable and chmod +x, which Run: 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 --all is clean. cargo check does not run on this machine (libz-ng-sys wants cmake,
not installed), so type-checking and the full e2e-win run are left to CI — nothing here is
reported as having been compiled locally.

Summary by CodeRabbit

  • Bug Fixes

    • Improved diagnostics for non-executable task files on Windows.
    • Added platform-appropriate guidance for making task files executable.
    • Removed outdated chmod advice from Windows messages.
    • Improved error reporting when no tasks are found.
    • Enhanced task discovery messages across supported platforms.
  • Tests

    • Added Windows end-to-end coverage for task discovery, listing, and execution scenarios.

@coderabbitai

coderabbitai Bot commented Aug 23, 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: Repository YAML (base), Central YAML (inherited), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: c7b18d40-241d-4c06-9e5a-cde71d18b736

📥 Commits

Reviewing files that changed from the base of the PR and between 600becd and 8514d8a.

📒 Files selected for processing (2)
  • src/cli/tasks/ls.rs
  • src/task/task_list.rs

Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

The 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.

Changes

Cross-platform task diagnostics

Layer / File(s) Summary
Cross-platform diagnostic behavior
src/cli/tasks/ls.rs, src/task/task_list.rs
Non-executable task detection now runs on Windows. Diagnostics use platform-specific executable hints. Windows reports guidance without prompting or modifying files. Non-Windows prompting remains unchanged. CLI metadata access uses direct command fields.
Windows end-to-end validation
e2e-win/task.Tests.ps1
Tests cover empty projects, valid neighboring tasks, mise tasks ls, and mise run. Assertions verify file paths and shebang guidance and exclude chmod instructions.

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

Merge Risk: ⚪ Minimal · up to 8514d

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: jdx, risu729

Poem

A rabbit checks the task-file trail,
With Windows hints instead of chmod mail.
Shebangs point the proper way,
Good batch tasks still hop and play.
Tests guard each path today.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: improving Windows diagnostics for skipped task files.
Docstring Coverage ✅ Passed Docstring check was indeterminate for this PR — some files could not be analyzed in time. Not blocking.
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.

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 Aug 23, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR enables platform-appropriate diagnostics when Windows skips task-directory files that lack a recognized extension or shebang.

  • Removes Windows-only diagnostic gates from task listing and failed task lookup paths.
  • Uses the shared executable-remediation helper to provide platform-specific guidance.
  • Avoids offering Windows users an ineffective executable-permission prompt.
  • Adds Windows end-to-end coverage for empty and mixed task directories.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
src/cli/tasks/ls.rs Enables the no-tasks diagnostic on Windows and supplies remediation through the platform-aware executable hint.
src/task/task_list.rs Enables skipped-file diagnostics on Windows while retaining the executable-marking prompt only on platforms where it is effective.
e2e-win/task.Tests.ps1 Adds isolated Windows coverage for task listing and failed lookup diagnostics with and without runnable sibling tasks.

Reviews (5): Last reviewed commit: "fix(tasks): tell Windows users why a tas..." | Re-trigger Greptile

@JamBalaya56562
JamBalaya56562 force-pushed the fix/task-windows-executable-diagnostics branch from 600becd to cdfda27 Compare August 23, 2026 11:45
@JamBalaya56562
JamBalaya56562 force-pushed the fix/task-windows-executable-diagnostics branch 2 times, most recently from 8514d8a to 94723b8 Compare August 23, 2026 14:39
@JamBalaya56562
JamBalaya56562 force-pushed the fix/task-windows-executable-diagnostics branch from 94723b8 to 5bc167f Compare August 23, 2026 16:19
@JamBalaya56562
JamBalaya56562 marked this pull request as ready for review August 24, 2026 01:01
@jdx
jdx merged commit b6bf059 into jdx:main Aug 24, 2026
29 checks passed
@JamBalaya56562
JamBalaya56562 deleted the fix/task-windows-executable-diagnostics branch August 24, 2026 01:26
jdx pushed a commit that referenced this pull request Aug 24, 2026
### 🚀 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)
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