fix(task): fix source freshness for workspace-rooted patterns in subproject tasks#11202
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Central YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughChangesSubproject source freshness
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
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 fixes source freshness checks for tasks defined in nested workspace projects. The main changes are:
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (2): Last reviewed commit: "fix(task): fix source freshness for work..." | Re-trigger Greptile |
|
Hey @jlarmstrongiv / @risu729, maybe you would be interested in looking at this since you've changed this part of the code most recently. I would appreciate any help on fixing this. |
…roject tasks
In a monorepo, tasks in a subproject with workspace-rooted source
patterns (e.g. `{{ vars.workspace_root }}/lib/**/*`) silently failed to
track files inside the subproject directory, so edits there never
triggered a rebuild.
The matcher was anchored at the task CWD, so template-expanded absolute
patterns couldn't be relativized to it — leaving them as raw absolute
strings the Override matcher couldn't evaluate, returning Match::Ignore
for all files in the subproject.
Fix: anchor the matcher at the workspace root and normalize patterns
relative to it — absolute patterns are stripped of the workspace prefix,
relative patterns are prefixed with the subproject path.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
35fd845 to
0f2b9a7
Compare
In a monorepo setup where a subproject has its own mise.toml nested
inside a workspace, tasks that use source patterns rooted at the
workspace root do not correctly track files inside the subproject
directory — edits there do not trigger a rebuild.
Example:
Running from
lib/worker/, the secondmise run buildafter editingworker.go(insidelib/worker/) is incorrectly skipped — the taskreports fresh despite the change.
Root cause:
build_source_matcherwas anchored at the task CWD(
lib/worker/). Source patterns are template-expanded to absolute pathslike
/workspace/lib/**/*. The matcher'srelativize_patterntries tostrip the task CWD as a prefix from this path, fails (since
lib/**/*is not under
lib/worker/), and leaves the pattern as a raw absolutestring. The Override matcher then can't match files against it, returning
Match::Ignorefor everything inside the subproject — silently droppingthem from source tracking.
Fix: replace
relativize_patternwithnormalize_pattern(match_root, task_cwd, pattern). The matcher is now anchored at the outermost config root that is an ancestor of the task CWD (the workspace root). Absolute patterns are stripped of that prefix as before. Relative patterns are prefixed with the task-CWD-relative-to-workspace path so they remain anchored at the subproject, not the workspace root.Note: the fix was mostly created by Claude since I'm not that familiar with Rust... and I'm not too sure about the fix... but the e2e test should make it clear what the problem is at least.
Summary by CodeRabbit
Bug Fixes
Tests