Fix: Name the repository on every Gerrit checkout - #9
Merged
askb merged 1 commit intoAug 18, 2026
Merged
Conversation
checkout-gerrit-change-action defaults its repository input to github.repository. Inside a reusable workflow that names the caller, not the project under review. A central .github repository calling on behalf of another project therefore seeded the working tree from itself, then looked for the project's branch there. ONAP calls these workflows that way. Every patchset check since the migration failed: fatal: couldn't find remote ref refs/heads/master onap/.github carries main rather than master, so the fetch could never resolve. Eight of eight runs failed. Had the branch names happened to match, the checkout would have succeeded against the wrong repository instead, which is the worse outcome. The merge lane escaped because it passes no gerrit_refspec and so takes the plain checkout, which already named the repository. Only the Gerrit path was wrong, and only for a caller that is not the project. All four Gerrit checkouts now pass the same repository expression the plain checkouts use. The input already existed and callers already supply it; the value was simply discarded. The pattern came from python-workflows, where a project calls the workflow from its own repository and the default is therefore correct. That assumption does not hold for a central caller, and nothing in the test suite covered the distinction. testing.yaml now counts checkout steps against repository inputs in both workflows and fails when they disagree, which catches a missing line without needing a Gerrit change ref to reproduce against. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Matthew Watkins <mwatkins@linuxfoundation.org>
ModeSevenIndustrialSolutions
requested review from
a team
and
a balanced review from Copilot
August 18, 2026 07:49
Copilot started reviewing on behalf of
ModeSevenIndustrialSolutions
August 18, 2026 07:50
View session
There was a problem hiding this comment.
Pull request overview
Fixes Gerrit checkouts in reusable documentation workflows so they target the repository under review rather than the calling repository.
Changes:
- Passes the repository input to all four Gerrit checkout steps.
- Adds a CI guard requiring explicit repository inputs for workflow checkouts.
- Includes the guard result in the aggregate test outcome.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
.github/workflows/docs-build.yaml |
Names the repository in three Gerrit checkouts. |
.github/workflows/docs-audit.yaml |
Names the repository in the audit Gerrit checkout. |
.github/workflows/testing.yaml |
Adds and reports the checkout-input guard. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
askb
approved these changes
Aug 18, 2026
This was referenced Aug 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a defect that has failed every ONAP patchset check since the
migration landed. My error in #6.
Root cause
checkout-gerrit-change-actiondeclares:Inside a reusable workflow,
github.repositorynames the caller, not theproject under review. All four Gerrit checkout steps omitted
repository:, soa central
.githubrepository calling on behalf of another project seeded theworking tree from itself, then looked for the project's branch there:
onap/.githubcarriesmain, notmaster, so the fetch could never resolve.Had the branch names happened to match, the checkout would have succeeded
against the wrong repository — the worse outcome, since the audit would then
have reported on the caller's content.
Impact measured
The merge lane escaped because it passes no
gerrit_refspecand so takes theplain checkout, which already named the repository. Only the Gerrit path was
wrong, and only for a caller that is not the project.
The fix
All four Gerrit checkouts now pass the same expression the plain checkouts
already used:
delay: '0s' + repository: ${{ inputs.repository || github.repository }} ref: refs/heads/${{ inputs.gerrit_branch }}Three sites in
docs-build.yaml, one indocs-audit.yaml. The input alreadyexisted and ONAP already supplied it; the value was simply discarded.
Why the tests missed it
The pattern came from
python-workflows, where a project calls the workflowfrom its own repository, so the default is correct there. That assumption does
not hold for a central caller, and nothing covered the distinction —
testing.yamlcalls by local path, where caller and project coincide.Reproducing properly needs a live Gerrit change ref, which a test workflow
cannot manufacture. So the guard checks the shape instead: it counts checkout
steps against
repositoryinputs in both workflows and fails when theydisagree.
Verified it catches the exact regression:
Verification
prek run --all-fileszizmor --persona auditorFollow-up
Needs a
v0.0.2tag, then a pin bump inonap/.githubando-ran-sc/.github.