fix(compliance): unbreak daily re-trigger sweep + throttle to one issue per repo#432
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis PR refactors the dev-lead compliance re-triggering system: it converts the dev-lead library to sourced-only with improved ISO-8601 timestamp parsing, adds per-run per-repo throttling and deferred-issues metrics to the compliance script, updates both primary and legacy issue sweeps to paginate and respect engagement limits, and shifts the workflow schedule to 05:00 UTC. ChangesCompliance Re-triggering Overhaul
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related issues
Possibly related PRs
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Dev-Lead — fix-bot-comment (no-changes)Agent reasoning |
There was a problem hiding this comment.
Code Review
This pull request migrates the legacy claude label to dev-lead across the compliance audit and re-trigger scripts, introducing a shared helper library dev-lead-retrigger.sh and a one-time migration script. Feedback on these changes highlights a starvation risk in the daily sweep due to missing pagination on the issue search, a potential script crash from fragile ISO 8601 timestamp parsing in the helper library, and an incomplete migration risk caused by the default limit of the GitHub CLI issue list command.
There was a problem hiding this comment.
Pull request overview
Fixes the daily compliance re-trigger sweep by restoring a valid GitHub search/issues query and adding per-repo throttling so dev-lead is re-engaged gradually (oldest-first) without causing bursty concurrent runs. This also standardizes the trigger label to dev-lead (vs legacy claude) and updates audit/retrigger workflows accordingly.
Changes:
- Update daily re-trigger sweep search + add “≤1 engagement per repo per run” throttling.
- Introduce shared
dev-leadre-trigger helper library and reuse it from both daily sweep and weekly audit. - Switch cron schedule for the sweep and update workflows/docs to use
dev-leadlabel (plus a one-time label migration script).
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
scripts/migrate-claude-label.sh |
Adds a one-time org migration script to move open issues from claude → dev-lead and optionally delete the old label. |
scripts/lib/dev-lead-retrigger.sh |
New shared helpers to detect active dev-lead work and cycle the trigger label safely. |
scripts/compliance-retrigger.sh |
Fixes the org search query and adds per-repo throttling + shared helper usage. |
scripts/compliance-audit.sh |
Updates audit issue labeling to dev-lead and re-triggers persistent findings via shared helpers. |
.github/workflows/compliance-retrigger.yml |
Moves the scheduled run time to 05:00 UTC (midnight Central during DST). |
.github/workflows/compliance-audit-and-improvement.yml |
Updates guidance/output plumbing to reflect dev-lead labeling and adds issues_retriggered output. |
…ue per repo The daily sweep failed every run since 2026-06-05: GitHub now rejects search/issues queries that omit is:issue/is:pull-request with HTTP 422. Both the primary and legacy-label sweep queries omitted it. Add is:issue to both (the primary failure aborted the whole run; ~107 stale dev-lead issues piled up across the fleet). Also throttle re-triggering to avoid the fleet-wide burst that stranded the work in the first place — cycling every stale issue at once queues many concurrent dev-lead runs in a single repo (rebase storms, token exhaustion): - One engagement per repo per run, shared across the primary and legacy sweeps via a run-scoped REPO_ENGAGED set. - Process issues oldest-first (sort=created&order=asc) so the most-stuck finding per repo is the one re-engaged; the daily cadence drains the rest. - --paginate both queries so a single repo's large backlog cannot fill the first result page and starve every other repo (gemini review). - Slurp-aware total_count / error-detection for paginated multi-object output. - break (not continue) at the first non-stale issue — global ascending sort means no older issues remain (Copilot review). - Mark a repo engaged regardless of cycle outcome, so a transient failure cannot let a second issue in the same repo fire (Copilot review). Move the sweep to 12:00 AM Central (05:00 UTC) to run off-peak. Closes #431. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
b057e08 to
1b8730a
Compare
Dev-Lead — review-changes (applied)Changes committed and pushed. |
|
…ue per repo (#432) * fix(compliance): unbreak daily re-trigger sweep + throttle to one issue per repo The daily sweep failed every run since 2026-06-05: GitHub now rejects search/issues queries that omit is:issue/is:pull-request with HTTP 422. Both the primary and legacy-label sweep queries omitted it. Add is:issue to both (the primary failure aborted the whole run; ~107 stale dev-lead issues piled up across the fleet). Also throttle re-triggering to avoid the fleet-wide burst that stranded the work in the first place — cycling every stale issue at once queues many concurrent dev-lead runs in a single repo (rebase storms, token exhaustion): - One engagement per repo per run, shared across the primary and legacy sweeps via a run-scoped REPO_ENGAGED set. - Process issues oldest-first (sort=created&order=asc) so the most-stuck finding per repo is the one re-engaged; the daily cadence drains the rest. - --paginate both queries so a single repo's large backlog cannot fill the first result page and starve every other repo (gemini review). - Slurp-aware total_count / error-detection for paginated multi-object output. - break (not continue) at the first non-stale issue — global ascending sort means no older issues remain (Copilot review). - Mark a repo engaged regardless of cycle outcome, so a transient failure cannot let a second issue in the same repo fire (Copilot review). Move the sweep to 12:00 AM Central (05:00 UTC) to run off-peak. Closes #431. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * chore: apply manual instructions [skip ci-relay] --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
…ue per repo (#432) * fix(compliance): unbreak daily re-trigger sweep + throttle to one issue per repo The daily sweep failed every run since 2026-06-05: GitHub now rejects search/issues queries that omit is:issue/is:pull-request with HTTP 422. Both the primary and legacy-label sweep queries omitted it. Add is:issue to both (the primary failure aborted the whole run; ~107 stale dev-lead issues piled up across the fleet). Also throttle re-triggering to avoid the fleet-wide burst that stranded the work in the first place — cycling every stale issue at once queues many concurrent dev-lead runs in a single repo (rebase storms, token exhaustion): - One engagement per repo per run, shared across the primary and legacy sweeps via a run-scoped REPO_ENGAGED set. - Process issues oldest-first (sort=created&order=asc) so the most-stuck finding per repo is the one re-engaged; the daily cadence drains the rest. - --paginate both queries so a single repo's large backlog cannot fill the first result page and starve every other repo (gemini review). - Slurp-aware total_count / error-detection for paginated multi-object output. - break (not continue) at the first non-stale issue — global ascending sort means no older issues remain (Copilot review). - Mark a repo engaged regardless of cycle outcome, so a transient failure cannot let a second issue in the same repo fire (Copilot review). Move the sweep to 12:00 AM Central (05:00 UTC) to run off-peak. Closes #431. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * chore: apply manual instructions [skip ci-relay] --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>



Summary
Fixes the daily compliance re-trigger sweep, which had been failing every day since 2026-06-05 and leaving ~107 stale
dev-leadcompliance issues stuck across the fleet.Closes #431.
Changes
search/issuesqueries that omitis:issue/is:pull-requestwith HTTP 422. Addedis:issueto the query inscripts/compliance-retrigger.sh.sort=created&order=asc) and re-trigger at most one issue per repo, deferring the rest to later daily sweeps. A repo already active (opendev-leadPR or in-progress issue) consumes its slot. Prevents the fleet-wide burst (63 concurrent dev-lead runs in dry-run) that caused rebase storms and token exhaustion — the failure mode that stranded the work originally.0 5 * * *, 05:00 UTC) so it runs off-peak.Validation
workflow_dispatchdry-runs on this branch:First green retrigger runs since 2026-06-05.
Note on DST
GitHub cron is fixed UTC and does not observe DST;
05:00 UTC= 12:00 AM CDT (summer) / 11:00 PM CST (winter), matching the repo's existing CDT annotation convention.Context
Part of the Compliance program initiative (GH Project #1 Initiatives) / "Compliance Blitz" effort.
Summary by CodeRabbit