Document automated PR review workflow - #35704
Conversation
Add a guide for maintainers and community contributors explaining /review, /review rerun, /review tests, the review pipeline flow, comment outputs, and troubleshooting guidance. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 35704Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 35704" |
|
/review -b feature/enhanced-reviewer -p android |
MauiBot
left a comment
There was a problem hiding this comment.
Expert Review — 4 findings
See inline comments for details.
|
Updated this branch to current
The |
Document recent workflow improvements: - Command comments are now minimized (collapsed as Resolved) after authorization (dotnet#35895, dotnet#36021) - /review rerun eligibility now requires PR author activity only (dotnet#35874) - Automated hourly rerun scanner processes queued reruns (dotnet#35685) - Add troubleshooting entries for rerun eligibility and command visibility Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
🤖 AI Agent — Updated documentation to reflect recent workflow changes: Changes documented:
The documentation now accurately describes the current state of the review automation system. Ready for review! 📚 |
- Move Next Steps section below Review Sessions (user feedback) - Replace colorful emojis with more professional symbols: * 🤖 → 🔍 (review/analysis indicator) * 🟢🔴🟡 → ● (colored bullets based on context) * ❌ → ✗ (simpler cross) * 💡 → ℹ (information/note) Affects: - post-ai-summary-comment.ps1: swapped session and future action order - post-inline-review.ps1: updated AI marker emoji - Find-RegressionRisks.ps1: replaced colored circles - pr-preflight.md: updated finding indicators Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
PureWeen
left a comment
There was a problem hiding this comment.
Adversarial review — PR #35704
Methodology: 3 independent reviewers (different model families) with adversarial consensus. Because this branch is behind main and its local infra files are stale, every finding was cross-checked against origin/main source (the actual merge target), not the local checkout.
This is a documentation-only PR, so the entire concern is accuracy. The prior automated review's 4 findings were stale-base artifacts and are genuinely resolved — on current main every referenced path exists, the command-comment minimization feature is implemented (PRs #35895 / #36021), and review-trigger.yml really does exclude /review tests. Also verified accurate against main: all 12 referenced file paths, platform-label inference, the hourly scanner cron, Review-Tests.ps1 params/output paths, and the /review tests comment-only behavior. Nicely written guide overall.
The findings below are remaining accuracy gaps versus current main:
Must fix
- ❌ line 113 —
/review rerundoes not run the pipeline directly; it applies thes/agent-ready-for-rerunlabel and the hourly scanner triggers AzDO (may be delayed ~1h or skipped). 3/3, verified. - ❌ lines 17 & 20 —
/review rerunpermission understated: a non-first-time PR author can rerun their own PR with no write access. 3/3, verified.
Should fix
⚠️ lines 107 & 246 — Older AI Summary sessions are not retained; the script posts a PR review and hides older ones, keeping only the latest session. Confirmed via source.⚠️ lines 252–256 — The comment's top-level heading is## Tests Failure Analysis, not## Test Failure Review(that's only the<summary>label). 2/3, verified.⚠️ lines 96–105 —Review-PR.ps1phase list has an extra phase and the regression/gate order swapped vs the 7-step script header. 3/3, verified.
Consider
- 💡 line 90 — The pipeline actually has a 4th
CleanupReviewLockstage. The "at a high level … three stages" framing is defensible (one reviewer considered it fine), but you could mention the cleanup stage for completeness. 2/3.
Test coverage: N/A — documentation only, no executable code paths.
Prior reviews: MauiBot's earlier expert review (4 findings) was resolved by the branch update to current main; those are not re-raised here.
3 independent reviewers with adversarial consensus. Posted as a comment (no approve / request-changes).
…d session retention Must-fix: - Document that /review rerun applies s/agent-ready-for-rerun label and is processed by hourly scanner (may delay ~1h), not direct pipeline trigger - Fix permission documentation: non-first-time PR authors can rerun their own PR without write access Should-fix: - Older AI Summary sessions are hidden as outdated, not retained side-by-side - Test comment heading is "## Tests Failure Analysis", not "## Test Failure Review" - Remove phantom phase from Review-PR.ps1 phase list and fix regression/gate order Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
🤖 AI Agent — Addressed all review findings in ead1342b6d: Must-fix:
Should-fix:
Consider:
All findings have been addressed. Ready for re-review! 🎯 |
PureWeen
left a comment
There was a problem hiding this comment.
Round 2 — multi-model adversarial re-review. This follow-up uses 3 independent reviewers with adversarial consensus. It builds on my prior review (pullrequestreview-4547825053).
Round-1 findings: resolved. ✅ All five documentation findings from the prior review were correctly addressed (rerun mechanics + s/agent-ready-for-rerun/rerun-review-scanner, rerun permissions for non-first-time authors, session replace/hide wording, the ## Tests Failure Analysis heading, and the Review-PR.ps1 phase list). Verified against origin/main. Thank you.
What changed since round 1: the PR grew from a docs-only change to also modify four production files (Find-RegressionRisks.ps1, post-ai-summary-comment.ps1, post-inline-review.ps1, pr-preflight.md) via the "Improve emoji choices and reorder review structure" commit. Those changes introduce one real regression and a few smaller issues.
Findings (ranked)
❌ Regression — 🟢→● swap breaks regression-section no-op suppression (3/3 reviewers)
Find-RegressionRisks.ps1 now emits ● No regression risks detected… / ● No implementation files modified… (lines 797, 346), but the consumer post-ai-summary-comment.ps1 → Test-PhaseContentIsNoOp still matches those strings with regexes anchored on the literal 🟢 (lines ~100–101). For the common case (no regression risk), the no-op check now returns false, so an empty "Regression Cross-Reference → ● No regression risks detected" block leaks into every AI Summary comment instead of being suppressed. The unit tests don't catch this because Post-AISummaryComment.Tests.ps1 fixtures (lines 63, 68) still feed the old 🟢 strings. Fix: update the two regexes (e.g. ^[●🟢]\s+…) and the test fixtures, keeping producer and consumer in lock-step. (Inline on line 797.)
The commit message says "Move Next Steps section below Review Sessions (user feedback)", but before this change $futureActionSection (Next Steps / Future Action) was already below $newSessionBlock (Review Sessions). The swap moves Next Steps above Review Sessions — the opposite of the message. The reorder itself is safe (the <!-- SESSION:… --> markers stay intact, so older-session hiding still works); the concern is that code and stated intent disagree. Fix: confirm which order the feedback asked for; if Next Steps should be below, swap the two blocks back. (Inline on line 623.)
💡 Information design — ● collapses three severities into one glyph in colorless output (2/3 reviewers)
In console output the change is cosmetic (Write-Host keeps -ForegroundColor), but the markdown content.md / PR-comment paths (REVERT, OVERLAP, CLEAN at lines 735/770/797) have no color, so all three render as an identical ● — the at-a-glance severity cue is lost. Mitigated by distinct text and mutually-exclusive branches. Fix (optional): use distinct colorless glyphs (e.g. the ✗/⚠/ℹ set already adopted in pr-preflight.md).
💡 Documentation — troubleshooting row contradicts the corrected session wording (1/3 reviewers, orchestrator-verified)
The Troubleshooting table still says "The comment preserves prior review sessions for traceability" (line 298), which conflicts with the now-corrected "New runs replace the review and hide older sessions" / "minimized and hidden as outdated" elsewhere in the same doc. Looks like a spot missed when fixing the round-1 session-retention finding. Fix: reword to match (older sessions are minimized/hidden as outdated). (Inline on line 298.)
💡 Maintainability — hardcoded model roster in inline-comment marker (3/3 reviewers)
post-inline-review.ps1 line 168 prepends > 🔍 **AI-Generated Review** (multi-model: GPT-5.5, Claude Opus 4.8, Claude Opus 4.6, Gemini 3.1 Pro) to every comment. This list isn't sourced from runtime/config and will silently go stale (and arguably already differs from the documented try-fix model set). Fix: use a generic "multi-model AI review" label or inject the active model list from run metadata. (Inline on line 168.)
Non-blocking note
The PR title and description still present this as documentation-only ("Adds a guide…") with no mention of the four production-script/template changes. Consider updating the description so the script changes are reviewable in context.
Test coverage
The behavioral change in Find-RegressionRisks.ps1 has no test exercising the new ● output; the existing Post-AISummaryComment.Tests.ps1 fixtures still assert against 🟢, which is why the regex regression isn't caught. Updating those fixtures alongside the fix would close the gap.
Methodology: 3 independent reviewers with adversarial consensus; consensus counts shown per finding. Factual claims verified against origin/main. Posted as a comment — not an approval or change request.
…ion findings PureWeen's Round 2 multi-model review flagged a regression introduced by the earlier emoji/reorder commit plus a few smaller issues: - [must-fix, 3/3] Regression no-op suppression broke: Find-RegressionRisks.ps1 emits '● No regression risks detected…' / '● No implementation files modified…' but Test-PhaseContentIsNoOp still matched the literal '🟢', so the empty regression section leaked into every clean PR's AI Summary. Updated both consumer regexes to '(?:●|🟢)' (alternation, not a char class — 🟢 is an astral surrogate pair that splits inside []) and refreshed the test fixtures to '●' with a 🟢 back-compat case. - [3/3] Section order now matches the commit's stated intent: Next Steps below Review Sessions (the earlier swap had inverted it). - [3/3] post-inline-review.ps1 marker no longer hardcodes a stale model roster — now a generic '(multi-model)' label. - [2/3] Distinct colorless severity glyphs in the regression markdown: ✗ REVERT (error), ⚠ OVERLAP (warning), ● CLEAN (status) — matching the ✗/⚠/ℹ set used elsewhere. Review-PR.ps1 keys off the JSON result field, not the glyph, so no new producer/consumer mismatch. - [1/3] Troubleshooting row corrected to match the session replace/hide wording. Validated: full .github/scripts Pester suite 241/241 pass. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@PureWeen — Round 2 findings addressed in
Note on the surrogate-pair gotcha: I initially used Validation: full I also updated the PR description to cover the production-script changes (per your non-blocking note). All 4 inline threads replied + resolved. Thanks for the thorough re-review! |
Refreshed this branch against the latest @PureWeen — the branch is now current and ready for another look whenever you have a chance. Thanks! |
This comment has been minimized.
This comment has been minimized.
@PureWeen — friendly nudge for re-review. All Round-2 findings are addressed in |
PureWeen
left a comment
There was a problem hiding this comment.
Adversarial multi-model re-review — Round 3
Methodology: 3 independent reviewers (different model families) with adversarial consensus, scoped strictly to this PR's changed files and verified against origin/main (the merge target).
Round-2 findings — all verified resolved ✅
All five prior-round findings are genuinely fixed in ac2dc2e77c (not merely reworded). One reviewer empirically executed Test-PhaseContentIsNoOp against every updated fixture to confirm:
- ❌ Regression (regex no-op suppression) — Resolved. The consumer regex now uses
^(?:●|🟢)\s+…alternation, matching both the new●producers (Find-RegressionRisks.ps1:346,797) and legacy🟢; the empty "no regression risks" section is suppressed again. The author's choice of alternation over a[●🟢]character class is the correct fix —🟢(U+1F7E2) is a surrogate pair that splits inside[], so a char class would mis-match (verified empirically, 3/3). ⚠️ Logic (section order) — Resolved.$newSessionBlocknow precedes$futureActionSection; SESSION markers still wrap the block as a contiguous unit, so rerun/replace parsing is unaffected.- 💡 Maintainability (hardcoded model roster) — Resolved. Marker is now
(multi-model). - 💡 Info design (severity glyphs) — Resolved.
✗/⚠/●distinguish REVERT/OVERLAP/CLEAN in colorless markdown; downstream consumers key offrisks.json/result.txt, never the glyph, so nothing breaks. - 💡 Documentation (troubleshooting row) — Resolved; wording now matches the minimize-and-hide behavior.
New findings this round
<details> (2/3, verified) — see inline on line 247. Doc lines 247 and 298 claim the latest session is expanded, but the code emits a plain <details> (no open) with a "click to expand" summary, so it renders collapsed. The <details> block is pre-existing on main, so the in-scope fix is the doc (or emit <details open> if expanded-by-default is intended).
💡 Testing — fixtures don't exercise the real producer (1/3 formal + 1/3 corroborated). Post-AISummaryComment.Tests.ps1 asserts against static string literals that happen to match current producer output, rather than feeding the actual content.md from Find-RegressionRisks.ps1 into Test-PhaseContentIsNoOp. A future producer-only glyph change (e.g. ●→○) would silently reintroduce the round-2 regression while the suite stays green. A small integration test that runs the producer and asserts suppression would make the coupling self-policing. Non-blocking — a pre-existing test-architecture gap, not a regression in this commit.
Test coverage
The new Post-AISummaryComment.Tests.ps1 adds direct coverage of the consumer regex (including a 🟢 back-compat case) — a real improvement over round 2, where no test caught the regression. The remaining gap is the producer/consumer integration noted above.
Prior reviews
No prior human review flagged the "expanded by default" inconsistency. Existing MauiBot reviews are the pipeline's own auto-generated AI Summary, not human findings.
Verdict: Round-2 findings verified resolved; no new functional bugs. One
3 independent reviewers · adversarial consensus · CI status out of scope.
… by default Round-3 review noted that the AI Summary wraps the Review Sessions in a plain <details> (no 'open' attribute) with a 'click to expand' summary, so it renders collapsed — the doc's 'expanded by default' wording was inaccurate. That <details> block is pre-existing on the base branch and untouched by this PR, so the in-scope fix is the doc: describe the section as collapsible and tell readers to expand it. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@PureWeen — thanks for the Round-3 pass and for confirming all five Round-2 findings resolved. Addressed the new
Ready for re-review. |
PureWeen
left a comment
There was a problem hiding this comment.
Adversarial multi-model re-review — Round 4
Methodology: 3 independent reviewers (different model families) with adversarial consensus, scoped to this round's change and verified against the actual source.
Round-3 finding — verified resolved ✅
The new commit bad5f62c76 correctly fixes the round-3 <details> (no open) with a "click to expand" summary. The troubleshooting row (line 298) was updated consistently. 3/3 reviewers confirmed this part is accurate.
New finding this round
While fixing the collapsed/expanded wording, the commit also added: "Within it, the latest session appears first; older sessions are minimized and hidden as outdated." All three reviewers independently traced the code and found this contradicts reality: each posted AI Summary contains exactly one session (the current HEAD commit), so there is no latest-first ordering "within it," and older sessions are separate prior comments/reviews minimized via Hide-StaleMauiBot* — not nested inside the Review Sessions block. A reader who expands the section expecting a history of minimized older runs will find only one session and may think history was lost. Suggested rewording in the inline comment.
This is a documentation precision issue on a docs-only change — non-blocking, but worth a one-line tweak before merge so the doc matches the script's own synopsis ("the replacement review contains only the latest review session, keyed by the current HEAD commit SHA").
Multi-round provenance
This finding targets wording introduced by bad5f62c76 itself (the round-3 fix). Per self-correction review, it was independently confirmed by all three reviewers with concrete code citations and re-verified against source by the orchestrator.
Prior reviews / test coverage
No prior human review flagged this clause. The 4 supporting PowerShell/template files are unchanged since round 3 (all round-2 findings remain resolved) and were not re-reviewed this round. Existing MauiBot reviews are the pipeline's own auto-generated AI Summary, not human findings.
Verdict: The round-3 fix is correct; one new
3 independent reviewers · adversarial consensus · CI status out of scope.
Round-4 review caught that the round-3 fix introduced a fresh inaccuracy: the
clause 'the latest session appears first; older sessions are minimized within it'
implied a nested latest-first history. In reality each AI Summary comment holds
exactly one session (keyed to the current HEAD commit); previous review *comments*
are separate and minimized via Hide-StaleMauiBot*. Reword so the doc matches the
script's own synopsis ('the replacement review contains only the latest review
session, keyed by the current HEAD commit SHA').
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@PureWeen — thanks for the Round-4 catch. Fixed in |
PureWeen
left a comment
There was a problem hiding this comment.
Adversarial multi-model re-review — Round 5
Methodology: 3 independent reviewers (different model families) with adversarial consensus, verified against the actual source.
Round-4 finding — verified resolved ✅ (3/3, unanimous)
Commit 11c74c41b1 correctly fixes the round-4 post-ai-summary-comment.ps1:
- Line 247 — "collapsed by default" ✓ (the
<details>block has noopenattribute); "expand … to read the latest session, which is keyed to the current HEAD commit" ✓ (the comment body contains exactly one$newSessionBlock, wrapped in<!-- SESSION:$commitSha7 -->for the current HEAD); "Previous review comments are minimized and hidden as outdated" ✓ (prior AI Summary comments/reviews are hidden as separate comments viaHide-StaleMauiBotIssueComments/Hide-StaleMauiBotPullRequestReviews, not nested in the block). - Line 298 (troubleshooting row) — "Each comment holds only the latest session (keyed to its HEAD commit)" and "Expand the Review Sessions section in the newest comment" ✓. Accurate and consistent with line 247.
No new issues
All three reviewers returned "Fix correct and complete; no new issues." The 4 supporting PowerShell/template files are unchanged since round 3 (all round-2 findings remain resolved) and were not re-reviewed this round. The doc now matches the script's own synopsis ("the replacement review contains only the latest review session, keyed by the current HEAD commit SHA").
Verdict: All findings from rounds 2–4 are verified resolved; no outstanding issues from this reviewer. 👍
3 independent reviewers · adversarial consensus · CI status out of scope.
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Description of Change
Adds a guide for Microsoft maintainers and community contributors explaining the automated PR review workflow:
/review/review <platform>/review rerun/review testsThe guide also explains the
maui-copilotpipeline flow, AI Summary and Test Failure Review comments, local/review testsusage, troubleshooting, and related implementation files.Companion review-output changes
Beyond the documentation, this PR also refines the review-comment output to keep it consistent with the guide and with the project's review-symbol conventions:
Find-RegressionRisks.ps1— distinct colorless severity glyphs in the regression markdown (✗REVERT /⚠OVERLAP /●CLEAN).post-ai-summary-comment.ps1—Test-PhaseContentIsNoOprecognizes the●(and legacy🟢) regression no-op markers so empty sections stay suppressed; Next Steps renders below Review Sessions.post-inline-review.ps1— inline-comment marker uses a generic(multi-model)label instead of a hardcoded model roster.pr-preflight.md— review-symbol set aligned (✗/⚠/ℹ).Producer/consumer pairs (e.g. the regression no-op markers) are kept in lock-step and covered by
Post-AISummaryComment.Tests.ps1.Issues Fixed
No issue filed.