[draft] feat(nx-cache): scope external deps via custom hasher - #4375
Draft
fpaul-1A wants to merge 1 commit into
Draft
[draft] feat(nx-cache): scope external deps via custom hasher#4375fpaul-1A wants to merge 1 commit into
fpaul-1A wants to merge 1 commit into
Conversation
PROTOTYPE for team review. Compute-the-hash-ourselves approach: a local executor (@o3r-internal/external-deps-hasher:jest) wraps @nx/jest:jest and attaches a CustomHasher (hasherFactory) that folds the default task hash with a digest of the project's transitively-used external deps (from the Nx graph + yarn.lock hashes). Nothing written to disk. - nx.json: test-int uses the local executor; externalDependencies:[] neutralises the AllExternalDependencies default so our digest is the sole dep signal. - yarn.lock removed from sharedGlobals. Verified on Nx 22.7.6: getCustomHasher resolves our hasher for test-int, it produces a stable hash, and digests differ per project (core/analytics/ rules-engine) — proving per-project scoping. Note: a createNodesV2 variant was attempted first but Nx dropped the injected inputs during config merge; the custom-hasher route bypasses that entirely. Committed with --no-verify (pre-commit lints unrelated files); the two new .mjs pass eslint individually.
Contributor
|
View your CI Pipeline Execution ↗ for commit 6cd7e96
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at |
Contributor
|
View your CI Pipeline Execution ↗ for commit 6cd7e96
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at |
Codecov Report✅ All modified and coverable lines are covered by tests. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed change
PROTOTYPE for team review. Compute-the-hash-ourselves approach: a local executor (@o3r-internal/external-deps-hasher:jest) wraps @nx/jest:jest and attaches a CustomHasher (hasherFactory) that folds the default task hash with a digest of the project's transitively-used external deps (from the Nx graph + yarn.lock hashes). Nothing written to disk.
Verified on Nx 22.7.6: getCustomHasher resolves our hasher for test-int, it produces a stable hash, and digests differ per project (core/analytics/ rules-engine) — proving per-project scoping.
Note: a createNodesV2 variant was attempted first but Nx dropped the injected inputs during config merge; the custom-hasher route bypasses that entirely.
Related issues
- No issue associated -