Skip to content

test(roadmap): compare each dashboard panel value with roadmap explain #3851

Open

Description

@devops-cli-service

Split from #3217.

The dashboard panel agreement with devops roadmap explain cannot be tested today. The panels are totals by repository and class, so no panel value equals one item's value. #3655 compares the panel values with the job record of a sample item. This test compares them with the explain output. The part is deferred because the panels need a per-item series. A test can then compare one value with the explain output of a fixture item. This part waits on #3217, which adds the totals to explain output. Acceptance criteria: a test SHALL compare each dashboard panel value with the explain output for a fixture item; the test SHALL fail when a panel value differs from the explain output.

Proposed design

Problem statement

#3217 added the totals of the last implement run to devops roadmap explain --json. The roadmap dashboard shows the implement counters as totals by repository and item class, so one panel value never equals one item's value. A fixture item that is the only item of its repository and item class makes the panel total equal that item's own value. This item adds an offline test that evaluates each such panel query with promtool and compares the value with the explain total of the fixture item.

Acceptance criteria

Requirement: Panel value equals explain

The test SHALL compare each implement dashboard panel value that has a counterpart in devops roadmap explain --json with the value that the command reports for a fixture item.

Scenario: Token and repair-round panels equal explain

  • WHEN The test emits the implement series of a fixture item that is the only item of its repository and item class, replaces the dashboard variables of the token and repair-round panel queries, evaluates them with promtool test rules, and reads devops roadmap explain --json for that item.
  • THEN The token panel value equals tokens_total, the repair-round panel value equals repair_rounds, and the test passes.

Requirement: A panel mismatch fails the test

The test SHALL fail, and name the panel, the panel value and the explain value, when a panel value differs from the explain output.

Scenario: Panel value differs

  • WHEN The test gives the comparison a panel value that differs from the explain total of the fixture item.
  • THEN The comparison fails and its message names the panel, the panel value and the explain value.

Requirement: The implement counters keep their bounded labels

The change MUST keep the label sets of the implement counters bounded and SHALL NOT add an item or issue-number label to any Service metric.

Scenario: No item label on the implement counters

  • WHEN A test reads the label names of the four implement counters from the counter definitions in src/devops_cli/config/constants.py.
  • THEN No label name is item or issue, and the test passes.

Existing Tool Considered

No alternatives check has run for this item. promtool is the open, maintained tool that evaluates PromQL rules offline. The project runs it from the devtools image in tests/prometheus/test_k8s_monitoring_alerting.py. promtool test rules evaluates a PromQL expression over fixture series with no server. It does not read a Grafana dashboard panel, replace a dashboard variable, or read devops roadmap explain. The change builds the glue: a pytest module that reads the implement panel queries, emits the fixture item's series, renders each query as a temporary recording rule, takes the expected value from explain --json, and runs promtool test rules. Written cost: about 20,000 tokens to build and fix, about 2,000 tokens a year to keep, and about 45 minutes of elapsed time.

