Fix: Name the repository on every Gerrit checkout - #25
Merged
ModeSevenIndustrialSolutions merged 1 commit intoAug 18, 2026
Conversation
The Gerrit checkout steps passed 'ref' but omitted 'repository', so the
action fell back to its default of github.repository. Inside a reusable
workflow that names the caller, not the project under review, so a
central .github repository acting for another project seeds the tree
from itself and then looks for the project's branch there:
fatal: couldn't find remote ref refs/heads/master
The plain checkout paired with each Gerrit checkout already passed the
right expression, so 'repository' was a declared, documented input that
the Gerrit path discarded without a word.
The same omission in docs-workflows failed every ONAP documentation
check once ONAP adopted it. Six sites across gradle-build-test and
maven-build-test now pass what the plain checkouts used.
Repositories calling these workflows from their own repository see no
change, because there the default already resolved correctly. The
defect reaches a run only where the caller differs from the project,
which today means the ONAP and O-RAN-SC central .github topology.
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 08:33
Copilot started reviewing on behalf of
ModeSevenIndustrialSolutions
August 18, 2026 08:34
View session
There was a problem hiding this comment.
Pull request overview
Ensures reusable Maven and Gradle workflows check out Gerrit changes from the explicitly requested repository.
Changes:
- Passes the repository input to all six Gerrit checkout steps.
- Preserves the calling repository as the fallback.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
.github/workflows/maven-build-test.yaml |
Names the repository in three Gerrit checkouts. |
.github/workflows/gradle-build-test.yaml |
Names the repository in three Gerrit checkouts. |
💡 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
zxiiro
approved these changes
Aug 18, 2026
zxiiro
left a comment
There was a problem hiding this comment.
🤖 Auto-approved by agent: reviewed workflow/code change for security and CI/CD impact, found low risk. Same fix as the sibling *-workflows repos: adds explicit repository: input to Gerrit checkout steps; purely additive, no permission/security changes.
ModeSevenIndustrialSolutions
merged commit Aug 18, 2026
15b3c1e
into
lfreleng-actions:main
9 checks passed
ModeSevenIndustrialSolutions
deleted the
fix/gerrit-checkout-repository
branch
August 18, 2026 14:08
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
Names the repository on all 6 Gerrit checkouts. One line per site, no
behaviour change for current consumers.
Part of an estate-wide sweep following an outage in
lfreleng-actions/docs-workflows#9, which carried this pattern from the shared
skeletons.
Root cause
checkout-gerrit-change-actiondeclares:Inside a reusable workflow
github.repositorynames the caller, not theproject under review. Each Gerrit checkout passed
ref:but omittedrepository:, so a central.githubrepository acting for another projectseeds the tree from itself and then looks for the project's branch there:
Where the branch names happen to match, the checkout succeeds against the
wrong repository — the worse outcome, since the job then reports on the
caller's content.
The paired plain checkout in each of these steps already got it right:
So
inputs.repositorywas a declared, documented input that the Gerrit lanediscarded without a word.
The fix
delay: '0s' + repository: ${{ inputs.repository || github.repository }} ref: refs/heads/${{ inputs.gerrit_branch }}gradle-build-test.yamlmaven-build-test.yamltag-push.yamlkeeps its checkouts untouched: it is repo-local CI rather thana reusable workflow, so it checks out this repository on purpose.
Blast radius
Nil for current consumers, which call these workflows from their own
repository, where the default already resolved correctly and
gerrit_refspecis empty anyway.
The defect reaches a run only where the caller differs from the project, which
today means the ONAP and O-RAN-SC central
.githubtopology. Those calldocs-workflowsalone, so this repository was latent rather than broken — butone adoption away.
Verification
prek run --all-fileszizmor --persona auditor .github/workflows/Checked 2 reusable workflow(s); 0 problem(s).The shape check asserts that a checkout omitting
repositoryfails when eitherthe workflow declares a
repositoryinput, or a Gerrit checkout pinsref.lfreleng-actions/workflows-template#36 adds it as a CI job so new repositories
inherit it; worth deciding whether to backfill it here too.