Repository navigation
fix(installer): skip the packages artifact push and stamp with PUSH=0 - #4663
Conversation
image-packages ran `flux push artifact` regardless of PUSH, so a local PUSH=0 build still published cozystack-packages and then stamped its digest into values.yaml. The stamped platformSourceRef is the digest the operator hands Flux to pull from the registry, so a build that pushes nothing has no digest worth writing: it now skips both steps and keeps the committed ref. With PUSH at its default of 1 the recipe is unchanged. Assisted-by: LLM Signed-off-by: Aleksei Sviridkin <[email protected]>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: cozystack/cozystack/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughThe installer ChangesInstaller package publishing
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Low Merge Risk: ⚪ Minimal · up to Package publishing remains controlled by PUSH, and the non-push path retains the committed source reference. No concrete merge-blocking behavior change is indicated. Security Architecture ReviewSecurity architecture risk: ⚪ Minimal · up to The change narrows package publication without adding privileges or weakening deployment-source controls. Non-publishing builds retain their existing source reference, and the established fork-build recovery path publishes packages separately. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
IvanHunters
left a comment
There was a problem hiding this comment.
LGTM, approve.
image-packages now gates flux push artifact and the values.yaml digest stamp behind ifeq ($(PUSH),1), and the else branch keeps the committed platformSourceRef. Right call: the stamped ref is a registry digest the operator hands to Flux, so stamping one for an artifact that was never pushed would point at nothing.
What I checked:
-
Consumer trace. Every reader of
platformSourceReftreats it as a registry digest: the operator via--platform-source-ref, and the release scriptsverify-promoted-packages.sh,promote-packages-artifact.sh,stitch-multiarch.sh,nightly-mirror.sh.PUSH=0leaves the committed ref untouched, so they keep resolving the last released artifact. Nothing downstream breaks. -
CI and release are untouched. No workflow sets
PUSHorLOAD, soPUSHstays 1. Thetags.yamlrelease stitch (image-packages chart) and the same-repo PR build (make imagewith an emptyOCI_EXPORT_DIR) push as before. The fork PR build runs onlypre-checks image-operatorand never reachesimage-packages, and thee2e-fork.yamlallowlist (make -n image OCI_EXPORT_DIR=/oci) greps only the.oci.tarnames fromimage-operator, which the push/echo line never matched. -
Tests pass on the PR head. I mutated the guard to always-true and the
PUSH=0test went red, so it isn't inert. Theif grep -q ...; then ...; false; fiidiom is what sidesteps cozytest.sh suppressing!-negated assertions. I also merged currentmaininto the head and reran the installer tests, still green, and the installer Makefile is untouched on main.
Three non-blocking notes:
-
[NIT] The one behaviour change is
OCI_EXPORT_DIRforcingPUSH := 0:image-packagesnow skips the push where it used to attempt an anonymous one. No CI path reachesimage-packageswithOCI_EXPORT_DIRset, and skipping beats a push that can only fail without credentials, so this is informational, not a regression. -
[NIT] On main, before #4654, the gate honours only a command-line
PUSH=0, becausehack/common-envs.mkstill assignsPUSH := 1and that beats the environment. The test uses the command-line form, so it is correct here; the environment-level isolation only starts working once #4654 lands. Worth a line saying so. -
[NIT] As the description already notes,
PUSH=0throughMAKEFLAGS(make bats-unit-tests PUSH=0) would fail the default-path test and the stitch ordering check. Nothing runs the suite that way today, so it is fine as a documented follow-up.
What this PR does
A local build with
PUSH=0no longer publishes the packages artifact. Before this change,make image-packagesinpackages/core/installerranflux push artifactno matter whatPUSHwas set to, and then wrote the pushed digest intovalues.yaml. Thecharttarget in the same Makefile already respectsPUSH.With
PUSHset to anything other than 1, the target now skips both the push and the digest stamp. It prints one line saying so and leaves the committedplatformSourceUrlandplatformSourceRefas they are. It still writespackages/core/platform/.build-revision, which is gitignored.I chose to skip the stamp instead of computing a local digest, because every reader of that value needs a digest that exists in the registry. The chart passes
platformSourceRefto the operator as--platform-source-ref, and Flux then pullscozystack-packages@<digest>from the registry. The release scriptsverify-promoted-packages.sh,promote-packages-artifact.sh,stitch-multiarch.shandnightly-mirror.shalso treat it as a registry digest. A digest of an artifact that was never pushed points at nothing. On main an unpushed run would not even get that far, since the recipe dies attest -n "$DIGEST".The gate is a make-level
ifeq ($(PUSH),1), so it reads whateverPUSHends up as afterhack/common-envs.mk. On main that meansPUSH=0on the command line. I also applied thecommon-envs.mkchange from #4654 locally, which takesPUSHfrom the environment and makesLOAD=1default it to 0. With that applied, a dry run shows no push and no stamp forPUSH=0in the environment, forLOAD=1, and forPUSH=0on the command line, whileLOAD=1 PUSH=1and an emptyPUSHstill push.CI is not affected, because no workflow sets
PUSHorLOADandPUSHstays at 1. I dry-ran the three CI invocations of this Makefile before and after the change, on main and again with #4654 applied:tags.yaml, release stitch step:make -C packages/core/installer image-packages chartwithREGISTRY, a release tag asIMAGE_TAG, andPUSHED_TAGS_LOGpull-requests.yaml, installer step of a same-repo PR:make -C packages/core/installer imagewith apr-N-shatag,PLATFORM=linux/amd64,BUILDER, and an emptyOCI_EXPORT_DIRbuild-main.yamlandbuild-release.yaml:make build, which runs the installerimagetarget with defaultsThere is one side effect.
OCI_EXPORT_DIRforcesPUSH := 0, so runningimage-packageswith it set no longer pushes, where before it would have tried an anonymous push. No CI path does that. The fork PR build already runs onlypre-checks image-operatorfor the installer, and themake -n ... image OCI_EXPORT_DIR=/ociscan ine2e-fork.yamlgreps only the.oci.tarnames, which this change does not touch.The new test dry-runs the target in both modes. With
PUSH=0there must be noflux push artifactand noplatformSourceRefstamp; withPUSHat its default, both must be present. The first test fails on main. I mutated the guard three ways, and each time only the matching test went red:PUSH=0test failsendifmoved up so only the push is gated: thePUSH=0test fails on the stamp checkOne limitation is left as a follow-up. The test's
env -u PUSH -u LOADonly isolates it once #4654 lands, because on main a file assignment wins over the environment anyway. It does not coverPUSH=0coming in throughMAKEFLAGS, somake bats-unit-tests PUSH=0would fail the default-path test here and the ordering check inhack/stitch-multiarch_test.bats. Nothing runs the suite that way today. If that changes, passing an explicitPUSH=1on the default-pathmakelines, or unsettingMAKEFLAGSthe wayhack/bats-unit-keep-going.batsdoes, would fix it.Screenshots
Not a UI change.
Downstream repositories
The website's
development.mdtells developers to runmake image-packageswithREGISTRYset to their own registry. That is the defaultPUSH=1path, and it works as before. Neither the website nor ccp mentionsPUSH=0for this target.Closes #4656
Release note
Summary by CodeRabbit
image-packageswithPUSH=0to skip publishing the artifact and keep the committed platform source reference unchanged.