ci: report job durations + queue-delay warning in merge gate#117
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CI runtime visibility in the shared Merge Gate
What
Adds CI runtime visibility to the shared Merge Gate. The
gatejob now writesa per-job run report to
$GITHUB_STEP_SUMMARY:(
completed_at - started_at), and queue delay (started_at - created_at),sourced from the Actions jobs API.
5 minutes in
queuedbefore a runner picked it up.Why here (not the watchdog)
The queue-delay scan needs final
created_at/started_at/completed_attimestamps. The
gatejob runs last, when every sibling is in a terminalstate, 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
always()+continue-on-error, sothe table renders even on a failed gate and a report hiccup never gates a merge.
actions: read(jobs API) +contents: read(sparsecheckout) to the
gatejob only — both within the STANDARD caller grant(
contents: read,pull-requests: read,actions: write), so it neverexceeds what callers grant and cannot poison graph validation.
scripts/ci-gate-run-report.sh,invoked via the same sparse-checkout pattern as the existing watchdog — no
complex inline bash in YAML.
Verification
actionlintclean on_ci-gate.yml.shellcheckclean onci-gate-run-report.sh.(durations, running-job
—, and the >5min flag all correct).🤖 Generated with Claude Code
https://claude.ai/code/session_01Vds3voWPSNVK76u7E4rei4