ci: branch-tagged image builds via workflow_dispatch (#1994 Phase 1) - #2004
Conversation
…ic#1994 Phase 1) A workflow_dispatch from any branch now builds and pushes every image tagged <date>-<sha7>.<sanitized-branch> (branch name sanitized to the docker-tag charset, capped at 60 chars). Main keeps the suffix-less tag format; PR runs keep building without pushing. The ~22 inline `event != pull_request && ref == main` push guards are replaced by one `should_push` output on the `changes` job — a single place that defines the push policy. Publishing side-effects keep their own main-only gates and are untouched: `latest` (now enable-gated in the merge jobs' metadata), bump-descriptors, and publish-chart — whose appVersion regex rejects branch-suffixed tags as the backstop, so a branch build can never auto-commit, bump appVersions, or publish a chart. Each merge job now writes its pushed ref to the run's step summary, so the run page shows a copy-pastable image list. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Anton Zelenov <antonz@constructor.tech>
📝 WalkthroughWalkthroughThe image workflow now computes a shared build tag and push policy, applies it to backend, toolbox, and connector image publishing and manifest merging, restricts ChangesImage publishing policy
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related issues
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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
🤖 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/build-images.yml:
- Around line 133-137: Update the SAFE_BRANCH/BUILD_TAG construction to retain
a deterministic, collision-resistant identifier derived from the full REF_NAME
after sanitization, including when sanitization produces an empty value or
truncation removes distinguishing characters. Preserve the readable sanitized
branch component while appending a sufficiently unique hash or equivalent
stable suffix, and ensure distinct Unicode refs cannot produce the same final
tag.
🪄 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: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 2a030211-8355-4acd-83c9-8e5366ee5e2b
📒 Files selected for processing (1)
.github/workflows/build-images.yml
Part of #1994 (Phase 1 — manual branch builds + image report). Companion PR in insight-front follows the same scheme.
What changes
workflow_dispatchfrom a non-main ref tags images<YYYY.MM.DD.HH.MM>-<sha7>.<sanitized-branch>(sanitized to the docker-tag charset viatr -c 'a-zA-Z0-9._-' '-', edge separators trimmed, capped at 60 chars). Main pushes keep the exact current suffix-less format; PR runs keep building without pushing.github.event_name != 'pull_request' && github.ref == 'refs/heads/main'guards (login /push=/ digest export+upload / merge-job conditions) are replaced by a singleshould_pushoutput on thechangesjob — true for a main push and anyworkflow_dispatch, false for PRs.lateststays main-only:enable=${{ github.ref == 'refs/heads/main' }}on thelatesttag in every merge job.image:tagref to$GITHUB_STEP_SUMMARY, so the run page shows a copy-pastable list.What deliberately does not change
bump-descriptorsandpublish-chartkeep their existingref == maingates — a branch build can never auto-commit descriptor/appVersion bumps or publish a chart. Backstop: publish-chart's appVersion regex (^[0-9]{4}(\.[0-9]{2}){4}-[0-9a-f]{7}$) rejects branch-suffixed tags outright.Usage
or Actions → Build & Push Container Images → Run workflow → pick the branch (must live in this repo, not a fork). Empty
frontend_tag= full rebuild of all images, same as today's manual dispatch semantics.Validation
release/2026-08,feat/bff+auth, unicode, leading/trailing separators, and >60-char names — all produce valid docker tags.workflow_dispatchruns the workflow definition from the dispatched ref, so dispatching this branch itself (once it lives in this repo or after merge) exercises the branch-tag path; a main dispatch reproduces today's behavior.🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Improvements