PR Health Pack
PR Health Pack continuously monitors your pull requests for common health issues and assigns each PR a health score. By catching stale PRs, oversized diffs, and missing test coverage early, your team ships faster with fewer surprises at merge time.
How It Works
PR Health Pack bundles multiple rules that evaluate your open pull requests. Each rule detects a specific health concern and contributes a weighted score to the overall PR health rating. When issues are found, TinyOps sends notifications through your configured channels so the right people can act.
Scans run in batches of 10 PRs at a time to avoid overwhelming your GitHub API rate limits.
Health Score Calculation
The health score starts at 100 and decreases based on triggered findings:
health_score = max(0, 100 - (totalWeight / maxPossibleWeight) * 100)Each rule has a severity weight that determines its impact on the score:
| Rule | Weight |
|---|---|
| Stale PR | 3 |
| Oversized PR | 2 |
| Missing Tests | 2 |
A PR that triggers all three rules would have a score of max(0, 100 - (7/7) * 100) = 0. A PR with only a missing tests finding scores max(0, 100 - (2/7) * 100) = 71.
Live Rules
Stale PR Detection
Flags PRs that have been inactive for 7 or more days. Uses a poll trigger that checks every hour.
name: stale-pr-detection
trigger:
type: poll
interval: 1h
condition:
field: pr.last_activity_days
operator: gte
value: 7
action:
type: notify
channel: slack
message: "PR #{{pr.number}} has been inactive for {{pr.last_activity_days}} days"
severity_weight: 3Oversized PR Warning
Flags PRs with 500 or more changed lines. Fires immediately on PR open via webhook trigger.
name: oversized-pr-warning
trigger:
type: webhook
event: pull_request.opened
condition:
field: pr.changed_lines
operator: gte
value: 500
action:
type: notify
channel: slack
message: "PR #{{pr.number}} has {{pr.changed_lines}} changed lines. Consider splitting."
severity_weight: 2Missing Tests Alert
Detects PRs that modify source code but include no test file changes (files matching *.test.*).
name: missing-tests-alert
trigger:
type: webhook
event: pull_request.opened
condition:
field: pr.has_test_files
operator: eq
value: false
action:
type: notify
channel: email
message: "PR #{{pr.number}} has no test file changes"
severity_weight: 2Coming Soon
| Rule | Description |
|---|---|
| Review SLA Monitor | Alerts when a PR has waited 24 hours without a review |
| Risky Merge Guard | Warns on merges attempted after 4 PM on Fridays |
Managing Findings
When a health check triggers, you can take action on individual findings:
- Snooze: Temporarily suppress the finding. Set an expiry (e.g., 24 hours, 3 days, 1 week) after which the finding reactivates.
- Dismiss: Permanently mark the finding as not applicable for this PR.
Snoozed findings automatically reactivate after their expiry period. Dismissed findings are permanent for the specific PR but the rule continues to evaluate future PRs normally.
Related
- Policies - enforce merge conditions based on health scores
- Simulation Mode - test health pack rules without sending notifications
- Schedules - customize poll intervals for stale detection