Repository navigation
Description
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 rulesover 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-rulesruns. - THEN The command runs
promtool test ruleson 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 noalert_rule_testorpromql_expr_testcase anduv run devops ci --check --only prometheus-rulesruns. - 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 k8sruns. - 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 k8sruns. - 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 aprometheus-rulesrow todevops ciand include it in the required checks. The row runspromtool test ruleson each fixture intests/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-rulesrow. It keeps rule tests apart from thek8smanifest row and lets the empty-fixture check fail alone. - Rejected: Extend the
k8srow. It mixes rule tests with manifest validation and makes the failure less clear.
- Chosen: New
- How does the row fail on a fixture with no case?: The row runs
promtool test rulesfor each fixture. Before each run, it checks that the fixture holds at least onealert_rule_testorpromql_expr_testcase. 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 beforepromtool. - Rejected: Rely on
promtoolalone. The issue says the row must fail on an empty fixture, so the row cannot rely onpromtoolalone.
- Chosen: Case count check with shell
- How does the Alerting table stay complete?: Extend the
k8scheck to compare each product alert name ink8s/devops/monitoring/prometheus-rules-values.yamlwith the Alerting table ink8s/README.md. Add the missing rows, includingCrawl4AIUnavailableandRoadmapServiceItemStuck. (best practice) [sources: k8s/devops/monitoring/prometheus-rules-values.yaml, k8s/README.md]- Chosen: Add a completeness check to the
k8srow. 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.
- Chosen: Add a completeness check to the
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 26, 2026
Both target product rule testing in k8s/devops/monitoring/prometheus-rules-values.yaml, but #5011 uses pint to check series existence while the candidate uses promtool to verify rule firing on fixtures and documents alerts.devops-cli-service commentedon Nov 28, 2026
Next step: the stage job writes the plan of the item. See the section Proposed design of the body.