Skip to content

Add CI queue snapshot harness for #2605 post-change measurement - #12906

Merged
dezren39 merged 1 commit into
mainfrom
lane-oc-code-07/2605-queue-snapshot
Nov 23, 2026
Merged

dezren39 merged 1 commit into
mainfrom
lane-oc-code-07/2605-queue-snapshot

Conversation

@dezren39

@dezren39 dezren39 commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds a committed post-change measurement harness for #2605 (hosted-runner queue saturation): .github/scripts/ci-queue-snapshot.sh plus golden-corpus contract tests (.github/scripts/ci-queue-snapshot.test.sh), wired into workflow-lint. 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 (<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):

ci-queue-snapshot: queued_total=59 in_progress_total=6
ci-queue-snapshot: queued_by_event issues=11 pull_request=40 push=8
ci-queue-snapshot: oldest_queued id=43096512057 created=2026-11-11T20:30:57Z
ci-queue-snapshot: fresh_in_progress=6
ci-queue-snapshot: stale_queued_older_than_24h=59

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)
  • Not run here: full workflow-lint (needs actionlint binary; nightly/manual venue covers it).

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.


Start Proof
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

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.
@dezren39
dezren39 requested a review from a team as a code owner November 23, 2026 04:47
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T04:55:02.030213Z 867b8d9 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f3f084ce-55d9-4844-9d5f-39538fd69fe3
Commits

Reviewing files that changed from the base of the PR and between 1db3530 and 867b8d9.

Files selected for processing: 3

  • .github/scripts/ci-queue-snapshot.sh
  • .github/scripts/ci-queue-snapshot.test.sh
  • .github/workflows/workflow-lint.yml
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

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

Copy link
Copy Markdown

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

Comment on lines +140 to +141
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"

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

@dezren39
dezren39 removed the request for review from a team November 23, 2026 05:55
@dezren39
dezren39 merged commit fb5ea07 into main Nov 23, 2026
2 checks passed
@dezren39
dezren39 deleted the lane-oc-code-07/2605-queue-snapshot branch November 23, 2026 06:11
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.

1 participant