Skip to content

feat(infra): add stale and Epic staleness detectors #437 #439#443

Open
chf3198 wants to merge 1 commit intomainfrom
feat/437-439-stale-epic-governance
Open

feat(infra): add stale and Epic staleness detectors #437 #439#443
chf3198 wants to merge 1 commit intomainfrom
feat/437-439-stale-epic-governance

Conversation

@chf3198
Copy link
Copy Markdown
Owner

@chf3198 chf3198 commented Apr 24, 2026

Summary

Test plan

  • Trigger stale.yml via workflow_dispatch → verify no issues affected yet (all exempted by active status)
  • Trigger p1-ready-stall.yml via workflow_dispatch → verify it runs without error
  • Trigger epic-staleness.yml via workflow_dispatch → verify it runs without error (sub-issues empty → skips gracefully)
  • npm run lint passes (38, 67, 72 lines respectively)

Closes #437
Closes #439

🤖 Generated with Claude Code

…439 #437

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 24, 2026 16:19
@chf3198 chf3198 had a problem deploying to collaborator-gate April 24, 2026 16:19 — with GitHub Actions Failure
@github-actions
Copy link
Copy Markdown

Messages
📖

Danger: ticket-first, branch, and title checks complete. Failures block merge; warnings are advisory.

Generated by 🚫 dangerJS against a42e978

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +42 to +44
const hasBlockerNote = comments.some(c =>
typeof c.body === 'string' && c.body.includes('BLOCKER_NOTE')
);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment on lines +34 to +38
const res = await github.request(
'GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues',
{ owner, repo, issue_number: epic.number }
);
subIssues = res.data;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment on lines +33 to +35
const updatedAt = new Date(issue.updated_at);
if (updatedAt > twentyFourHoursAgo) continue;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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.

Add stale governance detector and P1 ready-stall cron Add Epic status staleness detector using native sub-issues API

2 participants