Skip to content

Refactor github-actions to pr-status skill#29

Merged
stephen-tatari merged 5 commits into
mainfrom
worktree-pr-status-refactor
Mar 4, 2026
Merged

Refactor github-actions to pr-status skill#29
stephen-tatari merged 5 commits into
mainfrom
worktree-pr-status-refactor

Conversation

@stephen-tatari
Copy link
Copy Markdown
Owner

Summary

  • Rename github-actions/ skill to pr-status/ — refocused as general-purpose PR merge readiness analyzer
  • Rewrite bash helper script as Python CLI (pr_status.py) using uv PEP 723 inline script metadata
  • 11 subcommands: diagnose (primary), status, checks, comments, bot-comments, failed-runs, analyze-logs, required-checks, missing-checks, check-cli, detect-repo
  • Diagnose covers: draft status, merge state, review decision, unresolved threads, stale approvals, CI checks, missing required checks, bot error comments
  • Bot detection via [bot] suffix (not hardcoded list), branch protection via legacy API + rulesets fallback

Test plan

  • python3 -c "import ast; ast.parse(...)" — syntax check passes
  • uv run --script pr-status/scripts/pr_status.py --help — CLI loads
  • uv run --script pr-status/scripts/pr_status.py detect-repo — repo detection works
  • prek run --files ... — pre-commit checks pass
  • uv run --script pr-status/scripts/pr_status.py diagnose <pr> — test against a real PR

Rewrite as general-purpose PR merge readiness
analyzer in Python with 11 subcommands covering
CI, reviews, bot comments, and missing checks.
Use shebang for direct execution, remove redundant
uv run invocations. Fix find_error_keywords and
is_stale_approval bugs. Add 34 tests for pure fns.
Fix conflict regex to match plurals, sort run IDs
numerically. Add tests for URL variants, word
boundaries, timezone offsets, parser validation.
- Remove reviewThreads from gh pr view (not a valid
  field); fetch via GraphQL API instead
- Move --format from parent parser to subcommands so
  `diagnose --format json <url>` works
- Update parser tests for per-subcommand format flag
Add optional PR arg for cross-repo usage and replace
head-only truncation with head+tail to capture errors.
@stephen-tatari stephen-tatari marked this pull request as ready for review March 4, 2026 17:32
@stephen-tatari stephen-tatari merged commit 90b1ab1 into main Mar 4, 2026
2 checks passed
@stephen-tatari stephen-tatari deleted the worktree-pr-status-refactor branch March 4, 2026 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant