Skip to content

fix(adversarial-review): say to pass --repo when --repo-dir is not a checkout - #2120

Merged
potiuk merged 1 commit into
apache:mainfrom
potiuk:fix/adversarial-review-repo-hint
Nov 15, 2026
Merged

potiuk merged 1 commit into
apache:mainfrom
potiuk:fix/adversarial-review-repo-hint

Conversation

@potiuk

@potiuk potiuk commented Nov 15, 2026

Copy link
Copy Markdown
Member

Summary

  • run --target pr:<N> without --repo lets gh infer the repository from the git remotes of --repo-dir. With an exported PR head (the --repo-dir that docs(pr-management): export the PR head for adversarial reviewers #1986 and fix(adversarial-review): review a PR's head, and close two gaps from #1997 #2004 now recommend) there are none, and the run dies with a bare gh pr diff failed: failed to run git: fatal: not a git repository, which points at the export rather than at the missing flag.
  • When --repo is absent and gh pr diff fails, the error now says to pass --repo OWNER/NAME. The hint is not tied to git's or gh's wording, so a localized git or a checkout with no GitHub remote gets it too. Runs with --repo are unchanged.
  • The --repo help text and the tool README say when --repo is required.

Type of change

  • Python package (tools/*/ with pyproject.toml)
  • Documentation (docs/, README.md, CONTRIBUTING.md)

Test plan

  • For Python packages touched: uv run pytest passes (249 passed) for tools/adversarial-review; ruff and mypy pass through the hooks.
  • New parametrized test test_pr_input_without_repo_outside_a_checkout_names_the_fix fails on main and passes with the change; it also checks that runs with --repo get no hint.
  • prek run --files on the four changed files passes, with lychee skipped: it needs a Rust toolchain the sandbox could not download. The change adds no links. prek run --all-files was not run.
  • Other: hit on 2026-11-16 reviewing apache/infrastructure-actions PRs with --repo-dir set to a git archive export.

RFC-AI-0004 compliance

  • Sandbox — no new host access; the change only rewords an error.

Linked issues

Refs #1986, #2004

Notes for reviewers (optional)

An adversarial review (codex, antigravity, copilot) of the first version flagged that matching on not a git repository missed other no-remote failures; the hint is now added for every gh pr diff failure without --repo, worded conditionally so it stays accurate when the cause is something else (auth, network).

🤖 Generated with Claude Code

@potiuk potiuk added family:tools tools/* capability:fix Implement code change to resolve an issue labels Nov 15, 2026
@github-actions github-actions Bot added family:docs Docs, MISSION.md, READMEs substrate:review Tool substrate: second-model read of a change before publishing (read-only CLIs, merged findings) labels Nov 15, 2026
@potiuk
potiuk merged commit d88caa6 into apache:main Nov 15, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

capability:fix Implement code change to resolve an issue family:docs Docs, MISSION.md, READMEs family:tools tools/* substrate:review Tool substrate: second-model read of a change before publishing (read-only CLIs, merged findings)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant