Repository navigation
Fix(handback): Hand back .github pull requests - #124
ModeSevenIndustrialSolutions merged 2 commits into
Conversation
The hand-back list drops every result in a repository whose name starts with a dot, so a .github pull request never gets the revision its review requested, and nothing says so. Add tests, marked as expected failures, for a .github hand-back that is confirmed and dispatched, and for a warning naming each dropped hand-back. Pin that the names . and .. stay refused. Co-authored-by: Copilot <[email protected]> Signed-off-by: lf-releng-code-monkey-bot[bot] <332050256+lf-releng-code-monkey-bot[bot]@users.noreply.github.com>
The hand-back list checked a repository name with the owner pattern, which needs an alphanumeric first character, so a hand-back for a pull request in .github was dropped without a word and its revision never dispatched. Check repository names with one shared validator in selection_inputs, which allows a leading dot and refuses . and .., as the repository list already did. Warn, naming the pull request and the reason, whenever a result that claims a posted hand-back is dropped: outside the organisation, a bad name, not in the selection, no App, or no marked review. A lost hand-back is no longer silent. The artifact's text is escaped before it reaches the log. Co-authored-by: Copilot <[email protected]> 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 hand-back validation and warning changes.
No open issues 🎉
What changed in this PR
Fixes #122 by allowing .github pull requests through the antagonistic review hand-back path and making rejected hand-back claims visible.
Changes:
- Shares repository-name validation between selection and hand-back processing, allowing leading dots while rejecting
.and... - Adds escaped warnings explaining why claimed hand-backs are dropped.
- Adds regression tests and documents the validation and warning behavior.
| File | Description |
|---|---|
| tests/test_handback.py | Tests .github confirmation and dispatch-list output, invalid names, and dropped-claim warnings. |
| scripts/selection_inputs.py | Extracts a shared repository-name validator. |
| scripts/handback.py | Uses shared validation and warns when claimed hand-backs are rejected. |
| docs/DESIGN.md | Documents leading-dot repository names and dropped-hand-back warnings. |
Review effort: Balanced
There was a problem hiding this comment.
🤖 Antagonistic review by agent: no line-level findings; the summary below is the verdict.
The change fixes .github hand-backs while preserving selection and review-marker checks. The warning paths and downstream dispatch handling are consistent; no actionable defects found.
Antagonistic round 1 of 3.
Automated antagonistic review by lf-releng-antagonistic-review-bot[bot] using model gpt-6-astra; see the run. This is not a human review and never an approval: a maintainer must still review and approve this pull request.
67eed09
into
lfreleng-actions:main
Closes #122
Authored by an AI agent; human review required
claude-opus-5.5via GitHub Copilot CLI3c9f13f41f1731c08e89d57533fbe219a0458d1auv run python -B -m unittest discover -s testsuvx zizmor --offline --persona auditor .github/workflows/AISLOP_NO_TELEMETRY=1 npx -y [email protected] scan --json --base 3c9f13f41f1731c08e89d57533fbe219a0458d1aprek run --hook-stage commit-msg gitlint --commit-msg-filename <(git log -1 --format=%B)prek run --files docs/DESIGN.md scripts/handback.py scripts/selection_inputs.py tests/test_handback.pyThe
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 per antagonistic review round; after that a maintainer, or the next antagonistic review, takes on any finding that remains, and a maintainer reviews every round before merge.
Summary
scripts/handback.pychecked the repository name of each claimed hand-back with the owner pattern^[A-Za-z0-9][A-Za-z0-9._-]*$. That pattern requires an alphanumeric first character, so the script silently dropped any hand-back for a pull request in.github. That is how lfreleng-actions/.github#384 never got its revision.Changes
Shared validator.
selection_inputs.is_repository_name()accepts a name that starts with a dot and refuses.and...parse_repositories()andhandback.candidates()both use it now.NAME_REis still used for the--orgowner check, with a comment explaining why. The issue said to leavebot_evidence.pyandreview_notice.pyalone, and this change does not touch them.Warnings for dropped hand-backs. A result that claims a posted hand-back (
verdict: commented,handback: true) and is then dropped now prints a::warning::handback: <owner/repo#N> not handed back; <reason>line. The reasons are:The warning text comes from an artifact, so it is escaped first (
ascii, with::and##[broken up). A forged result therefore cannot inject a workflow command.Tests (committed first as expected failures; the fix commit removes the markers):
.githubhand-back is confirmed and reachespulls=/count=1;.and..are refused without reading GitHub;Docs.
docs/DESIGN.md§19.9 now describes the warning and the leading-dot rule.Validation
uv run python -B -m unittest discover -s tests: 880 tests, OK.prek run --files docs/DESIGN.md scripts/handback.py scripts/selection_inputs.py tests/test_handback.py: all hooks passed, including aislop.aislop scan --base <base>(aislop 0.16.0, the version the hook pins, with telemetry off): score 100, emptydiagnostics.zizmor --offline --persona auditor .github/workflows/: no findings. No workflow files changed.For reviewers
selected_heads()to warn as well. That function reads selection entries, not results, so it has no claimed hand-back it could name. Instead,handbacks()warns when it looks up a candidate and the selection holds no entry for it. A selection entry thatselected_heads()drops therefore still produces a warning naming the pull request.code-review.yaml(repo_reand the dispatchrefpattern) already accept a repository name that starts with a dot, so no workflow change is needed.