Skip to content

fix(task): match project-qualified monorepo tasks without // - #11782

Merged
jdx merged 1 commit into
jdx:mainfrom
williamsjokvist:main
Aug 9, 2026
Merged

jdx merged 1 commit into
jdx:mainfrom
williamsjokvist:main

Conversation

@williamsjokvist

@williamsjokvist williamsjokvist commented Aug 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

mise run web:build no longer resolves //web:build. Project-qualified task names without the // prefix regressed in 2026.8.1 (#11581); this restores them, keeping the group-boundary semantics that PR introduced.

Still worked throughout, for contrast: //web:build from anywhere, and build or :build from inside the project.

Repro

mise.toml           monorepo_root = true, config_roots = ["web"]
web/mise.toml       [tasks.build]
mise run web:build  # 2026.8.0: runs it. 

2026.8.1+: 
no task //:web:build found
Did you mean one of these?
  - //web:build

AI-assisted — Tool: Claude Code; model: Anthropic/claude-opus-5[1m]; version: unavailable.

Summary by CodeRabbit

  • New Features

    • Added support for referencing monorepo tasks with optional // prefixes.
    • Improved task matching for project-qualified patterns, wildcard scopes, and root task names containing colons.
  • Bug Fixes

    • Prevented incorrect matches when exact task names shadow project-qualified tasks.
    • Added clearer handling for unknown projects and tasks.

`mise run web:build` stopped resolving `//web:build` in 2026.8.1. jdx#11581
replaced the fall-through for patterns not starting with `//` with an early
return that matches whole task identities only, and deleted the
`relative_match` arm that had matched such patterns against keys with their
`//` prefix stripped. Bare project-qualified names reach `get_matching`
through the fallback in `task_list.rs`, so both halves of the regression sit
on that path. It also fails confusingly: `err_no_task` reports the expanded
`//:web:build`, a name the user never typed.

When identity matching finds nothing and the map holds monorepo keys, anchor
the pattern at the monorepo root instead. Monorepo keys are always rooted, so
this is equivalent to the removed prefix-stripped match, but it routes through
the current matcher and preserves the group-boundary semantics jdx#11581 added —
reinstating the old arm would have brought back the `*`-crosses-`:` bug.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 8, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This change allows unprefixed patterns to resolve monorepo project tasks when no direct match exists. Exact root task names remain preferred. Unit and end-to-end tests cover project matching, wildcard scoping, root task names with colons, and invalid task or project failures.

Changes

Monorepo task matching

Layer / File(s) Summary
Monorepo matching fallback
src/task/mod.rs
get_matching retries unprefixed patterns with a // prefix when monorepo tasks exist. Tests verify root-task precedence and unchanged flat-task behavior.
End-to-end task validation
e2e/tasks/test_task_monorepo_optional_slash_prefix
The test covers root, web, and api tasks, optional prefixes, shorthand invocation, wildcard scoping, colon-containing root tasks, and invalid task or project failures.

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

Possibly related PRs

  • jdx/mise#11466: Shared task-pattern matching changes for monorepo-qualified task names.
  • jdx/mise#11283: Related handling of the monorepo // task namespace.
  • jdx/mise#11503: Related matching changes for // and relative-qualified patterns.

Suggested reviewers: jdx, risu729

Poem

I hop through web and api with care,
Optional slashes float through the air.
Root tasks keep their rightful place,
Wildcards stay within project space.
Tests thump softly: all paths are bright.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.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 clearly identifies the fix for matching project-qualified monorepo tasks without the optional // prefix.

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/task/mod.rs`:
- Around line 3316-3317: Update the task resolution flow around the earlier `/`
and `:` syntax rejection so monorepo fallback is attempted first when monorepo
tasks exist, allowing unprefixed nested names such as apps/web:build to resolve
to the project-qualified task. Preserve existing rejection behavior when no
matching monorepo task is available, and add unit and end-to-end coverage for a
nested config root.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro Plus

Run ID: 09b910db-f390-4e71-b22f-a653b7a35af9

📥 Commits

Reviewing files that changed from the base of the PR and between bd7d113 and 6944d8a.

📒 Files selected for processing (2)
  • e2e/tasks/test_task_monorepo_optional_slash_prefix
  • src/task/mod.rs

Comment thread src/task/mod.rs Resolved
@greptile-apps

greptile-apps Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR restores resolution of project-qualified monorepo task names that omit the leading //, while retaining exact root-task precedence and project-scoped wildcard behavior.

  • Adds a final matching fallback that retries eligible unresolved patterns as monorepo-qualified patterns.
  • Adds unit coverage for exact, wildcard, unknown, shadowing, and non-monorepo cases.
  • Adds end-to-end coverage for explicit and shorthand invocation forms.

Confidence Score: 5/5

The PR appears safe to merge, with no actionable correctness or security issues identified.

Existing exact and ordinary matching retain precedence, the fallback only activates after those paths fail, and the rewritten pattern enters the monorepo branch without further recursion.

Important Files Changed

Filename Overview
src/task/mod.rs Adds a terminating, last-resort monorepo-prefix fallback after existing exact and extension-stripped matching, with focused unit coverage and no identified defect.
e2e/tasks/test_task_monorepo_optional_slash_prefix Adds end-to-end regression coverage for prefix omission, wildcard scoping, root-task precedence, shorthand invocation, and missing-task failures.

Reviews (1): Last reviewed commit: "fix(task): match project-qualified monor..." | Re-trigger Greptile

@jdx
jdx merged commit bfcbe0b into jdx:main Aug 9, 2026
30 checks passed
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