Skip to content

build: add post-infra lifecycle hook to the matrix deploy tooling#6342

Draft
eamonnmoloney wants to merge 1 commit into
mainfrom
post-infra-lifecycle-hook
Draft

build: add post-infra lifecycle hook to the matrix deploy tooling#6342
eamonnmoloney wants to merge 1 commit into
mainfrom
post-infra-lifecycle-hook

Conversation

@eamonnmoloney

Copy link
Copy Markdown
Contributor

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 the
flow-level pre-upgrade. There was no hook that runs once the companion
charts (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-references Bitnami→external migration
scripts; see Related.)

What's in this PR?

A new post-infra declarative lifecycle hook:

  • deployer (types.Options + deployer.Deploy): runs PostInfraHooks
    after the companion-charts loop and before upgradeInstall (the main chart).
  • config.RuntimeFlags.PostInfraHooks, wired through deploy.Execute into
    the deployer options.
  • matrix: CIScenario.PostInfra / Entry.PostInfra (yaml key post-infra,
    same LifecycleHook shape as the others: script xor fixtures + required
    description); carried onto the Entry; registerDeclarativePostInfraHook
    mirrors the existing pre-install/post-deploy shims. Registered on the install
    path, the upgrade-only (modular-upgrade-minor) path, and Step 2 of two-step
    upgrades.
  • TestLifecycleFixtures now also validates post-infra script/fixture
    references and descriptions.

Ordering inside the deployer is now: namespace/secrets → pre-install hooks →
companion charts → post-infra hooks → main chart install/upgrade →
post-deploy hooks.

This is the hook mechanism only — no scenario uses it yet. The migration
wiring (a post-infra script that drives the references scripts against the
companions) lands in a follow-up.

Validation

  • go build ./... (deploy-camunda + camunda-deployer), go test ./matrix/...
    and ./pkg/deployer/..., gofmt — all pass locally.

Related

Checklist

Before opening the PR:

  • In the repo's root dir, run make go.update-golden-only.
  • There is no other open pull request for the same update/change.
  • Tests for charts are added (if needed).
  • In-repo documentation are updated (if needed).

After opening the PR:

  • Did you sign our CLA (Contributor License Agreement)?
  • Did all checks/tests pass in the PR?

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant