chore(matrix): derive CI scenario validation from filesystem#6350
Draft
Ian-wang-liyang wants to merge 2 commits into
Draft
chore(matrix): derive CI scenario validation from filesystem#6350Ian-wang-liyang wants to merge 2 commits into
Ian-wang-liyang wants to merge 2 commits into
Conversation
391e80e to
425bf6b
Compare
Eliminates the four coupling points called out in #6340 between data under charts/<version>/test/ and the deploy-camunda Go CLI: adding or removing a scenario, persistence layer, fixture, or pre-install script no longer forces a CLI edit + rebuild. Changes: - scenarios.Validate(scenariosDir) discovers valid identity/persistence/ platform/feature names from values/<sub>/*.yaml at call time, replacing three hardcoded slices that had already drifted from the filesystem. Per-version: a name accepted for 8.10 may now be rejected for 8.7 if the corresponding values file doesn't exist there. - BuildDeploymentConfig takes scenariosDir and forwards it to Validate. Four production call sites already had the path on hand and pass it through. - Shell completions and flag help text in cmd/{root,prepare_values}.go no longer carry duplicate hardcoded name lists; they discover via scenarios.List* + a chart-scan fallback. - The orphan-file allowlist moves out of Go (lifecycle_allowlist.go, deleted) and into per-chart .orphan-allowlist.yaml under test/integration/scenarios/. Loader: matrix.LoadOrphanAllowlist. Adding an exempt file is a YAML edit + a one-line reason; no Go rebuild required. RegistryValidator and TestLifecycleFixtures both consume the loader and additionally assert that every allowlist entry matches an existing file (dead-entry guard). - TestGenerate_PropagatesPreInstall no longer pins the rdbms scenario; it iterates every scenario whose config declares a pre-install hook and asserts the fixtures/script payload propagates to the Generate'd entry. - TestLifecycleFixtures iterates chart-versions.yaml's ActiveVersions() (alpha + supportStandard) rather than every directory on disk; supportExtended series (8.3-8.6) and EOL series are skipped because they are not in the active CI matrix. Closes #6340
38a834e to
e0090b6
Compare
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.
Which problem does the PR fix?
Closes #6340. Stacked on top of #6318 — merge that first; this PR's base
will need to be retargeted to
mainafter the parent lands.What's in this PR?
Adding or removing a CI scenario, persistence layer, fixture, or
pre-install script under
charts/<version>/test/previously forced anaccompanying edit to the
deploy-camundaGo CLI (and therefore arebuild/release). The issue called out four concrete coupling points;
this PR eliminates all four so that those operations are pure
YAML/file changes.
1.
scenarios.Validatediscovers valid names from the filesystem.validIdentities/validPersistence/validPlatformsslices inscripts/camunda-core/pkg/scenarios/scenarios.goare gone.Validatenow takes a
scenariosDirargument and listsvalues/{identity,persistence,platform,features}/*.yamlat call time.A new helper
validateAgainstDirenumerates the actually-availablechoices in the error message. Per-version semantics: a name accepted
for 8.10 may now be rejected for 8.7 if the corresponding values file
doesn't exist there (today's behaviour was silent skip; the issue
explicitly asks for "by construction" detection).
If
values/<sub>/doesn't exist at all, validation is skipped for thatdimension (matches
ResolvePaths's existing silent-skip semantics formissing files, and preserves legacy scenarios that don't declare a full
selection vocabulary).
2.
BuildDeploymentConfigplumbsscenariosDir. Four productioncall sites already had the path on hand —
cmd/prepare_values.go,deploy/values.go(buildDeploymentConfigFromFlagsand the inline callin
prepareScenarioValues), andmatrix/runner.go(dryRunandcoverageReport). No new infrastructure; just forwards an existing var.3. Shell completions and flag help text.
cmd/root.goandcmd/prepare_values.gopreviously duplicated the hardcoded name listsin both completion functions and flag-help strings. Replaced with a
small
discoverCompletions(cmd, scenarios.List*)helper that resolvesthe scenario path via the existing
resolveScenarioPath, falling backto the newest in-repo chart-full-setup directory via a glob. If nothing
resolves, completions return
nil(cobra treats as "no completions" —the point is to avoid carrying a stale parallel list).
4. Orphan allowlist moved out of Go.
lifecycle_allowlist.go(hand-maintained Go maps of files exempt from the orphan check) is
deleted. Replaced by a per-chart YAML file
charts/<v>/test/integration/scenarios/.orphan-allowlist.yamlwith arequired
reason:per entry. Loader:matrix.LoadOrphanAllowlist(
scripts/deploy-camunda/matrix/orphan_allowlist.go). Missing file isnot an error — chart versions with no exemptions don't need a stub.
Both
RegistryValidator(load-time) andTestLifecycleFixtures(
make go.test) consult the loader and additionally assert that everyallowlist entry matches an existing file (dead-entry guard, replacing
the cross-version Go map check).
TestLifecycleFixturesnow iterateschart-versions.yaml'sActiveVersions()(alpha + supportStandard = 8.7-8.10) instead of everydirectory on disk, so supportExtended series (8.3-8.6) and EOL series
are skipped — their
pre-setup-scripts/hygiene is not asserted.5.
TestGenerate_PropagatesPreInstallde-pinned. The test previouslyasserted on
Scenario == "rdbms"and the literalpostgresql-cluster.yamlfixture, which broke whenever that one scenario changed shape. Rewritten
to iterate every scenario whose config declares a pre-install hook and
assert that the fixtures/script payload propagates to the Generate'd
entry — property-based, no scenario name baked in. Description is
intentionally NOT compared (dependency-profile composition rewrites it).
Net diff: ~440 / 287 lines across 12 Go files + 4 small YAML
allowlist files (54 lines total). One Go file deleted, one added.
Checklist
Please make sure to follow our Contributing Guide.
Before opening the PR:
make go.update-golden-only.After opening the PR: