Skip to content

build(catalog): render every catalog chart one way, wherever it is rendered - #299

Merged
stxkxs merged 4 commits into
mainfrom
claude/catalog-one-render
Nov 29, 2026
Merged

stxkxs merged 4 commits into
mainfrom
claude/catalog-one-render

Conversation

@stxkxs

@stxkxs stxkxs commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

The Druid catalog chart was rendered in three places, and each spelled its own helm template command:

  • task render;
  • CI's validate job;
  • check-serviceaccount-bindings.py.

The first two passed the nine synthetic tenant inputs as --set flags. The third passed one of them, hostedId, and no environment. This gives the render one definition, so what one renderer checks is what the others check. The image gates read the same definition in the follow-up PR.

What changed

catalog/druid/ci-values.yaml (new) holds the tenant inputs: hostedId, the four secret paths and the three buckets. The environment stays per render.

scripts/catalog.py (new) is the one place that builds the command:

  • release ci, namespace <name>-ci;
  • the chart's values.yaml, then its ci-values.yaml;
  • --set environment=<env>.

Its population is catalog/*/chart, the glob the ServiceAccount gate already read. main() writes each render to a path naming the chart, and render() hands the manifests to a gate. For development, staging, production and hub, its render is byte for byte what the --set flags produced.

Exit status:

  • 1: a chart without its tenant inputs, or one helm refuses. The run fails, and the other charts still render.
  • 2: helm is missing, a render runs past its 120-second bound, or no chart matches.

It is a module, like gatelib.py and verdicts.py, so it carries no positive control of its own. The validate job now sets up Python from .python-version to run it.

The renderers.

  • task render and the validate job call python3 scripts/catalog.py. task render also now stops on a chart that does not render. The helm line it replaces wrote an empty file and went on.
  • check-serviceaccount-bindings.py renders through catalog.render(). An empty catalog is now could-not-run (exit 2) rather than a finding, and so is a render that never finished. Its verdict on the real tree is unchanged: druid has 4 ServiceAccounts, 3 of them used by pods.

Tests and harnesses.

  • scripts/tests/test_catalog.py (new) covers discovery, the command, each way a render ends, what main() writes and exits with, and the real tree's inputs. It holds the module at 100% of its lines and branches, and run.py makes that the module's floor.
  • scripts/tests/test_serviceaccount_bindings.py asserts the gate builds the catalog's command, and adds a chart without its inputs and a render that runs out of time.
  • scripts/tests/reverify-tests.sh plants seven mutants, each naming the test that must fail:
    • five in the module: the inputs check, the inputs in the command, a hung render read as a finding, exit 0 over a failure, and an --out naming no chart;
    • two in the ServiceAccount gate's new verdicts.

Docs. CLAUDE.md's CI section says where a catalog chart is rendered from.

Checks run on this branch

All local, at this head (194260b, on 6e9fdb2), under Python 3.15.2 with the lock installed --require-hashes:

  • COVERAGE_REQUIRED=1 coverage run --rcfile=.coveragerc scripts/tests/run.py: 1528 tests across 44 modules pass, with all 25 per-file floors held, scripts/catalog.py at 100% of its lines and branches among them.
  • scripts/tests/controls.py: 25 controls complete a proof, the ServiceAccount gate's among them.
  • scripts/tests/empty-corpus.py: all 36 probed gates refuse an empty corpus.
  • scripts/tests/reverify-tests.sh: pass=293 fail=0, main's 286 and the 7 this adds.
  • scripts/check-named-things.py: all 276 path and target references resolve.
  • ruff, ruff format, mypy over scripts/, yamllint, shellcheck: pass.

@github-actions

Copy link
Copy Markdown

CI Results

Check Status
Zero-placeholder gate ✅ success
Pinned chart archives ✅ success
YAML Lint ✅ success
Dashboard gate (live grafana.com ids + AMG-saveable) ✅ success
Kyverno policy tests (+ verify-images contract) ✅ success
Admission pins a verified tag to its digest (kind) ✅ success
Fork-safety gate (no hardcoded org, blocking) ✅ success
Account ids read as secrets and masked first ✅ success
Helm-render (every addon × every env) ✅ success
Rendered images carry no unacknowledged CRITICAL ✅ success
Policy-admission (Enforce-tier Kyverno vs the fleet) ✅ success
ApplicationSet schema + sync waves ✅ success
Appset render (ApplicationSet template strings) ✅ success
Secret scan (gitleaks) ✅ success
Render + assert + schema + misconfig (all environments) ✅ success
Renovate manager coverage ✅ success
Loki volume warns before cutoff ✅ success
Falco loads every rule set it installs ✅ success
Gate scripts pass lint, typecheck and shellcheck ✅ success
Policy validity (kustomize + kyverno) ✅ success
The gates themselves are tested ✅ success
Pods name ServiceAccounts that exist ✅ success
Catalog CRs admissible against the operator chart ✅ success
Catalog source reads its revision ✅ success

All checks passed.

@stxkxs
stxkxs force-pushed the claude/catalog-one-render branch from 0458dba to ee504da Compare November 27, 2026 09:39
@github-actions

Copy link
Copy Markdown

CI Results

Check Status
Zero-placeholder gate ✅ success
Pinned chart archives ✅ success
YAML Lint ✅ success
Dashboard gate (live grafana.com ids + AMG-saveable) ✅ success
Kyverno policy tests (+ verify-images contract) ✅ success
Admission pins a verified tag to its digest (kind) ✅ success
Fork-safety gate (no hardcoded org, blocking) ✅ success
Account ids read as secrets and masked first ✅ success
Helm-render (every addon × every env) ✅ success
Rendered images carry no unacknowledged CRITICAL ✅ success
Policy-admission (Enforce-tier Kyverno vs the fleet) ✅ success
ApplicationSet schema + sync waves ✅ success
Appset render (ApplicationSet template strings) ✅ success
Secret scan (gitleaks) ✅ success
Render + assert + schema + misconfig (all environments) ✅ success
Renovate manager coverage ✅ success
Loki volume warns before cutoff ✅ success
Falco loads every rule set it installs ✅ success
Gate scripts pass lint, typecheck and shellcheck ✅ success
Policy validity (kustomize + kyverno) ✅ success
The gates themselves are tested ✅ success
Pods name ServiceAccounts that exist ✅ success
Catalog CRs admissible against the operator chart ✅ success
Catalog source reads its revision ✅ success

All checks passed.

stxkxs and others added 3 commits November 27, 2026 21:22
…ndered

The Druid catalog chart was rendered in three places, each spelling its
own helm template command: task render, CI's validate job and
check-serviceaccount-bindings.py. The first two passed the nine
synthetic tenant inputs as --set flags. The third passed one of them,
hostedId, and no environment.

catalog/druid/ci-values.yaml now holds those inputs, and
scripts/catalog.py is the one place that builds the command: release
ci, namespace <name>-ci, the chart's values.yaml and then its
ci-values.yaml, and the environment. task render and the validate job
write through its main(), and the ServiceAccount gate reads through its
render(). For every environment the render is byte for byte what the
--set flags produced. Its population is catalog/*/chart, the glob the
ServiceAccount gate already read.

