Repository navigation
Description
What changed
#327 committed sdks/javascript/package-lock.json and switched the sdk-metrics job from npm install to npm ci. Both were deliberate: npm ci installs the locked tree, so what CI resolves is what a developer resolves, and a vulnerability alert then describes a copy that is actually in the tree rather than whatever a manifest range happens to pick up that day. (That second point is not hypothetical — an npm alert on this SDK previously closed without a fix, because with no lockfile the alert tracked the manifest range instead of the nested copy actually installed.)
The consequence, which I did not flag at the time: npm ci refuses to run when package.json and package-lock.json disagree. Dependabot's open PRs against this directory predate the lockfile and edit the manifest only, so they now fail before installing anything:
npm error `npm ci` can only install packages when your package.json and package-lock.json are in sync.
npm error Invalid: lock file's @types/[email protected] does not satisfy @types/[email protected]
npm error Invalid: lock file's [email protected] does not satisfy [email protected]
Reproduced with #310's manifest against main's lockfile.
The trap: their green checks are stale, and look authoritative
#310 and #309 both show passing checks. Those runs happened before #327 merged, against the old workflow — #310's sdk-metrics completed in 34 seconds and its log still shows npm install --no-audit --no-fund under the comment "No lockfile is committed". That job never ran npm ci, never ran tsc, and never ran npm run lint.
So a reviewer glancing at either PR sees green on a PR that would fail on main. This is the same shape as the defect class #327 was about — a check that does not run is indistinguishable from one that passes — arriving this time as a check that ran under different rules than the ones now in force.
What to do
Going forward Dependabot regenerates the lockfile alongside the manifest, because one is now committed; that is its normal behaviour and it is the reason committing the lockfile was worth doing. The open PRs need a rebase to pick it up.
-
@dependabot rebaseon deps(deps-dev): bump @types/node from 18.19.130 to 26.1.2 in /sdks/javascript #310 (@types/node18 → 26 — verified clean otherwise: 0tscerrors,dist/emits, 65 tests pass on both versions) - Decide deps(deps-dev): bump the typescript-eslint group across 1 directory with 3 updates #309 before rebasing it — it needs an eslint 10 flat-config migration and four more package bumps than it proposes; see the measurements on that PR
- Re-run checks on any npm PR opened before
06e0c7frather than trusting its existing green - Consider a CI guard that fails when a PR changes
sdks/javascript/package.jsonwithoutpackage-lock.json, so this is caught by a check rather than by a reviewer noticing
The last item is the durable fix. The rest is one-time cleanup of a queue that predates the gate.
Not affected
The Python, Java and C SDKs. Python's CI step installs from requirements.txt, Java's resolves through Maven with its own lockfile-equivalent semantics, and the C SDK's make test builds from the Go module, which already has go.sum.
Activity
scttfrdmn commentedon Aug 3, 2026
The one-time cleanup resolved itself; the durable item is what's left.
Merging #327 triggered Dependabot to rebase its open npm PRs, and because a
package-lock.jsonis now committed, it regenerated the lockfile alongside each manifest — the normal behaviour this issue predicted. #310 is now at7d0b91etouching both files, and its re-run executed the full post-#327sdk-metricsjob (install / build / tests / lint, plus Java and C) and passed. So:06e0c7f— the rebase did thispackage.jsonchange without a matchingpackage-lock.jsonOnly the last one is still worth building, and it is the only one that prevents recurrence rather than cleaning up after it. Note the failure mode it guards against is not the one I originally described: Dependabot handles the lockfile correctly now, so the realistic case is a human editing
package.jsonby hand and pushing without runningnpm install. That failsnpm ciwithInvalid: lock file's X does not satisfy Y, which is a clear message but arrives after a full job setup, and the fix is non-obvious to anyone who has not metnpm cibefore.Keeping this open for that item alone. Retitling accordingly.
[-]npm Dependabot PRs opened before the package-lock.json landed now fail npm ci, and their green checks are stale[/-][+]Guard against a package.json change without a matching package-lock.json, so npm ci cannot fail late[/+]scttfrdmn commentedon Aug 4, 2026
Its three cleanup items are done, and #345 implements the fourth — the one this issue calls the durable fix.
/sdks/javascriptis empty.The gate is
TestNPMLockfilesAgreeWithTheirManifests, in thetestjob rather than as a workflow step, comparing each manifest against the lockfile'spackages[""]entry — npm's own copy of what the manifest said when the lock was generated. That answers this issue's question from one checkout, where a changed-files diff would need a base ref, would not run on a push tomain, and would pass a hand edit that touched both files without regenerating the tree.One correction to this issue's "Not affected" section, because it named
sdks/pythonas fine and it is not. The claim was "Python's CI step installs fromrequirements.txt" — there is norequirements.txtinsdks/python, and nopyproject.tomleither.ci.yml:292runspip install --quiet pytest ., which resolves 16 unbounded>=floors fromsetup.pyfresh on every run. Worse, nothing scans them:trivy fs --scanners vuln .reports exactly four targets —go.mod,sdks/java/pom.xml, and the twopackage-lock.jsonfiles — because Trivy detects Python fromrequirements.txt/poetry.lock/Pipfile.lock/pyproject.toml, and a baresetup.pyis on none of those lists. Filed as #343.The Java and C claims hold as written. Java resolves through Maven, and the C SDK builds from the Go module with
go.sum.Coverage of the new gate is both npm directories:
/sdks/javascript(#201) and/docs-platform(#214). And Dependabot is now doing the right thing unprompted — #339, #340 and #341 each change the manifest and the lockfile together, which is the behaviour committing the lockfile was supposed to buy.