Skip to content

ci: add SLSA build provenance to docker images#2556

Merged
duwenxin99 merged 3 commits intomainfrom
prov
Mar 30, 2026
Merged

ci: add SLSA build provenance to docker images#2556
duwenxin99 merged 3 commits intomainfrom
prov

Conversation

@duwenxin99
Copy link
Copy Markdown
Contributor

@duwenxin99 duwenxin99 commented Feb 24, 2026

Ref: Generate Cloud Build provenance

  • Remove the original binary upload steps.
  • Let artifact registry config automatically upload binaries & dockers and generate provenance.
  • Add a new final step to create versioned directories containing binaries to be automatically uploaded.

@duwenxin99 duwenxin99 requested a review from a team as a code owner February 24, 2026 15:54
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @duwenxin99, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the integrity and verifiability of the project's release artifacts. By adopting SLSA build provenance, it ensures that all generated binaries and Docker images come with cryptographically signed metadata detailing their build process. This change streamlines artifact storage and improves supply chain security without altering the core build logic.

Highlights

  • SLSA Build Provenance: Integrated SLSA build provenance generation for release binaries and Docker images by configuring Cloud Build's artifact management to include requestedVerifyOption: VERIFIED.
  • Artifact Handling Refactor: Replaced individual gcloud storage cp steps with a unified prepare-artifacts step that organizes all built binaries into a structured directory for Cloud Build's native artifact upload feature.
  • Go Build Optimization: Added the -trimpath flag to all go build commands, which removes all file system paths from the compiled executable, improving build reproducibility and reducing binary size.
Changelog
  • .ci/versioned.release.cloudbuild.yaml
    • Removed redundant store-* steps for various platform binaries (Linux, macOS, Windows, AMD64, ARM64, geminicli variants) as artifact storage is now handled by Cloud Build's built-in feature.
    • Added -trimpath flag to all go build commands to remove build path information from binaries.
    • Introduced a new prepare-artifacts step to consolidate all built binaries into a standardized artifacts directory structure.
    • Configured the artifacts section in the Cloud Build YAML to automatically upload the artifacts directory to Google Cloud Storage.
    • Enabled SLSA provenance generation by adding requestedVerifyOption: VERIFIED to the Cloud Build options.
    • Corrected the output filename for Windows binaries to consistently include the .exe extension in go build commands.
Activity
  • No specific activity has been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the Cloud Build release process to generate SLSA build provenance for release binaries and Docker images, replacing manual artifact storage with the artifacts block and updating go build commands for reproducibility. However, the implementation introduces a medium-severity path traversal vulnerability in a build script, where an attacker could manipulate a version file to compromise build integrity. Additionally, a critical issue in the new prepare-artifacts step could cause build failure, and there's an opportunity to improve script maintainability.

@Yuan325 Yuan325 added the priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. label Mar 11, 2026
@duwenxin99 duwenxin99 changed the title ci: add SLSA build provenance to release binaries and docker images ci: add SLSA build provenance to docker images Mar 13, 2026
@Yuan325 Yuan325 added the release candidate Use label to signal PR should be included in the next release. label Mar 30, 2026
@duwenxin99 duwenxin99 merged commit 0e94cec into main Mar 30, 2026
19 checks passed
@duwenxin99 duwenxin99 deleted the prov branch March 30, 2026 17:42
@github-actions
Copy link
Copy Markdown
Contributor

🧨 Preview deployments removed.

Cloudflare Pages environments for pr-2556 have been deleted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. release candidate Use label to signal PR should be included in the next release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants