feat(infra): add stale and Epic staleness detectors #437 #439#443
feat(infra): add stale and Epic staleness detectors #437 #439#443
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a42e978738
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const hasBlockerNote = comments.some(c => | ||
| typeof c.body === 'string' && c.body.includes('BLOCKER_NOTE') | ||
| ); |
There was a problem hiding this comment.
Treat escalation comments as valid Ready-SLA evidence
The Ready-SLA contract allows either a BLOCKER_NOTE or an escalation comment, but this predicate only searches for BLOCKER_NOTE. As a result, issues that are actually compliant via option (2) will still be flagged and receive escalation comments, creating false governance violations and unnecessary noise for P1 tickets.
Useful? React with 👍 / 👎.
| const res = await github.request( | ||
| 'GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues', | ||
| { owner, repo, issue_number: epic.number } | ||
| ); | ||
| subIssues = res.data; |
There was a problem hiding this comment.
Paginate sub-issue fetch before evaluating epic status
This call reads only one page of /sub_issues, but the endpoint is paginated (default 30). For epics with more than 30 children, allClosed/anyStarted are computed from a partial subset and can produce incorrect stale advisories (for example, first page closed while later pages still contain open children).
Useful? React with 👍 / 👎.
| const updatedAt = new Date(issue.updated_at); | ||
| if (updatedAt > twentyFourHoursAgo) continue; | ||
|
|
There was a problem hiding this comment.
Compute stall age from ready transition, not issue updated_at
Using issue.updated_at as the stall timer does not measure how long the ticket has remained in status:ready; any unrelated activity (comments, edits, label churn) resets updated_at and suppresses escalation even when the issue has been ready for well over 24 hours without required blocker/escalation evidence.
Useful? React with 👍 / 👎.
Summary
stale.yml(Add stale governance detector and P1 ready-stall cron #439):actions/stale@v9— labels issuesstatus:staleafter 30 days idle, never auto-closes, exempts active-status issuesp1-ready-stall.yml(Add stale governance detector and P1 ready-stall cron #439): Scheduledgithub-scriptcron (every 6h) — detects P1 issues atstatus:ready>24h withoutBLOCKER_NOTE, posts escalation commentepic-staleness.yml(Add Epic status staleness detector using native sub-issues API #437): Dailygithub-scriptcron — uses native sub-issues API (GA Dec 2024) to detect Epic status/child mismatches, posts advisory commentTest plan
stale.ymlviaworkflow_dispatch→ verify no issues affected yet (all exempted by active status)p1-ready-stall.ymlviaworkflow_dispatch→ verify it runs without errorepic-staleness.ymlviaworkflow_dispatch→ verify it runs without error (sub-issues empty → skips gracefully)npm run lintpasses (38, 67, 72 lines respectively)Closes #437
Closes #439
🤖 Generated with Claude Code