Key questions

  • Which dashboard panel values have a counterpart in devops roadmap explain --json?: Two panels: the implement token panel and the implement repair-round panel. TraceTotals in src/devops_cli/roadmap/explain.py holds tokens_total, seconds_total, repair_rounds, outcomes and dropped. The implement counters are the job count, the repair rounds, the tokens and the consecutive failures. No panel total matches the job count, the outcomes or the dropped events, and no implement counter records the model seconds. [sources: src/devops_cli/roadmap/explain.py:79, src/devops_cli/config/constants.py, tests/fixtures/dashboard_queries/roadmap-pipeline.yaml]
  • How does the test get one panel value that equals the explain total of one item?: Use a fixture item that is the only item of its repository and item class. Emit its implement series, evaluate the panel query with promtool test rules, and compare the result with devops roadmap explain --json for that item. The total of one item is the whole aggregate, so the test needs no per-item series and no new label. (best practice) [sources: tests/prometheus/test_k8s_monitoring_alerting.py, tests/fixtures/dashboard_queries/roadmap-pipeline.yaml, src/devops_cli/roadmap/explain.py:79]
    • Chosen: Single-item fixture evaluated with promtool. The panel aggregate equals the one fixture item's total, and promtool evaluates the panel's own PromQL, so a wrong panel query fails.
    • Rejected: Per-item series with an item label. It adds unbounded cardinality to the Service counters, and the project rejected an issue number in labels.
    • Rejected: Recompute the panel aggregation in Python. It restates the query in Python, so a wrong panel query would still pass.
  • What does this item wait on?: Nothing. feat(roadmap): report pipeline outcomes in roadmap explain #3217 no longer blocks: TraceTotals at src/devops_cli/roadmap/explain.py:79 holds the run totals, and the module docstring names feat(roadmap): report pipeline outcomes in roadmap explain #3217. The dashboard queries of the implement token and repair-round counters are in tests/fixtures/dashboard_queries/roadmap-pipeline.yaml, and tests/grafana/test_grafana_dashboards.py covers the same counters. feat(roadmap): a dashboard and alerts for the pipeline #3655 compares these panels with the job record of a sample item, so it is a related item and no dependency. [sources: src/devops_cli/roadmap/explain.py:79, tests/fixtures/dashboard_queries/roadmap-pipeline.yaml, tests/grafana/test_grafana_dashboards.py]
  • Does the test add an item or issue-number label to a Service metric?: No. The test adds no metric and no label. It reads the existing panel queries and uses the existing labels of the counters with a fixture item that is the only item of its repository and class, so each label set stays bounded. (best practice) [sources: tests/fixtures/dashboard_queries/roadmap-pipeline.yaml, src/devops_cli/config/constants.py]
    • Chosen: Single-item fixture over the existing labels. The existing label sets stay bounded, and one fixture item makes the aggregate equal its own value.
    • Rejected: Per-item series with an item label. It adds unbounded cardinality to the Service counters.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/test
    scope/roadmap
    status/new
    value/medium
    effort/low
    on Nov 6, 2026
  2. devops-cli-service commented on Nov 6, 2026

    @devops-cli-service
    ContributorAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/test. The test prefix of the title gives the type.
    • Scope: scope/roadmap. The (roadmap) scope of the title gives the scope.
    • Priority: P3-Low. The test is deferred and depends on #3217 completing first.
    • Value: Medium. It validates dashboard correctness but is a test, not a user-facing change.
    • Effort: Low. A single test comparing panel values to explain output for a fixture item.
    • Related: feat(roadmap): report pipeline outcomes in roadmap explain #3217, which asks for a different change. Both concern dashboard panel agreement with explain output, but #3217 delivers the explain reporting while the candidate delivers only the test.
  3. added
    priority/p3-low
    on Nov 6, 2026
  4. devops-cli-service commented on Nov 9, 2026

    @devops-cli-service
    ContributorAuthor

    Refine cannot set this item to Ready at 1b37dbc while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.

    The next refine round also looks at the item again when a commit on the default branch changes one of these files: k8s/monitoring/dashboards/devops-cli.json, tests/grafana/test_grafana_dashboards.py.

  5. dan-petty commented on Nov 14, 2026

    @dan-petty
    Owner

    Blocked on #3655: this test compares implement dashboard panel values with , and the implement panels do not exist yet. The design states that #3655 charts the four implement metrics, and no dashboard under k8s/monitoring holds them: the LLM stack dashboard carries the pipeline totals only. No test can compare a panel query that no dashboard declares. The test follows #3655 with the same fixture item.

  6. devops-cli-service commented on Nov 19, 2026

    @devops-cli-service
    ContributorAuthor

    Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.

  7. devops-cli-service commented on Nov 28, 2026

    @devops-cli-service
    ContributorAuthor

    Next step: the alternatives check records a verdict. See the section Proposed design of the body.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lowpriority/p3-lowscope/roadmapsource/agentstatus/newtype/testvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions