Repository navigation
Publish npm packages via a staging repository to attach SBOMs - #2491
Draft
apilaskowski wants to merge 2 commits into
Draft
apilaskowski wants to merge 2 commits into
apilaskowski wants to merge 2 commits into
Conversation
…hem with attachments to Exit Gate
This branch has not been deployed
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.
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.npmPackagesnow 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 RegistrycopyArtifact, and waits for the copy to finish.cloudbuild-exit-gate-trigger.yaml: runsscripts/copy_to_exit_gateafter the publish build has succeeded and before uploading the release manifest. Timeout raised to 1 hour.Rollout
The staging repository
dataform-npm-staging(NPM, locationus) has been created; it must be inusbecause 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
nextprerelease from this branch before merging.