A chart without its tenant inputs, or one helm refuses, fails the run,
and the others still render. A render past its 120-second bound, helm
missing, or no chart at all cannot run (exit 2). task render now stops
on a chart that does not render; the helm line it replaces wrote an
empty file and went on. The ServiceAccount gate reports an empty catalog
as could-not-run rather than as a finding, and a render that never
finished the same way.

catalog.py is a module, like gatelib.py and verdicts.py, which the
validate job runs under the Python .python-version pins.
test_catalog holds it at 100% of its lines and branches, and
reverify-tests.sh plants seven mutants: five in the module and two in
the ServiceAccount gate's new verdicts.

Co-authored-by: stxkxsbot <275011021+stxkxsbot@users.noreply.github.com>
With check_untyped_defs on, mypy reads Main.setUp, where the out path is
assigned after the patch variable is rebound, and cannot determine its
type where four tests read it. It is declared a str where it is set.

Co-authored-by: stxkxsbot <275011021+stxkxsbot@users.noreply.github.com>
Main.setUp reused `patch`, the loop variable over the ROOT and require
patchers, for the discover patcher, a patcher of another type. With
check_untyped_defs on, mypy then cannot settle the type of what setUp
assigns after it, and four tests reading self.out failed the typecheck.
The discover patcher is its own name now, so the annotation the previous
commit added is not needed and is taken out again.

Co-authored-by: stxkxsbot <275011021+stxkxsbot@users.noreply.github.com>
@stxkxs
stxkxs force-pushed the claude/catalog-one-render branch from ee504da to 7e14a7a Compare November 27, 2026 21:22
@github-actions

Copy link
Copy Markdown

CI Results

Check Status
Zero-placeholder gate ✅ success
Pinned chart archives ✅ success
YAML Lint ✅ success
Dashboard gate (live grafana.com ids + AMG-saveable) ✅ success
Kyverno policy tests (+ verify-images contract) ✅ success
Admission pins a verified tag to its digest (kind) ✅ success
Fork-safety gate (no hardcoded org, blocking) ✅ success
Account ids read as secrets and masked first ✅ success
Helm-render (every addon × every env) ✅ success
Rendered images carry no unacknowledged CRITICAL ✅ success
Policy-admission (Enforce-tier Kyverno vs the fleet) ✅ success
ApplicationSet schema + sync waves ✅ success
Appset render (ApplicationSet template strings) ✅ success
Secret scan (gitleaks) ✅ success
Render + assert + schema + misconfig (all environments) ✅ success
Renovate manager coverage ✅ success
Loki volume warns before cutoff ✅ success
Falco loads every rule set it installs ✅ success
Gate scripts pass lint, typecheck and shellcheck ✅ success
Policy validity (kustomize + kyverno) ✅ success
The gates themselves are tested ✅ success
Pods name ServiceAccounts that exist ✅ success
Catalog CRs admissible against the operator chart ✅ success
Catalog source reads its revision ✅ success

All checks passed.

Seven places said the image gates read the catalog through
scripts/catalog.py: the module's docstring, the comment in
catalog/druid/ci-values.yaml, test_catalog's docstring, the validate job's
comment in ci.yml, two comments in run.py, and the docstring of
CatalogChart.chart. Neither image gate imports the module at this head, so
merged alone, main would say something false. Each claim goes, and the
change that has the image gates render the catalog adds it back.

CatalogChart.chart was there for those gates, which record a rendered image
against a unit's chart. Nothing at this head reads it, so it goes too, with
the assertion that held it, and comes back with its reader.

run.py gave the image gates' scan as the reason scripts/catalog.py is held
at 100%. It now gives the reason that holds here: every gate that reads a
catalog chart reads what the module renders.

Co-authored-by: stxkxsbot <275011021+stxkxsbot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

CI Results

Check Status
Zero-placeholder gate ✅ success
Pinned chart archives ✅ success
YAML Lint ✅ success
Dashboard gate (live grafana.com ids + AMG-saveable) ✅ success
Kyverno policy tests (+ verify-images contract) ✅ success
Admission pins a verified tag to its digest (kind) ✅ success
Fork-safety gate (no hardcoded org, blocking) ✅ success
Account ids read as secrets and masked first ✅ success
Helm-render (every addon × every env) ✅ success
Rendered images carry no unacknowledged CRITICAL ✅ success
Policy-admission (Enforce-tier Kyverno vs the fleet) ✅ success
ApplicationSet schema + sync waves ✅ success
Appset render (ApplicationSet template strings) ✅ success
Secret scan (gitleaks) ✅ success
Render + assert + schema + misconfig (all environments) ✅ success
Renovate manager coverage ✅ success
Loki volume warns before cutoff ✅ success
Falco loads every rule set it installs ✅ success
Gate scripts pass lint, typecheck and shellcheck ✅ success
Policy validity (kustomize + kyverno) ✅ success
The gates themselves are tested ✅ success
Pods name ServiceAccounts that exist ✅ success
Catalog CRs admissible against the operator chart ✅ success
Catalog source reads its revision ✅ success

All checks passed.

@stxkxs
stxkxs merged commit 3deae31 into main Nov 29, 2026
34 checks passed
@stxkxs
stxkxs deleted the claude/catalog-one-render branch November 29, 2026 04:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant