Repository navigation
fix(licences): list every traced package in the image's licence bundle - #1584
Merged
Merged
Conversation
The bundle was built from the lockfile's production closure, but the image ships what the standalone tracer copies. A module required without being declared resolves through pnpm's hidden hoist, which pointed semver at 7.8.5, a dev-only version, so the image carried a package its bundle did not list and the published-image SBOM check failed. --bundle-pnpm now takes --traced and adds every package manifest found in the standalone output, under the same policy, with its licence read from the full install. A new --installed mode checks every package on the finished image filesystem against the bundles by the rule the SBOM check uses; the runner stage runs it, so the gap fails the image build on a pull request rather than the nightly afterwards.
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.
The nightly verify job failed: the image SBOM reported
semver@7.8.5, which/app/THIRD_PARTY_LICENSES.txtdid not list.Cause. The bundle is generated from the lockfile's production closure, but the image ships what the standalone tracer copies. A module required without being declared resolves through pnpm's hidden hoist (
node_modules/.pnpm/node_modules/semver), which points at 7.8.5, a version only the mutation-testing tools depend on. Code that landed since the last green nightly reached that path, so the trace copied it.Fix.
--bundle-pnpmtakes--traced /app/.next/standaloneand adds every package manifest found there (rule:node_modules/<name>/package.json, symlinks not followed), under the same licence policy, licence read from the full install.--installed ROOTmode checks every package on disk against the bundles by the rule the SBOM check uses. The runner stage runs it on/as its last package step, so the same gap fails the image build on a pull request (docker-publish builds both platforms on PRs) instead of the published nightly.Checked. Local arm64 build: the builder logs
Traced into /app/.next/standalone outside the production closure: semver@7.8.5, the runner check passes (624 entries); with semver removed from the bundle the check fails namingsemver@7.8.5; the new bundle checked against the failing nightly's amd64 SBOM leaves only the x64 platform binaries an arm64 bundle cannot list. Unit tests cover the walker, the union and the policy on traced packages.