Skip to content

feat(recorder): record completed CI job timings - #105

Merged
tbhb-agent merged 1 commit into
mainfrom
agent/ci-timing-b2
Nov 24, 2026
Merged

tbhb-agent merged 1 commit into
mainfrom
agent/ci-timing-b2

Conversation

@tbhb-dev-agent-pull-requests

@tbhb-dev-agent-pull-requests tbhb-dev-agent-pull-requests Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Why

CI failure counts leave queue delays and job runtimes invisible. Completed jobs need timing metrics and logs across every conclusion.

Behavior change

Record queue and run histograms in seconds with repository, workflow, job, conclusion, event class, and runner attributes. Emit a finished log with numeric durations when timestamps support them. Keep the failure log and counter. Claim each job ID before recording. A duplicate delivery doesn't record anything. A claim error returns so the delivery can retry. Skip jobs without an ID and skip durations with missing, invalid, or reversed timestamps.

Decisions

Chose the metric names from the brief because they define this change's interface. The catalog uses a different naming scheme from the code. This change keeps github.ci.job.queue_seconds and github.ci.job.run_seconds. Reuse the existing milestone ledger with a decimal job ID and the ci_job suffix.

Deviations from the task

No scope deviations.

Needs human judgment

The branch rule approximates the triggering event. Scheduled and manual runs on the default branch count as push. Other triggers on non-default branches count as pull_request.

Risk

Tech debt: REST lookup, backfill, sweep integration, reconciler integration and deploy configuration remain out of scope. Trigger classification relies on the documented branch approximation. The existing ledger keeps the job claims.

Verification

Formatting and bazelisk run //:gazelle completed. bazelisk test //:golangci_lint_test passed. Across the whole tree, tests reported: Executed 19 out of 34 tests: 33 tests pass and 1 was skipped. The skipped target checks the Windows workspace status script. Deploy testing passed too. Size came to: pr_size: code=351/400 raw=422/1500. Tests cover branch classification, runner selection, success and failure recording, redelivery, timestamp skips, and claim errors.

Human steering

The brief defines the metrics, claim semantics, logging fields, and scope limits.

Assisted-by: LLM effort=medium;harness=claude-code:2.1.331;model=anthropic:claude-sonnet-5-5;session=sha-256-64:6507fa80a17e0653;surface=cli

Generated-by: LLM effort=high;harness=codex:0.171.0;model=openai:gpt-6.1-sol;session=sha-256-64:524a7bd302fd1c59;surface=exec
@tbhb-agent
tbhb-agent merged commit 7151ded into main Nov 24, 2026
8 checks passed
@tbhb-agent
tbhb-agent deleted the agent/ci-timing-b2 branch November 24, 2026 21:05
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