Skip to content

fix(licences): list every traced package in the image's licence bundle - #1584

Merged
MBombeck merged 1 commit into
release/v1.50.0from
fix/150-licence-bundle
Nov 26, 2026
Merged

MBombeck merged 1 commit into
release/v1.50.0from
fix/150-licence-bundle

Conversation

@MBombeck

Copy link
Copy Markdown
Owner

The nightly verify job failed: the image SBOM reported semver@7.8.5, which /app/THIRD_PARTY_LICENSES.txt did 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-pnpm takes --traced /app/.next/standalone and 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.
  • New --installed ROOT mode 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 naming semver@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.

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.
@MBombeck
MBombeck merged commit 6871858 into release/v1.50.0 Nov 26, 2026
41 checks passed
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.

1 participant