Repository navigation
[pr-review] Stage B: a defect that must be fixed means changes requested - #202455
izaitsevfb wants to merge 4 commits into
Conversation
Stage A sometimes recommends Needs Discussion while naming a blocker. Stage B mapped that to ready_for_human_review with a major finding, which the sanitizer rejects, so no review was posted. Also tell stage B that deleted and rename-only files have no line to anchor to.
PR Status: Approved 🚀Please fix all CI failures and trigger merge by commenting "@pytorchbot merge". ✅ AUTOMATED REVIEW - Ready for human review:
Reviewed commit: 🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/202455
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (2 Unrelated Failures)As of commit 215a73f with merge base ca67de4 ( 🟡 GREEN LIGHT - PR requires human review:
reason: FLAKY - The following jobs failed but were likely due to flakiness present on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
…tes the verdict, pin both rules in tests
…tion, not open questions or unreviewed files
There was a problem hiding this comment.
Automated review of 215a73f: nothing blocking; ready for human review.
The PR changes two rules in the Stage B prompt of hardened-pr-review-run.yml. Under Approve or Needs Discussion, a defect that must be fixed first now gets a major finding and a changes_requested verdict, and findings on files with no attachable line are anchored to a changed line instead; two contract tests pin both rules. Recommendation: Approve, since the review found no issues.
This review is AI-generated and advisory. Each new automated review replaces the previous one.
Withdrawn: the automated review of 215a73f found nothing blocking.
| or context line (a deletion, a pure rename, a mode-only change, a | ||
| binary file) has no such line, even though /tmp/pr-files.txt lists | ||
| it. When a point is not about one changed line (a missing test, | ||
| say), or is about such a file, anchor it to the most relevant |
There was a problem hiding this comment.
FYI #202456 (comment), maybe we can merge this first and tweak the change here in #202456
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
#202455 listed a deletion among files with no line to anchor on; this PR anchors deleted files on their old lines, so the list now says a file with no added, removed or context line.
✴️ iz2: The automated review pointed out that "such as a docstring, comment or naming fix" exempts whole categories, including a public rename that breaks BC. The exception now covers documentation, comment or code-structure fixes the review does not tie to a bug or a violated rule. Re-mapping the 10 runs where the #202455 path decided the verdict, twice each: the one known real defect stayed blocking 2 of 2; blocks on maintainer-approved or nit-reported PRs went from 15 of 18 (current stage B) to 8 of 18. A "docstring or comment fix the review treats as non-blocking" variant leaked the real defect once, since an Approve review reads as treating everything as non-blocking. Test plan: `python3 -m unittest discover -p 'test_*.py'` in scripts/pr_review (551 pass).
✴️ iz2: A PR that only deletes files has no new-side line, so the sanitizer discarded every finding and refused any blocking review. #202328 (removes three workflows) was rejected on all 4 automated runs and never got a review. - `extract_verdict.parse_diff` records a deleted file's removed lines, numbered as in the deleted file. Each finding must still point at a line the diff touches. A type change, where the path still exists, keeps only its new side. - `post_review` lists the PR's files and posts findings on `removed` files on the diff's LEFT side. In the review body they link to the diff line, since the file has no blob at the head. It matches earlier discussions on the same side only. - The Stage B prompt says how to number lines in a deleted file, and no longer lists a deletion among files with no anchorable line (added by #202455). Known limits: the review row's findings carry no side, so a deleted file's `line` is its pre-deletion number (noted in `emit_row.py`; Dr.CI shows `path:line` as plain text). If the file list can't be read or GitHub disagrees with git on a rename, the comment goes RIGHT, GitHub refuses the review's inline comments, and all of them land in the body. This complements #202455, which covers findings on renamed-only files in PRs that change other files. Part of pytorch/test-infra#9260. No ClickHouse query changes. Test plan: `python3 -m unittest discover -s scripts/pr_review -t .` passes. The new tests fail against main. Pull Request resolved: #202456 Approved by: https://github.com/huydhn
…ted (pytorch#202455) ✴️ iz2: Two prompt fixes to Stage B of the hardened PR review. In both cases a real blocking review was rejected by `extract_verdict.py` and nothing was posted. Part of pytorch/test-infra#9260. 1. **Needs Discussion with a blocker.** Stage A can recommend Needs Discussion while naming a defect that must be fixed. Stage B mapped Needs Discussion to `ready_for_human_review` and the defect to `major`, and the sanitizer refuses that combination. This happened on pytorch#202251 and pytorch#201766. Now such a defect is `major` and the verdict is `changes_requested`; open questions, requests for data or discussion, and unreviewed files are not such defects. The summary keeps the Recommendation and says when a defect overrode it. 2. **Findings on files with no anchorable line.** `/tmp/pr-files.txt` lists deletions, pure renames, mode-only changes and binary files, but their diffs show no added or context line, so a finding on one is discarded and a change request left with none is rejected (pytorch#201671). The prompt now names these and points Stage B at a changed line instead. This does not fix PRs whose every file is such a file, since they have no anchorable line at all. A separate change to the sanitizer covers that case. Test plan: `python3 -m unittest test_workflow_contract` in `scripts/pr_review` (174 pass). Two new tests pin both rules and fail on the old prompt. Pull Request resolved: pytorch#202455 Approved by: https://github.com/huydhn
…h#202456) ✴️ iz2: A PR that only deletes files has no new-side line, so the sanitizer discarded every finding and refused any blocking review. pytorch#202328 (removes three workflows) was rejected on all 4 automated runs and never got a review. - `extract_verdict.parse_diff` records a deleted file's removed lines, numbered as in the deleted file. Each finding must still point at a line the diff touches. A type change, where the path still exists, keeps only its new side. - `post_review` lists the PR's files and posts findings on `removed` files on the diff's LEFT side. In the review body they link to the diff line, since the file has no blob at the head. It matches earlier discussions on the same side only. - The Stage B prompt says how to number lines in a deleted file, and no longer lists a deletion among files with no anchorable line (added by pytorch#202455). Known limits: the review row's findings carry no side, so a deleted file's `line` is its pre-deletion number (noted in `emit_row.py`; Dr.CI shows `path:line` as plain text). If the file list can't be read or GitHub disagrees with git on a rename, the comment goes RIGHT, GitHub refuses the review's inline comments, and all of them land in the body. This complements pytorch#202455, which covers findings on renamed-only files in PRs that change other files. Part of pytorch/test-infra#9260. No ClickHouse query changes. Test plan: `python3 -m unittest discover -s scripts/pr_review -t .` passes. The new tests fail against main. Pull Request resolved: pytorch#202456 Approved by: https://github.com/huydhn
…ted (pytorch#202455) ✴️ iz2: Two prompt fixes to Stage B of the hardened PR review. In both cases a real blocking review was rejected by `extract_verdict.py` and nothing was posted. Part of pytorch/test-infra#9260. 1. **Needs Discussion with a blocker.** Stage A can recommend Needs Discussion while naming a defect that must be fixed. Stage B mapped Needs Discussion to `ready_for_human_review` and the defect to `major`, and the sanitizer refuses that combination. This happened on pytorch#202251 and pytorch#201766. Now such a defect is `major` and the verdict is `changes_requested`; open questions, requests for data or discussion, and unreviewed files are not such defects. The summary keeps the Recommendation and says when a defect overrode it. 2. **Findings on files with no anchorable line.** `/tmp/pr-files.txt` lists deletions, pure renames, mode-only changes and binary files, but their diffs show no added or context line, so a finding on one is discarded and a change request left with none is rejected (pytorch#201671). The prompt now names these and points Stage B at a changed line instead. This does not fix PRs whose every file is such a file, since they have no anchorable line at all. A separate change to the sanitizer covers that case. Test plan: `python3 -m unittest test_workflow_contract` in `scripts/pr_review` (174 pass). Two new tests pin both rules and fail on the old prompt. Pull Request resolved: pytorch#202455 Approved by: https://github.com/huydhn
…h#202456) ✴️ iz2: A PR that only deletes files has no new-side line, so the sanitizer discarded every finding and refused any blocking review. pytorch#202328 (removes three workflows) was rejected on all 4 automated runs and never got a review. - `extract_verdict.parse_diff` records a deleted file's removed lines, numbered as in the deleted file. Each finding must still point at a line the diff touches. A type change, where the path still exists, keeps only its new side. - `post_review` lists the PR's files and posts findings on `removed` files on the diff's LEFT side. In the review body they link to the diff line, since the file has no blob at the head. It matches earlier discussions on the same side only. - The Stage B prompt says how to number lines in a deleted file, and no longer lists a deletion among files with no anchorable line (added by pytorch#202455). Known limits: the review row's findings carry no side, so a deleted file's `line` is its pre-deletion number (noted in `emit_row.py`; Dr.CI shows `path:line` as plain text). If the file list can't be read or GitHub disagrees with git on a rename, the comment goes RIGHT, GitHub refuses the review's inline comments, and all of them land in the body. This complements pytorch#202455, which covers findings on renamed-only files in PRs that change other files. Part of pytorch/test-infra#9260. No ClickHouse query changes. Test plan: `python3 -m unittest discover -s scripts/pr_review -t .` passes. The new tests fail against main. Pull Request resolved: pytorch#202456 Approved by: https://github.com/huydhn
✴️ iz2: Two prompt fixes to Stage B of the hardened PR review. In both cases a real blocking review was rejected by
extract_verdict.pyand nothing was posted. Part of pytorch/test-infra#9260.ready_for_human_reviewand the defect tomajor, and the sanitizer refuses that combination. This happened on [CLAUDE.md] Keep long implementation notes out of C++/CUDA headers #202251 and [tunableop] compile-time nearest match and borrowed-result recording #201766. Now such a defect ismajorand the verdict ischanges_requested; open questions, requests for data or discussion, and unreviewed files are not such defects. The summary keeps the Recommendation and says when a defect overrode it./tmp/pr-files.txtlists deletions, pure renames, mode-only changes and binary files, but their diffs show no added or context line, so a finding on one is discarded and a change request left with none is rejected ([Kineto] Finish documentation and compatibility cleanup (#201671) #201671). The prompt now names these and points Stage B at a changed line instead.This does not fix PRs whose every file is such a file, since they have no anchorable line at all. A separate change to the sanitizer covers that case.
Test plan:
python3 -m unittest test_workflow_contractinscripts/pr_review(174 pass). Two new tests pin both rules and fail on the old prompt.