Skip to content

ci: pin branch-built images into the chart on release-* branches (#1994) - #2097

Merged
cyberantonz merged 2 commits into
constructorfabric:mainfrom
cyberantonz:ci/release-branch-chart-pin
Jul 31, 2026
Merged

ci: pin branch-built images into the chart on release-* branches (#1994)#2097
cyberantonz merged 2 commits into
constructorfabric:mainfrom
cyberantonz:ci/release-branch-chart-pin

Conversation

@cyberantonz

@cyberantonz cyberantonz commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

What

Completes the release-branch half of #1994: a build on a release-* branch now pins the freshly pushed branch-suffixed images into the chart and publishes it with a patch-only umbrella version bump. This is collision-safe because trunk's minor version is bumped right after a release branch is cut, so the branch's x.y.Z patch stream and main's stream never overlap on the OCI registry.

Why nothing was pinned before

  • bump-descriptors and publish-chart were hard-gated github.ref == 'refs/heads/main'.
  • Even if opened up, the flow could not converge: bump-descriptors commits without [skip ci] and relies on the resulting push re-triggering the workflow (toolbox rebake with patched descriptors + deferred publish-chart) — but on.push only covered main, so on a release branch that follow-up run never fires.
  • The umbrella appVersion sanity regex deliberately rejects the branch-suffixed tag form.

Changes

  1. on.push / on.pull_request: add release-** — release-branch pushes get the same paths-filtered build → pin → publish machinery as main, and the bump-descriptors auto-commit re-triggers the workflow exactly like it does on main.
  2. dorny/paths-filter gets base: ${{ github.ref_name }} — without it, dorny diffs a release-branch push against the repo default branch and marks every service changed on every push. With base=ref_name the per-push diff semantics main has always had apply to release branches too. (Ignored on pull_request; on workflow_dispatch it yields no-diff, same as today — dispatch builds fire via the full-rebuild condition.)
  3. Ref gates on bump-descriptors / publish-chart widened to main || startsWith(ref_name, 'release-').
  4. Umbrella appVersion regex: non-main refs accept the branch-suffixed tag shape (YYYY.MM.DD.HH.MM-sha7.<branch>); main keeps the strict suffix-less regex as the backstop against branch tags leaking into main-published charts.

Unchanged: latest image tag stays main-only; PR runs still build without pushing; umbrella bump is patch-only (existing behavior).

Resulting flow on a release branch

  • gh workflow run build-images.yml --ref release-YYYY.MM.N (full rebuild) → all images pushed with .release-YYYY.MM.N-suffixed tags → bump-descriptors pins connector descriptors + service subchart appVersions and commits → that push re-triggers → toolbox rebakes, publish-chart bumps the umbrella patch version and publishes oci://ghcr.io/constructorfabric/charts/insight:<x.y.Z+1>.
  • A plain push (e.g. a merged backport) to the branch auto-builds only the changed images and publishes the pinned chart, same as main.
  • Frontend: a manual dispatch on the release ref with frontend_tag=<tag> pins the frontend subchart without rebuilding backends (the cross-repo auto-dispatch from insight-front remains main-only).

Notes

  • Descriptor version: bumps stay minor on release branches (per ADR-0015 the minor bump drives catalog re-discovery without a full refresh — same rationale as main; descriptor versions are compared per-environment, not across chart streams).
  • The very first push that creates a release-* branch may build everything once (paths-filter can't diff an initial push) — that gives the branch its own tagged image baseline, which is desirable.
  • Verified release-* branches carry no branch protection, so the App-token auto-commits push cleanly.

Refs #1994

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Expanded image build automation to support both the main branch and release branches.
    • Release branches now receive branch-specific image tags.
    • Descriptor and chart publishing is supported for eligible release branches.
    • Main-branch-only safeguards remain in place for the latest tag and strict version validation.
    • Improved branch-aware chart validation and publishing commit messages.

@cyberantonz
cyberantonz requested a review from a team as a code owner July 31, 2026 07:04
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@cyberantonz, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 14 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 780e839a-88e8-4ffb-812d-0d328f55c31c

📥 Commits

Reviewing files that changed from the base of the PR and between fa5f7b864e3ef6ba385c7c0f239d4f965b834574 and 4043fda.

📒 Files selected for processing (1)
  • .github/workflows/build-images.yml
📝 Walkthrough

Walkthrough

The workflow now builds images for main and release-* branches. Release branches use branch-specific tags and support descriptor and chart publishing. Main-only latest tagging and strict appVersion validation remain unchanged.

Changes

Release branch publishing

Layer / File(s) Summary
Branch triggers and image tags
.github/workflows/build-images.yml
Push and pull-request triggers include release-* branches. Release builds use branch-suffixed image tags.
Branch-aware publishing flow
.github/workflows/build-images.yml
Descriptor and chart publishing support main and release-* branches. Path filtering uses the current ref. Release branches use patch-only chart versioning.
Branch-aware validation and commits
.github/workflows/build-images.yml
Non-main refs accept sanitized branch suffixes in umbrella appVersion. Version-bump commits target the triggering branch.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related issues

Possibly related PRs

Suggested reviewers: ktursunov, mozhaev-dev

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes pinning branch-built images into the chart for release-* branches.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

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/build-images.yml:
- Line 988: Update the release-gating conditions at the referenced workflow
checks, including the expressions near the main/release jobs, to match full
branch refs only: permit refs/heads/main or refs/heads/release-.* and reject tag
refs. Replace github.ref_name-based release matching with github.ref checks
while preserving the existing main-branch allowance.
🪄 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: 793602f2-c7ba-4e4e-99db-56d83e2c09b0

📥 Commits

Reviewing files that changed from the base of the PR and between b908f1c and fa5f7b864e3ef6ba385c7c0f239d4f965b834574.

📒 Files selected for processing (1)
  • .github/workflows/build-images.yml

Comment thread .github/workflows/build-images.yml Outdated
cyberantonz and others added 2 commits July 31, 2026 15:44
…structorfabric#1994)

Manual branch image builds (constructorfabric#1994 Phase 1) push branch-suffixed tags but
nothing pins them: bump-descriptors and publish-chart were hard-gated to
main, and the descriptor auto-commit could not re-trigger the workflow on
a release branch (on.push covered main only).

- trigger build-images on push to release-** (paths-filtered, same as
  main) so the bump-descriptors commit re-triggers the run that rebakes
  toolbox and performs the deferred chart publish
- give dorny/paths-filter base=ref_name so release-branch pushes diff
  against the previous push instead of against main
- open the bump-descriptors and publish-chart ref gates to release-*
- accept the branch-suffixed build-tag shape in the umbrella appVersion
  check on non-main refs; main keeps the strict suffix-less regex as the
  backstop against branch tags leaking into main-published charts

The umbrella version bump stays patch-only. Release-branch chart versions
remain inside the minor stream the branch was cut with (trunk minor-bumps
right after cutting a release branch), so the two publish streams cannot
collide on the OCI registry. The latest image tag stays main-only.

Refs constructorfabric#1994

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Anton Zelenov <antonz@constructor.tech>
startsWith(github.ref_name, 'release-') also matches a TAG named
release-*: a workflow_dispatch on such a tag would pass the
bump-descriptors/publish-chart gates and then run branch-oriented
git push HEAD:${GITHUB_REF_NAME} against a tag ref. Match the full
refs/heads/release- prefix instead, and select the umbrella appVersion
regex from $GITHUB_REF for the same reason.

Reported by coderabbitai on constructorfabric#2097.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Anton Zelenov <antonz@constructor.tech>
@cyberantonz
cyberantonz force-pushed the ci/release-branch-chart-pin branch from fa5f7b8 to 4043fda Compare July 31, 2026 07:47
cyberantonz added a commit that referenced this pull request Jul 31, 2026
)

Manual equivalent of the publish-chart job, which does not yet run on
release branches (CI gap, being fixed separately in #2097): pin the
branch-built image tags into the subchart appVersions + the toolbox ref,
and patch-bump the umbrella version so the chart carrying the
identity-resolution seed CronJob template (#2046 backport) can be
published and consumed from gitops.

- backend subcharts + toolbox: 2026.07.31.06.52-bf09d6a.release-2026.07.1
- frontend subchart:           2026.07.31.06.52-0bb785c.release-2026.07.1
- umbrella: 0.4.68 -> 0.4.70 (appVersion = max subchart appVersion)

Signed-off-by: Anton Zelenov <antonz@constructor.tech>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
@cyberantonz
cyberantonz added this pull request to the merge queue Jul 31, 2026
Merged via the queue into constructorfabric:main with commit 523ea77 Jul 31, 2026
35 checks passed
@cyberantonz
cyberantonz deleted the ci/release-branch-chart-pin branch July 31, 2026 11:25
cyberantonz added a commit that referenced this pull request Jul 31, 2026
…) (#2097) (#2115)

Backport of the #2097 merge (523ea77) to release-2026.07.1. Required on
the branch itself: push-event workflows run the workflow file from the
pushed ref, so the release branch needs the release-** triggers and the
widened publish gates locally for chart publishing to fire here.

(cherry picked from commit 523ea77)

Signed-off-by: Anton Zelenov <antonz@constructor.tech>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants