Skip to content

ci: build only affected production images#54

Merged
kl3inIT merged 4 commits into
mainfrom
ci/selective-production-images
Jul 25, 2026
Merged

ci: build only affected production images#54
kl3inIT merged 4 commits into
mainfrom
ci/selective-production-images

Conversation

@kl3inIT

@kl3inIT kl3inIT commented Jul 25, 2026

Copy link
Copy Markdown
Owner

Outcome

  • compare each green main commit with the latest successful production image release
  • build only dependency-affected components
  • carry unchanged OCI manifests forward without recompilation
  • verify all six immutable SHA-tagged images and publish a release manifest

Safety

  • first run and workflow changes rebuild every image
  • deploy remains pinned to one commit SHA
  • unchanged images retain their original digest and provenance

Verification

  • actionlint 1.7.12
  • git diff --check
  • current action release versions verified against upstream

Summary by CodeRabbit

  • New Features

    • Production image builds now run only for components affected by recent changes.
    • Unchanged images are automatically carried forward, reducing unnecessary rebuilds.
    • Releases now include a complete, verified set of immutable image references for each commit.
  • Reliability Improvements

    • Image publishing validates that all referenced image digests are valid before release.

@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

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

Next review available in: 55 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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: a7165e91-9d82-4065-a535-6de05bf6b2fb

📥 Commits

Reviewing files that changed from the base of the PR and between 55333cb and a6c2e69.

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

Walkthrough

The workflow now identifies changed production images, builds only affected images, carries unchanged manifests to the new commit, validates all image digests, and uploads a complete immutable image-set artifact.

Changes

Production image release

Layer / File(s) Summary
Change planning and image selection
.github/workflows/build-images.yml
Adds a planning job that compares the head commit with the latest successful main run and outputs changed and unchanged image lists.
Selective image builds
.github/workflows/build-images.yml
Builds only changed images and resolves each image’s Dockerfile and build arguments from its matrix name.
Manifest carry-forward and release artifact
.github/workflows/build-images.yml
Retags unchanged image manifests, validates all image digests, distinguishes built and carried-forward images, and uploads release-images.json.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CI
  participant Plan
  participant Images
  participant CarryForward
  participant Release
  participant Registry
  CI->>Plan: provide completed run and head SHA
  Plan->>Plan: compare head SHA with prior successful main SHA
  Plan-->>Images: provide changed image matrix
  Images->>Registry: build and publish changed images
  Plan-->>CarryForward: provide unchanged image list and base SHA
  CarryForward->>Registry: retag unchanged manifests to head SHA
  Images-->>Release: provide changed image results
  CarryForward-->>Release: provide carry-forward results
  Release->>Registry: verify image digests
  Release-->>CI: upload complete release-images.json
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main CI change: building only affected production images.
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 ci/selective-production-images

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: 2

🤖 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 49-61: Update the base_sha selection in the Build production
images workflow to validate that the selected successful main-branch commit is
an ancestor of HEAD_SHA using the checked-out repository history. Ignore
non-ancestor candidates and select an eligible ancestor; if none exists or
ancestry validation fails, leave base_sha unset so downstream logic performs a
full rebuild instead of carry-forward.
- Around line 357-364: Update the changed-image decision logic in the workflow
to verify that the base and head image references resolve to the same digest
before recording a carried-forward entry with source_sha="$BASE_SHA". Compare
the digests for sha-$BASE_SHA and sha-$HEAD_SHA, and fail the workflow when they
differ; retain the existing built=true path for images in CHANGED.
🪄 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: ASSERTIVE

Plan: Pro Plus

Run ID: 0ea7742c-eefb-4b15-8735-8992bd0ae970

📥 Commits

Reviewing files that changed from the base of the PR and between 2cf8693 and 55333cb.

⛔ Files ignored due to path filters (2)
  • docs/increments/active/2026-07-25-production-cicd-zm/design.md is excluded by !docs/**
  • docs/increments/active/2026-07-25-production-cicd-zm/plan.md is excluded by !docs/**
📒 Files selected for processing (1)
  • .github/workflows/build-images.yml
📜 Review details
⏰ Context from checks skipped due to timeout. (2)
  • GitHub Check: Deployment contracts
  • GitHub Check: Backend · Java 25
🧰 Additional context used
📓 Path-based instructions (1)
.github/**/*.{yml,yaml}

⚙️ CodeRabbit configuration file

.github/**/*.{yml,yaml}: Require least-privilege permissions, explicit release tags for actions,
bounded job timeouts, concurrency cancellation, frozen lockfiles, and no
secrets in pull-request workflows. GitHub Actions are intentionally not
pinned to commit SHAs; Dependabot owns their scheduled version updates.

Files:

  • .github/workflows/build-images.yml
🧠 Learnings (1)
📚 Learning: 2026-07-24T22:52:57.466Z
Learnt from: kl3inIT
Repo: kl3inIT/OrgMemory PR: 40
File: .github/workflows/ci.yml:126-126
Timestamp: 2026-07-24T22:52:57.466Z
Learning: In this repository’s GitHub Actions workflows, the `uses:` field may intentionally reference GitHub Actions by explicit release tags (not immutable commit SHAs) per the project’s OrgMemory policy. Do not flag tag-based `uses:` references as “unpinned” if they are release-tag-based (e.g., `owner/repovX.Y.Z`) and follow the repo’s Dependabot-owned scheduled updates approach.

Applied to files:

  • .github/workflows/build-images.yml
🪛 zizmor (1.26.1)
.github/workflows/build-images.yml

[warning] 13-13: permissions without explanatory comments (undocumented-permissions): needs an explanatory comment

(undocumented-permissions)


[error] 35-35: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)


[error] 66-66: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)


[error] 251-251: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)


[error] 287-287: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)


[error] 290-290: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)


[error] 329-329: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)


[error] 332-332: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)


[error] 385-385: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)

🔇 Additional comments (10)
.github/workflows/build-images.yml (10)

13-13: LGTM!


24-39: LGTM!


136-184: LGTM!


186-195: LGTM!

Also applies to: 213-260


279-312: LGTM!


314-326: LGTM!

Also applies to: 384-390


50-55: 📐 Maintainability & Code Quality

--workflow matches the workflow name.


63-69: 📐 Maintainability & Code Quality

No change needed.

dorny/paths-filter@v4.0.2 is a valid release, and ref + base are supported inputs for this workflow-run diff.


71-134: 🗄️ Data Integrity & Integration

Contract-only rebuilds only affect web.

contracts/ contains OpenAPI/schema artifacts, and there’s no evidence the backend JVM app image filters consume generated contract sources; restricting these triggers to web avoids unnecessarily rebuilding api, worker, or mcp.


355-356: 🩺 Stability & Availability

No change needed for this assertion.

jq -e --arg digest "$digest" still runs the jq program even when stdin is empty, and the false result exits non-zero as intended for an invalid digest.

			> Likely an incorrect or invalid review comment.

Comment thread .github/workflows/build-images.yml Outdated
Comment thread .github/workflows/build-images.yml
@kl3inIT
kl3inIT merged commit 65dfc6a into main Jul 25, 2026
11 checks passed
@kl3inIT
kl3inIT deleted the ci/selective-production-images branch July 25, 2026 18:43
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.

1 participant