Skip to content

test(monitoring): run the product rule fixtures and list each product alert #7314

Backlog

Description

@dan-petty

Problem

After #7290, no check runs promtool test rules over the rule fixtures in tests/fixtures/prometheus_rules/. Also, some alerts of k8s/devops/monitoring/prometheus-rules-values.yaml have no row in the Alerting table of k8s/README.md, for example Crawl4AIUnavailable and RoadmapServiceItemStuck.

Done when

  • A gate row runs promtool test rules over each remaining fixture, and the row fails when a fixture holds no case.
  • Each product alert has a row in the Alerting table.

Alternatives check of 2026-11-26: not-applicable.
Class: test, no search.
Tool: none found.

Proposed design

Problem statement

No gate runs promtool test rules over the remaining rule fixtures. Some product alerts have no row in the Alerting table. Add the gate and the missing rows.

Acceptance criteria

Requirement: Rule fixtures gate

The CI gate SHALL run promtool test rules over each fixture in tests/fixtures/prometheus_rules/.

Scenario: Each fixture runs

  • WHEN uv run devops ci --check --only prometheus-rules runs.
  • THEN The command runs promtool test rules on each fixture and exits zero when each fixture passes.

Requirement: Empty fixture fails

The CI gate MUST fail when a rule fixture holds no test case.

Scenario: Empty fixture

  • WHEN A file in tests/fixtures/prometheus_rules/ holds no alert_rule_test or promql_expr_test case and uv run devops ci --check --only prometheus-rules runs.
  • THEN The command exits non-zero and names the fixture with no case.

Requirement: Alerting table complete

The k8s check SHALL fail when a product alert in k8s/devops/monitoring/prometheus-rules-values.yaml has no row in the Alerting table of k8s/README.md.

Scenario: Missing product alert row

  • WHEN A product alert has no row in the Alerting table and uv run devops ci --check --only k8s runs.
  • THEN The command exits non-zero and names the missing alert.

Requirement: Named alerts have rows

The Alerting table SHALL hold a row for Crawl4AIUnavailable and for RoadmapServiceItemStuck.

Scenario: Rows for the two named alerts

  • WHEN uv run devops ci --check --only k8s runs.
  • THEN The command exits zero and lists a row for each named alert.

Existing Tool Considered

The alternatives check in the issue body gives not-applicable for the test class and records Tool: none found. The change uses the open promtool from Prometheus, which the issue body names, to run the fixtures. The row adds a case count check for an empty fixture.

Key questions

  • Which gate row runs promtool test rules?: Add a prometheus-rules row to devops ci and include it in the required checks. The row runs promtool test rules on each fixture in tests/fixtures/prometheus_rules/. (best practice) [sources: docs/CLI_REFERENCE.md, tests/fixtures/prometheus_rules/crawl4ai_tests.yaml, tests/fixtures/prometheus_rules/roadmap_service_items_tests.yaml]
    • Chosen: New prometheus-rules row. It keeps rule tests apart from the k8s manifest row and lets the empty-fixture check fail alone.
    • Rejected: Extend the k8s row. It mixes rule tests with manifest validation and makes the failure less clear.
  • How does the row fail on a fixture with no case?: The row runs promtool test rules for each fixture. Before each run, it checks that the fixture holds at least one alert_rule_test or promql_expr_test case. It fails with the fixture path when none exists. (best practice) [sources: tests/fixtures/prometheus_rules/crawl4ai_tests.yaml, tests/fixtures/prometheus_rules/roadmap_service_items_tests.yaml]
    • Chosen: Case count check with shell grep. It adds no code and makes the empty case fail before promtool.
    • Rejected: Rely on promtool alone. The issue says the row must fail on an empty fixture, so the row cannot rely on promtool alone.
  • How does the Alerting table stay complete?: Extend the k8s check to compare each product alert name in k8s/devops/monitoring/prometheus-rules-values.yaml with the Alerting table in k8s/README.md. Add the missing rows, including Crawl4AIUnavailable and RoadmapServiceItemStuck. (best practice) [sources: k8s/devops/monitoring/prometheus-rules-values.yaml, k8s/README.md]
    • Chosen: Add a completeness check to the k8s row. The table cannot lose a row without a failed check.
    • Rejected: Add the missing rows only. The table can become incomplete again with no failed check.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    type/test
    source/agent
    on Nov 26, 2026
  2. dan-petty commented on Nov 26, 2026

    @dan-petty
    OwnerAuthor
  3. added
    status/new
    value/medium
    effort/low
    scope/monitoring
    priority/p2-medium
    on Nov 26, 2026
  4. added
    status/ready
    and removed
    status/new
    on Nov 28, 2026
  5. devops-cli-service commented on Nov 28, 2026

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. 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/p2-mediumscope/monitoringsource/agentstatus/readytype/testvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions