Repository navigation
CI: Exercise live Gerrit transfer and REST auth - #525
Merged
ModeSevenIndustrialSolutions merged 2 commits intoNov 2, 2026
Merged
ModeSevenIndustrialSolutions merged 2 commits into
ModeSevenIndustrialSolutions merged 2 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The workflow checks can mistake client-construction logs for authenticated REST requests and an existing Gerrit URL for a completed push, allowing paths that perform neither operation to pass.
2 open issues
What changed in this PR
Updates the CLI integration workflow to exercise sandbox transfers and authenticated Gerrit REST access on both pushes to main and manual runs, addressing #524.
Changes:
- Selects an open sandbox Dependabot PR, with optional URL overrides, and sets the CLI event context per process.
- Adds credential checks, REST-log validation, and live change-URL reporting; removes the duplicate action integration job.
- Adds stub-based workflow tests covering selection, event handling, authentication checks, and output validation.
| File | Description |
|---|---|
| tests/test_testing_workflow.py | Adds regression tests for the integration step scripts and workflow configuration. |
| .github/workflows/testing.yaml | Updates sandbox selection, CLI invocation, REST checks, and live-result reporting. |
Review effort: Balanced
The CLI integration job in testing.yaml runs only on a push to main or a dispatch, so a pull request never shows whether it still exercises anything. On a push it took the merged-PR cleanup path, because a step's env: cannot override GITHUB_EVENT_NAME; on a dispatch it failed on fixture pull requests closed long ago; and every Gerrit REST call it made was anonymous. These tests run the job's step scripts out of the workflow under stubbed gh, uv and python, and pin what each step should accept as a pass: the CLI runs as a dispatch on a push, an open Dependabot pull request is selected at run time, a missing HTTP password or an anonymous REST call fails, and the live step names a change URL. The live step must also fail on a log whose only auth_user line is the REST client's constructor, logged before any request, and on a change URL without the push line, since reconciliation can return an existing change's URL without pushing. They are marked strict xfail until the workflow change lands. 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>
The Gerrit integration jobs passed on every push to main without transferring anything. A step's env: cannot override the runner's GITHUB_EVENT_NAME, so on a push the CLI saw a push event and took the merged-PR cleanup path. On a dispatch both jobs failed at once, because the fixture pull requests they named were long closed. No Gerrit HTTP credentials were set, so every REST call was anonymous and the authenticated path lfreleng-actions#513 changed went untested. The CLI job now: - sets GITHUB_EVENT_NAME and GITHUB_EVENT_PATH for the CLI process alone, so a push runs the same single-PR path as a dispatch; the expected-failure step moves its override the same way, and the other runner defaults the steps restated are dropped - selects an open app/dependabot pull request in lfit/sandbox at run time, keeping DEPENDABOT_PR_URL_1 and _2 as optional overrides, and fails naming the problem when none is open - passes GERRIT_HTTP_USER and GERRIT_HTTP_PASSWORD to both Gerrit steps, fails when the password is missing, and fails when the log shows an anonymous REST call or, in dry-run, no verified authentication - checks that the live push reported a sandbox change URL instead of printing a fixed success line The action integration job is removed. It ran the same CLI commands as the CLI job, and the composite action cannot stand in for them: it takes its pull request from this repository's event and github.token, so it cannot target lfit/sandbox. The reusable workflow and action jobs keep covering the action under G2G_NO_GERRIT. Review of lfreleng-actions#525 found two ways the live step could pass without the operation it checks: - Its authenticated-REST check matched any auth_user= line, which the REST client's constructor log satisfies before any request. It now requires a request line, Gerrit REST <METHOD> ... (auth_user=<user>); the anonymous (auth_user=) check is unchanged. - A change URL in the CLI's outputs does not prove a push: reconciliation returns an existing change's URL without pushing. The step now also requires the "Successfully pushed changes to Gerrit" log line, which G2G_VERBOSE makes visible. The environment comment no longer claims to scope the secrets, which are repository secrets. GERRIT_HTTP_PASSWORD must exist as a repository secret before this merges, or the first push to main fails the new check by design. 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>
lf-releng-code-monkey-bot
Bot
force-pushed
the
code-monkey/issue-524
branch
from
November 2, 2026 16:36
18778e0 to
db0e541
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
A maintainer must provision GERRIT_HTTP_PASSWORD and validate live Gerrit transfers for both push and workflow_dispatch runs, since the stubbed harness cannot verify authentication or server-side success.
No open issues 🎉
Review effort: Balanced
ModeSevenIndustrialSolutions
approved these changes
Nov 2, 2026
ModeSevenIndustrialSolutions
merged commit Nov 2, 2026
51eca1f
into
lfreleng-actions:main
33 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 #524
Authored by an AI agent; human review required
claude-opus-5.5via GitHub Copilot CLI03c617aa6ef9f5075f9a357590f11c0853271446uv run pytest -q --no-cov tests/test_testing_workflow.pyprek run --files .github/workflows/testing.yaml tests/test_testing_workflow.pyuvx zizmor --persona auditor .github/workflows/git log --raw --format=%h 03c617aa6ef9f5075f9a357590f11c0853271446..HEADThe
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.
Round 1 of revision, on its base.
Fixes #524.
The Gerrit integration job in
testing.yamlpassed on every push tomainwithout transferring anything, and failed on every dispatch. This PR makes it exercise a live transfer and authenticated Gerrit REST on both events.Commits
Test: Add expected-fail live Gerrit job testsaddstests/test_testing_workflow.py, which runs the job's step scripts out of the workflow withgh,uvandpythonstubbed. The tests carry strict xfail markers until the workflow change lands.CI: Exercise live Gerrit transfer and REST authchanges the workflow and removes the markers:GITHUB_EVENT_NAME=workflow_dispatchand an emptyGITHUB_EVENT_PATHare set for the CLI process alone, so a push takes the single-PR path rather than the merged-PR cleanup path.app/dependabotPR inlfit/sandboxis selected at run time.DEPENDABOT_PR_URL_1/_2remain as validated optional overrides.GERRIT_HTTP_USER/GERRIT_HTTP_PASSWORDare passed to both Gerrit steps. A missing password fails the step. Any anonymous(auth_user=)line fails the step. The dry run must logGerrit REST authenticated access verified. The live step must log at least one request line of the formGerrit REST <METHOD> … (auth_user=<user>).Successfully pushed changes to Gerritlog line and a sandbox change URL in the CLI's outputs. It writes the URL to the step summary.action-integration-testjob is removed. The composite action takes its PR from this repository's event, so it cannot targetlfit/sandbox.environment:comment no longer claims that the environment scopes the secrets.This round
Both Copilot findings were fixed as the maintainer directed:
GerritRestClient(…, auth_user=…)constructor log.Two harness cases were added: a log that holds only the constructor line, and a URL with no push line. Both must fail.
Checks run
uv run pytest --no-cov tests/test_testing_workflow.py: 23 passed. On the test commit alone the new cases xfail.prek run --fileson the changed files: passed.zizmor --persona auditor .github/workflows/: no findings.Still to look at
GERRIT_HTTP_PASSWORDas a repository secret. Without it, the first push tomainfails the new check by design.SubmissionResult.pushedas a CLI output. That would give the live step a cleaner push signal than a debug log line, but it is a tool change and is left out of this PR.