Skip to content

feat(infra): roll the dev platform release from CI on main (§14.2's Helm half) - #353

Merged
athvin merged 1 commit into
mainfrom
bm/infra-ci-deploy-dev
Oct 29, 2026
Merged

athvin merged 1 commit into
mainfrom
bm/infra-ci-deploy-dev

Conversation

@athvin

@athvin athvin commented Oct 29, 2026

Copy link
Copy Markdown
Owner

Completes infrastructure.md §14.2. The Terraform half landed in #352; this is
"Dev platform releases apply from CI on main; make dev-up stays a human
command."

§14.2's clause had no target, so this gives it one

er-platform is only ever installed into a PER-DEVELOPER namespace: its
developer value defaults to the release namespace and names the §9 Secrets
Manager entries er/{environment}/{developer}/…. There is no shared dev
release. That left two readings of "applies from CI on main":

(a) redeploy every developer's namespace — which restarts a pod someone is
mid-debug on, and contradicts the very next clause in the same sentence;
(b) give CI a namespace of its own.

(b), by operator decision. CI owns exactly one namespace and cannot touch a
developer's; make dev-up is untouched.

The namespace is ci, not the suggested dev: the name becomes the
developer value and lands in secret paths, where er/dev/dev/erserver reads
like a mistake, and ci cannot collide with a real developer's name.

Promote-by-digest, enforced rather than assumed

§14.2 requires a deploy to pass a DIGEST, never a tag, and to gate on that
digest being present first — and er-platform's own values.yaml already cites
that section next to its digest fields. The job resolves both digests from
ECR and refuses to continue if either is absent.

Images are sha-tagged and built only when their own tree moved, so for any given
commit one of them may legitimately have no sha tag. That case reuses the newest
digest already in the registry — which IS what is running — and logs that it
did. Nothing is ever deployed by tag.

needs: [detect, er-api, er-web] with always() && !cancelled(), because a
rust-only commit SKIPS er-web and a plain needs would skip the deploy with it.
A skipped image job and a FAILED one must not mean the same thing, so the first
step inspects both results and refuses to deploy a failed build rather than
rolling out a half-built commit.

--atomic on the platform release: a failed upgrade rolls back instead of
leaving half a release in the namespace.

Also

  • images.yml now triggers on infra/k8s/** and scripts/dev_env.sh, because
    a change to either IS a platform release even when no image moved. Previously
    a chart-only commit would have deployed nothing.
  • The namespace's EFS access point and secrets come from the same
    scripts/dev_env.sh up that make dev-up runs, so CI and a human provision a
    namespace identically rather than by two drifting paths.
  • The eks module gains a cluster_arn output, so the role's
    eks:DescribeCluster is scoped to this cluster instead of *.
  • helm is a version-pinned tarball, not a third-party action — the same choice
    rust.yml's disk-reclaim step documents, and it avoids adding a uses: whose
    SHA I would have had to pin.

NOT verified, and one caveat worth reading

er-ci-deploy-dev does not exist until envs/dev is applied, so this job's
first run fails at role assumption exactly as infra.yml's plan jobs do. Nothing
here has touched the live cluster.

The role gets cluster-admin, because that is what this module's
admin_principal_arns grants (the access entry associates
AmazonEKSClusterAdminPolicy). A namespace-scoped access entry is the narrower
shape and is worth doing if this role gains a second caller; for one
namespace-scoped release whose trust is pinned to pushes on main, the extra
moving part buys little. Said out loud in eks.tf rather than left to be noticed.

Prefer making the first real rollout a deliberate workflow_dispatch rather
than whatever the next merge happens to be.

Co-Authored-By: Claude Opus 5 (1M context) [email protected]

🤖 Generated with Claude Code

…elm half)

Completes infrastructure.md §14.2. The Terraform half landed in #352; this is
"Dev platform releases apply from CI on `main`; `make dev-up` stays a human
command."

## §14.2's clause had no target, so this gives it one

`er-platform` is only ever installed into a PER-DEVELOPER namespace: its
`developer` value defaults to the release namespace and names the §9 Secrets
Manager entries `er/{environment}/{developer}/…`. There is no shared dev
release. That left two readings of "applies from CI on main":

  (a) redeploy every developer's namespace — which restarts a pod someone is
      mid-debug on, and contradicts the very next clause in the same sentence;
  (b) give CI a namespace of its own.

(b), by operator decision. CI owns exactly one namespace and cannot touch a
developer's; `make dev-up` is untouched.

The namespace is **`ci`**, not the suggested `dev`: the name becomes the
`developer` value and lands in secret paths, where `er/dev/dev/erserver` reads
like a mistake, and `ci` cannot collide with a real developer's name.

## Promote-by-digest, enforced rather than assumed

§14.2 requires a deploy to pass a DIGEST, never a tag, and to gate on that
digest being present first — and `er-platform`'s own values.yaml already cites
that section next to its `digest` fields. The job resolves both digests from
ECR and refuses to continue if either is absent.

Images are sha-tagged and built only when their own tree moved, so for any given
commit one of them may legitimately have no sha tag. That case reuses the newest
digest already in the registry — which IS what is running — and logs that it
did. Nothing is ever deployed by tag.

`needs: [detect, er-api, er-web]` with `always() && !cancelled()`, because a
rust-only commit SKIPS er-web and a plain `needs` would skip the deploy with it.
A skipped image job and a FAILED one must not mean the same thing, so the first
step inspects both results and refuses to deploy a failed build rather than
rolling out a half-built commit.

`--atomic` on the platform release: a failed upgrade rolls back instead of
leaving half a release in the namespace.

## Also

- `images.yml` now triggers on `infra/k8s/**` and `scripts/dev_env.sh`, because
  a change to either IS a platform release even when no image moved. Previously
  a chart-only commit would have deployed nothing.
- The namespace's EFS access point and secrets come from the same
  `scripts/dev_env.sh up` that `make dev-up` runs, so CI and a human provision a
  namespace identically rather than by two drifting paths.
- The eks module gains a `cluster_arn` output, so the role's
  `eks:DescribeCluster` is scoped to this cluster instead of `*`.
- helm is a version-pinned tarball, not a third-party action — the same choice
  rust.yml's disk-reclaim step documents, and it avoids adding a `uses:` whose
  SHA I would have had to pin.

## NOT verified, and one caveat worth reading

`er-ci-deploy-dev` does not exist until `envs/dev` is applied, so this job's
first run fails at role assumption exactly as infra.yml's plan jobs do. Nothing
here has touched the live cluster.

The role gets cluster-admin, because that is what this module's
`admin_principal_arns` grants (the access entry associates
AmazonEKSClusterAdminPolicy). A namespace-scoped access entry is the narrower
shape and is worth doing if this role gains a second caller; for one
namespace-scoped release whose trust is pinned to pushes on `main`, the extra
moving part buys little. Said out loud in eks.tf rather than left to be noticed.

Prefer making the first real rollout a deliberate `workflow_dispatch` rather
than whatever the next merge happens to be.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@athvin
athvin merged commit 302cfd9 into main Oct 29, 2026
19 of 22 checks passed
@athvin
athvin deleted the bm/infra-ci-deploy-dev branch October 29, 2026 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants