build: add post-infra lifecycle hook to the matrix deploy tooling#6342
Draft
eamonnmoloney wants to merge 1 commit into
Draft
build: add post-infra lifecycle hook to the matrix deploy tooling#6342eamonnmoloney wants to merge 1 commit into
eamonnmoloney wants to merge 1 commit into
Conversation
Add a `post-infra` declarative lifecycle hook that fires after a scenario's companion charts (the external infrastructure: PostgreSQL, Elasticsearch, Keycloak, …) are deployed and ready, but BEFORE the main Camunda chart is installed/upgraded. It fills the gap between `pre-install` (before anything) and `post-deploy` (after the chart) — there was no point to act on freshly-provisioned external infrastructure. The motivating use case: migrating data from a prior release's bundled (Bitnami) backends onto the companion services before the chart switches over to them, so the upgraded chart finds its realm/data on the external infra. - types.Options + deployer.Deploy: run PostInfraHooks after the companion charts loop, before upgradeInstall - config.RuntimeFlags.PostInfraHooks; wired through deploy.Execute - matrix: CIScenario.PostInfra / Entry.PostInfra (yaml `post-infra`), carried to the Entry; registerDeclarativePostInfraHook mirrors the pre-install/ post-deploy shims; registered on the install path, the upgrade-only path, and Step 2 of two-step upgrades - TestLifecycleFixtures now validates `post-infra` script/fixture references Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
6 tasks
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?
The matrix deploy tooling had two declarative lifecycle hooks —
pre-install(before the namespace/chart) and
post-deploy(after the chart) — plus theflow-level
pre-upgrade. There was no hook that runs once the companioncharts (external infrastructure: PostgreSQL, Elasticsearch, Keycloak, …) are
deployed and ready, but before the main Camunda chart.
That gap blocks a real scenario: standing up companion infra as migration
targets and moving data from a prior release's bundled (Bitnami) backends
onto them before the chart upgrade switches over — so the upgraded chart
finds its realm/data on the external infrastructure. (This is the Helm-CI side
of exercising the
camunda-deployment-referencesBitnami→external migrationscripts; see Related.)
What's in this PR?
A new
post-infradeclarative lifecycle hook:types.Options+deployer.Deploy): runsPostInfraHooksafter the companion-charts loop and before
upgradeInstall(the main chart).config.RuntimeFlags.PostInfraHooks, wired throughdeploy.Executeintothe deployer options.
CIScenario.PostInfra/Entry.PostInfra(yaml keypost-infra,same
LifecycleHookshape as the others:scriptxorfixtures+ requireddescription); carried onto theEntry;registerDeclarativePostInfraHookmirrors the existing pre-install/post-deploy shims. Registered on the install
path, the upgrade-only (
modular-upgrade-minor) path, and Step 2 of two-stepupgrades.
TestLifecycleFixturesnow also validatespost-infrascript/fixturereferences and descriptions.
Ordering inside the deployer is now: namespace/secrets →
pre-installhooks →companion charts →
post-infrahooks → main chart install/upgrade →post-deployhooks.This is the hook mechanism only — no scenario uses it yet. The migration
wiring (a
post-infrascript that drives the references scripts against thecompanions) lands in a follow-up.
Validation
go build ./...(deploy-camunda + camunda-deployer),go test ./matrix/...and
./pkg/deployer/...,gofmt— all pass locally.Related
KEYCLOAK_TARGET_MODE=externaland
SKIP_HELM_UPGRADE(data-only cutover) so a CI harness can migrate Bitnamidata onto external/companion infra and own the chart upgrade. The follow-up
Helm-CI PR will add a
post-inframigration script that uses both.Checklist
Before opening the PR:
make go.update-golden-only.After opening the PR: