Repository navigation
Description
Problem
devops k8s catalog reads SLO specs only from <environment tree>/devops/monitoring/slos. The product specs stay in k8s/devops/monitoring/slos of this repository (#7290), and an environment repository holds no devops/ folder. A catalog of that tree lists no SLO. The command warns and succeeds.
Done when
- Decide the source of the product SLO specs, then a catalog of an environment tree lists them, or the document says that it does not.
Alternatives check of 2026-11-26: none.
Tool: none found.
Reason: Searches found SLO rule generators and a spec format (Sloth, Pyrra, OpenSLO), but each renders Prometheus rules or defines SLO YAML; none reads a product repository's SLO specs into an environment-tree catalog, so the source decision stays the project's own.
Lacks:
- No read of product repo SLO specs from a tree path
- No catalog document listing products and their SLOs
- No answer to which tree the catalog should read
Proposed design
Problem statement
devops k8s catalog reads SLO specs only from devops/monitoring/slos of the environment tree. The product specs live in k8s/devops/monitoring/slos of the devops-cli repository, and an environment repository holds no devops/ folder, so a catalog of that tree lists no SLO and only warns. The change reads the SLO specs of the environment tree and of the product base that resolve_product_root() gives, names the root and the path of each SLO in the document, and warns only when both roots hold none.
Acceptance criteria
Requirement: Product SLO source
devops k8s catalog SHALL list each Sloth spec under monitoring/slos of the product base k8s/devops for an environment tree that holds no devops/monitoring/slos.
Scenario: A tree with no devops folder
- WHEN a test runs
devops k8s catalog --format json --k8s-dir <tree>from a temporary repository whosek8s/devops/monitoring/slosholdsroadmap-service-rounds.yamland whose tree holds acatalog.tomlentry forroadmap-serviceand nodevops/monitoring/slos - THEN the JSON
sloslist holds one entry whosenameis thenameof that spec and whoseserviceisroadmap-service
Requirement: Environment tree override
An SLO spec of the environment tree MUST replace the product spec that holds the same service and SLO name.
Scenario: One SLO in both roots
- WHEN a test builds the catalog for a tree whose
devops/monitoring/slos/roadmap-service-rounds.yamlholdsservice = "roadmap-service"and SLOname = "rounds"with objective 99.9, and the product base holds a spec with the same service and name and objective 99 - THEN the catalog holds one SLO entry for that service and name, its objective is 99.9%, and its
sourcestarts withtree:
Requirement: Source in the document
The catalog document MUST name the root and the path of each SLO that it lists.
Scenario: A product SLO in the document
- WHEN a test renders the catalog document for a tree with no
devops/monitoring/slosand a product base whosemonitoring/slosholdsroadmap-service-rounds.yaml - THEN the SLO table row for that spec holds
product:monitoring/slos/roadmap-service-rounds.yamlin itsSourcecolumn
Requirement: Warning only when both roots hold none
devops k8s catalog SHALL warn about missing SLO specs only when the environment tree and the product base both hold none.
Scenario: Both roots empty
- WHEN a test runs
devops k8s catalog --format json --k8s-dir <tree>from a temporary repository whosek8s/devopsholds nomonitoring/slos, and the tree holds nodevops/monitoring/slos - THEN the JSON
sloslist is empty and standard error holds one warning that namesdevops/monitoring/slosandk8s/devops/monitoring/slos
Requirement: Generated command page
The command page of devops k8s catalog and docs/CLI_REFERENCE.md SHALL state the two SLO roots of the command.
Scenario: Docs regeneration
- WHEN the command help text names
devops/monitoring/slosandk8s/devops/monitoring/slos,uv run devops docs generatehas regenerated the pages, anduv run devops ci --check --only docsruns - THEN
uv run devops ci --check --only docsexits 0 with the regenerated command page and CLI reference
Existing Tool Considered
No open, maintained tool or library covers the need. The alternatives check of 2026-11-26 records the verdict none, and the closest tools it considered each stop short: Sloth (https://github.com/slok/sloth) and Pyrra (https://github.com/prometheus-community/pyrra) render Prometheus rules from SLO specs, and OpenSLO (https://github.com/OpenSLO/OpenSLO) defines an SLO document format; none reads the SLO specs of an environment tree and a product base into a service catalog document. The alternatives block of the issue body lists what no tool covers. The change builds its own code: it reads monitoring/slos of the product base as a second folder for _load_and_join_slos, merges the two sets, and adds a source field to each SLO summary. Cost of the code that the project builds and keeps: about 15k tokens to build, keep and fix it, and about 3 hours of elapsed time.
Key questions
- Which source holds the product SLO specs that a catalog of an environment tree lists?: The catalog reads two roots:
devops/monitoring/slosunder the environment tree root, andmonitoring/slosunder the product base thatresolve_product_root()gives, which isk8s/devopsof the repository of the current folder. The product specs arek8s/devops/monitoring/slos, so the folder under the product base ismonitoring/slosand not the tree-relativedevops/monitoring/slos. A catalog run from the devops-cli checkout therefore lists the product SLOs of an environment tree; a run inside an environment repository, which holds nok8s/devops, reads the tree only, and the warning and the command page say so. (best practice) [sources: src/devops_cli/k8s/environment.py:194, src/devops_cli/commands/grafana.py:285, src/devops_cli/prometheus/slo_rules.py:9, src/devops_cli/k8s/catalog.py:35]- Chosen: Environment tree, then the product base of the current repository.
devops grafana dashboardsalready reads its content from the environment tree and then from the product base of the current repository (src/devops_cli/commands/grafana.py:285), andresolve_product_rootgives that base (src/devops_cli/k8s/environment.py:194). The product specs are a folder of the product base,k8s/devops/monitoring/slos(src/devops_cli/prometheus/slo_rules.py:9). - Rejected: The environment tree only, and document the gap. An environment repository holds no
devops/folder, so every catalog of a tree would list no SLO, which is the gap this issue closes. - Rejected: Add a
--product-diroption todevops k8s catalog. The dashboards read the product base with no such option (src/devops_cli/commands/grafana.py:293), and a catalog of a tree runs from the devops-cli checkout or names the tree with--k8s-dir, so a second option adds CLI surface and regenerated docs for a case that the command page can state. - Rejected: The product base only. The SLO specs that an environment tree holds, and the override of a product objective that the SRE guideline gives the environment, would be lost.
- Chosen: Environment tree, then the product base of the current repository.
- Which root wins when the environment tree and the product base hold the same SLO?: The environment tree wins: its spec replaces the product spec with the same
serviceand SLOname, and the catalog drops the product spec before the two sets are joined. The SRE guideline gives the environment tree the SLO objectives that differ from a default, andload_slo_specsrefuses two specs with one service and one SLO name, so the merge must keep one of the pair. (best practice) [sources: docs/guidelines/sre.md:3, src/devops_cli/prometheus/slo_rules.py:199, src/devops_cli/k8s/catalog.py:850]- Chosen: The environment tree wins.
docs/guidelines/sre.md:3gives the README of the environment tree the SLO objectives that differ from a default, and the rule labels carry the service and the SLO name (src/devops_cli/prometheus/slo_rules.py:199), so one pair has one spec. - Rejected: The product base wins. The environment could then not set an objective that differs from the product default, which the SRE guideline gives it.
- Rejected: Refuse the pair with an error. A tree that tunes a product SLO would fail every catalog run, though the SRE guideline expects that override.
- Chosen: The environment tree wins.
- Which code resolves the path of the shipped product base
k8s/devopsfor thedevops k8scommands?:resolve_product_rootinsrc/devops_cli/k8s/environment.py:194: theproduct_dirargument when given, elsek8s/devopsof the repository that holds the current folder, from_PRODUCT_BASEatsrc/devops_cli/k8s/environment.py:34and the branch atsrc/devops_cli/k8s/environment.py:200.devops grafanacalls it with no argument (src/devops_cli/commands/grafana.py:293) anddevops k8s deploy-stackpasses its--product-diroption (src/devops_cli/commands/k8s/stack_lifecycle.py:1492). The SLO folder under that base ismonitoring/slos, so the specs arek8s/devops/monitoring/slos(src/devops_cli/prometheus/slo_rules.py:9). [sources: src/devops_cli/k8s/environment.py:194, src/devops_cli/k8s/environment.py:34, src/devops_cli/k8s/environment.py:200, src/devops_cli/commands/grafana.py:293, src/devops_cli/commands/k8s/stack_lifecycle.py:1492, src/devops_cli/prometheus/slo_rules.py:9] - How does the catalog document say which root an SLO came from?: The SLO table gains a
Sourcecolumn that holds the root name and the path of the spec under that root:tree:devops/monitoring/slos/<file>for the environment tree andproduct:monitoring/slos/<file>for the product base. Both paths are relative to their root, so the generatedCATALOG.mdstays the same on every machine that--checkcompares. (best practice) [sources: src/devops_cli/k8s/catalog.py:1037, src/devops_cli/k8s/catalog.py:188, src/devops_cli/k8s/catalog.py:35]- Chosen: A root-labelled relative path. The two roots give the same relative path in different repositories, so the
tree:andproduct:labels keep the origin readable, and a relative path keeps the generated file stable across machines. - Rejected: An absolute path.
CATALOG.mdis generated and compared with--check(src/devops_cli/commands/k8s/catalog.py:96), so an absolute path would differ per machine and host. - Rejected: No source column. With two roots and an override, a reader could not tell which root a listed SLO came from.
- Chosen: A root-labelled relative path. The two roots give the same relative path in different repositories, so the
- Must the change update the documents that name the SLO source?: Yes, in the same pull request.
k8s/README.mdstates the two roots in its SLO paragraph, the command help text names them, anduv run devops docs generateregeneratesdocs/commands/k8s.mdanddocs/CLI_REFERENCE.mdbeforeuv run devops ci --check --only docs. The change's spec delta replaces the requirementA tree with no SLO folder is said(openspec/specs/k8s-service-catalog/spec.md:135) with the both-roots rule, and the warning message insrc/devops_cli/lang/en/messages.py:806names both folders. (best practice) [sources: AGENTS.md:14, k8s/README.md:156, openspec/specs/k8s-service-catalog/spec.md:135, src/devops_cli/lang/en/messages.py:806, src/devops_cli/commands/k8s/catalog.py:67]- Chosen: Update the documents in the same pull request. AGENTS.md rule 8 makes a wrong document part of the same change, and the generated command page is refused by the
docsrow when it is not the output of its generator. - Rejected: Leave the documents unchanged.
k8s/README.mdand the generated command page would still name the environment tree as the only source, which the change makes wrong.
- Chosen: Update the documents in the same pull request. AGENTS.md rule 8 makes a wrong document part of the same change, and the generated command page is refused by the
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 26, 2026
Both concern the k8s service catalog command, but #5535 builds the catalog generator while the candidate fixes the SLO spec read path it uses.devops-cli-service commentedon Nov 26, 2026
The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.
Searches (10)
Tools considered:
Searches run:
Sources:
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.
devops-cli-service commentedon Nov 29, 2026
Released in v0.243.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.243.0
devops-cli-service commentedon Nov 29, 2026
Live since 2026-11-29 03:13 UTC