chore: build base image when the file changes in commit or release#41583
chore: build base image when the file changes in commit or release#41583wyattwalter wants to merge 2 commits intoreleasefrom
Conversation
WalkthroughRefactors Docker base-image build into a reusable workflow-callable workflow with an optional Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.github/workflows/docker-base-image.yml (1)
42-65: Consider gating prep steps behind the same change condition.When
changed=false, Lines 42/48/61 still run. You can apply the same condition there to reduce unnecessary secret usage and runtime.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/docker-base-image.yml around lines 42 - 65, The workflow runs preparatory steps even when no relevant changes exist; add the same guard used on the Build step (if: steps.check.outputs.changed != 'false') to the "Login to DockerHub", "Get tag" (id: tag), and "Set up Depot CLI" steps so those steps are skipped when steps.check.outputs.changed == 'false'; update the three steps to include that identical if condition to avoid consuming secrets and runtime unnecessarily.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/docker-base-image.yml:
- Around line 29-40: The check step (id: check) only diffs HEAD~1..HEAD which
misses changes in multi-commit pushes and is paired with fetch-depth: 2; update
the workflow to fetch full history (set fetch-depth: 0) or at least ensure the
pushed range is present, then replace the git diff invocation to compare the
push range using github.event.before and github.sha (e.g., git diff --name-only
"${{ github.event.before }}" "${{ github.sha }}" | grep -q
"deploy/docker/base.dockerfile") so any change to deploy/docker/base.dockerfile
in the entire push is detected and the base image rebuild is triggered.
---
Nitpick comments:
In @.github/workflows/docker-base-image.yml:
- Around line 42-65: The workflow runs preparatory steps even when no relevant
changes exist; add the same guard used on the Build step (if:
steps.check.outputs.changed != 'false') to the "Login to DockerHub", "Get tag"
(id: tag), and "Set up Depot CLI" steps so those steps are skipped when
steps.check.outputs.changed == 'false'; update the three steps to include that
identical if condition to avoid consuming secrets and runtime unnecessarily.
ℹ️ Review info
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
.github/workflows/docker-base-image.yml.github/workflows/github-release.yml.github/workflows/test-build-docker-image.yml
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/docker-base-image.yml:
- Around line 36-40: The current if-block sets range based only on whether
github.event.before is non-empty, but that value can be the null SHA
"0000000000000000000000000000000000000000" on first-time branch pushes which
causes git diff to fail; update the conditional to treat the null SHA as
equivalent to empty by checking github.event.before is not empty AND not equal
to the null SHA (e.g., compare against the 40-zero string or test prefix), and
only then set range="${{ github.event.before }}..${{ github.sha }}"; otherwise
set range="HEAD~1..HEAD" so new-branch pushes use a valid diff range.
Description
The existing base Docker image build job was completely independent of the final image build, and they run in parallel. That means that in practice, often we were seeing the image on the
releasebranch be built with the older base image which makes rollout of changes with dependencies between the two tricky.This removes the direct push trigger on the base Docker image build, and shifts it to the places where we build the image. It calls the base image job which checks whether it needs to be re-built for this commit. If not, it skips the build step. But if it does, it halts the build of the downstream image until the base is updated.
Fixes #
Issue Numberor
Fixes
Issue URLWarning
If no issue exists, please create an issue first, and check with the maintainers if the issue is valid.
Automation
/ok-to-test tags=""
🔍 Cypress test results
Warning
Tests have not run on the HEAD 9a82393 yet
Fri, 27 Feb 2026 23:07:59 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit