ci(deploy-camunda): native --extra-values on matrix run with per-scenario overrides#6429
Conversation
There was a problem hiding this comment.
Pull request overview
This PR completes native --extra-values support for deploy-camunda matrix run by wiring workflow upgrade flows to pass the extra values file and by adding per-scenario extra-values declarations that are propagated from the scenario registry through to runtime flags.
Changes:
- Add per-scenario
extra-valuesto the registry schema and propagate it throughCIScenario→Entry→flags.Deployment.ExtraValues, with defined precedence (global first, per-scenario next). - Update the integration test upgrade workflow to forward workflow
extra-valuesvia the native--extra-valuesflag (Step 2 only for two-step upgrades). - Add unit tests covering loader propagation, Generate propagation, precedence/path resolution, and validator behavior for missing extra-values.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/deploy-camunda/matrix/runner_upgrade.go | Clarifies and enforces that upgrade Step 1 ignores all extra-values (global + per-scenario). |
| scripts/deploy-camunda/matrix/runner_execute.go | Appends scenario-declared extra-values after global extra-values when constructing DeploymentFlags. |
| scripts/deploy-camunda/matrix/registry.go | Extends scenario registry parsing/plumbing to include extra-values. |
| scripts/deploy-camunda/matrix/registry_validator.go | Validates scenario extra-values references at load time (relative under chart-full-setup; absolute skipped). |
| scripts/deploy-camunda/matrix/registry_test.go | Adds unit tests for registry load/generate propagation and validator behavior for extra-values. |
| scripts/deploy-camunda/matrix/matrix.go | Adds Entry.ExtraValues and copies it from CIScenario during generation. |
| scripts/deploy-camunda/matrix/matrix_test.go | Adds a unit test pinning precedence/path resolution for per-scenario extra-values. |
| scripts/deploy-camunda/matrix/config.go | Adds CIScenario.ExtraValues to represent scenario-declared extra-values in config. |
| scripts/deploy-camunda/cmd/matrix.go | Tweaks --help text for flags including --extra-values. |
| .github/workflows/test-integration-runner.yaml | For upgrade flows, persists extra-values and forwards them via --extra-values to matrix run. |
…log leak Address copilot review findings on #6429: - registry_validator.go: reject relative extra-values paths that escape chart-full-setup via `..` traversal (filepath.Rel guard). Add TestRegistryValidatorRejectsExtraValuesPathTraversal to pin this. - test-integration-runner.yaml: replace all four `tee /tmp/extra-values-file.yaml` instances with a plain redirect to avoid printing potentially sensitive values content into workflow logs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…log leak Address copilot review findings on #6429: - registry_validator.go: reject relative extra-values paths that escape chart-full-setup via `..` traversal (filepath.Rel guard). Add TestRegistryValidatorRejectsExtraValuesPathTraversal to pin this. - test-integration-runner.yaml: replace all four `tee /tmp/extra-values-file.yaml` instances with a plain redirect to avoid printing potentially sensitive values content into workflow logs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
c3b2d35 to
9372d1e
Compare
…log leak Address copilot review findings on #6429: - registry_validator.go: reject relative extra-values paths that escape chart-full-setup via `..` traversal (filepath.Rel guard). Add TestRegistryValidatorRejectsExtraValuesPathTraversal to pin this. - test-integration-runner.yaml: replace all four `tee /tmp/extra-values-file.yaml` instances with a plain redirect to avoid printing potentially sensitive values content into workflow logs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
9372d1e to
88e0769
Compare
eamonnmoloney
left a comment
There was a problem hiding this comment.
crev review
PR #6429 correctly wires --extra-values into the upgrade CI flow and adds well-guarded per-scenario extra-values support. The implementation is architecturally sound: the Step 1 nil-out in runner_upgrade.go, the checkExtraValues path-traversal guard, and the appendScenarioExtraValues helper are all correct and backed by tests. Two issues warrant attention: (1) the new extra-values scenario YAML field extends a closed enumeration defined in ADR 0093 without a formal ADR amendment — the ADR anticipated this via the #6312 reference but anticipation is not a formal amendment; (2) TestExtraValues_UpgradeStep1Cleared should be extended to include a pre-scenario path in its input slice so the merged-slice ordering invariant (that Step 1 receives nil even when per-scenario paths are present) is explicitly falsifiable.
Specialists run: correctness, api-stability, adr-conformance, test-adequacy, devils-advocate, verifier, escalation-assessor. Devil's-advocate hypotheses: 7 raised, 0 promoted.
Hypotheses by stance: adversarial-input=2 author-blind-spot=1 claim-vs-code=1 missing-case=2 scope-discipline=1 · by disposition: covered_by_specialist=1 dropped_low_severity=2 dropped_rubric=3 dropped_ungroundable=1
Escalation: AI review sufficient (score: 0.45, threshold: 0.50). Two P1 findings (upgrade job behavior change now verified as intentional fix, ADR 0093 conformance gap) and external authorship drive moderate risk. Security surface touched via workflow handling potentially sensitive EXTRA_VALUES (tee removal is a security improvement). No NEVER rules violated. Score 0.45 is below threshold; reviewers should focus on ADR 0093 amendment and the test coverage gap for the merged-slice upgrade invariant.
Findings on lines outside this PR's diff:
-
P2
scripts/deploy-camunda/matrix/matrix_test.go:2079— TestExtraValues_UpgradeStep1Cleared does not exercise the merged-slice ordering invariant introduced by this PR
TestExtraValues_UpgradeStep1ClearedconstructsbaseFlagswith a single global extra-values path:baseFlags := &config.RuntimeFlags{Deployment: config.DeploymentFlags{ExtraValues: []string{"/tmp/engine-image.yaml"}}}
Before this PR that was sufficient. After this PR,
flags.Deployment.ExtraValuesarrives atexecuteTwoStepUpgradeas a merged slice — global paths followed by resolved per-scenario paths — becauseappendScenarioExtraValuesruns insideexecuteEntrybefore the upgrade function is called. The nil-out atrunner_upgrade.go:186correctly zeros the whole merged slice. But because the test's input carries only one global path with no per-scenario entry, it does not confirm that per-scenario paths are absent from Step 1.Critically, the test would still pass if
appendScenarioExtraValueswere accidentally moved to run insideexecuteTwoStepUpgradeafter the nil-out — which would silently inject per-scenario extra-values into Step 1, contaminating the previous-version install baseline that the PR comment explicitly protects.Recommendation: Extend
TestExtraValues_UpgradeStep1ClearedsobaseFlags.Deployment.ExtraValuescontains both a global path and a pre-resolved per-scenario path (matching the post-appendScenarioExtraValuesproduction state), then assertstep1Flags.Deployment.ExtraValues == nil. No realexecuteEntrycall is needed — the existing isolation approach is fine — but the input must reflect the merged state to make the ordering invariant falsifiable.
…ario overrides Closes #6312. Two gaps remained after #6375 shipped the CLI flag: Gap B — upgrade flow never forwarded the file. The CLI already applied --extra-values to Step 2 only (runner_upgrade.go nils Step 1's copy), but the workflow job omitted EXTRA_VALUES entirely. Wire it: add the env var, tee to the fixed path, guard with EXTRA_VALUES_ARGS, inject into the matrix run invocation — mirroring the install-flow pattern. Gap A — per-scenario extra-values. Scenarios can now declare their own values files under extra-values in ci-test-config.yaml / the registry format. appendScenarioExtraValues resolves relative paths against chart-full-setup and appends them after the global --extra-values, so per-scenario files win within the extra slot. Precedence: chart defaults < global --extra-values < per-scenario extra-values < scenario layers All three propagation hops are tested: - TestLoadRegistryCarriesExtraValues: YAML → CIScenario - TestGenerate_PropagatesExtraValues: CIScenario → Entry - TestAppendScenarioExtraValues: precedence + path resolution - TestRegistryValidatorRejectsMissingExtraValues: validator parity Also debloated three flag descriptions in cmd/matrix.go. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…log leak Address copilot review findings on #6429: - registry_validator.go: reject relative extra-values paths that escape chart-full-setup via `..` traversal (filepath.Rel guard). Add TestRegistryValidatorRejectsExtraValuesPathTraversal to pin this. - test-integration-runner.yaml: replace all four `tee /tmp/extra-values-file.yaml` instances with a plain redirect to avoid printing potentially sensitive values content into workflow logs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
88e0769 to
322b16b
Compare
…rage Add `extra-values` to ADR 0093's closed scenario-field enumeration and note path-resolution semantics (relative → chart-full-setup, absolute → runtime-supplied). Closes the conformance gap flagged in review. Extend TestExtraValues_UpgradeStep1Cleared to carry a merged slice (global + per-scenario path) matching the post-appendScenarioExtraValues production state. Confirms Step 1's nil-out zeros both kinds of path, making the ordering invariant falsifiable. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
|
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
|
Both findings addressed: P1 (ADR 0093) — aed7bde adds P2 (TestExtraValues_UpgradeStep1Cleared) — same commit extends the test so |
Which problem does the PR fix?
Closes #6312.
Two gaps remained after #6375 shipped the
--extra-valuesCLI flag:What's in this PR?
Gap B — wire upgrade flow (
test-integration-runner.yaml)The CLI already applied
--extra-valuesto Step 2 only (runner_upgrade.gonils Step 1's copy), so the run-built image tag correctly lands on the upgraded chart without contaminating the previous-version install. The workflow just needed wiring: addEXTRA_VALUESto the upgrade step env, tee to/tmp/extra-values-file.yaml, buildEXTRA_VALUES_ARGS, inject into thematrix runinvocation — mirroring the existing install-flow pattern above it.Gap A — per-scenario extra-values
Scenarios can now declare their own values files:
appendScenarioExtraValuesresolves relative paths againstchart-full-setupand appends them after the global--extra-values. Precedence (last wins in Helm's-fmerge):The field threads through:
registryScenario→CIScenario→Entry→DeploymentFlags.ExtraValues. The Step-1 nil inrunner_upgrade.goalready clears the full merged slice, so both global and per-scenario files apply to Step 2 only in upgrade flows.registry_validator.gocatches dangling relative paths at load time (parity withcheckFeature/checkDep). Absolute paths pass through — they're runtime-supplied.Tests
Four new tests covering all three propagation hops:
TestLoadRegistryCarriesExtraValues— YAML →CIScenarioTestGenerate_PropagatesExtraValues—CIScenario→EntryviaGenerateTestAppendScenarioExtraValues— precedence order + path resolutionTestRegistryValidatorRejectsMissingExtraValues— validator rejects dangling relative, passes absoluteAlso debloated three
--helpflag descriptions incmd/matrix.go.Checklist
Before opening the PR:
make go.update-golden-only.After opening the PR: