Push to bazel* caches from the main branch only#46151
Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit intomainfrom Feb 10, 2026
Merged
Conversation
Contributor
Gitlab CI Configuration ChangesChanges Summary
ℹ️ Diff available in the job log. |
Configure Bazel ephemeral cache to use `pull`-only policy by default and `pull-push` only from the `main` branch. This avoids cache pollution from feature branches while allowing `main` to populate the cache.
0dfc9d4 to
18b8824
Compare
bazel* caches only from the main branchbazel* caches from the main branch only
chouquette
approved these changes
Feb 10, 2026
Ishirui
approved these changes
Feb 10, 2026
Contributor
Author
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
|
dd-octo-sts bot
added a commit
that referenced
this pull request
Feb 10, 2026
… does this PR do? Configure GitLab `bazel*` caches on ephemeral runners to use a `pull`-only policy by default, and `pull-push` only when running on the `main` branch. This restriction applies only to **GitLab** caches - at this stage, the `bazel` **remote** cache remains indeed shared across all branches. ### Motivation 1. avoid cache pollution from feature and release branches while allowing `main` to populate the cache in a _progressive_ manner, 2. because the GitLab cache is uploaded to a shared S3 bucket, restricting uploads to `main` reduces S3 write contention and costs incurred by parallel cache overwrites. Because the GitLab cache is shared across pipelines, allowing feature or release branches to push artifacts pollutes the cache with _experimental_ entries from feature branches and _meanwhile-evicted_ entries from oldest release branches. ### Additional Notes Release branches and feature branches _behind_ `main` may fetch _older_ dependencies, whereas feature branches _ahead_ of `main` may fetch _newer_ dependencies, but: - they'll still benefit from the `bazel` remote cache, - they'll no longer incur the overhead of uploading GitLab caches. Co-authored-by: regis.desgroppes <[email protected]> (cherry picked from commit 0463d57) ___ Co-authored-by: Régis Desgroppes <[email protected]>
gh-worker-dd-mergequeue-cf854d bot
pushed a commit
that referenced
this pull request
Feb 11, 2026
…#46179) Backport 0463d57 from #46151. ___ ### What does this PR do? Configure GitLab `bazel*` caches on ephemeral runners to use a `pull`-only policy by default, and `pull-push` only when running on the `main` branch. This restriction applies only to **GitLab** caches - at this stage, the `bazel` **remote** cache remains indeed shared across all branches. ### Motivation 1. avoid cache pollution from feature and release branches while allowing `main` to populate the cache in a _progressive_ manner, 2. because the GitLab cache is uploaded to a shared S3 bucket, restricting uploads to `main` reduces S3 write contention and costs incurred by parallel cache overwrites. Because the GitLab cache is shared across pipelines, allowing feature or release branches to push artifacts pollutes the cache with _experimental_ entries from feature branches and _meanwhile-evicted_ entries from oldest release branches. ### Additional Notes Release branches and feature branches _behind_ `main` may fetch _older_ dependencies, whereas feature branches _ahead_ of `main` may fetch _newer_ dependencies, but: - they'll still benefit from the `bazel` remote cache, - they'll no longer incur the overhead of uploading GitLab caches. Co-authored-by: axel.vonengel <[email protected]>
dd-octo-sts bot
added a commit
that referenced
this pull request
Feb 12, 2026
… does this PR do? Configure GitLab `bazel*` caches on ephemeral runners to use a `pull`-only policy by default, and `pull-push` only when running on the `main` branch. This restriction applies only to **GitLab** caches - at this stage, the `bazel` **remote** cache remains indeed shared across all branches. ### Motivation 1. avoid cache pollution from feature and release branches while allowing `main` to populate the cache in a _progressive_ manner, 2. because the GitLab cache is uploaded to a shared S3 bucket, restricting uploads to `main` reduces S3 write contention and costs incurred by parallel cache overwrites. Because the GitLab cache is shared across pipelines, allowing feature or release branches to push artifacts pollutes the cache with _experimental_ entries from feature branches and _meanwhile-evicted_ entries from oldest release branches. ### Additional Notes Release branches and feature branches _behind_ `main` may fetch _older_ dependencies, whereas feature branches _ahead_ of `main` may fetch _newer_ dependencies, but: - they'll still benefit from the `bazel` remote cache, - they'll no longer incur the overhead of uploading GitLab caches. Co-authored-by: regis.desgroppes <[email protected]> (cherry picked from commit 0463d57) ___ Co-authored-by: Régis Desgroppes <[email protected]>
gh-worker-dd-mergequeue-cf854d bot
pushed a commit
that referenced
this pull request
Feb 12, 2026
…#46325) Backport 0463d57 from #46151. ___ ### What does this PR do? Configure GitLab `bazel*` caches on ephemeral runners to use a `pull`-only policy by default, and `pull-push` only when running on the `main` branch. This restriction applies only to **GitLab** caches - at this stage, the `bazel` **remote** cache remains indeed shared across all branches. ### Motivation 1. avoid cache pollution from feature and release branches while allowing `main` to populate the cache in a _progressive_ manner, 2. because the GitLab cache is uploaded to a shared S3 bucket, restricting uploads to `main` reduces S3 write contention and costs incurred by parallel cache overwrites. Because the GitLab cache is shared across pipelines, allowing feature or release branches to push artifacts pollutes the cache with _experimental_ entries from feature branches and _meanwhile-evicted_ entries from oldest release branches. ### Additional Notes Release branches and feature branches _behind_ `main` may fetch _older_ dependencies, whereas feature branches _ahead_ of `main` may fetch _newer_ dependencies, but: - they'll still benefit from the `bazel` remote cache, - they'll no longer incur the overhead of uploading GitLab caches. Co-authored-by: florent.clarret <[email protected]>
rdesgroppes
added a commit
that referenced
this pull request
Feb 26, 2026
### What does this PR do? Wire up `bazel`-managed Go and `pip` caches to `XDG_CACHE_HOME` in the bazel wrapper scripts, and adds the corresponding paths to the progressive GitLab runner cache keyed on `.go-version` and `.python-version`: ```diff -.bazel:defs:cache:ephemeral +.bazel:defs:cache:progressive ``` (my bad, "ephemeral" was kind of misleading: indeed used by ephemeral _runners_, but not ephemeral in itself since it's _stored_ to S3) ### Motivation Extend #43274's XDG-as-single-cache-root design to Go and `pip`, whose XDG support has been steadlessly growing from "Partial" to "Supported": https://wiki.archlinux.org/title/XDG_Base_Directory. By landing in `$XDG_CACHE_HOME`, they inherit the progressive-cache policy from #46151: only main pushes to them, keeping growth bounded. Keying on language version files further contains growth by resetting the cache at upgrade boundaries rather than accumulating superseded artifacts. ### Additional Notes No worry: the new cache paths are already excluded from omnibus source trees via `**/.cache/**/*` source filters. Coming soon: we might want to leverage upcoming `--strict_repo_env` (with `bazel` 8.6+), for which we'll anyway have to list allowed environment variables. Near future: as the omnibus-bazel transition progresses, other caches (`cache_omnibus_ruby_deps`, `go_deps`, `go_tools_deps`, `go_tools_deps_arm64`, etc.) are expected to shrink until no longer applicable.
rdesgroppes
added a commit
that referenced
this pull request
Feb 27, 2026
### What does this PR do? ```diff -.bazel:defs:cache:ephemeral +.bazel:defs:cache:progressive ``` ### Motivation My bad, "ephemeral" was kind of misleading: admittedly used by ephemeral _runners_, but not ephemeral in itself since it's stored to S3. ### Additional Notes "progressive" better reflects the controlled policy introduced in #46151: only `main` pushes to the cache, keeping it growing incrementally rather than going back and forth depending on the last pushing branch - whether antiquated or exploratory.
rdesgroppes
added a commit
that referenced
this pull request
Feb 27, 2026
### What does this PR do? ```diff -.bazel:defs:cache:ephemeral +.bazel:defs:cache:progressive ``` ### Motivation My bad, "ephemeral" was kind of misleading: admittedly used by ephemeral _runners_, but not ephemeral in itself since it's stored to S3. ### Additional Notes "progressive" better reflects the controlled policy introduced in #46151: only `main` pushes to the cache, keeping it growing incrementally rather than going back and forth depending on the last pushing branch - whether antiquated or exploratory.
rdesgroppes
added a commit
that referenced
this pull request
Feb 27, 2026
### What does this PR do? Wire up `bazel`-managed Go and `pip` caches to `XDG_CACHE_HOME` in the bazel wrapper scripts, and adds the corresponding paths to the progressive GitLab runner cache keyed on `.go-version` and `.python-version`. ### Motivation Extend #43274's XDG-as-single-cache-root design to Go and `pip`, whose XDG support has been steadlessly growing from "Partial" to "Supported": https://wiki.archlinux.org/title/XDG_Base_Directory. By landing in `$XDG_CACHE_HOME`, they inherit the progressive-cache policy from #46151: only `main` pushes to them, keeping growth bounded. Keying on language version files further contains growth by resetting the cache at version upgrade boundaries rather than accumulating superseded artifacts. ### Additional Notes No worry: the new cache paths are already excluded from omnibus source trees via `**/.cache/**/*` source filters. Coming soon: we might want to leverage upcoming `--strict_repo_env` (with `bazel` 8.6+), for which we'll anyway have to list allowed environment variables. Near future: as the omnibus-bazel transition progresses, other caches (`cache_omnibus_ruby_deps`, `go_deps`, `go_tools_deps`, `go_tools_deps_arm64`, etc.) are expected to shrink until no longer applicable.
rdesgroppes
added a commit
that referenced
this pull request
Feb 27, 2026
### What does this PR do? Wire up `bazel`-managed Go and `pip` caches to `XDG_CACHE_HOME` in the `tools/bazel*` scripts, and add the corresponding paths to the progressive GitLab runner cache keyed on `.go-version` and `.python-version`. ### Motivation Extend #43274's XDG-as-single-cache-root design to Go and `pip`, whose XDG support has been steadlessly growing from "Partial" to "Supported": https://wiki.archlinux.org/title/XDG_Base_Directory. By landing in `$XDG_CACHE_HOME`, they inherit the progressive-cache policy from #46151: only `main` pushes to them, keeping growth bounded. Keying on language version files further contains growth by resetting the cache at version upgrade boundaries rather than accumulating superseded artifacts. ### Additional Notes No worry: the new cache paths are already excluded from omnibus source trees via `**/.cache/**/*` source filters. Coming soon: we might want to leverage upcoming `--strict_repo_env` (with `bazel` 8.6+), for which we'll anyway have to list allowed environment variables. Near future: as the omnibus-bazel transition progresses, other caches (`cache_omnibus_ruby_deps`, `go_deps`, `go_tools_deps`, `go_tools_deps_arm64`, etc.) are expected to shrink until no longer applicable.
rdesgroppes
added a commit
that referenced
this pull request
Feb 27, 2026
### What does this PR do? Wire up `bazel`-managed Go and `pip` caches to `XDG_CACHE_HOME` in the `tools/bazel*` scripts, and add the corresponding paths to the progressive GitLab runner cache keyed on `.go-version` and `.python-version`. ### Motivation Extend #43274's XDG-as-single-cache-root design to Go and `pip`, whose XDG support has been steadlessly growing from "Partial" to "Supported": https://wiki.archlinux.org/title/XDG_Base_Directory. By landing in `$XDG_CACHE_HOME`, they inherit the progressive-cache policy from #46151: only `main` pushes to them, keeping growth bounded. Keying on language version files further contains growth by resetting the cache at version upgrade boundaries rather than accumulating superseded artifacts. ### Additional Notes No worry: the new cache paths are already excluded from omnibus source trees via `**/.cache/**/*` source filters. Coming soon: we might want to leverage upcoming `--strict_repo_env` (with `bazel` 8.6+), for which we'll anyway have to list allowed environment variables. Near future: as the omnibus-bazel transition progresses, other caches (`cache_omnibus_ruby_deps`, `go_deps`, `go_tools_deps`, `go_tools_deps_arm64`, etc.) are expected to shrink until no longer applicable.
rdesgroppes
added a commit
that referenced
this pull request
Feb 27, 2026
### What does this PR do? Wire up `bazel`-managed Go and `pip` caches to `XDG_CACHE_HOME` in the `tools/bazel*` scripts, and add the corresponding paths to the progressive GitLab runner cache keyed on `.go-version` and `.python-version`. ### Motivation Extend #43274's XDG-as-single-cache-root design to Go and `pip`, whose XDG support has been steadlessly growing from "Partial" to "Supported": https://wiki.archlinux.org/title/XDG_Base_Directory. By landing in `$XDG_CACHE_HOME`, they inherit the progressive-cache policy from #46151: only `main` pushes to them, keeping growth bounded. Keying on language version files further contains growth by resetting the cache at version upgrade boundaries rather than accumulating superseded artifacts. ### Additional Notes No worry: the new cache paths are already excluded from omnibus source trees via `**/.cache/**/*` source filters. Coming soon: we might want to leverage upcoming `--strict_repo_env` (with `bazel` 8.6+), for which we'll anyway have to list allowed environment variables. Near future: as the omnibus-bazel transition progresses, other caches (`cache_omnibus_ruby_deps`, `go_deps`, `go_tools_deps`, `go_tools_deps_arm64`, etc.) are expected to shrink until no longer applicable.
gh-worker-dd-mergequeue-cf854d bot
pushed a commit
that referenced
this pull request
Feb 27, 2026
### What does this PR do? Wire up `bazel`-managed Go and `pip` caches to `XDG_CACHE_HOME` in the `tools/bazel*` scripts, and add the corresponding paths to the progressive GitLab runner cache keyed on `.go-version` and `.python-version`. ### Motivation Extend #43274's XDG-as-single-cache-root design to Go and `pip`, whose XDG support has been steadlessly growing from "Partial" to "Supported": https://wiki.archlinux.org/title/XDG_Base_Directory. By landing in `$XDG_CACHE_HOME`, they inherit the progressive-cache policy from #46151: only `main` pushes to them, keeping growth bounded. Keying on language version files further contains growth by resetting the cache at version upgrade boundaries rather than accumulating superseded artifacts. ### Additional Notes No worry: the new cache paths are already excluded from omnibus source trees via `**/.cache/**/*` source filters. Coming soon: we might want to leverage upcoming `--strict_repo_env` (with `bazel` 8.6.0, #47011), for which we'll anyway have to list propagated environment variables. Near future: as the omnibus-bazel transition progresses, other caches (`cache_omnibus_ruby_deps`, `go_deps`, `go_tools_deps`, `go_tools_deps_arm64`, etc.) are expected to shrink until no longer applicable. Co-authored-by: regis.desgroppes <[email protected]>
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.
What does this PR do?
Configure GitLab
bazel*caches on ephemeral runners to use apull-only policy by default, andpull-pushonly when running on themainbranch.This restriction applies only to GitLab caches - at this stage, the
bazelremote cache remains indeed shared across all branches.Motivation
mainto populate the cache in a progressive manner,mainreduces S3 write contention and costs incurred by parallel cache overwrites.Since the GitLab cache is shared across pipelines, allowing feature or release branches to push artifacts pollutes the cache with experimental entries from feature branches and meanwhile-evicted entries from oldest release branches.
Additional Notes
Release branches and feature branches behind
mainmay fetch older dependencies, whereas feature branches ahead ofmainmay fetch newer dependencies, but:bazelremote cache,