Skip to content

Enable buildbuddy in CI workflows build_and_test.yml and docs.yml#3104

Merged
copybara-service[bot] merged 1 commit into
google:mainfrom
j2kun:buildbuddy-enable
Jun 23, 2026
Merged

Enable buildbuddy in CI workflows build_and_test.yml and docs.yml#3104
copybara-service[bot] merged 1 commit into
google:mainfrom
j2kun:buildbuddy-enable

Conversation

@j2kun

@j2kun j2kun commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

This change adds support for buildbuddy in the CI workflows.

However, due to GitHub's security isolation, we can't directly load the buildbuddy API key used for remote builds from a GH pull request. So we have a (public) read-only key that at least allows one to pull in cached build artifacts.

The configuration here also (hopefully) sets up the build_and_test workflow that runs on main to use RBE, which I can't test until this is merged. But once that workflow runs, then the Content addressable storage cache should reflect in faster pull_request builds with the read-only key.

https://heir.buildbuddy.io/invocation/4dd62bd8-bb88-4049-8f0a-2988d008d655

Includes instructions on using buildbuddy as a developer in the README.

@j2kun j2kun marked this pull request as draft June 22, 2026 18:29
@j2kun j2kun force-pushed the buildbuddy-enable branch 3 times, most recently from c8afc3b to e79967d Compare June 23, 2026 16:09
@j2kun j2kun force-pushed the buildbuddy-enable branch from e79967d to fd27969 Compare June 23, 2026 16:17
@j2kun j2kun requested a review from asraa June 23, 2026 16:55
@j2kun j2kun marked this pull request as ready for review June 23, 2026 16:58
labels: ubuntu-24.04-64core
env:
BUILDBUDDY_API_KEY: ${{ github.event_name != 'pull_request' && secrets.BUILDBUDDY_API_KEY || vars.BUILDBUDDY_READ_ONLY_API_KEY }}
BUILDBUDDY_API_KEY: ${{ github.event_name != 'pull_request' && secrets.BUILDBUDDY_API_KEY || '7eYz4UY70YSrT55wmjWV' }}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

wdyt about putting the read only key string directly into the .bazelrc for build:common or ci? that way we sync across all the workflows

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I tried that, but then this env setting overrides it via the flag with an empty string.

Comment thread .bazelrc
common --noremote_upload_local_results # Uploads logs & artifacts without writing to cache
common --remote_cache=grpcs://heir.buildbuddy.io
common --remote_cache_compression
common --remote_header=x-buildbuddy-api-key=IqGGzfrvMgDJh927qtrw

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this one is different than the one in CI "7eYz4UY70YSrT55wmjWV"? could you add a comment for this (is this read-only as well? hopefully this isn't your personal one)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Indeed, two separate read-only keys. I wanted to make them different for metrics tracking purposes (if one key starts being abused, we can know where it's coming from).

@j2kun j2kun added the pull_ready Indicates whether a PR is ready to pull. The copybara worker will import for internal testing label Jun 23, 2026
@copybara-service copybara-service Bot merged commit 5bf27a0 into google:main Jun 23, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pull_ready Indicates whether a PR is ready to pull. The copybara worker will import for internal testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants