Summary
Adding or removing a CI scenario, persistence layer, fixture, or pre-install script — a change to YAML/data under charts/<version>/test/ — currently forces an accompanying change to the Go deploy-camunda CLI (and therefore a CLI rebuild/release). Data and code are coupled where they should be independent: a YAML change alone should never require shipping a new CLI binary.
This was hit repeatedly while working on #6339 (CNPG → companion swap): swapping a few scenarios in ci-test-config.yaml required editing Go source and Go tests.
Concrete coupling points
-
Hardcoded validPersistence list — scripts/camunda-core/pkg/scenarios/scenarios.go:80 enumerates every persistence name as a Go string slice. Adding values/persistence/<name>.yaml does nothing until this slice is edited. It already drifts: the slice has 14 entries (elasticsearch-external, elasticsearch-external-self-signed, opensearch-external, rdbms-oracle, …) while charts/camunda-platform-8.10/.../values/persistence/ has 10 files — the two are not derived from each other.
-
Hardcoded help text + shell completions — scripts/deploy-camunda/cmd/prepare_values.go and scripts/deploy-camunda/cmd/root.go repeat the persistence/identity name lists in flag help and completion functions (see also the "New Persistence Layer" checklist in AGENTS.md, which literally instructs editing three Go files to add one YAML file).
-
Go-test allowlists keyed by filename — scripts/deploy-camunda/matrix/lifecycle_hook_test.go (preSetupScriptAllowlist, commonResourcesAllowlist) must be hand-edited whenever a fixture/script under common/resources/ or pre-setup-scripts/ is added or removed, or TestLifecycleFixtures fails.
-
Tests that hardcode scenario names — e.g. matrix/config_test.go's TestGenerate_PropagatesPreInstall pinned the rdbms scenario; removing rdbms's pre-install hook broke the test and forced a code edit (it had to be retargeted to hub-external-db). matrix/matrix_test.go similarly references specific scenario names.
Why this is wrong
Proposed direction (not prescriptive)
- Derive
validPersistence (and identity/feature/platform name validation) by listing values/persistence/*.yaml etc. for the target version, instead of the hardcoded slice. Same for shell completions (dynamic completion from the filesystem).
- Replace the filename allowlists in
lifecycle_hook_test.go with a convention (e.g. a small per-directory .meta/manifest, or a documented naming rule) so unreferenced-but-intentional files don't require editing Go.
- Make scenario-targeted tests data-driven (assert a property over all scenarios, or look up "any scenario with a pre-install hook") rather than pinning a named scenario.
- Acceptance: adding/removing a scenario, persistence layer, fixture, or script is a pure YAML/file change — no edits to
scripts/**.go and no CLI release required; CI catches drift by construction.
Context
Surfaced during #6339 (workaround for the CNPG CI flakiness #6338).
Summary
Adding or removing a CI scenario, persistence layer, fixture, or pre-install script — a change to YAML/data under
charts/<version>/test/— currently forces an accompanying change to the Godeploy-camundaCLI (and therefore a CLI rebuild/release). Data and code are coupled where they should be independent: a YAML change alone should never require shipping a new CLI binary.This was hit repeatedly while working on #6339 (CNPG → companion swap): swapping a few scenarios in
ci-test-config.yamlrequired editing Go source and Go tests.Concrete coupling points
Hardcoded
validPersistencelist —scripts/camunda-core/pkg/scenarios/scenarios.go:80enumerates every persistence name as a Go string slice. Addingvalues/persistence/<name>.yamldoes nothing until this slice is edited. It already drifts: the slice has 14 entries (elasticsearch-external,elasticsearch-external-self-signed,opensearch-external,rdbms-oracle, …) whilecharts/camunda-platform-8.10/.../values/persistence/has 10 files — the two are not derived from each other.Hardcoded help text + shell completions —
scripts/deploy-camunda/cmd/prepare_values.goandscripts/deploy-camunda/cmd/root.gorepeat the persistence/identity name lists in flag help and completion functions (see also the "New Persistence Layer" checklist inAGENTS.md, which literally instructs editing three Go files to add one YAML file).Go-test allowlists keyed by filename —
scripts/deploy-camunda/matrix/lifecycle_hook_test.go(preSetupScriptAllowlist,commonResourcesAllowlist) must be hand-edited whenever a fixture/script undercommon/resources/orpre-setup-scripts/is added or removed, orTestLifecycleFixturesfails.Tests that hardcode scenario names — e.g.
matrix/config_test.go'sTestGenerate_PropagatesPreInstallpinned therdbmsscenario; removing rdbms's pre-install hook broke the test and forced a code edit (it had to be retargeted tohub-external-db).matrix/matrix_test.gosimilarly references specific scenario names.Why this is wrong
ci-test-config.yaml(and thevalues/**directories) are the source of truth for data. The CLI should discover valid persistence/identity/feature names and fixture references from the filesystem/config at runtime, not from a parallel hardcoded list that must be kept in sync by hand.Proposed direction (not prescriptive)
validPersistence(and identity/feature/platform name validation) by listingvalues/persistence/*.yamletc. for the target version, instead of the hardcoded slice. Same for shell completions (dynamic completion from the filesystem).lifecycle_hook_test.gowith a convention (e.g. a small per-directory.meta/manifest, or a documented naming rule) so unreferenced-but-intentional files don't require editing Go.scripts/**.goand no CLI release required; CI catches drift by construction.Context
Surfaced during #6339 (workaround for the CNPG CI flakiness #6338).