Repository navigation
fix(impact): fall back when an npm lockfile bump meets undeclared imports - #246
Merged
adityankale190895 merged 1 commit intoNov 18, 2026
Merged
Conversation
…orts npm hoists transitive packages to the root node_modules, where repository code can import them without declaring them. npm lockfile attribution reaches only declared dependencies, so a bump of a hoisted package selected the tests of the declared package that pulls it in and skipped the tests that import it directly. The Yarn and pnpm paths already fall back in this case; npm now does too. Signed-off-by: FredApps <[email protected]>
FredApps
commented
Nov 17, 2026
FredApps
left a comment
Contributor
Author
There was a problem hiding this comment.
Cross-review of 08fb20a.
Checked:
- The fix matches #244. A
package-lock.jsonchange now falls back when repository code imports an external package thatpackage.jsondoes not declare, as the Yarn and pnpm paths already do. The condition (!dependencyLockfileplus a changed rootpackage-lock.json) cannot fire on a Yarn or pnpm change, and the new row indocs/using-diffci.mdmatches the reason text. - The new test fails with
src/reverted (1 of 2 fail) and passes with the fix.tests/repo/npm-lock-undeclared-imports.test.tsis listed inrelease-files.json. The commit is DCO-signed. The branch is level with main. CI is green, apart from the hosted "DiffCI change impact" check, which is still in progress and never blocks.
Fixed: nothing.
Still open (not blocking): the npm block is now the third near-copy of the undeclared-import check, after Yarn and pnpm. A shared helper would be a follow-up refactor and is out of scope here.
FredApps
added a commit
to FredApps/core
that referenced
this pull request
Nov 18, 2026
…ffCI#246 The manifest is an unordered set, and the PRs listed above add their entries at the same line. Moving this entry one line away lets them merge in either order without a conflict. Signed-off-by: FredApps <[email protected]>
FredApps
marked this pull request as ready for review
November 18, 2026 00:56
adityankale190895
pushed a commit
that referenced
this pull request
Nov 18, 2026
* fix(impact): cover a program the test script runs directly
A changed file that the root test script runs with an interpreter
("node scripts/check.mjs && node --test"), or code it imports, was only
an affected entry point: no test imports it, so the selection skipped it
and verify passed while npm test failed. It now runs that test-script
phase for callers that run phases, and the full suite otherwise.
Signed-off-by: FredApps <[email protected]>
* chore: move the release-files.json entry so it merges cleanly with #246
The manifest is an unordered set, and the PRs listed above add their entries at the same line. Moving this entry one line away lets them merge in either order without a conflict.
Signed-off-by: FredApps <[email protected]>
---------
Signed-off-by: FredApps <[email protected]>
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.
Fixes #244
When the delta changes
package-lock.json(sodependencyLockfileis neither Yarn nor pnpm),collectDependencyChangeTestsnow collects the external packages the graph resolved. It falls back if any of them is not independencies,devDependenciesor the changed dependencies. This is the same check the pnpm path makes. The reason isnpm lockfile changed and repository imports undeclared dependencies (<names>); full validation required. It is listed indocs/using-diffci.mdnext to the pnpm entry. Repositories that declare everything they import are unaffected.Validation:
tests/repo/npm-lock-undeclared-imports.test.tsfails onmainand passes here.npm run typecheck,npm test(1169 pass),npm run build,npm run audit:boundary.