From 872d0c1d5350e229aa123bb364696626b725aa95 Mon Sep 17 00:00:00 2001 From: Yolean macbot01 Date: Thu, 11 Jun 2026 15:55:46 +0200 Subject: [PATCH 1/3] ci: pin Swatinem/rust-cache save-if to main only MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR runs were producing one ~500 MB rust-cache entry per (job × rustc × Cargo.lock) tuple. With dependency churn across PRs the per-repo Actions cache budget grew to ~130 entries / ~65 GB, which trips eviction of warm main-scope entries and ultimately costs storage. PRs now still *restore* from existing caches (so they get the same speedup, ~3-5 min per job on a librdkafka cold build) but skip the save step, leaving cache writes to main only. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/ci.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 25f2411..33185a5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -40,6 +40,11 @@ jobs: with: components: rustfmt, clippy - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 + with: + # PRs restore from main's cache but don't write their own — + # otherwise every (rustc, Cargo.lock) tuple per PR adds a + # ~500 MB entry and the per-repo cache budget blows up. + save-if: ${{ github.ref == 'refs/heads/main' }} - run: cargo fmt --all -- --check - run: cargo clippy --workspace --all-targets --locked -- -Dwarnings - name: unit + integration tests (no docker) @@ -56,6 +61,10 @@ jobs: run: sudo apt-get update && sudo apt-get install -y --no-install-recommends $LIBRDKAFKA_BUILD_DEPS - uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable as of 2026-03-27 - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 + with: + # See note in the `test` job: PRs restore but don't save, + # so PR runs don't proliferate the per-repo cache budget. + save-if: ${{ github.ref == 'refs/heads/main' }} - name: prepull e2e images run: | docker pull quay.io/ogunalp/kafka-native:latest & From fac729379b444281280b0c547fd2e3e4e90b80f4 Mon Sep 17 00:00:00 2001 From: Yolean macbot01 Date: Thu, 11 Jun 2026 15:58:03 +0200 Subject: [PATCH 2/3] gitignore: ignore local NOTES_*.md design memos Lets in-flight design discussions live in the repo root as markdown without polluting git history. The current use is NOTES_DELIVERY_SEMANTICS.md, written locally as a shelf for the delivery-semantics + readiness redesign while sub-decisions (Skip semantics, commit-during-debounce concern) are still open. Co-Authored-By: Claude Opus 4.7 (1M context) --- .gitignore | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitignore b/.gitignore index ea8c4bf..7eb055a 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,6 @@ /target + +# Local design memos / shelf notes — useful for human resumption +# of in-flight design work but not stable enough to commit. Files +# matching this pattern stay in the working tree, unversioned. +NOTES_*.md From ad50e9260d78039566299c831eecec8326095560 Mon Sep 17 00:00:00 2001 From: Yolean macbot01 Date: Tue, 16 Jun 2026 09:22:04 +0200 Subject: [PATCH 3/3] ci: prune superseded main buildkit caches after each successful build Builds on main are rarely reverted, so the next main build only ever reads from the most recent run's buildkit blobs. Per-commit layers from older runs are dead weight: they accumulate, content-address collisions make them hard to evict deliberately, and they push other caches (rust-cache, etc.) closer to GitHub's 10 GB per-repo ceiling until LRU starts evicting useful entries. The keep-top-N=200 heuristic survives one multi-arch build's ~30-50 blob writes plus 2-3x headroom; older entries get the `gh cache delete` treatment. PR runs are untouched (their entries are already capped by the rust-cache save-if change in the previous commit, and buildx writes are scoped per-ref). Needs `actions: write` on the image job so gh CLI can delete cache entries via the repo's API token. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/ci.yaml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 33185a5..4337c3e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -82,6 +82,9 @@ jobs: permissions: packages: write contents: read + # The prune-superseded-caches step at the end of this job + # deletes obsolete buildkit blobs via `gh cache delete`. + actions: write steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0 @@ -126,3 +129,35 @@ jobs: cache-from: type=gha cache-to: type=gha,mode=max provenance: false + - name: prune superseded main buildkit caches + # Buildx writes content-addressed blobs and an index per build; + # the next main build only reads from the most recent entries + # (main rarely reverts), so older runs' blobs are dead weight + # that pushes the rust-cache and other useful entries closer + # to GHA's per-repo eviction ceiling. Keep the top N most- + # recently-created buildkit-* / index-buildkit-* entries on + # refs/heads/main; delete the rest. + # + # N=200 is roughly 2-4 main builds' worth (one multi-arch build + # writes ~30-50 entries). Adjust if a single build ever pushes + # close to the limit — symptom is the *next* main build going + # cold despite this step running. + if: github.ref == 'refs/heads/main' && github.event_name == 'push' && success() + env: + GH_TOKEN: ${{ github.token }} + run: | + set -euo pipefail + to_delete=$(gh cache list -R "$GITHUB_REPOSITORY" -L 1000 \ + --json id,key,ref,createdAt \ + --jq '[ .[] + | select(.ref == "refs/heads/main") + | select((.key | startswith("buildkit-")) or (.key | startswith("index-buildkit-"))) + ] + | sort_by(.createdAt) | reverse | .[200:] | .[].id') + if [ -n "${to_delete:-}" ]; then + count=$(echo "$to_delete" | wc -l | tr -d ' ') + echo "Pruning $count superseded buildkit cache entries on main" + echo "$to_delete" | xargs -I {} gh cache delete -R "$GITHUB_REPOSITORY" {} + else + echo "No superseded buildkit caches to prune" + fi