Skip to content

fix(roadmap): count each implement outcome once with its repo - #4903

Merged
dan-petty merged 3 commits into
mainfrom
fix/4703-implement-outcome-counter
Nov 12, 2026
Merged

dan-petty merged 3 commits into
mainfrom
fix/4703-implement-outcome-counter

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

The result of devops_cli_service_implement_jobs_total is failed for an attempt that left a failure class. A runner that writes its own stop exits 0, so its Job is Complete, and the counter counted each stop as succeeded. Now each count of devops_cli_service_implement_failures_total is also one failed attempt.

A round also reports the Job of a closed item while the cluster holds that Job, because the pull request of a Job can merge and close its item before the round. A closed item is no stop. A closed item whose Job is gone is not reported.

run_implement_round refuses an empty repo before any request, so no counter of the round gets a series with no repository.

Closes #4703

Change: openspec/changes/archive/2026-11-12-4703-count-each-implement-outcome-once-with/

@dan-petty dan-petty added type/bug Type bug: the code does not do what it must scope/roadmap The roadmap jobs: intake, refine, stage, implement and the Service that runs them labels Nov 12, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

The count against kube-state-metrics

I measured on 2026-11-11 with Prometheus and Loki. Each query is in the table, so a person can run it again.

The 7 days of the issue (2026-11-04T14:51:23Z to 2026-11-11T14:51:23Z)

Fact Query Value
Runner Jobs that started count((max by (job_name) (max_over_time(kube_job_status_start_time{namespace="devops", job_name=~"devops-cli-runner-.*"}[8d])) > 1793804483) < 1794409883) 93
Jobs that the Service created (Loki) sum(count_over_time({namespace="devops", container="service"} |= "created devops-cli-runner-" [7d])) 94
Jobs that the Service reported (Loki) sum(count_over_time({namespace="devops", container="service"} |~ "implement row of .* reported 1 Job" [7d])) 93
First sample of the jobs counter min(min_over_time(timestamp(devops_cli_service_implement_jobs_total)[8d:10m])) 2026-11-08T22:39:21Z

The jobs counter came with #4185 on 2026-11-08, so it existed for 2.7 of the 7 days: 84 of the 93 runner Jobs started before it. The 19 failure series with no repo all end before 2026-11-05T17:29Z, before #3680 added the label. So "8 against 94" and "25.7 with no repo" come mostly from the age of the series, not from the current code.

Since the jobs counter exists (2026-11-08T22:39Z to 2026-11-11T22:39Z)

Fact Value
Runner Jobs that started (kube-state-metrics) 9
... with kube_job_status_succeeded 1 / kube_job_status_failed 1 9 / 0
sum by (result) (increase(devops_cli_service_implement_jobs_total{job="roadmap-service"}[72h])) succeeded 7.05, failed 0, gone 0
sum by (class) (increase(devops_cli_service_implement_failures_total{job="roadmap-service"}[72h])) limit_reached 3.01, conflict 1.02, test 1.00

The 2 Jobs that the counter does not have:

  1. devops-cli-runner-20261110-000512-7baf delivered pull request fix(k8s): move the mattermost database off the control plane #4304, which merged at 00:33:15Z, about 1 minute after the Job ended. Its item fix(k8s): move the mattermost database off the control plane #3647 closed first, and the round reads only open items, so no round reported it. This pull request fixes that: the round reports the Job of a closed item while the cluster holds the Job (ttlSecondsAfterFinished: 86400).
  2. devops-cli-runner-20261110-140833-a7fa was reported at 14:37:25Z by a pod that started to shut down at 14:37:02Z. Its last scrape was at 14:36:15Z, so the count was lost. fix(service): keep the counts that the Service makes while it stops #4876 fixes that in the Service shutdown.

The 5 failures are 5 of the 7 succeeded counts: a runner that writes its stop exits 0. This pull request fixes that: the result is failed when the report finds a failure class.

What the counter gives for these 9 Jobs after this pull request

Result Before After
succeeded 7 3
failed 0 5
Total 7 of 9 8 of 9, and 9 of 9 after #4876

The acceptance check of the issue needs 7 days of the new counter after the deploy. Query for that check: sum(increase(devops_cli_service_implement_jobs_total{job="roadmap-service"}[7d])) against count(max by (job_name) (max_over_time(kube_job_status_start_time{namespace="devops", job_name=~"devops-cli-runner-.*"}[7d])) > (time() - 7*86400)).

Tests

uv run devops ci fail-to-pass --base origin/main: 3 failed on base (3 failed and 66 passed in tests/roadmap/implement/test_roadmap_implement_submit.py; 0 errored). The 3 tests are the stop with exit 0, the Job of a closed item, and the round with no repository.

@dan-petty
dan-petty marked this pull request as ready for review November 12, 2026 02:53
@devops-cli-service

Copy link
Copy Markdown
Contributor

Pull request #4903 has merge conflicts with main at commit 8b9046abdca8. GitHub cannot merge it. Rebase the branch onto the current main, resolve the conflicts and push the branch.

The result label of devops_cli_service_implement_jobs_total is failed for
an attempt with a failure class, because a runner that writes its stop
exits 0. A round reports the Job of a closed item while the cluster holds
the Job, and a closed item is no stop. The implement round refuses an
empty repo before any request.
@dan-petty
dan-petty force-pushed the fix/4703-implement-outcome-counter branch from 8b9046a to 85a38cb Compare November 12, 2026 04:34
@dan-petty
dan-petty enabled auto-merge (squash) November 12, 2026 04:36
@dan-petty
dan-petty merged commit c17f71f into main Nov 12, 2026
27 checks passed
@dan-petty
dan-petty deleted the fix/4703-implement-outcome-counter branch November 12, 2026 04:46
dan-petty pushed a commit that referenced this pull request Nov 12, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.116.0](v0.115.0...v0.116.0)
(2026-11-12)


### Features

* **gh:** name the gh groups issue, run, label and secret
([#4923](#4923))
([2dd4c97](2dd4c97))


### Bug Fixes

* **ci:** set job timeouts from the measured run times
([#4892](#4892))
([e26dde5](e26dde5))
* **design:** check the design test bound and source hex values
([#4922](#4922))
([e2c1a5a](e2c1a5a))
* **k8s:** check the credential sync context as a kubeconfig name
([#4916](#4916))
([8797c88](8797c88))
* **roadmap:** bound the stage gate returns and start no return in a
drain ([#4925](#4925))
([77eed38](77eed38))
* **roadmap:** count each implement outcome once with its repo
([#4903](#4903))
([c17f71f](c17f71f))
* **roadmap:** refine looks again at a wait that older rules set
([#4919](#4919))
([e6f7cb9](e6f7cb9))


### Performance Improvements

* **k8s:** put the dependencies in their own image layers
([#4872](#4872))
([48dc866](48dc866))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/roadmap The roadmap jobs: intake, refine, stage, implement and the Service that runs them type/bug Type bug: the code does not do what it must

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(roadmap): count each implement outcome once with its repo

1 participant