Repository navigation
build(catalog): render every catalog chart one way, wherever it is rendered - #299
Merged
Merged
Conversation
CI Results
All checks passed. |
stxkxs
force-pushed
the
claude/catalog-one-render
branch
from
November 27, 2026 09:39
0458dba to
ee504da
Compare
CI Results
All checks passed. |
…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
force-pushed
the
claude/catalog-one-render
branch
from
November 27, 2026 21:22
ee504da to
7e14a7a
Compare
CI Results
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>
CI Results
All checks passed. |
This was referenced Nov 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Druid catalog chart was rendered in three places, and each spelled its own
helm templatecommand:task render;check-serviceaccount-bindings.py.The first two passed the nine synthetic tenant inputs as
--setflags. 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:ci, namespace<name>-ci;values.yaml, then itsci-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, andrender()hands the manifests to a gate. For development, staging, production and hub, its render is byte for byte what the--setflags produced.Exit status:
It is a module, like
gatelib.pyandverdicts.py, so it carries no positive control of its own. The validate job now sets up Python from.python-versionto run it.The renderers.
task renderand the validate job callpython3 scripts/catalog.py.task renderalso now stops on a chart that does not render. The helm line it replaces wrote an empty file and went on.check-serviceaccount-bindings.pyrenders throughcatalog.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, whatmain()writes and exits with, and the real tree's inputs. It holds the module at 100% of its lines and branches, andrun.pymakes that the module's floor.scripts/tests/test_serviceaccount_bindings.pyasserts 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.shplants seven mutants, each naming the test that must fail:--outnaming no chart;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, on6e9fdb2), 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.pyat 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.scripts/, yamllint, shellcheck: pass.