Skip to content

Docker: Only cache qemu/buildx on default branch - #11241

Merged
vidplace7 merged 1 commit into
developfrom
docker-slim-cache
Jul 26, 2026
Merged

Docker: Only cache qemu/buildx on default branch#11241
vidplace7 merged 1 commit into
developfrom
docker-slim-cache

Conversation

@vidplace7

@vidplace7 vidplace7 commented Jul 26, 2026

Copy link
Copy Markdown
Member

Docker qemu / buildx are eating up lots of cache for little benefit. Remove unless we're building from the main branch.

Summary by CodeRabbit

  • Chores
    • Improved Docker build workflow efficiency by enabling build caching only on the repository’s default branch.
    • Reduced unnecessary cache activity during pull requests and merge-queue runs.

@vidplace7 vidplace7 added the github_actions Pull requests that update GitHub Actions code label Jul 26, 2026
@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 23e6e613-4eae-4d6d-82d0-c28414597357

📥 Commits

Reviewing files that changed from the base of the PR and between 5b9a732 and 1beea0f.

📒 Files selected for processing (1)
  • .github/workflows/docker_build.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/docker_build.yml

📝 Walkthrough

Walkthrough

The Docker build workflow now enables QEMU and Buildx caching only when the ref matches the repository’s default branch.

Changes

Docker cache gating

Layer / File(s) Summary
Cache flag and setup wiring
.github/workflows/docker_build.yml
Defines USE_CACHE for the default branch and uses it to conditionally configure QEMU image caching and Buildx binary caching.

Estimated code review effort: 2 (Simple) | ~5 minutes

Possibly related PRs

Suggested labels: github_actions

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is only a short summary and omits the template's required attestation and testing details. Replace the placeholder template with a full PR description, including summary, testing/attestations, and any regression notes.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the Docker cache behavior change on the default branch.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docker-slim-cache

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/docker_build.yml:
- Around line 48-50: Update the SAVE_CACHE expression in the workflow
environment to require both a push event and that github.ref_name matches
github.event.repository.default_branch, matching the contract used by
build_portduino_wasm.yml. Keep cache population disabled for workflow_dispatch,
scheduled, pull request, and other non-push runs.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 45906fa6-fa33-412a-aa4b-87a3162bd9fe

📥 Commits

Reviewing files that changed from the base of the PR and between 67e12dc and 5b9a732.

📒 Files selected for processing (1)
  • .github/workflows/docker_build.yml

Comment thread .github/workflows/docker_build.yml Outdated
Docker qemu / buildx are eating up lots of cache for little benefit. Remove unless we're building from the main branch.
@vidplace7
vidplace7 force-pushed the docker-slim-cache branch from 5b9a732 to 1beea0f Compare July 26, 2026 19:32
@github-actions

Copy link
Copy Markdown
Contributor

⚡ Try this PR in the Web Flasher

Note

Building this pull request… the flash button, badges and supported-board
list will appear here automatically once CI finishes.

@vidplace7
vidplace7 merged commit 2c8a2a8 into develop Jul 26, 2026
66 of 87 checks passed
@vidplace7
vidplace7 deleted the docker-slim-cache branch July 26, 2026 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

github_actions Pull requests that update GitHub Actions code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant