Skip to content

Publish npm packages via a staging repository to attach SBOMs - #2491

Draft
apilaskowski wants to merge 2 commits into
mainfrom
moss/sbom-staging-copy
Draft

apilaskowski wants to merge 2 commits into
mainfrom
moss/sbom-staging-copy

Conversation

@apilaskowski

Copy link
Copy Markdown
Collaborator

Publish npm packages to a staging Artifact Registry repository in the build project and copy them, with all attachments, into the Exit Gate repository, so the released packages carry an SBOM attestation in addition to provenance.

Cloud Build can only generate and attach SBOMs when the artifact repository is in the same project as the build. Uploading directly to the Exit Gate repository therefore attaches provenance but no SBOM.

Changes

  • cloudbuild-publish.yaml: artifacts.npmPackages now uploads to the staging repository (us-npm.pkg.dev/dataform-open-source/dataform-npm-staging). The first step clears previous uploads from both the staging and the Exit Gate repositories.
  • scripts/copy_to_exit_gate (new): for each package, waits for Cloud Build to attach the SBOM to the staged version (up to 10 minutes; it logs a warning and continues if none appears), then copies the version with all attachments into the Exit Gate repository using Artifact Registry copyArtifact, and waits for the copy to finish.
  • cloudbuild-exit-gate-trigger.yaml: runs scripts/copy_to_exit_gate after the publish build has succeeded and before uploading the release manifest. Timeout raised to 1 hour.

Rollout

The staging repository dataform-npm-staging (NPM, location us) has been created; it must be in us because cross-region copies are not supported for npm. The Cloud Build service account already has the required permissions on both repositories.

Testing

To be tested end to end with a next prerelease from this branch before merging.

This branch has not been deployed

No deployments
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