Repository navigation
fix(build): only enforce registry pairing when pushing - #10
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 (7)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe pull request fixes fork PR CI failures by scoping Docker Hub credential pair validation to only enforce when OCI pushing is enabled. The build workflow is modified to move validation inside the push guard, the oci-build specification is updated to define this behavior, and OpenSpec archive documentation captures the decision and full scenario specifications. ChangesRegistry Validation Scoping
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
The reusable build.yml "Validate registry inputs" step asserted that `dockerhub_image` and `dockerhub_username` are both set or both empty, unconditionally. On fork PRs the orchestrator forces `push_oci: false` and the `dockerhub_username` variable is withheld (forks don't receive repo variables) while `dockerhub_image` stays a literal, producing an asymmetric pair (`image=true user=false`) that hard-failed the build leg in ~8s — contradicting the existing "PR from a fork" spec scenario and blocking consumer CI (e.g. kalbasit/ncps#1317). Move the pairing check inside the existing `push_oci == true` guard, alongside the at-least-one-registry check. When not pushing, an asymmetric pair is harmless: every login/push/manifest step is already gated on `push_oci`. Non-fork push behavior is unchanged. Co-Authored-By: Claude Opus 4.8 <[email protected]>
29b6d58 to
ba7ce35
Compare
There was a problem hiding this comment.
Code Review
This pull request updates the oci-build specification to ensure that registry-input validation (specifically the pairing of dockerhub_image and dockerhub_username) is only enforced when push_oci is true. This prevents fork PRs, where the dockerhub_username variable is withheld by GitHub, from failing the validation step. The changes include archiving the design, proposal, and updated specification under the OpenSpec directory. There are no review comments, and I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Summary
Fork PRs (and any run where the
dockerhub_usernamerepo variable is not exposed) were failing the reusablebuild.ymlworkflow at its "Validate registry inputs" step — even though the build is correctly configured to skip pushing on forks. The symptom was the spurious, ~8s failure:This blocked consumer CI such as
kalbasit/ncps#1317.Root cause
Consumers pass
dockerhub_imageas a literal (e.g.kalbasit/ncps) anddockerhub_usernamefrom a repo variable (${{ vars.DOCKERHUB_USERNAME }}). GitHub withholds that variable from fork PRs, so the orchestrator forwardsdockerhub_image="kalbasit/ncps"withdockerhub_username=""→image=true user=false. The caller (ci.yml) already forcespush_oci: falsefor fork PRs, so nothing would push — but the pairing check ran unconditionally andexit 1'd. This directly contradicted the existingoci-build"PR from a fork" scenario.Fix
Move the
dockerhub_image/dockerhub_usernamepairing check inside the existingif [[ "$OCI_PUSH" == "true" ]]block, alongside the "at least one registry enabled" check.push_oci == false(fork PRs, non-pushing runs): validation is a no-op. Every step that consumes the username/token (Login to Docker Hub,Push the OCI image, theoci-manifestjob) is alreadyif: inputs.push_oci ..., so a half-set pair can never reach an auth/push step.push_oci == true: behavior is byte-for-byte identical to today — a misconfigured consumer still fails fast with the same message.No change to inputs, secrets, or non-fork push behavior.
Verification
actionlint .github/workflows/build.yml→ clean (exit 0)inputs.push_ocikalbasit/ncps#1317; theshared / build (x86_64-linux)and(aarch64-linux)legs should go green.OpenSpec
Modifies the
oci-buildcapability (tightens the "PR from a fork" scenario to require registry-input validation not fail when pushing is disabled). The change is archived in this PR soopenspec-guardpasses.