fix(core): hash task outputs under scoped directories - #36846
fix(core): hash task outputs under scoped directories#36846jcaracciolo wants to merge 6 commits into
Conversation
👷 Deploy request for nx-docs pending review.Visit the deploys page to approve it
|
👷 Deploy request for nx-dev pending review.Visit the deploys page to approve it
|
|
Thanks for sending this in. Assigned, CI is starting now, and someone will review as time allows.
|
|
View your CI Pipeline Execution ↗ for commit 16badf8
☁️ Nx Cloud last updated this comment at |
There was a problem hiding this comment.
Nx Cloud has identified a flaky task in your failed CI:
Since the failure was identified as flaky, the solution is to rerun CI. Because this branch comes from a fork, it is not possible for us to push directly, but you can rerun by pushing an empty commit:
git commit --allow-empty -m "chore: trigger rerun"
git push
🔔 Heads up, your workspace has pending recommendations ↗ to auto-apply fixes for similar failures.
🎓 Learn more about Self-Healing CI on nx.dev
|
Seems i hit a flaky test @AgentEnder , what is the process to either re-run it or validate my changes against it? |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 923b49ad-c037-401e-aaff-a79945209bcd
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 923b49ad-c037-401e-aaff-a79945209bcd
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 923b49ad-c037-401e-aaff-a79945209bcd
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 923b49ad-c037-401e-aaff-a79945209bcd
a691a0a to
f43ce63
Compare
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
@FrozenPandaz what is the process for getting this reviewed? Would like to unblock this if possible |
We'll get back to this, just have a lot of open PRs right now and are all decently busy on getting a few high priority things over the line. We are working on it, and appreciate the PR. |
Current Behavior
The native dependent-task output hasher derives an incorrect filesystem root for output globs containing scoped directory segments such as
packages/@acme/producer/dist/**/*.d.ts. The glob parser's invalid-group recovery discards the ungrouped@, causingget_files_for_outputsto walkpackages/acme/...and omit the generated files from the dependent task hash.Expected Behavior
Output-root partitioning preserves literal ungrouped special characters while deriving static path segments, so scoped declarations are discovered and included in dependent task hashes. Normal glob conversion retains its existing invalid-group compatibility behavior, and valid grouped patterns such as
@(foo|bar)continue to be converted normally.The change adds regression coverage for scoped output expansion and verifies that changing a declaration beneath a scoped directory changes the task output hash.
Design Decisions
Why the parser has two behaviors
Nx intentionally discards ungrouped
?,+, and@characters during normal glob conversion. This behavior was introduced in #21027 to tolerate malformed extglob prefixes such as+spec.tsinstead of failing the entire glob. Existing workspaces may depend on that compatibility behavior.Output-root partitioning has a different requirement: it must retain the original path text long enough to identify the directory that should be walked. In a path such as
packages/@acme/producer/dist/**/*.d.ts,@acmeis a literal directory segment rather than malformed extglob syntax.The parser therefore accepts an explicit behavior:
Discardpreserves the existingparse_globbehavior used by glob conversion.Preserveretains ungrouped special characters for static-root partitioning.Both behaviors use the same parser implementation; the mode only controls whether an ungrouped special character is retained in the parse result.
Alternatives considered
parse_globto always preserve these characters was rejected because it would alter the established invalid-group contract and require changing existing compatibility tests.@was rejected because valid forms such as@(foo|bar)must remain extglob expressions.Compatibility and scope
parse_globcontinue to useDiscardbehavior by default.Preservebehavior.Related Issue(s)
Fixes #36845