Repository navigation
Feat: Gate Gerrit examples on change visibility - #101
Merged
ModeSevenIndustrialSolutions merged 1 commit intoOct 30, 2026
Merged
ModeSevenIndustrialSolutions merged 1 commit into
ModeSevenIndustrialSolutions merged 1 commit into
Conversation
gerrit_to_platform dispatches the required verify for private changes too. The voting account cannot read them, so 'prepare' and 'vote' fail with 'Not found' and mail the author. Until the dispatcher fix (lfit/releng-gerrit_to_platform#116) is deployed, both change isolation examples start with a 'visibility' job running gerrit-change-visible-action as the voting account, and every later job runs only when it reports the change visible. A failed check fails that job and skips the rest, never reading as "not visible". The examples' Gerrit-talking jobs now run harden-runner v2.22.3 in block mode with the organisation's Gerrit-servers allow-list, loaded by explicit path through harden-runner-block-action, in place of audit mode. The zizmor ignores follow the lines the new job moves, and cover the visibility job's secret reference. The change isolation docs and the README describe the gate, its three outcomes and when to remove it. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: lf-releng-code-monkey-bot[bot] <332050256+lf-releng-code-monkey-bot[bot]@users.noreply.github.com>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block approval of the visibility-gating and network-hardening updates.
No open issues 🎉
What changed in this PR
This PR updates the Gerrit change-isolation examples for issue #100, adding a voting-account visibility check so unreadable private changes skip verification and voting while visibility-check failures remain visible.
Changes:
- Add a
visibilityjob and gate downstream jobs in both callers, preserving voting after verification failures for readable changes. - Switch Gerrit-facing jobs to block-mode network hardening with the pinned Gerrit-servers allow-list.
- Document the gate’s behavior and removal conditions, and update line-scoped zizmor suppressions.
| File | Description |
|---|---|
| README.md | Summarizes the visibility gate and links to detailed guidance. |
| examples/change-isolation/gerrit.yaml | Adds visibility gating and block-mode hardening to the two-check caller. |
| examples/change-isolation/gerrit-info-yaml-only.yaml | Applies the same gating and hardening to the INFO.yaml-only caller. |
| docs/change-isolation.md | Explains visibility outcomes, voting behavior, gate removal, and network restrictions. |
| .github/zizmor.yml | Updates exact-line suppressions and covers the new visibility job’s secret reference. |
Review effort: Balanced
ModeSevenIndustrialSolutions
approved these changes
Oct 30, 2026
ModeSevenIndustrialSolutions
merged commit Oct 30, 2026
12feb2f
into
lfreleng-actions:main
37 checks passed
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.
Closes #100
Authored by an AI agent; human review required
claude-opus-5.5via GitHub Copilot CLI40d31e6250a57b021875fd8e3970fbe467060052prek run --files examples/change-isolation/gerrit.yaml examples/change-isolation/gerrit-info-yaml-only.yaml .github/zizmor.yml docs/change-isolation.md README.mdzizmor --offline --persona auditor --no-progress examples/change-isolation/gerrit.yaml examples/change-isolation/gerrit-info-yaml-only.yaml examples/release/gerrit.yamlgrep -n "egress-policy" examples/change-isolation/*.yamlaislop scan --changes --json .git commit -s (pre-commit and commit-msg hooks)The
github-code-monkey-botworkflow opened this pull request.Nobody has merged it; a maintainer must review it first.
Review findings on this pull request are answered by a later revision round of this workflow, up to ten rounds; a maintainer must act on any finding that remains after that, and reviews every round before merge.
What changed
Both Gerrit change isolation callers (
examples/change-isolation/gerrit.yamlandgerrit-info-yaml-only.yaml) now:visibilityjob runninglfreleng-actions/gerrit-change-visible-action@31eb69fc…(v0.0.1) in its defaultsshmode, as the voting account (GERRIT_SERVER,GERRIT_SSH_REQUIRED_USER,GERRIT_KNOWN_HOSTS,GERRIT_SSH_REQUIRED_PRIVKEY). It exposesvisibleas a job output.prepare:needs: visibility,if: needs.visibility.outputs.visible == 'true'change-isolation:needs: [visibility, prepare], sameif:vote:needs: [visibility, prepare, change-isolation],if: ${{ always() && needs.visibility.outputs.visible == 'true' }}. The existing vote expression that refuses a positive vote whenprepareorchange-isolationdid not succeed is unchanged.visibility,prepareandvotein block mode. Eachegress-policy: auditstep is replaced withharden-runner-block-actionv0.14.0 loadinglf-gerrit-servers/gerrit_servers.txtby explicit path, followed bystep-security/harden-runnerv2.22.3 (46b06cea…) withegress-policy: block,disable-telemetry: trueandallowed-endpoints: ${{ env.CONNECTION_ALLOW_LIST }}. No extra hosts are added.Each example's header comment now gives the job list, the three cases below, a note that the gate can be removed once the dispatcher fix is deployed, and where the variables, secret and egress allow-list come from. The
concurrencyblock, theworkflow_dispatchinputs and the all-zerogeneric-workflowsplaceholder are unchanged. The two examples still differ only in their header text, workflow name, concurrency prefix andchecks.What each gating
if:producesvisibilityprepare/change-isolation(visible == 'true')vote(always() && visible == 'true')visible=truevisible=falseneedsand an empty output)always(). The failedvisibilityjob is the signal.github/zizmor.ymlEvery line-scoped entry for these two files now points at its new line:
impostor-commit,stale-action-refs):gerrit.yaml:213,gerrit-info-yaml-only.yaml:213secrets-outside-env:gerrit.yaml:164/196/265,gerrit-info-yaml-only.yaml:164/196/264. Lines 164 are the newvisibilityreferences. The justification comment now namesgerrit-change-visible-action.No entry was widened to a whole file.
Docs
docs/change-isolation.md: a new section, "Private changes and the visibility gate", covering why the gate exists, the three-case table and when to remove it. "Voting" now covers the extra job and thealways()interaction, and "Network egress" says the callers' Gerrit-talking jobs use the Gerrit-servers list while the reusable keeps its per-job lists.README.md: one sentence on the gate in the change isolation section.Validation
prek run --files <the 5 changed files>: passes, with exit 0. That covers yamllint, actionlint, zizmor (--offline), check-jsonschema for the examples and timeouts, markdownlint, write-good, codespell and reuse. The commit hooks (including gitlint) also passed.zizmor --offline --persona auditor --no-progress examples/change-isolation/*.yaml examples/release/gerrit.yaml:No findings to report. Good job! (6 ignored), exit 0.grep -n "harden-runner@" examples/change-isolation/*.yaml: every match is46b06cea…(v2.22.3).grep -n "egress-policy"shows onlyblock.aislop scan --changes --json: emptydiagnostics. aislop scores no YAML or Markdown, so this gate covers no files here.For the reviewer
gerrit.yaml:51is unchanged on purpose. The issue lists it among the entries to re-point, but zizmor matches on base filename, and line 51 is the placeholder inexamples/release/gerrit.yaml, not in the change isolation example. The change isolation placeholder was at:128, now:213. None of the newgerrit.yamlline numbers falls on auses:or secret line in the 66-line release example.impostor-commit,stale-action-refs) were not run. As a result the new placeholder entries at:213, and the new pins forgerrit-change-visible-actionandharden-runner-block-action, have not been checked online. The pins were copied verbatim from the issue.votejob now loads the Gerrit-servers list in block mode.im-open/workflow-conclusiononly calls the GitHub API, which harden-runner always allows, so no host was added.