Skip to content

fix(roadmap): keep other projects' workload names out of the review #6615

Closed

Description

@dan-petty

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 rows fact reads only the project namespaces (a namespace matcher, for example a {namespaces} placeholder that config gives), or removes namespace and pod from its by clause.
  • A loader rule, beside unscoped_service_metric, refuses a rows fact that groups by namespace or pod with 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 rows fact that groups by namespace with 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

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 rows fact that groups by namespace with no namespace matcher
  • THEN the loader raises the unscoped_workload_metric error.

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 namespace devops
  • 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_metric error 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 rows facts exclude workloads outside the project namespaces?: Add a {namespaces} placeholder and a namespace=~"{namespaces}" matcher to each of the seven facts. Keep the namespace and pod labels in the by clauses. (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 namespace and pod from each by clause. It hides the names but still counts other projects' workloads, so the facts stay wrong.
    • Rejected: Filter rows after dispatch. The data.json already holds the foreign names, so the leak remains.
  • Where should the loader read the project namespaces?: Use a {namespaces} placeholder supplied by the project-review config. Add a namespaces list 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_metric beside unscoped_service_metric. It refuses a rows fact that uses namespace or pod in a by or on clause and has no namespace=~ matcher. (best practice) [sources: src/devops_cli/roadmap/project_review/catalog.py:226, src/devops_cli/roadmap/project_review/catalog.yaml]
    • Chosen: Check the by and on labels. It finds the name leak and also catches a join on namespace with no matcher.
    • Rejected: Reject any query that mentions namespace. Many valid queries use namespace in a selector that already has a matcher.
    • Rejected: Keep only the current unscoped_service_metric rule. The seven workload facts stay unprotected.
  • 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_maxmemory and prometheus.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

  1. dan-petty commented on Nov 21, 2026

    @dan-petty
    OwnerAuthor
    • Priority: P1-High. Other projects' namespace and pod names are actively published in the review report via #4733, an ongoing data leak.
    • Related: fix(roadmap): correct the facts and the stage SLI of the review #6612, which asks for a different change. 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.
  2. added
    type/bug
    source/agent
    scope/roadmap
    status/new
    value/medium
    effort/low
    priority/p1-high
    on Nov 21, 2026
  3. devops-cli-service commented on Nov 21, 2026

    @devops-cli-service
    Contributor

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

  4. devops-cli-service commented on Nov 21, 2026

    @devops-cli-service
    Contributor

    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:

    • PromQL linter detect queries without namespace matcher, results: 5
    • open source tool validate custom YAML query catalog scope namespace Kubernetes, results: 5
    • python promql parser library parse query labels, results: 5
    • pint prometheus rule linter query checks, results: 5
    • "pint" prometheus rules linter github cloudflare, results: 5

    Sources:

  5. added
    status/ready
    and removed
    status/new
    on Nov 21, 2026
  6. devops-cli-service commented on Nov 21, 2026

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. See the section Proposed design of the body.

  7. added
    owner/agent
    status/in-progress
    and removed
    status/ready
    on Nov 21, 2026
  8. added
    status/in-review
    and removed
    status/in-progress
    on Nov 21, 2026
  9. removed
    status/in-review
    owner/agent
    on Nov 21, 2026
  10. devops-cli-service commented on Nov 21, 2026

    @devops-cli-service
    Contributor
  11. devops-cli-service commented on Nov 21, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-21 16:05 UTC

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/p1-highscope/roadmapsource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions