Skip to content

fix(roadmap): eval grades counts the result lines of Job pods - #5569

Merged
dan-petty merged 8 commits into
mainfrom
fix/5556-grades-read-job-pod-lines
Nov 13, 2026
Merged

dan-petty merged 8 commits into
mainfrom
fix/5556-grades-read-job-pod-lines

Conversation

@dan-petty

@dan-petty dan-petty commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

devops roadmap eval grades and the panels of the row Roadmap Job Success read the result lines of the Service, of the stage Job pods and of the fix-plan Job pods. One constant, RESULT_LINES, holds the selector (the containers service, stage and fix-plan of the namespace devops) and the parse of the two forms of a line: the JSON line of the Service and the plain line of a Job pod. A dashboard test holds each panel query to it.

The stage Job now writes its result line to stderr, because a CLI process has no handler for these INFO records. The actor that writes the check-in of an attempt writes its line. The Job writes it only when its check-in found its check-out, or when no check-out named it at its start, as for a Job that a person starts. So each attempt counts once.

Before this change, fix_plan showed 0 attempts, and a stage attempt in a Job wrote no line.

Closes #5556

Change: openspec/changes/archive/2026-11-13-5556-grades-read-job-pod-lines/

Plan the change that makes the job grades and the job success panels
read the result lines of the Job pods. The fix-plan Jobs write a plain
line on stderr that no query reads. The stage Jobs write no line to the
log, because a CLI process has no handler for INFO records.
The grades read the containers of the units that write result lines:
service, stage and fix-plan. One base, RESULT_LINES, parses a JSON line
of the Service by its message field and a plain line of a Job pod as it
is. The drop of the error label of the json parser stops the refusal of
Loki for a plain line, and a filter keeps only a line that starts with
the prefix.

A fake Loki in the tests runs the queries of the report on streams of
labels and lines, and refuses a pipeline error as Loki does.
devops roadmap stage --job-item writes the round lines and the result
line to stderr as plain text, as devops roadmap step fix-plan does. The
stderr handler moves to job_lines_to_stderr in roadmap/job_result.py,
and both commands use it.

The actor that writes the check-in of a stage attempt writes its line.
The Job logs its line after its check-in, and only when the check-in
found its check-out or the pod has no Job name. When the Service ended
the attempt, or the check-in fails, the Job writes no line, and the
recovery of the Service writes the line of the failed end.
The four queries of the row Roadmap Job Success start with RESULT_LINES
of the job grades, so the panels count the lines of the Service, of the
stage Jobs and of the fix-plan Jobs. A test holds each count of the
dashboard to the constant. The documents give the two forms of a line
and the rule that the writer of the check-in writes the line.
Only the result line of the stage Job waits for its check-in. The
counter devops_cli_roadmap_stage_total counts the item of the plan
before the check-in again, as on main and as a round does, so a Job
whose check-in finds no check-out or fails still counts its item.
The paragraph about the two forms of a line split the list of the
fields of the line. Move it after the list. The stage row of the job
table names the stage Job and the recovery of the Service. TESTING.md
names the Loki fake and records that it has no contract suite yet.
@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 13, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Checks and evidence

Premise (live Loki, namespace devops, 7 days). The Service logs JSON on stdout with the line in message. The fix-plan Job pods (container fix-plan) log a plain line on stderr. The stage Job pods (label devops-cli-job, container stage) wrote no result line: a CLI process has no handler for the INFO records of devops_cli.roadmap.job_result. The OpenTelemetry log streams have service_name and no namespace label, so the selector does not read a line twice.

Live query with the new base (instant, 7 days to 2026-11-13T23:50Z): alternatives 35, fix_plan 2, implement 15, intake 306, refine 101, refine_judge 7, stage 19. The old base gave fix_plan 0. With the old base and a selector that reads the fix-plan pods, Loki answers HTTP 400 pipeline error: 'JSONParserErr'.

Tests

  • uv run devops ci fail-to-pass --base origin/main: exit 0. 7 tests fail on base and pass on head (2 grade report, 4 stage Job, 1 dashboard). No unchanged test fails.
  • pytest tests/roadmap/test_job_grade_report.py tests/roadmap/test_job_result.py tests/roadmap/stage tests/commands/test_roadmap_step_fix_plan.py tests/commands/test_roadmap_eval_grades.py tests/prometheus tests/grafana tests/invariants tests/docs: 4151 passed, 1 skipped.
  • devops ci --check --only lint,format,domain,docs,k8s,test-tree,constructs,swallowed-failures,startup-imports,test-settings,deps,typecheck: all pass. devops ci --check --only openspec: pass.

Render diff (kubectl kustomize at origin/main and at the branch)

  • k8s/monitoring: one object changes, ConfigMap monitoring/grafana-devops-cli-dashboards, key devops-cli.json: the 4 Loki queries of the row Roadmap Job Success and 2 panel descriptions. The metadata does not change. The generator sets disableNameSuffixHash, so the name stays and no pod restarts. The Grafana sidecar reloads the dashboard.
  • k8s/devops: no change.
  • Old base: {namespace="devops", app_kubernetes_io_name=~"roadmap-service|devops-cli-job", container=~"service|stage"} |= "roadmap job result:" | json message | line_format "{{.message}}"
  • New base: {namespace="devops", container=~"service|stage|fix-plan"} |= "roadmap job result:" | json message | drop __error__, __error_details__ | line_format "{{ or .message __line__ }}" |~ "^roadmap job result: "

Review fixes in this pull request

  • The stage Job counts its item in devops_cli_roadmap_stage_total before its check-in again, as on main. Only the result line waits for the check-in. A new test holds this.
  • docs/roadmap/job-success.md: the paragraph about the two forms of a line no longer splits the list of the fields, and the stage row names the stage Job and the recovery of the Service.
  • docs/TESTING.md names the Loki fake and records that it has no contract suite yet.

After the release (a person): run devops roadmap eval grades --window 7d. The fix_plan row shows the Loki attempts, and the stage Job attempts of the new image appear. Releases 0.133.0 and 0.134.0 do not hold this change, so their stage Job pods write no result line.

@dan-petty
dan-petty force-pushed the fix/5556-grades-read-job-pod-lines branch from cc9ce77 to 792d8bc Compare November 13, 2026 23:30
@dan-petty

Copy link
Copy Markdown
Owner Author

Second push: a stage Job that a person starts

devops k8s run-job --template stage gives the Job a name (adhoc_name) and writes no check-out. Before this push, the check-in of such a Job found no check-out, so the Job wrote no result line, and the Service had no check-out to recover. That attempt was lost.

Now the Job reads at its start whether the check-out names it. A Job that no check-out named writes its own line, at a normal end and at a deadline end. A Job that the Service checked out keeps the rule of the first push.

  • uv run devops ci fail-to-pass --base b2c27c656 (the commit before this fix): exit 0. test_a_job_that_a_person_starts_logs_its_result_line and test_a_deadline_end_logs_one_result_line[person-job] fail there and pass on head.
  • pytest tests/roadmap/test_job_grade_report.py tests/roadmap/test_job_result.py tests/roadmap/stage tests/commands/test_roadmap_step_fix_plan.py tests/commands/test_roadmap_eval_grades.py tests/commands/k8s tests/prometheus tests/grafana tests/invariants tests/docs: 4759 passed, 1 skipped.
  • Static rows, mypy and openspec: all pass. The render diff of the first comment does not change.
  • The Job makes one more store read at its start (one GitHub request in the budget of the pod).

The stage Job reads at its start whether the check-out names it. The
Service knows only such an attempt: it recovers it and writes its line
when the Job does not check in. A Job that devops k8s run-job starts
has a Job name and no check-out, so its check-in finds nothing and the
Service cannot recover it. Such a Job now writes its own line, at a
normal end and at a deadline end, so its attempt counts once.
Move the change to the archive and apply its deltas to the specs
roadmap-job-grades and roadmap-stage/job.
@dan-petty
dan-petty force-pushed the fix/5556-grades-read-job-pod-lines branch from 792d8bc to 908f17f Compare November 13, 2026 23:34
@dan-petty
dan-petty marked this pull request as ready for review November 13, 2026 23:41
@dan-petty

Copy link
Copy Markdown
Owner Author

Check results

Head commit: 908f17fdc657b0356744f99747fc4f36d3a4f45e

Check Conclusion Link
Tests & Coverage success run
devops-cli success run
zizmor success run
trivy-config success run
CodeQL success run
Test Job Duration skipped run
Tests on Main skipped run
Dependency Freshness skipped run
Design Tokens success run
Tests & Coverage (shard 4 of 4) success run
Runner Image success run
Static Analysis success run
Tests & Coverage (shard 2 of 4) success run
MCP Server Image success run
Changed-Test Independence success run
Service Image success run
Tests & Coverage (shard 3 of 4) success run
Tests & Coverage (shard 1 of 4) success run
Plan Check skipped run
Analyze (python) success run
Analyze (actions) success run
Image Pins success run
Semantic PR title success run
Fail-to-Pass Check success run
Docs Site Build success run

Fail-to-pass run: https://github.com/dan-petty/devops-cli/actions/runs/43528090184/job/132238708696

Skipped check: Test Job Duration
Skipped check: Tests on Main
Skipped check: Dependency Freshness
Skipped check: Plan Check

@dan-petty
dan-petty merged commit 1eb3ea4 into main Nov 13, 2026
25 checks passed
@dan-petty
dan-petty deleted the fix/5556-grades-read-job-pod-lines branch November 13, 2026 23:46
dan-petty pushed a commit that referenced this pull request Nov 13, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.134.1](v0.134.0...v0.134.1)
(2026-11-13)


### Bug Fixes

* **k8s:** the DeepSeek gateway group gets a fallback group
([#5565](#5565))
([183487d](183487d))
* **roadmap:** eval grades counts the result lines of Job pods
([#5569](#5569))
([1eb3ea4](1eb3ea4))

---
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): eval grades counts the result lines of Job pods

1 participant