Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/aw/actions-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
"version": "v0.62.2",
"sha": "20045bbd5ad2632b9809856c389708eab1bd16ef"
},
"github/gh-aw-actions/setup@v0.62.5": {
"repo": "github/gh-aw-actions/setup",
"version": "v0.62.5",
"sha": "dc50be57c94373431b49d3d0927f318ac2bb5c4c"
},
"github/gh-aw/actions/setup@v0.43.19": {
"repo": "github/gh-aw/actions/setup",
"version": "v0.43.19",
Expand Down
95 changes: 95 additions & 0 deletions .github/skills/find-regression-risk/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
---
name: find-regression-risk
description: "Detects if a PR modifies or reverts code from a recent bug-fix PR, which could re-introduce a previously-fixed bug. Use when reviewing any PR, before approving, or when asked 'check for regression risks', 'could this revert a fix', 'regression cross-reference'."
metadata:
author: dotnet-maui
version: "1.0"
compatibility: Requires git, PowerShell, and gh CLI.
---

# Find Regression Risk

Detects if a PR's changes could re-introduce previously-fixed bugs by cross-referencing the diff against recently-merged bug-fix PRs.

## Why This Exists

PRs that fix one bug can silently re-introduce another if they modify or revert lines from a prior fix.

**Real-world example:** PR #33908 removed `|| parent is IMauiRecyclerView` from `MauiWindowInsetListener.cs` β€” a line that PR #32278 had specifically added to fix issue #32436 (increasing gap at bottom while scrolling). The agent approved PR #33908 without detecting this revert, and the exact same bug reappeared as issue #34634.

## When to Use

- βœ… Before approving any PR that modifies platform code
- βœ… When asked "check for regression risks" or "could this revert a fix"
- βœ… As part of the `pr-review` skill's Pre-Flight phase
- βœ… When a PR touches high-churn files (safe area, CollectionView handlers, inset listeners)

## Workflow

### Step 1: Run the Script

```bash
# Auto-detect implementation files from PR diff
pwsh .github/skills/find-regression-risk/scripts/Find-RegressionRisks.ps1 -PRNumber XXXXX

# Or specify files manually
pwsh .github/skills/find-regression-risk/scripts/Find-RegressionRisks.ps1 \
-PRNumber XXXXX \
-FilePaths @("src/Core/src/Platform/iOS/MauiView.cs","src/Core/src/Platform/Android/MauiWindowInsetListener.cs")
```

### Step 2: Interpret Results

| Risk Level | Meaning | Action |
|------------|---------|--------|
| πŸ”΄ **REVERT DETECTED** | PR removes/modifies lines from a recent bug-fix PR | **MUST** verify the previously-fixed bug doesn't reappear before approving |
| 🟑 **OVERLAP** | PR modifies the same file as a recent bug-fix but different lines | Note as lower-risk concern |
| 🟒 **CLEAN** | No recent bug-fix PRs touched these files | No action needed |

### Step 3: Act on Findings

**If πŸ”΄ REVERT DETECTED:**

1. Identify the at-risk issues β€” the script reports which issues were fixed by the reverted code
2. Verify the fix still holds β€” run the test from the original fix PR, or manually verify
3. Document in PR review β€” note the revert risk and the verification result
4. **Do NOT approve** until the risk is mitigated

## What the Script Does

For each implementation file in the PR diff:

1. **Finds recent PRs** β€” queries `git log` for the last 6 months of changes to that file
2. **Identifies bug fixes** β€” checks PR labels AND linked issue labels for `i/regression`, `t/bug`, `p/0`, `p/1`
3. **Compares diffs** β€” checks if lines ADDED by a fix PR are being REMOVED by the current PR
4. **Reports risks** β€” structured output with file, PR, issue, and reverted line details

## Output Format

Post results using the following format:

```markdown
## πŸ” Regression Risk Analysis

**PR:** #XXXXX
**Risk Level:** [🟒 Clean | 🟑 Overlaps Found | πŸ”΄ Revert Risks Detected]

[Summary sentence]

> πŸ‘ / πŸ‘Ž β€” Was this analysis helpful? React to let us know!

<details>
<summary>πŸ“Š Expand Full Analysis</summary>

### Risks Found

| File | Recent Fix PR | Fixed Issue | Risk | Details |
|------|--------------|-------------|------|---------|
| ... | ... | ... | ... | ... |

### Recommendations

- ...

</details>
```
Loading
Loading