watch: track all dependencies of an owner #66139
All Vouch review confidence checks passed
Residual risk 0.07 = Change Risk (0.25) × (1 − Review Confidence (0.71)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.25 · 31 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.55 · 3 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.207
Real PR Conversation Timeline
5 items
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 90.28%. Comparing base (
bca9bbe) to head (c3cc140).:warning: Report is 443 commits behind head on main.
<details><summary>Additional details and impacted files</summary>
@@ Coverage Diff @@
## main #66139 +/- ##
=======================================
Coverage 90.28% 90.28%
=======================================
Files 790 790
Lines 271982 271985 +3
Branches 51915 51921 +6
=======================================
+ Hits 245546 245571 +25
+ Misses 16947 16901 -46
- Partials 9489 9513 +24
| Files with missing lines | Coverage Δ | |
|---|---|---|
| lib/internal/watch\_mode/files\_watcher.js | 91.55% <100.00%> (+0.11%) | :arrow_up: |
... and 32 files with indirect coverage changes
</details>
<details><summary> :rocket: New features to boost your workflow: </summary>
</details>
@MoLow since this is in the FilesWatcher dependency tracking from #45214, could you take a look when you get a chance? cc @ShogunPanda. If it looks good, could you also add request-ci? Thanks!
Approved
Approved these changes.
MoLow
christianaurichzm
FilesWatcher#filterFile()reads#ownerDependencieswith the dependency path, but writes the set back keyed by the owner. As a result, each call starts a fresh set and overwrites the previous one, so an owner keeps only the last dependency registered for it.Each test child reports the modules it loads through
watch:require/watch:import, with onefilterFile()call per module. A test file with N dependencies therefore keeps 1 and loses N-1.unfilterFilesOwnedBy()walks that set to release an owner's dependencies, so the lost dependencies remain in#filteredFilesand#dependencyOwners. A restart re-reports the modules the test still loads, which hides the stale state for those modules, but a dependency it stopped requiring is never reported again and therefore never removed:The second restart should not happen:
dep1.jsis no longer a dependency of any test. Its stale entries otherwise remain for the lifetime of the process.The bug was introduced with #45214 (
97355c74e819), first released in v19.2.0 and later backported to v18.13.0.test-watch-file-shared-dependencydoes not catch it because it registers one dependency per owner, while this bug requires an owner with multiple dependencies.The diff also stores the
#dependencyOwnerslookup in a local while removing an owner's dependencies, avoiding repeated map lookups for each dependency.Refs: https://github.com/nodejs/node/pull/45214