Skip to content

ci: report job durations + queue-delay warning in merge gate#117

Merged
openbao-service-broker[bot] merged 1 commit into
mainfrom
feat/ci-duration-summary
Jul 23, 2026
Merged

ci: report job durations + queue-delay warning in merge gate#117
openbao-service-broker[bot] merged 1 commit into
mainfrom
feat/ci-duration-summary

Conversation

@openbao-service-broker

Copy link
Copy Markdown
Contributor

CI runtime visibility in the shared Merge Gate

What

Adds CI runtime visibility to the shared Merge Gate. The gate job now writes
a per-job run report to $GITHUB_STEP_SUMMARY:

  • A table of every job in the run: result, execution duration
    (completed_at - started_at), and queue delay (started_at - created_at),
    sourced from the Actions jobs API.
  • A loud runner-capacity warning naming any job that waited longer than
    5 minutes in queued before a runner picked it up.

Why here (not the watchdog)

The queue-delay scan needs final created_at/started_at/completed_at
timestamps. The gate job runs last, when every sibling is in a terminal
state, so timestamps are final — the watchdog runs mid-flight and would read
partial data. Both the table and the warning must also share one job's step
summary, so they belong together in gate.

Safety / invariants

  • Non-blocking: the report steps are always() + continue-on-error, so
    the table renders even on a failed gate and a report hiccup never gates a merge.
  • Permissions: adds actions: read (jobs API) + contents: read (sparse
    checkout) to the gate job only — both within the STANDARD caller grant
    (contents: read, pull-requests: read, actions: write), so it never
    exceeds what callers grant and cannot poison graph validation.
  • No new third-party actions. Logic lives in scripts/ci-gate-run-report.sh,
    invoked via the same sparse-checkout pattern as the existing watchdog — no
    complex inline bash in YAML.

Verification

  • actionlint clean on _ci-gate.yml.
  • shellcheck clean on ci-gate-run-report.sh.
  • jq table + queue-delay logic validated against a sample jobs payload
    (durations, running-job , and the >5min flag all correct).

🤖 Generated with Claude Code

https://claude.ai/code/session_01Vds3voWPSNVK76u7E4rei4

The Merge Gate job now writes a per-job run report to the step summary:
each job's result, execution duration, and queue delay, sourced from the
Actions jobs API. It also appends a runner-capacity warning naming any job
that waited longer than 5 minutes in queue before a runner picked it up.

The gate job runs last with every sibling in a terminal state, so job
timestamps are final there — the only point where a queue-delay scan reads
true values. The report is non-blocking (always + continue-on-error) so it
renders on a failed gate and never gates a merge. Adds `actions: read` to
the gate job (within the standard caller grant) for the jobs API, and
delegates the logic to scripts/ci-gate-run-report.sh, matching the existing
watchdog sparse-checkout pattern.

Assisted-by: Claude:claude-opus-4-8[1m]
Claude-Session: https://claude.ai/code/session_01Vds3voWPSNVK76u7E4rei4
@openbao-service-broker
openbao-service-broker Bot merged commit 3e4935b into main Jul 23, 2026
19 checks passed
@openbao-service-broker
openbao-service-broker Bot deleted the feat/ci-duration-summary branch July 23, 2026 19:17
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