Skip to content

deploy-camunda CLI shouldn't need code changes when CI scenarios/fixtures/persistence change #6340

@eamonnmoloney

Description

@eamonnmoloney

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

  1. Hardcoded validPersistence listscripts/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.

  2. Hardcoded help text + shell completionsscripts/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).

  3. Go-test allowlists keyed by filenamescripts/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.

  4. 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).

Metadata

Metadata

Labels

area/testMarks an issue as improving or extending the tests of the projectkind/internalGeneral internal work and improvements (not customer facing)kind/refactorlikelihood/highA recurring issueseverity/highMarks a bug as having a noticeable impact on the user with no known workaroundtriage:completed

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions