unify build workflows and add quay.expires-after label to container images#525
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThe build workflow now computes a Quay image expiry value based on the git ref ( ChangesQuay Image Expiry Labelling
Estimated code review effort: 1 (Trivial) | ~5 minutes Sequence Diagram(s)sequenceDiagram
participant Workflow as build-push.yaml
participant GitRef as GitHub Ref
participant DockerBuild as docker/build-push-action
participant Dockerfile as Dockerfile
Workflow->>GitRef: Inspect ref_name / ref_type
GitRef-->>Workflow: main / semver tag / other
Workflow->>Workflow: Compute expiry (never or 3w)
Workflow->>DockerBuild: Pass build-args QUAY_IMAGE_EXPIRY
DockerBuild->>Dockerfile: Build with ARG QUAY_IMAGE_EXPIRY
Dockerfile-->>DockerBuild: LABEL quay.expires-after set
Possibly related issues
Suggested reviewers: Poem
🚥 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 |
20d3cde to
b19bc2e
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
scripts/cluster-setup.sh (1)
53-59: ⚡ Quick winPin Developer Portal Controller manifests to the same release as the controller image
scripts/cluster-setup.sh(used for local dev + e2e) applies the controller manifests fromref=mainwhile the image is pinned toquay.io/kuadrant/developer-portal-controller:v0.2.0. If upstreammainchanges RBAC/deployment/args independently, the pinned binary can become incompatible. Pin both the kustomizerefand the image to the same immutable release (tag/commit).Suggested change
-log "installing Developer Portal Controller from main..." -kubectl apply -k https://github.com/Kuadrant/developer-portal-controller/config/default?ref=main +DPC_REF="v0.2.0" +DPC_IMAGE="quay.io/kuadrant/developer-portal-controller:${DPC_REF}" +log "installing Developer Portal Controller from ${DPC_REF}..." +kubectl apply -k "https://github.com/Kuadrant/developer-portal-controller/config/default?ref=${DPC_REF}" log "patching Developer Portal Controller image to quay.io..." kubectl set image deployment/developer-portal-controller-controller-manager \ - manager=quay.io/kuadrant/developer-portal-controller:v0.2.0 \ + manager="${DPC_IMAGE}" \ -n developer-portal-controller-system🤖 Prompt for 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. In `@scripts/cluster-setup.sh` around lines 53 - 59, The manifest URL currently used by kubectl apply -k references ref=main while the image is pinned to quay.io/kuadrant/developer-portal-controller:v0.2.0; update the kustomize ref to the same immutable release (e.g., change the URL used in the kubectl apply -k call to use ref=v0.2.0 or the exact commit/tag that matches the image) so manifests and the controller image stay in sync, and consider replacing the hardcoded tag with a single variable used both for the image (in the kubectl set image manager=...) and the kustomize ref to avoid drift.
🤖 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-push.yaml:
- Around line 55-64: Replace direct GitHub Actions template expansions inside
the bash run block (the references to ${{ github.ref_name }} and ${{
github.ref_type }} used in the quay-expiry step) by first mapping them to
environment variables and then using those shell variables in the condition;
specifically, set env entries (or export at the top of the run script) like
REF_NAME and REF_TYPE from the GitHub context and update the conditional that
currently checks "${{ github.ref_name }}" and "${{ github.ref_type }}" to use
"$REF_NAME" and "$REF_TYPE" (and keep the same regex and expiry logic) so the
template expansion happens safely outside the shell code.
---
Nitpick comments:
In `@scripts/cluster-setup.sh`:
- Around line 53-59: The manifest URL currently used by kubectl apply -k
references ref=main while the image is pinned to
quay.io/kuadrant/developer-portal-controller:v0.2.0; update the kustomize ref to
the same immutable release (e.g., change the URL used in the kubectl apply -k
call to use ref=v0.2.0 or the exact commit/tag that matches the image) so
manifests and the controller image stay in sync, and consider replacing the
hardcoded tag with a single variable used both for the image (in the kubectl set
image manager=...) and the kustomize ref to avoid drift.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 3f1599c5-7136-4393-955b-3a0c6eefc982
📒 Files selected for processing (4)
.github/workflows/build-push.yaml.github/workflows/e2e.yamlDockerfilescripts/cluster-setup.sh
|
@eguzki please review it. |
eguzki
left a comment
There was a problem hiding this comment.
Thanks for the contribution 🙏 .
The changes look good to me. But remove the commit with message chore(e2e): fix developer-portal-controller deployment. It's out of scope
Needs rebase to resolve conflicts with latest changes
- Add QUAY_IMAGE_EXPIRY build arg and quay.expires-after label to Dockerfile - Expiry set to 'never' for main branch and release tags - Expiry set to '3w' for all other refs (e.g. manual workflow dispatch) - Remove dev-build.yaml and release-build.yaml - Add build-push.yaml to handle pushes, releases, and workflow dispatch Signed-off-by: Arpit Tripathi <arpittripathiayo@gmail.com>
Signed-off-by: Arpit Tripathi <arpittripathiayo@gmail.com>
233594c to
3d01f42
Compare
Changes
.github/workflows/build-push.yaml(replacesdev-build.yaml+release-build.yaml)pushtomain→ tags with git SHA +latestreleasepublished → tags with semver (e.g.v0.4.0)workflow_dispatch→ manual triggerQUAY_IMAGE_EXPIRY:neverformainbranch and release tags (v*.*.*)3w(3 weeks) for all other refs (e.g. git SHA builds from feature branches)QUAY_IMAGE_EXPIRYas a build argument to the Docker build stepIMG_REGISTRY_USERNAME/IMG_REGISTRY_TOKENsecrets (consistent withdev-build.yaml)linux/amd64,linux/arm64,linux/s390x,linux/ppc64leDockerfileARG QUAY_IMAGE_EXPIRY="never"— defaults toneverfor local/manual buildsLABEL quay.expires-after=${QUAY_IMAGE_EXPIRY}— Quay.io reads this label and automatically expires the image accordinglyExpiry Behaviour Summary
QUAY_IMAGE_EXPIRYmainneverlatestneverv0.4.0(release)never3wcloses #518
Summary by CodeRabbit
New Features
mainand version tags use no expiry; other builds get a shorter expiry period.Changes