Repository navigation
Description
Problem
Seven cluster-wide rows facts of the project review catalog (src/devops_cli/roadmap/project_review/catalog.yaml, PR #6586) group by namespace or pod over all namespaces of the shared cluster, with no namespace matcher: prometheus.requests_over_allocatable, prometheus.working_set_over_limit, prometheus.cpu_throttling, prometheus.restarting_containers, prometheus.valkey_memory, prometheus.valkey_no_maxmemory and prometheus.database_memory. The dispatcher keeps each label of a series. So the data.json of the review of one repository can hold the namespace and pod names of the workloads of other projects. The header rule of the catalog says only "A query gives no host name: no grouping by node or instance". The loader check unscoped_service_metric covers only the Service metrics.
Live (read-only, 7 days, 2026-11-21): prometheus.database_memory gave 15 rows. One row named the namespace and the database pod of another project on the cluster. #4733 publishes the review data, so these names would go into the report of devops-cli.
Expected
- Each cluster-wide
rowsfact reads only the project namespaces (a namespace matcher, for example a{namespaces}placeholder that config gives), or removesnamespaceandpodfrom itsbyclause. - A loader rule, beside
unscoped_service_metric, refuses arowsfact that groups bynamespaceorpodwith no namespace matcher. - The header rule of the catalog says "no name of a workload outside the project namespaces".
Acceptance criteria
- Test first: a catalog with a
rowsfact that groups bynamespacewith no namespace matcher is refused. The test fails on the base. - A test: the shipped catalog loads.
- The live check after the merge: a 7-day review, read-only, gives no row with a namespace outside the project namespaces.
Dependencies
- fix(roadmap): correct the facts and the stage SLI of the review #6612 changes the same file: no merge order, rebase before the second.
Source
Source: #6586
Alternatives check of 2026-11-21: none.
Tool: none found.
Reason: Searches found no open tool for this: pint lints Prometheus rule files, not the project's own rows catalog, and promql-parser only parses queries. The loader rule and {namespaces} substitution stay in-house.
Lacks:
- No rule that refuses an unscoped namespace or pod grouping
- No {namespaces} placeholder substituted from the review config
- No linter for the project's own rows catalog format
Proposed design
Problem statement
Seven cluster-wide rows facts in the project review catalog read all namespaces. The review of one repository can publish the namespace and pod names of other projects. The change scopes the seven facts to the project namespaces. It adds a loader rule that refuses an unscoped workload grouping. It states the workload privacy rule in the catalog header.
Acceptance criteria
Requirement: Reject unscoped workload rows
The catalog loader SHALL refuse a rows fact that groups by namespace or pod and has no namespace matcher.
Scenario: Unscoped workload grouping
- WHEN a test catalog holds a
rowsfact that groups bynamespacewith no namespace matcher - THEN the loader raises the
unscoped_workload_metricerror.
Requirement: Substitute project namespaces
The catalog loader MUST replace the {namespaces} placeholder in a query with the project namespaces from the project-review config.
Scenario: Namespace placeholder replacement
- WHEN the loader loads a catalog whose query holds
{namespaces}and the config gives the namespacedevops - THEN the query that the loader returns holds
namespace=~"devops".
Requirement: Scope shipped catalog
The shipped catalog.yaml MUST scope each of the seven cluster-wide rows facts to the project namespaces.
Scenario: Seven facts scoped
- WHEN a person runs the live 7-day read-only project review after the merge
- THEN the review loads the shipped catalog with no
unscoped_workload_metricerror and no row from the seven facts names a namespace outside the project namespaces.
Existing Tool Considered
The alternatives check in the issue body records verdict none and no tool. It considered pint and promql-parser, and neither covers the need. No open, maintained tool covers this internal catalog privacy rule. The change builds the rule and the {namespaces} substitution in the existing Python loader. The written cost is about 8,000 tokens and 3 hours to build, keep and fix.
Key questions
- How should the seven cluster-wide
rowsfacts exclude workloads outside the project namespaces?: Add a{namespaces}placeholder and anamespace=~"{namespaces}"matcher to each of the seven facts. Keep thenamespaceandpodlabels in thebyclauses. (best practice) [sources: src/devops_cli/roadmap/project_review/catalog.yaml, src/devops_cli/roadmap/project_review/catalog.py:226]- Chosen: Add a
{namespaces}matcher. It removes foreign workloads before the dispatcher reads them and keeps the per-workload rows. - Rejected: Remove
namespaceandpodfrom eachbyclause. It hides the names but still counts other projects' workloads, so the facts stay wrong. - Rejected: Filter rows after dispatch. The
data.jsonalready holds the foreign names, so the leak remains.
- Chosen: Add a
- Where should the loader read the project namespaces?: Use a
{namespaces}placeholder supplied by the project-review config. Add anamespaceslist to that config if it has none. The loader joins the list with|for the Prometheus regex matcher. (best practice) [sources: src/devops_cli/roadmap/project_review/catalog.py:226, src/devops_cli/roadmap/project_review/catalog.yaml]- Chosen: Project-review config. One value serves all facts and can change for each reviewed repository.
- Rejected: Hard-code namespaces in each fact. It duplicates the value and makes a second repository wrong.
- Rejected: Read namespaces from cluster manifests at review time. It adds a cluster read and fails when the manifests are absent.
- What loader rule should refuse an unscoped workload grouping?: Add
unscoped_workload_metricbesideunscoped_service_metric. It refuses arowsfact that usesnamespaceorpodin abyoronclause and has nonamespace=~matcher. (best practice) [sources: src/devops_cli/roadmap/project_review/catalog.py:226, src/devops_cli/roadmap/project_review/catalog.yaml]- Chosen: Check the
byandonlabels. It finds the name leak and also catches a join onnamespacewith no matcher. - Rejected: Reject any query that mentions
namespace. Many valid queries usenamespacein a selector that already has a matcher. - Rejected: Keep only the current
unscoped_service_metricrule. The seven workload facts stay unprotected.
- Chosen: Check the
- Which facts need the namespace matcher?: All seven facts:
prometheus.requests_over_allocatable,prometheus.working_set_over_limit,prometheus.cpu_throttling,prometheus.restarting_containers,prometheus.valkey_memory,prometheus.valkey_no_maxmemoryandprometheus.database_memory. [sources: src/devops_cli/roadmap/project_review/catalog.yaml] - What should the catalog header say about workload names?: Add the sentence 'no name of a workload outside the project namespaces' to the header rule. Keep the existing host-name rule. (best practice) [sources: src/devops_cli/roadmap/project_review/catalog.yaml]
- Chosen: Extend the header rule. The header is the catalog contract for every fact author.
- Rejected: Add no header text. A new fact author would not know the workload privacy rule.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 21, 2026
Other projects' namespace and pod names are actively published in the review report via #4733, an ongoing data leak.Both fix defects in catalog.yaml from PR #6586, but #6612 corrects wrong metric bases while the candidate adds namespace matchers to stop cross-project name leakage.devops-cli-service commentedon Nov 21, 2026
Next step: the alternatives check records a verdict. See the section Proposed design of the body.
devops-cli-service commentedon Nov 21, 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 (5)
Tools considered:
Searches run:
Sources:
devops-cli-service commentedon Nov 21, 2026
Next step: the stage job writes the plan of the item. See the section Proposed design of the body.
test(roadmap): add failing tests of more labels of the row guard (#6615)
fix(roadmap): check the namespace labels of a scrape and Argo CD in t…
docs(roadmap): say that only rows facts read the project namespaces (#…
test(security): list the variable of the project review namespaces (#…
devops-cli-service commentedon Nov 21, 2026
Released in v0.188.1: https://github.com/dan-petty/devops-cli/releases/tag/v0.188.1
devops-cli-service commentedon Nov 21, 2026
Live since 2026-11-21 16:05 UTC