You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 4ac3fe0
Browse filesBrowse the repository at this point in the historyBrowse files
build: declare each comparison corpus as a manifest with a lockfile (#22237)
* build: declare each comparison corpus as a manifest with a lockfile
The pinned lists lived in the scripts, so only the top level was pinned:
npm still resolved every transitive dependency fresh, and nothing told
anyone when a pin went stale. Each corpus is now tooling/comparison/<name>/,
a package.json pinning what the script asked for and the package-lock.json
freezing what it resolved to, installed with npm ci and skipped while the
lockfile it was installed from still matches.
Dependabot watches the three directories, so a bump arrives as its own pull
request and a version that breaks a printer invariant reds that run rather
than an unrelated one. CI keys its cache on the lockfiles, which change
exactly when the corpus does.
* build(ci): exempt the comparison corpora's unlicensed packages from dependency review
The action reviews every manifest a pull request changes, so committing the
corpus lockfiles put their packages under webpack's own license policy. Five
declare no license in their metadata — coa, dom-walk and three @minify-html
platform binaries — rather than one the policy refuses, and none reaches a
build. The action offers no way to scope itself to a manifest, so naming
them in the list the repository already keeps for this is what there is.
* Revert "build(ci): exempt the comparison corpora's unlicensed packages from dependency review"
This reverts commit 30b0877.
* build: pin the CSS corpus past js-yaml's vulnerable range
Dependency review reads every manifest a pull request changes, so
committing the lockfiles is what made it see what the corpus had been
installing all along: crass asks for svgo ^0.7.1, whose 0.7.2 pins
js-yaml ~3.7.0, and seven advisories stand against it. The advisories
name <=3.15.1, so an override to ^3.15.2 clears them while staying on
the 3.x line svgo's safeLoad call needs.
npm audit over the corpus goes from one high and three moderate to one
moderate, and crass still parses and optimizes.
* build: order the CSS corpus manifest the way npm writes one
* build: bump @minify-html/node to a version whose platform packages exist
0.15.0 declares optional dependencies on @minify-html/node-linux-arm64 and
-darwin-arm64, which were never published at that version. npm install
skips an optional dependency it cannot resolve, so the lockfile recorded
three platform packages where the manifest asks for five — and npm ci
reads that as a lockfile out of sync and refuses, which is what reds the
invariants job while a plain install passed. 0.18.1 publishes all five.
Verified with npm 11, the line CI runs: npm ci now succeeds in all three
corpora, and minify-html's minify(Buffer, options) API is unchanged.
* build: take the Materialize fixture from the fork that is still maintained
materialize-css stopped at 1.0.0 in 2018 and carries four moderate XSS
advisories with no version that fixes them, so dependency review refuses
the corpus now that the lockfile is committed. The comparison reads its
stylesheet and never its JavaScript, which is where the advisories are,
but the check cannot see that and nothing will ever clear them upstream.
@materializecss/materialize is the maintained continuation, ships the
same dist/css/materialize.css, and audits clean.
The corpus stays 961 stylesheets, FIXTURE=Materialize still matches one,
and npm audit over all three corpora is now empty.
* build: clear a corpus cache before reinstalling it
npm ci refreshes node_modules and nothing else, so a fixture the caller
generated from the packages it installed — the three Tailwind stylesheets
compare-css-tools.js builds — outlived a lockfile bump and was skipped as
already there, then passed for current under the new stamp. That is the
staleness the lockfile exists to remove, left alive for the derived half.
Everything under the cache is derived from the manifest, so the reinstall
now starts from an empty directory. Found by CodeRabbit on this PR.
* build(ci): let the corpus's robust-predicates past the license check
With the vulnerabilities cleared, dependency review reaches the licenses
and refuses one package: robust-predicates, which d3 pulls into the
JavaScript corpus. It declares Unlicense, which allow-licenses already
permits; GitHub reports the pair LicenseRef-scancode-public-domain AND
Unlicense, and the half scancode names is no SPDX identifier, so the
conjunction cannot match whatever the list holds.
Both halves are as permissive as a license gets, and the action offers no
way to scope itself to a manifest, so the list the repository already
keeps for this is where it goes.
* build: decide a corpus cache on its manifest as well as its lockfile
The stamp read the lockfile alone, so a manifest edited without
regenerating it left the cache warm — and the install that would have
refused the pair never ran, because skipping it is exactly what the stamp
does. npm ci is what catches that mismatch, and the shortcut sat in front
of it. CI's cache keys read only the lockfiles for the same reason.
Both files now decide, hashed with a delimiter between them, and a test
moves the manifest alone and asserts the reinstall. Found by CodeRabbit.
* build(ci): say what the corpus cache key is actually keyed on
The equivalence job's cache comment still described the old scheme, where
the key hashed the scripts holding the package lists. Both keys read each
corpus's package.json and package-lock.json now, so the comment named an
input that no longer exists. Found by CodeRabbit.
0 commit comments