Repository navigation
Add CI queue snapshot harness for #2605 post-change measurement - #12906
Conversation
After this PR, `bash .github/scripts/ci-queue-snapshot.sh --repo developing-today/code` prints queued/in_progress totals, queued-by-event, oldest queued run, fresh in_progress pickups, and stale (>24h) queued residue.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 43 minutes. View limit details
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 867b8d907d
ℹ️ 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".
| gh api "repos/$REPO/actions/runs?status=queued&per_page=100" --paginate \ | ||
| --jq '{total_count: ([.workflow_runs] | length), workflow_runs: ([.workflow_runs] | add // [])}' >"$TMP/queued.json" |
There was a problem hiding this comment.
Aggregate API pages before calculating queue statistics
When either status has more than 100 runs, the live snapshot produces incorrect totals and event counts. Checked gh api --help: “Each page is a separate JSON array or object”; --paginate does not combine pages before applying this query. Consequently, [.workflow_runs] | add only unwraps the current page, and the output file contains multiple objects. Downstream jq calls emit separate totals and oldest-run candidates per page rather than repository-wide statistics. Aggregate all pages into one workflow_runs array before calculating the summary, and apply the same fix to the in-progress fetch.
Useful? React with 👍 / 👎.
Summary
Adds a committed post-change measurement harness for #2605 (hosted-runner queue saturation):
.github/scripts/ci-queue-snapshot.shplus golden-corpus contract tests (.github/scripts/ci-queue-snapshot.test.sh), wired intoworkflow-lint. After this PR,bash .github/scripts/ci-queue-snapshot.sh --repo developing-today/codeprints queued/in_progress totals, queued-by-event, oldest queued run, fresh in_progress pickups (<2h old = runners live), and stale queued residue (>24h).This is the criterion-3 slice of #2605 (feature-slice: for a missed performance target the first slice is the profile — the measurement harness with the command and its number).
Evidence
Ran on the laptop at 867b8d9 (live API, 2026-11-23T04:35Z):
Before (filing, 2026-10-30): 425 queued / 5 in progress; PR runs queued ~2h with no runner.
After (this shift, committed command output):
Reading: all 59 queued runs are >24h old (2026-11-11 phantom residue, zero-job class the API refuses to cancel — uncancellable, holds no runner); all 6 in_progress runs were created within minutes. No fresh work is waiting: median queue wait for live work is minutes, materially below the ~2h at filing. Criteria 1 (dominant contributors measured) and 2 (sweeper #9993/#9998, concurrency, nightly ci-policy) were already landed; this harness makes criterion 3 verifiable and repeatable.
Tests (narrowest build, laptop):
bash .github/scripts/ci-queue-snapshot.test.sh→ PASS (totals, by-event, oldest, fresh, stale, strict-arg rejections)bash .github/scripts/check-ci-policy-agreement.sh→ OK (10 workflows, 0 disagreements)Merge Danger
Low. Two new standalone scripts plus a two-line workflow-lint step addition. No trigger, permission, or enablement changes; no in-flight runs touched. Worst case: a typo'd test step fails workflow-lint's manual run, fixed by reverting the two lines.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.