Skip to content

fix(task): validate monorepo-relative task refs#10342

Merged
jdx merged 3 commits into
mainfrom
fix-task-validate-monorepo-deps
Jun 12, 2026
Merged

fix(task): validate monorepo-relative task refs#10342
jdx merged 3 commits into
mainfrom
fix-task-validate-monorepo-deps

Conversation

@jdx

@jdx jdx commented Jun 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • resolve task references relative to their parent task before tasks validate checks for missing dependencies
  • apply the same lookup path to task references inside run entries
  • add e2e coverage for bare, :task, and //pkg:task dependencies inside a monorepo config_root

Discussion: #10329

Tests

  • cargo fmt --check
  • mise run test:e2e e2e/tasks/test_task_validate

This PR was generated by an AI coding assistant.


Note

Low Risk
Scoped to validation-only lookup logic with e2e coverage; no changes to task execution paths beyond matching existing runtime behavior.

Overview
mise tasks validate now resolves task references the same way runtime does, using the parent task for monorepo-relative patterns instead of treating dependency and run targets as plain global names.

task_exists calls resolve_task_pattern and build_task_ref_map / get_matching, so checks for depends, depends_post, wait_for, and run task entries accept bare names, :task, //pkg:task, and aliases inside monorepo config roots without false missing-dependency errors.

E2e coverage adds a small monorepo fixture and asserts tasks validate passes from pkg while mise run still executes those dependencies correctly.

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

Summary by CodeRabbit

  • Tests

    • Added an end-to-end validation that verifies monorepo task dependency patterns (bare, colon, full, alias) resolve and run with expected outputs.
  • Bug Fixes

    • Improved task resolution in monorepo setups so referenced tasks are interpreted consistently during validation and execution.

@coderabbitai

coderabbitai Bot commented Jun 12, 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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 24c2b70c-a744-439d-b606-408d26a676ea

📥 Commits

Reviewing files that changed from the base of the PR and between 64f3cad and 7c3f37a.

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

📝 Walkthrough

Walkthrough

Validator now resolves task pattern references relative to the current task using resolve_task_pattern; validation call sites pass the parent task. An e2e test verifies resolution for bare, colon-prefixed, fully-qualified, and alias dependency syntaxes.

Changes

Monorepo Task Validation

Layer / File(s) Summary
Task existence resolution with monorepo context
src/cli/tasks/validate.rs
task_exists now accepts a parent: &Task, calls resolve_task_pattern to resolve patterns relative to that parent, and checks matches via the task reference map; validation sites for missing dependencies and run entries pass the current task as parent.
End-to-end validation test
e2e/tasks/test_task_validate
Adds an e2e test that creates a temporary monorepo-validate workspace (experimental monorepo root + config_roots = ["pkg"]), defines a hidden _dep task with an alias and argument output, wires four dependent tasks referencing _dep via bare, :colon, //pkg:full, and alias forms, asserts mise tasks validate success and verifies mise -C monorepo-validate run //pkg:<task> yields expected arg= outputs.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped through paths of names and dots,
Patterns whispered secrets in hidden slots,
Bare, colon, slash, and alias too,
The validator learned what each one knew,
Tests cheered softly — now resolution hops true.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.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 'fix(task): validate monorepo-relative task refs' accurately and specifically describes the main change: fixing validation of task references that use monorepo-relative syntax patterns.
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.


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

@greptile-apps

greptile-apps Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes mise tasks validate so that monorepo-relative dependency references (bare, :task, //pkg:task, and alias forms) are resolved through the same resolve_task_pattern + build_task_ref_map + get_matching path used at runtime, eliminating false-positive "missing dependency" errors inside config_roots packages.

  • task_exists in validate.rs now accepts the parent Task and delegates resolution to the existing monorepo helpers instead of doing its own name/alias/display-name scan; all three call sites (depends/depends_post/wait_for and both run entry checks) are updated.
  • e2e/tasks/test_task_validate adds a monorepo-validate fixture exercising all four reference styles in validation and runtime, with proper cleanup after the block.

Confidence Score: 5/5

The change is validation-only and mirrors the existing runtime resolution path; no task execution logic is modified.

Both changed files are well-contained: the logic change in validate.rs delegates to already-tested helpers rather than introducing new resolution logic, and the e2e test covers all four reference forms end-to-end with proper fixture cleanup.

No files require special attention.

Important Files Changed

Filename Overview
src/cli/tasks/validate.rs Replaces manual name/alias/display_name checks in task_exists with resolve_task_pattern + build_task_ref_map + get_matching, fixing false-positive missing-dependency errors for monorepo-relative references; build_task_ref_map is rebuilt on every call to task_exists which is a minor inefficiency.
e2e/tasks/test_task_validate Adds a monorepo fixture covering bare, :task, //pkg:task, and alias dependency forms, then asserts validation passes and runtime execution produces correct output; cleanup via rm -rf monorepo-validate added to keep tests hermetic.

Reviews (2): Last reviewed commit: "fix(task): validate monorepo task aliase..." | Re-trigger Greptile

Comment thread e2e/tasks/test_task_validate

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 64f3cad. Configure here.

Comment thread src/cli/tasks/validate.rs Outdated
@jdx jdx enabled auto-merge (squash) June 12, 2026 07:50
@github-actions

Copy link
Copy Markdown

Hyperfine Performance

mise x -- echo

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.6.3 x -- echo 18.4 ± 0.8 16.9 22.4 1.00
mise x -- echo 19.1 ± 1.7 17.6 50.6 1.04 ± 0.10

mise env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.6.3 env 18.3 ± 0.8 16.8 23.0 1.00
mise env 20.0 ± 1.4 17.4 24.7 1.09 ± 0.09

mise hook-env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.6.3 hook-env 20.8 ± 1.4 18.0 29.1 1.00
mise hook-env 21.0 ± 1.4 18.7 27.5 1.01 ± 0.09

mise ls

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.6.3 ls 18.9 ± 2.5 15.1 27.6 1.00
mise ls 23.3 ± 2.7 17.6 31.2 1.24 ± 0.22
⚠️ Inconclusive: ls measured 24% slower, but the relative uncertainty overlaps the 10% threshold.

xtasks/test/perf

Command mise-2026.6.3 mise Variance
install (cached) 148ms 147ms +0%
ls (cached) 65ms 64ms +1%
bin-paths (cached) 71ms 75ms -5%
task-ls (cached) 141ms 139ms +1%

@jdx jdx merged commit c0ea5f0 into main Jun 12, 2026
34 checks passed
@jdx jdx deleted the fix-task-validate-monorepo-deps branch June 12, 2026 08:23
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