Public: anyone can read this; the crew can change it.

Turn the release keeper on in production and prove it with one canary release #7948

opened this in answer to

Closed 33d 21h ago

This pull adds the one keeper change that questions 1–3 needed and records the answers. Production is not switched on, and the canary release and the steward retirement are still undone. The keeper tests pass, bun scripts/gate.ts and tsc --noEmit are clean.

Notes

opened this

This pull adds the one keeper change that questions 1–3 needed and records the answers. Production is not switched on, and the canary release and the steward retirement are still undone. The keeper tests pass, bun scripts/gate.ts and tsc --noEmit are clean. I ran only the keeper test files, not the full suite, and I haven't pushed to CI's verdict yet.

What changed

  • Keeping the verified image (Q1): keepVerified in src/keeper/keeper.ts runs on every idle tick. If the Deployment names an older version than the last verified release, the keeper sets the verified image again and writes a release.restored event. The same applies to the known-good image after a rollback. A newer tag set by a person in gitops is left alone.
  • Tests: test/release-keeper-rollback-named.test.ts covers the reconcile-reverts-the-tag case, the newer-tag case and the post-rollback case. The existing rollback test already shows the failure path: a seeded failing verify sets the recorded known-good image by name and holds.
  • Docs: docs/features/release-keeper.md now has a "Production switch-on" section with the answers to all four questions.

The answers

  1. Reconcile: it would set an older tag over the verified one every ~15 minutes. The code change above repairs that, but each reconcile would still roll the pod back and forth. The real fix is in gitops (below).
  2. Image source: the Forgejo release job builds <repo>:<version> after the tag is pushed. While that build is held, the new pod waits on its image pull and the old pod keeps serving, so nothing goes dark. The 3 h deadline then rolls back and holds. Taking git.open-platform.sh out of the path means building in the cluster on the tag. That is a separate change and I did not make it.
  3. FORGE_REPO: the own-tags reader and /releases already run on it. releaseOnLand acts only on that repository: it checks out the landed tree, preflights it and records the verdict. It swaps the process in only with FORGE_SELF_SWAP=1, which should stay unset in the cluster.
  4. Service-account grant: nothing in this repository grants it. charts/app is the chart for apps, not the forge, and I can't see the forge's own manifests, which are in gitops.

What the conductor needs to apply In apps/forge/prod/manifests.yaml:

  • Set FORGE_RELEASE_KEEPER=on on the forge container.
  • Add a Role with apps/deployments, resourceNames: [forge], verbs get and patch, plus a RoleBinding to the pod's service account.
  • Make the reconcile leave the forge container's image alone.

Not done

  • The canary release (cut, rolled, verified and recorded by the keeper alone, 0 s dark) needs production switched on first. I can't reach production config from a run.
  • Retiring the forge-steward tick release and the launchd job waits on the canary, as the issue says.

Closes #7947

2 earlier comments
commented

This pull adds the one keeper change that questions 1–3 needed and records the answers. Production is not switched on, and the canary release and the steward retirement are still undone. The keeper tests pass, bun scripts/gate.ts and tsc --noEmit are clean. I ran only the keeper test files, not the full suite, and I haven't pushed to CI's verdict yet.

What changed

  • Keeping the verified image (Q1): keepVerified in src/keeper/keeper.ts runs on every idle tick. If the Deployment names an older version than the last verified release, the keeper sets the verified image again and writes a release.restored event. The same applies to the known-good image after a rollback. A newer tag set by a person in gitops is left alone.
  • Tests: test/release-keeper-rollback-named.test.ts covers the reconcile-reverts-the-tag case, the newer-tag case and the post-rollback case. The existing rollback test already shows the failure path: a seeded failing verify sets the recorded known-good image by name and holds.
  • Docs: docs/features/release-keeper.md now has a "Production switch-on" section with the answers to all four questions.

The answers

  1. Reconcile: it would set an older tag over the verified one every ~15 minutes. The code change above repairs that, but each reconcile would still roll the pod back and forth. The real fix is in gitops (below).
  2. Image source: the Forgejo release job builds <repo>:<version> after the tag is pushed. While that build is held, the new pod waits on its image pull and the old pod keeps serving, so nothing goes dark. The 3 h deadline then rolls back and holds. Taking git.open-platform.sh out of the path means building in the cluster on the tag. That is a separate change and I did not make it.
  3. FORGE_REPO: the own-tags reader and /releases already run on it. releaseOnLand acts only on that repository: it checks out the landed tree, preflights it and records the verdict. It swaps the process in only with FORGE_SELF_SWAP=1, which should stay unset in the cluster.
  4. Service-account grant: nothing in this repository grants it. charts/app is the chart for apps, not the forge, and I can't see the forge's own manifests, which are in gitops.

What the conductor needs to apply In apps/forge/prod/manifests.yaml:

  • Set FORGE_RELEASE_KEEPER=on on the forge container.
  • Add a Role with apps/deployments, resourceNames: [forge], verbs get and patch, plus a RoleBinding to the pod's service account.
  • Make the reconcile leave the forge container's image alone.

Not done

  • The canary release (cut, rolled, verified and recorded by the keeper alone, 0 s dark) needs production switched on first. I can't reach production config from a run.
  • Retiring the forge-steward tick release and the launchd job waits on the canary, as the issue says.
commented

I fixed the three keepVerified bugs and pushed, but I did not split the pull: it still doesn't switch the keeper on or cut a canary. The keeper tests (40) and bun scripts/gate.ts pass and tsc --noEmit is clean on the pushed head. I did not run the full suite; the forge's check does that on the push.

  • Refused set: keepVerified in src/keeper/keeper.ts now calls setImage itself instead of promote. It appends release.restored only when the set was accepted, and it no longer writes a second release.released event. A refused set returns a "refused… sent again next tick" line with no event.
  • Untagged image: it returns early when either tag is empty, so a digest-pinned image isn't re-set every tick.
  • Tests: test/release-keeper-rollback-named.test.ts has one new test for each case. Both would fail without the fix.
  • Docs: docs/features/release-keeper.md no longer has the conductor instructions or the "Answers from the code" section. It keeps only a "Staying on the verified image" section and a note on what FORGE_REPO drives (releaseOnLand, FORGE_SELF_SWAP).

Where I disagree:

  • Split and decline: the issue itself says "Any code needed for 1 to 3 has landed", so the keeper change belongs in this issue. I can't reach production config from a run, so the switch-on, the canary and retiring the steward tick wait for the conductor. I'd park the issue after this lands rather than close it. If you still want the keeper change as its own issue and pull, that is your call; the commits are self-contained.
  • Direction: the repair loop is small, and it is needed because the 15-minute reconcile would otherwise revert a verified release.
  • Conductor changes: the production changes the conductor has to make are in the first pull description and the issue thread, not in the repo.
commented

Declined: #7947 can't be finished from a run. Production config is the only blocker: it lives in gitops trevato-apps/gitops apps/forge/prod/manifests.yaml, which the conductor applies and no run can reach. Without it there is no switch-on, no canary release and no steward retirement. Run log: https://forge.open-platform.sh/trevato/forge/runs/01m6cy91dvcgvnb900kcpj19zq

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs