Repository navigation
Conversation
Non-blocking findings were folded into one collapsed section of the review body. Most findings are non-blocking since #203531, so most of what the review says sat behind one click, away from the code it is about. Nobody could reply to one finding or react to it, so a thumbs-down could not settle it and there was no per-finding signal on non-blocking findings. `post_review.py` now posts every finding on its line. A blocking finding stays as it was: marked with a red circle and shown in full. A non-blocking one is a collapsed block whose summary is a grey circle and the finding's first sentence, labelled "Non-blocking" if the message does not already say so. The rest of the message and the report link sit under it. The summary is HTML- escaped, cut at 150 characters (the full message then goes under it), and the body is contained so an unclosed fence cannot swallow the closing tag. The review body says how many findings of each kind are attached to the code. The collapsed body section remains for findings that cannot go inline: those next to an earlier thread someone replied to, and all of them when GitHub refuses the inline comments. The verdict, the review event and the fallbacks are unchanged. Test plan: `python3 -m unittest discover -s scripts/pr_review -t .`, 675 pass (6 new). Tests of the body-only behaviour (folding, the size cap, fence containment, permalinks) now run through the refused-inline fallback.
PR Status: Approved 🚀Please fix all CI failures and trigger merge by commenting "@pytorchbot merge". ✅ AUTOMATED REVIEW - Ready for human review:
Findings (7): Reviewed commit: 🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/206357
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit af578b0 with merge base 7f632bb ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
lintrunner's formatter wrapped five lines of the new tests, and the URL link check fetched their placeholder URLs. Mark those with `# @lint-ignore`, as the other tests do.
albanD
left a comment
There was a problem hiding this comment.
Sounds good. Do fix the escape flagged by the bot before mergin!
…e on refusal - Messages reach `comment_body` neutralized, so already HTML-escaped. The summary escaped them again and showed `<` as `&lt;`. It now unescapes to the text a reader should see and escapes once. - The summary line is part of an HTML block, so markdown on it is not rendered. It drops neutralize's `\[`, `\]` and `\#` escapes and bold markers, and turns code spans into `<code>`. - The 150-character cap covers the whole summary, label included, and cuts at a word. - The label is added only when "non-blocking" is nowhere in the sentence, and a sentence ends only before a capital, so "e.g. `x`" does not end one. - GitHub refuses every inline comment when it refuses one. On a refusal, the review is now posted with only the blocking findings inline before falling back to the body. - Taking down a superseded review paces its deletes, as backfill does: most findings are inline now, so a review can cost a delete per finding. - Tests: the summary is checked on neutralized input, the long-headline test checks the summary itself, and the fallback tests check that an inline attempt was refused first. Test plan: `python3 -m unittest discover -s scripts/pr_review -t .`, 681 pass.
Withdrawn: the automated review of 2d4ce44 found nothing blocking.
- `neutralize` leaves `@**user**` and `#**12**` alone, since no letter or digit follows the `@` or `#`. Stripping `**` from the summary turned them into a live mention and a live cross-reference. The summary no longer strips `**`; it only drops neutralize's own escapes, which keeps every defused mention and reference defused. A test covers both. - The label counts only at the start of the sentence or as "(non-blocking)" or "non-blocking:", so a sentence about a non-blocking copy still gets it. - The cut drops a split word only when it split one, and uses a local regex instead of `extract_verdict`'s private `_PARTIAL_TOKEN`. - A one-sentence finding is a single line, with no empty block to open. - A successful blocking-only retry says that the non-blocking findings went to the body. `with_removed`'s docstring says what the retry changes. - `take_down` reads `BACKFILL_PAUSE` when called, so tests can zero it, and the comment says what is paced. - Tests: two body-only tests run through the refused-inline fallback, the fence test checks that no fence survives, and the cut tests cut mid-word and on a space. Test plan: `python3 -m unittest discover -s scripts/pr_review -t .`, 684 pass.
Withdrawn: the automated review of e716882 found nothing blocking.
There was a problem hiding this comment.
Automated review of af578b0: nothing blocking; ready for human review.
post_review.py now posts every finding on its line. Blocking findings appear in full, non-blocking ones are collapsed under their first sentence, and if GitHub refuses the inline comments the review is retried with only the blocking findings inline. The review's recommendation is Approve, and it says every remaining point is non-blocking.
⚪ 7 non-blocking findings
pytorch/scripts/pr_review/post_review.py
Line 530 in af578b0
Non-blocking (continuing): "collapsed" is wrong for one-sentence findings. Line 388 posts a one-sentence non-blocking finding as an open <p>, but the review body line at 528-530 still says these findings are "attached to the code below, collapsed", and its count includes the <p> ones. The docstrings at lines 24-25 and 365-366 say the same, though only loosely. Suggested fix: drop ", collapsed" from the body line.
pytorch/scripts/pr_review/post_review.py
Line 327 in af578b0
Non-blocking (continuing): the PR description, which becomes the commit message, is out of date. It says neutralize's escapes "and bold markers are dropped", but HEAD keeps ** on purpose (post_review.py:323-327), and the tests confirm this (test_post_review.py:545-548, 553-556). It also calls every non-blocking finding "a collapsed block".
pytorch/scripts/pr_review/post_review.py
Line 358 in af578b0
Non-blocking (continuing): a long first token can empty the summary. In summary_line (351-361), the first token can be 136 or more characters with no spaces, such as a long dotted name or a code span, and _BLOB doesn't reject these. The cut at MAX_HEADLINE - 1 then lands inside that token and _LAST_WORD removes all of it. What remains is "Non-blocking: ", which isn't empty, so the or kept fallback never fires and the summary reads Non-blocking:. The effect is cosmetic, since the full message is still under <details>. Suggested fix: drop the partial word only when what remains is longer than the label.
pytorch/scripts/pr_review/post_review.py
Line 332 in af578b0
Non-blocking (continuing): the cut-at-word logic is duplicated. _LAST_WORD (post_review.py:332) is identical to extract_verdict._PARTIAL_TOKEN (extract_verdict.py:184) but lacks its comment on the anchoring. The guard at post_review.py:356-358 repeats the one in extract_verdict.py around lines 476-478. A shared public cut_at_word(text, limit) would keep the copies from drifting apart.
pytorch/scripts/pr_review/post_review.py
Line 373 in af578b0
Non-blocking (new): a finding that drew only a reaction gets a duplicate thread on the next round. delete_unreplied keeps any earlier inline comment that has a reaction (1064, 1076, via reacted() at 1002-1004). But note_discussions (766) only links a new finding to a comment someone replied to, using replies_seen, which is built from in_reply_to_id. So if an author reacts without replying and the next review re-raises the finding as "continuing", a new inline comment is posted on the same line and the reacted one stays visible. GITHUB_TOKEN can't resolve threads (823-825), and minimizing hides only the review. Each such round adds a thread. Blocking findings already had this gap, but this PR makes it common because non-blocking findings are the majority and the kind that carries over between rounds. Suggested fix: have note_discussions treat reacted comments like replied ones.
pytorch/scripts/pr_review/post_review.py
Line 364 in af578b0
Non-blocking, low confidence (continuing): re-reviews may hit truncated more often. Non-blocking findings used to sit in the latest review body, which fetch_pr_comments.py keeps in its "answered" tier. Each one is now a separate inline item, and one with no reply or reaction falls into the tier that is dropped first when the item cap is reached.
pytorch/scripts/pr_review/post_review.py
Line 828 in af578b0
Non-blocking (continuing): take_down paces only its deletes. Line 828 calls fold(gh, pr, review, reason) with no budget, although fold accepts budget=. Only delete_unreplied gets a Budget(pause=BACKFILL_PAUSE), at line 831. hide_earlier calls take_down once per review, so the minimize at line 840 and the next review's fold PUT run back to back. _backfill (around line 1122) shares one Budget across its folds and deletes, and doing the same in take_down would pace all these writes. The impact is small.
This review is AI-generated and advisory. Each new automated review replaces the previous one. Report a bad review
|
@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 |
Non-blocking findings were folded into one collapsed section of the review body. Most findings are non-blocking since #203531, so most of what the review says sat behind one click, away from the code it is about. Nobody could reply to one finding or react to it, so a thumbs-down could not settle it and there was no per-finding signal on non-blocking findings.
post_review.pynow posts every finding on its line:\[,\]and\#escapes and bold markers are dropped, and code spans become<code>. The whole summary, label included, is cut at 150 characters at a word, and a cut summary has the full message under it.The review body says how many findings of each kind are attached to the code. The collapsed body section is kept for findings that cannot go inline: those next to an earlier thread someone replied to, and any GitHub refuses. GitHub refuses every inline comment when it refuses one, so a refused review is retried with only the blocking findings inline before everything falls back to the body. The verdict and the review event are unchanged.
Most findings are now inline, so taking down a superseded review can cost a delete per finding. Those deletes are paced, as backfill's already are.
Test plan:
python3 -m unittest discover -s scripts/pr_review -t ., 681 pass. New tests cover the summary on neutralized input (escaped once, no markdown escapes, the label added once, abbreviations, the length cap), the retry with only blocking findings inline, and the paced deletes. The body-only tests (folding, the size cap, fence containment, permalinks) run through the refused-inline fallback and check that the inline attempt was refused first.