Skip to content
Merged
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
10 changes: 6 additions & 4 deletions plugins/sentry-skills/skills/iterate-pr/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@ Continuously iterate on the current branch until all CI checks pass and review f

**Requires**: GitHub CLI (`gh`) authenticated.

**Important**: All scripts must be run from the repository root directory (where `.git` is located), not from the skill directory. Use the full path to the script via `${CLAUDE_SKILL_ROOT}`.

## Bundled Scripts

### `scripts/fetch_pr_checks.py`

Fetches CI check status and extracts failure snippets from logs.

```bash
uv run scripts/fetch_pr_checks.py [--pr NUMBER]
uv run ${CLAUDE_SKILL_ROOT}/scripts/fetch_pr_checks.py [--pr NUMBER]
```

Returns JSON:
Expand All @@ -36,7 +38,7 @@ Returns JSON:
Fetches and categorizes PR review feedback using the [LOGAF scale](https://develop.sentry.dev/engineering-practices/code-review/#logaf-scale).

```bash
uv run scripts/fetch_pr_feedback.py [--pr NUMBER]
uv run ${CLAUDE_SKILL_ROOT}/scripts/fetch_pr_feedback.py [--pr NUMBER]
```

Returns JSON with feedback categorized as:
Expand All @@ -58,7 +60,7 @@ Stop if no PR exists for the current branch.

### 2. Check CI Status

Run `scripts/fetch_pr_checks.py` to get structured failure data.
Run `${CLAUDE_SKILL_ROOT}/scripts/fetch_pr_checks.py` to get structured failure data.

**Wait if pending:** If bot-related checks (sentry, codecov, cursor, bugbot, seer) are still running, wait before proceeding—they may post additional feedback.

Expand All @@ -73,7 +75,7 @@ Do NOT assume what failed based on check name alone—always read the logs.

### 4. Gather Review Feedback

Run `scripts/fetch_pr_feedback.py` to get categorized feedback.
Run `${CLAUDE_SKILL_ROOT}/scripts/fetch_pr_feedback.py` to get categorized feedback.

### 5. Handle Feedback by LOGAF Priority

Expand Down
44 changes: 22 additions & 22 deletions plugins/sentry-skills/skills/iterate-pr/scripts/fetch_pr_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,28 +77,28 @@ def extract_failure_snippet(log_text: str, max_lines: int = 50) -> str:
"""
lines = log_text.split("\n")

# Patterns that indicate failure points
# Patterns that indicate failure points (case-insensitive via re.IGNORECASE)
failure_patterns = [
r"(?i)error[:\s]",
r"(?i)failed[:\s]",
r"(?i)failure[:\s]",
r"(?i)traceback",
r"(?i)exception",
r"(?i)assert(ion)?.*failed",
r"(?i)FAILED",
r"(?i)panic:",
r"(?i)fatal:",
r"(?i)npm ERR!",
r"(?i)yarn error",
r"(?i)ModuleNotFoundError",
r"(?i)ImportError",
r"(?i)SyntaxError",
r"(?i)TypeError",
r"(?i)ValueError",
r"(?i)KeyError",
r"(?i)AttributeError",
r"(?i)NameError",
r"(?i)IndentationError",
r"error[:\s]",
r"failed[:\s]",
r"failure[:\s]",
r"traceback",
r"exception",
r"assert(ion)?.*failed",
r"FAILED",
r"panic:",
r"fatal:",
r"npm ERR!",
r"yarn error",
r"ModuleNotFoundError",
r"ImportError",
r"SyntaxError",
r"TypeError",
r"ValueError",
r"KeyError",
r"AttributeError",
r"NameError",
r"IndentationError",
r"===.*FAILURES.*===",
r"___.*___", # pytest failure separators
]
Expand All @@ -108,7 +108,7 @@ def extract_failure_snippet(log_text: str, max_lines: int = 50) -> str:
# Find lines matching failure patterns
failure_indices = []
for i, line in enumerate(lines):
if re.search(combined_pattern, line):
if re.search(combined_pattern, line, re.IGNORECASE):
failure_indices.append(i)

if not failure_indices:
Expand Down