Skip to content

[TEST] Add two-stage auto PR review with Claude (comment-only, no merge)#3801

Open
sekyondaMeta wants to merge 3 commits intomainfrom
autoClaudeReview
Open

[TEST] Add two-stage auto PR review with Claude (comment-only, no merge)#3801
sekyondaMeta wants to merge 3 commits intomainfrom
autoClaudeReview

Conversation

@sekyondaMeta
Copy link
Contributor

  • Stage 1 (claude-pr-review.yml): Captures PR number on PR open, no AI/secrets
  • Stage 2 (claude-pr-review-run.yml): Runs Claude review in protected bedrock environment with script-generated facts section and COMMENT-only output
  • Harden claude-code.yml with --allowedTools Skill (matches pytorch main repo)
  • Update pr-review skill: SECURITY block, COMMENT-only policy, advisory labels

Security: Claude cannot merge, approve, push, or execute commands. Reviews are advisory COMMENT-only. Script-generated facts provide injection-resistant anchor.

- Stage 1 (claude-pr-review.yml): Captures PR number on PR open, no AI/secrets
- Stage 2 (claude-pr-review-run.yml): Runs Claude review in protected bedrock
  environment with script-generated facts section and COMMENT-only output
- Harden claude-code.yml with --allowedTools Skill (matches pytorch main repo)
- Update pr-review skill: SECURITY block, COMMENT-only policy, advisory labels

Security: Claude cannot merge, approve, push, or execute commands. Reviews are
advisory COMMENT-only. Script-generated facts provide injection-resistant anchor.
@pytorch-bot
Copy link

pytorch-bot bot commented Mar 19, 2026

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/tutorials/3801

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 4ca941b with merge base ccac77f (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla bot added the cla signed label Mar 19, 2026
@sekyondaMeta sekyondaMeta marked this pull request as ready for review March 19, 2026 19:42
…ermission

- Remove lintrunner install + run (already handled by lintrunner.yml workflow)
- Remove issues:write permission (only PR comments needed, not issue writes)
- Keep id-token:write (required for AWS OIDC → Bedrock auth)
Comment on lines +163 to +167
IMPORTANT — SCRIPT-GENERATED FACTS:
The following facts were generated by automated scripts (not AI) and are verified.
Include this facts table VERBATIM at the top of your review comment.
Do NOT modify, omit, or contradict these facts in your analysis.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why mention that it's AI generated and tell it to include that table in the review comment?

If you actually want it showing up in the final output, prob more reliable way to get claude's response w/o this thend insert this table yourself at the beginning

echo "number=$PR_NUM" >> "$GITHUB_OUTPUT"
echo "Reviewing PR #${PR_NUM}"

- uses: actions/checkout@v4
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider if you want to even check out the PR branch. It'll make it easier for claude to navigate the repo and look at the related files.

At that point, claude doesn't even need to know about the PR or have github access. It just needs to be told "code is here. Explore changes in diff range X - Y. Here's a summary of facts about it"

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants