Layered promotion-gated test pipeline: build once → test at dev → rc → prod #4

Open
opened 2026-07-05 23:40:15 +00:00 by jmiller · 1 comment
Owner

Restructure testing so it's layered across the deploy tiers (dev → rc → prod) instead of only running on dev, with each tier requiring a stable, tested build before it promotes. Pairs with the deploy workflows (Template-Go#3) and the new RC environment.

Principle: build once, test, promote the artifact

Build a single image, test it, and promote the same tested artifact up the tiers — don't rebuild an untested image at each stage.

Tier Trigger Gate to promote
dev push to dev build + full test suite pass → deploy to dev → stable → eligible for rc
rc promote-rc (PR→main) deploy the tested image to rc.git → run suite + smoke tests against the live RC instance → stable → eligible for main
prod merge to main deploy to prod only if the RC build was stable + healthy (gate on RC, not dev)

So tests run at dev and rc; each tier certifies a stable build before the next.

Prerequisites (blockers — must land first)

  1. tests/integration must compile and run. It's currently broken (API drift never propagated to the tests — auth_oauth2 dup func → NewRequestWithBody []byte→io.Reader → value-vs-pointer → …). A tested pipeline can't gate on a suite that doesn't build. This is a fork-wide integration-test repair (tracked separately).
  2. Runner-queue stall fixed. The "Project CI / Tests" job chronically stays "Blocked by required conditions" — the gate is meaningless if tests never run. Needs the runner reliability issue resolved.

Design notes

  • Generic + template-owned (like the deploy workflows): drive tier config from repo vars.*/secrets.* so it works across Go server repos. Lives in the root .mokogitea/workflows/ synced from here.
  • Prod-deploy gate becomes "RC healthy + RC tests green" (replaces the current "dev healthy" gate in deploy-mokogitea.yml).
  • Consider a status/label the promotion checks read (e.g. only promote a commit whose dev tests passed), and reuse the built image digest across tiers.

Related: Template-Go#3 (deploy workflows), MokoGitea-Fork#751 (deploy-rc), Template-Generic#71 (release-notes). Prereq: fork-wide integration-test repair.

https://claude.ai/code/session_01Wsno14cxE49MstXFs9G5KT

Restructure testing so it's **layered across the deploy tiers (dev → rc → prod)** instead of only running on dev, with each tier requiring a **stable, tested build** before it promotes. Pairs with the deploy workflows (Template-Go#3) and the new RC environment. ## Principle: build once, test, promote the artifact Build a single image, test it, and **promote the same tested artifact** up the tiers — don't rebuild an untested image at each stage. | Tier | Trigger | Gate to promote | |---|---|---| | **dev** | push to `dev` | build + full test suite pass → deploy to dev → **stable** → eligible for `rc` | | **rc** | promote-rc (PR→main) | deploy the tested image to `rc.git` → run suite + smoke tests against the live RC instance → **stable** → eligible for `main` | | **prod** | merge to `main` | deploy to prod **only if** the RC build was stable + healthy (gate on RC, not dev) | So tests run at dev **and** rc; each tier certifies a stable build before the next. ## Prerequisites (blockers — must land first) 1. **`tests/integration` must compile and run.** It's currently broken (API drift never propagated to the tests — auth_oauth2 dup func → NewRequestWithBody `[]byte`→io.Reader → value-vs-pointer → …). A tested pipeline can't gate on a suite that doesn't build. This is a fork-wide integration-test repair (tracked separately). 2. **Runner-queue stall fixed.** The "Project CI / Tests" job chronically stays "Blocked by required conditions" — the gate is meaningless if tests never run. Needs the runner reliability issue resolved. ## Design notes - **Generic + template-owned** (like the deploy workflows): drive tier config from repo `vars.*`/`secrets.*` so it works across Go server repos. Lives in the root `.mokogitea/workflows/` synced from here. - Prod-deploy gate becomes "RC healthy + RC tests green" (replaces the current "dev healthy" gate in deploy-mokogitea.yml). - Consider a status/label the promotion checks read (e.g. only promote a commit whose dev tests passed), and reuse the built image digest across tiers. Related: Template-Go#3 (deploy workflows), MokoGitea-Fork#751 (deploy-rc), Template-Generic#71 (release-notes). Prereq: fork-wide integration-test repair. https://claude.ai/code/session_01Wsno14cxE49MstXFs9G5KT
Author
Owner

Both prerequisites are now cleared — this is implementable

  1. tests/integration compiles — repaired in MokoGitea-Fork #755 (composer value→pointer + oauth_avatar_test.go upstream-import drift). go vet ./tests/integration/... exits 0.
  2. Runner stall fixed — root-caused: the Gitea Actions scheduler does not offer the dependent 2nd job of a needs-chain to runners, so Project CI / Tests sat in waiting and was reaped. Fixed by making the Tests job independent (MokoGitea-Fork #756 + Template-Generic #78); verified the Tests job now schedules + runs (run 34999).

The paired deploy workflows (Template-Go#3, PR #5) are also ready. So the layered pipeline can now be built: build-once → test at dev → promote the tested artifact to rc → gate prod on RC health (replacing the old dev-health gate that was just removed in MokoGitea-Fork #758).

https://claude.ai/code/session_01Wsno14cxE49MstXFs9G5KT

## Both prerequisites are now cleared — this is implementable 1. **`tests/integration` compiles** — repaired in **MokoGitea-Fork #755** (composer value→pointer + `oauth_avatar_test.go` upstream-import drift). `go vet ./tests/integration/...` exits 0. 2. **Runner stall fixed** — root-caused: the Gitea Actions scheduler does not offer the **dependent 2nd job of a `needs`-chain** to runners, so `Project CI / Tests` sat in `waiting` and was reaped. Fixed by making the Tests job independent (**MokoGitea-Fork #756** + **Template-Generic #78**); verified the Tests job now schedules + runs (run 34999). The paired deploy workflows (Template-Go#3, PR #5) are also ready. So the layered pipeline can now be built: **build-once → test at dev → promote the tested artifact to rc → gate prod on RC health** (replacing the old dev-health gate that was just removed in MokoGitea-Fork #758). https://claude.ai/code/session_01Wsno14cxE49MstXFs9G5KT
Sign in to join this conversation.
Priority Medium
Type Feature
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/Template-Go#4