Repository navigation
feat(recorder): record completed CI job timings - #105
Merged
Merged
Conversation
Generated-by: LLM effort=high;harness=codex:0.171.0;model=openai:gpt-6.1-sol;session=sha-256-64:524a7bd302fd1c59;surface=exec
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.
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_secondsandgithub.ci.job.run_seconds. Reuse the existing milestone ledger with a decimal job ID and theci_jobsuffix.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 aspull_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 //:gazellecompleted.bazelisk test //:golangci_lint_testpassed. 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