Skip to content

Fix(handback): Hand back .github pull requests #122

Closed

Description

Summary

The antagonistic review of lfreleng-actions/.github#384 requested a
revision, and its review says so ("Revision requested from Code
Monkey"), but no revision was ever dispatched. The pull request sat
for twelve hours with an unanswered major finding until a
maintainer noticed.

Run: https://github.com/lfreleng-actions/github-code-review-bot/actions/runs/45081908196

  • Apply (.github-384) ran with HANDBACK: true and posted the review
    with the hand-back marker.
  • Report logged handback: 0 pull request(s) to hand back.
  • Hand back for revision was skipped, because handback_count was
    0.

Cause

scripts/handback.py candidates() drops any result whose repository
name fails NAME_RE:

NAME_RE = re.compile(r"^[A-Za-z0-9][A-Za-z0-9._-]*$")
...
if owner.lower() != org.lower() or not NAME_RE.fullmatch(name):
    continue

The pattern requires an alphanumeric first character, so .github
never matches and its hand-backs vanish without a warning. GitHub
permits a repository name to start with .; it rejects only . and
...

Nothing else catches it: Code Monkey's hourly revise-only scan leaves
.github out unless include_dotgithub is set, and a schedule passes
no inputs, so a .github pull request has no fallback once its
hand-back is lost.

Required changes

  1. Accept repository names that start with . in handback.py,
    rejecting . and .., consistent with REPO_NAME_RE and its
    (".", "..") exclusion in scripts/selection_inputs.py. Prefer
    one shared validator over another copy of the pattern. Leave the
    NAME_RE checks on file names (bot_evidence.py) and owner names
    (review_notice.py, the --org check in handback.py) as they
    are: those are not repository names.
  2. When candidates(), handbacks() or selected_heads() drop a
    result that claims a posted hand-back (verdict commented,
    handback true), print a ::warning:: naming the pull request and
    the reason, so a lost hand-back is never silent again.
  3. Add tests: a .github hand-back is listed and dispatched; . and
    .. are refused; a dropped candidate produces the warning.

Acceptance criteria

  • A hand-back for a pull request in .github is counted and
    dispatched.
  • Repository names . and .. are still refused.
  • Every candidate dropped after claiming a hand-back emits a
    warning naming it.
  • Existing tests, prek (including the aislop gate) and
    zizmor --persona auditor pass.

Activity

  1. lf-releng-code-monkey-bot commented on Nov 23, 2026

    @lf-releng-code-monkey-bot
    Contributor

    🐒 An AI agent has proposed a change for this issue: pull request #124 (head f107195). The Copilot review of it is clean. An antagonistic review was requested from the review bot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions