feat(ci): build must-gather image hermetically in upstream repo [RHIDP-14412] - #218
Conversation
PR Summary by QodoHermetic CI build for must-gather image via Hermeto + locked dependencies
AI Description
Diagram
High-Level Assessment
Files changed (17)
|
Code Review by Qodo
1.
|
|
/agentic_review |
|
FYI I will be resolving conflicts soon.... |
0759b41 to
8fca11e
Compare
|
/agentic_review |
Code Review by Qodo
1.
|
Add a reusable composite action for building container images hermetically (--network none) with pre-fetched dependencies via hermeto. This action handles disk space cleanup, dependency prefetching, Containerfile transformation, and image building with podman/buildah. Assisted-by: Claude
The docker-build composite action had five issues preventing it from working: missing generic fetcher for helm CGW binaries, a stale curl step that conflicts with --network=none, a Containerfile transform that would double-inject cachi2 patterns into the already-hermetic .rhdh/docker/Containerfile, no requirements copy step for pip fetcher discovery, and no workflow integration. Fix all five issues in the composite action and add a hermetic-build validation job to pr-build.yaml. This runs alongside the existing non-hermetic build so Renovate PRs updating .rhdh/docker/requirements, base image digests, or RPM lockfiles are validated before merge. Locally verified: hermeto fetch-deps succeeds with all four fetcher types (rpm, pip, generic, cargo) and helm binaries land at the path install-helm-binary.sh --prefetch expects. Assisted-by: Claude
d9b130d to
4a82cf8
Compare
The previous lockfile had a stale openshift-clients aarch64 RPM URL (build 202608051112) that returns 404 from the OCP mirror. Regenerate to pick up the current build (202608132049) which resolves the hermetic build failure in the fetch-deps RPM prefetch step. Assisted-by: Claude
|
PR images are available (for 1 week):
|
Convert both the publish (container-build.yaml) and PR (pr-build.yaml) workflows to build images hermetically using the docker-build composite action with --network=none. This ensures upstream CI parity with downstream Konflux builds and catches dependency issues early. container-build.yaml: replace make image-push with the hermetic composite action, build all tags in a single buildah invocation, push individually, capture digest via podman push --digestfile. pr-build.yaml: replace make image-build with the hermetic composite action, remove the now-redundant hermetic-build validation job, merge its file-change triggers into the main pr-build job. Signed-off-by: Fortune Ndlovu <fndlovu@redhat.com> Assisted-by: Claude
|
/agentic_review |
|
Code review by qodo was updated up to the latest commit 59a5e2d |
|
PR images are available (for 1 week):
|
For consistency with all other RHDH repos, the main branch image should be tagged "next" rather than "latest". The "latest" tag is reserved for the current stable release. Also update the expiry-tag detection to include next-* commit-SHA tags so they still receive their 2-week expiration. Assisted-by: Claude
Pin actions/checkout to SHA in container-build.yaml for supply-chain safety, matching pr-build.yaml. Bump upload-artifact in the composite action from v4.6.2 to v7 for consistency. Fix unquoted GITHUB_ENV assignment in docker-build action. Map all step outputs through env: blocks in container-build.yaml run: scripts to prevent potential script injection, matching the pattern already used in pr-build.yaml. Signed-off-by: Fortune Ndlovu <fndlovu@redhat.com>
|
PR images are available (for 1 week):
|
|
PR images are available (for 1 week):
|
|
PR images are available (for 1 week):
|
| containerfilePath: | ||
| description: Path to the Containerfile to use | ||
| required: false | ||
| default: '.rhdh/docker/Containerfile' |
There was a problem hiding this comment.
so we're still using two containefiles in https://github.com/redhat-developer/rhdh-must-gather/blob/main/Containerfile and https://github.com/redhat-developer/rhdh-must-gather/blob/main/.rhdh/docker/Containerfile ? I thought the idea here was to remove the need for two different files...
|
have you prepared the downstream changes that will be needed to absorb this, once we get rid of the duplicate Containerfile in both the root and in .rhdh/docker/ ? (Aside: new convention is a folder called "containerfiles", rather than docker. |
|
/hold |
Description
This PR replaces the non-hermetic Containerfile build with a Hermeto-based hermetic build pipeline, following the same pattern used by the RHDH upstream repo. This catches hermetic build issues earlier (before downstream Konflux) and validates Renovate PRs that update hermetic-only dependencies like rpms.lock.yaml.
Which issue(s) does this PR fix or relate to
PR acceptance criteria
How to test changes / Special notes to the reviewer
To test the hermetic build locally, we can replicate what the composite action does by running Hermeto to prefetch deps, then buildah with
--network=noneor using pr image