Skip to content

fix(docs-platform): commit the lockfile, so the tree is reproducible and auditable - #337

Merged
scttfrdmn merged 2 commits into
mainfrom
deps/docs-platform-lockfile
Aug 4, 2026
Merged

scttfrdmn merged 2 commits into
mainfrom
deps/docs-platform-lockfile

Conversation

@scttfrdmn

Copy link
Copy Markdown
Owner

Closes #214.

docs-platform/package-lock.json — 741 packages — and docs-site moves from npm install to npm ci.

Why the job needed this, separately from the alerts

The docs-site gate added in #334 was resolving every ^x.y.z range fresh on each run. That makes it a weaker gate than it looks: it tested a dependency tree no reader could reproduce, and a break could appear or disappear with no commit behind it. Its own comment said so; this removes the caveat.

Verified, not assumed

check before after
npm ci into empty node_modules fails — can only install with an existing package-lock.json 221 prod / full tree installs
npx vitepress build . after npm ci n/a, install failed build complete in 1.45s, 6 pages
npm audit no tree to audit 0 vulnerabilities

One correction, because the tempting reading is wrong

This is not what closed the three vite alerts against docs-platform/package.json. They closed at 21:24 today, before this lockfile existed.

They closed because vite is a direct devDependency at ^6.4.3 with an overrides entry forcing the same, and the advisories' vulnerable range is <= 6.4.2 with 6.4.3 the first patched version — so no version the manifest admits is vulnerable. That is the "or pinned version requirement" half of Dependabot's own error message, and it is a different mechanism from the lockfile.

Both are now true for this directory, and that is precisely the situation where one gets credited for the other. .github/dependabot.yml's comment is updated to say which is which, since it previously asserted that committing a lockfile was what would close the alerts.

All 8 Dependabot alerts on the repository are now fixed — 5 jackson-databind in sdks/java, 3 vite here.

Note

npm ci warns about 6 packages with install scripts (esbuild, fsevents, ssh2, cpu-features, protobufjs, @scarf/scarf) under npm's newer allow-scripts prompt. It is a warning, not a failure, and the build completes — flagging it because it is new output on this job rather than something I fixed.

…and auditable

package-lock.json, 741 packages, and docs-site moves npm install -> npm ci.
The job was resolving every ^x.y.z range fresh on each run, so it gated a tree
no reader could reproduce.

Verified rather than assumed: npm ci into an empty node_modules builds the site
(build complete in 1.45s, six pages) where npm ci here previously failed
outright, and npm audit reports 0 vulnerabilities where it previously had no
tree to audit.

Corrects a claim I was about to make: this is NOT what closed the three vite
alerts. They closed earlier the same day, before the lockfile existed, because
vite is a direct devDependency at ^6.4.3 with an overrides entry forcing the
same, and the advisories' range is <= 6.4.2 with 6.4.3 first patched — the
'or pinned version requirement' half of Dependabot's error. Both mechanisms are
true here, which is when one gets credited for the other.

Refs #214
CHANGELOG conflict only: #309 and #291 landed entries in the same 'Fixed'
section this branch adds its #214 entry to. All three kept, in main's order.
@scttfrdmn
scttfrdmn merged commit ee952e7 into main Aug 4, 2026
25 checks passed
@scttfrdmn
scttfrdmn deleted the deps/docs-platform-lockfile branch August 4, 2026 04:16
scttfrdmn added a commit that referenced this pull request Aug 4, 2026
CHANGELOG conflict only: #337 added the #214 lockfile entry to the same
`### Fixed` section this branch adds the TypeScript 6 entry to. Both kept,
in main-first order.
scttfrdmn added a commit that referenced this pull request Aug 4, 2026
…ner (#347)

Closes #343.

Two problems, one file. setup.py declared 16 dependencies as unbounded
>= floors with no lockfile, so the sdk-metrics job resolved all of them
fresh on every run - the defect #337 fixed for docs-site, in another
language. And nothing scanned them: trivy fs reported four targets
(go.mod, sdks/java/pom.xml, and the two package-lock.json files) with
sdks/python absent, because Trivy detects Python from requirements.txt,
poetry.lock, Pipfile.lock or an installed .dist-info, and the only
manifest here was setup.py. It now reports five.

The filename is load-bearing and cost a rewrite to find. This was first
written as requirements-ci.txt, which Trivy does not detect - scanned in
a scratch directory it reported no targets, so the file would have read
as the fix while leaving the gap where it was. requirements-dev.txt,
dev-requirements.txt and requirements/ci.txt are equally invisible, and a
bare pyproject.toml is not detected either.

install_requires stays as ranges, because a library that pins its
transitive tree pins it for every consumer. pip check now runs between
install and test to catch the one thing that split can get wrong; verified
by mutation - psutil==5.7.0 against a >=5.8.0 floor reports the conflict
and exits 1.

Two entries removed rather than pinned, because neither was a dependency:
asyncio has been stdlib since 3.4 and this package requires >=3.8, and
typing-extensions is imported nowhere. 71 tests pass with both gone.

The pip ecosystem entry needed the pinned tree to exist first, for the
same reason docs-platform security updates needed a lockfile. Its python
label was added to labels.yml and synced from there, rather than being
created by the first PR to apply it - which is how java got onto the
repository.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs-platform: no committed lockfile, so Dependabot cannot apply npm security updates

1 participant