CI: Woodpecker validation and tag-release pipelines; the git tag becomes the release unit #41

Closed
opened 2026-11-02 05:42:43 +00:00 by piers · 2 comments
Owner

Decision record (grill, 2026-11-02 09:40Z, operator accepted)

This record supersedes the body below wherever they disagree. It applies to dev/mail-mind-mcp#132 as well. ADR 0008 (docs/adr/0008-release-and-delivery.md, branch feat/41-release-delivery) records the decision.

  1. Release unit. An annotated v-prefixed tag on main names a release: v0.1.0-rc.5 publishes image 0.1.0-rc.5. The release filter is refs/tags/v*, not refs/tags/0.*. The reason is that Mail Mind already has released v* tags and a live starbase pin on v0.10.1.
  2. Version source. The tag only. pyproject.toml stays 0.1.0.dev0 as a development marker. Nothing reads the package version at runtime.
  3. Trigger. event: tag, not publish-on-main (item 5 below is ruled). The starbase pin needs one version string for ?ref=, newTag and digest.
  4. Record. A new ADR 0008, not an amendment. "The deploy ADR from #9" is ADR 0001 §6, and ADR 0008 refines it. The README gets a new ## Releases and deploy section; it has no deploy section today.
  5. Immutable publish. bake-publish.sh probes crane digest <image>:<tag> first. If the tag exists, it fails and prints the existing digest.
  6. Credential. forgejo_package_token (svc-oci-writer) with events: ["tag"]. A Forgejo protected-tag rule limits v* to piers. The infra/iac#833 residual stands; this is tighter.
  7. Guards in make check. A drift test asserts that the .woodpecker/*.yaml base digests equal the Makefile's PYTHON_DIGEST_amd64. A parity test asserts that the bake sets the Containerfile's user, entrypoint and command.
  8. Route. Architect-direct, one PR. Not SVD (the dispatch-note question is ruled).
  9. No backfill. v0.1.0-rc.5, built by CI, is the first tag. rc.2 to rc.4 stay digest-only.
  10. Out of scope. The starbase pin (starbase/iac#297 or a hand PR after rc.5). The infra/iac runbook update is a separate infra/iac issue that lands after rc.5 runs green.

Corrections to the body below.

  • The validation image is the amd64 digest sha256:623674a14ef93d052bb9b0de4dbf5f28eb578a35263838941cc8aa43213c1487 (Makefile PYTHON_DIGEST_amd64). The Containerfile's default ARG is the arm64 digest.
  • make check reports 5 skipped, not 3.

Acceptance (replaces the list below).

  • A PR run on validation.yaml goes green on make check.
  • Pushing v0.1.0-rc.5 runs release.yaml; image 0.1.0-rc.5 exists; podman pull git.groupthink.asia/dev/people-mind-mcp@<digest> returns the logged digest.
  • A second run for the same tag fails at the publish probe and prints the existing digest.
  • A local kubectl kustomize of an overlay with ?ref=v0.1.0-rc.5 renders the base.
  • ADR 0008 and the README state the tag convention.

Human act (CONV-40, per repo): activate on ci.groupthink.asia and PATCH {"allow_pr": true}; store forgejo_package_token with events: ["tag"]; add the v* protected-tag rule for piers.


Problem

The repo has no CI and no release automation. Every rc so far (0.1.0-rc.2, rc.3, rc.4 on 2026-11-02) was produced by hand: the architect ran make check on a scratch worktree before each merge, ran make image-amd64, pushed the image to git.groupthink.asia/dev/people-mind-mcp, pulled it back by digest, and opened the starbase pin PR with the digest and the commit SHA. Nothing in the repo records what a release is, so the image tag is a hand-chosen string and the starbase kustomize base pins a bare commit SHA (?ref=902eed7…).

Woodpecker exists for this forge at https://ci.groupthink.asia (estate meridian, lane linux, docker backend; dev/stables and infra/iac carry .woodpecker/ pipelines). This repo is not enabled on it and has no pipeline files. One lane in the estate already builds and publishes an image: dev/ops-gateway .woodpecker/bake.yaml, a daemonless crane bake to the Forgejo registry (dev/ops-gateway ADR-0008 Amendment 2026-10-04, ruled on infra/iac#652). It runs with no container daemon, no Kaniko, no buildx and no trusted flag, because a Woodpecker step on the meridian lane has none of those, and the runner validator refuses privileged, volumes, devices and network_mode by key name. A new bake here copies that shape; it does not need a new builder decision.

Decision to record

  1. The annotated git tag is the release unit. 0.1.0-rc.N and 0.1.0 tags on main (no v prefix, matching the image tags already pushed). CI builds the image from the tag. The starbase pin references the tag three times: the kustomize base ?ref=<tag>, images[].newTag: <tag>, and images[].digest. Record this as an ADR amendment in docs/adr/ (the deploy ADR from #9) and in the README deploy section.
  2. Validation pipeline .woodpecker/validation.yaml: event: push on main and event: pull_request; labels platform: linux/amd64, backend: docker, estate: meridian, lane: linux (mirror dev/stables/.woodpecker/validation.yaml); CONV-36 trigger-posture header at the top of the file (runbook §2); clone plugin pinned by digest; one step on a digest-pinned python:3.12-slim-bookworm image (the Containerfile's digest) that installs uv and runs make check. The embed tests skip without the model (3 skipped), which is acceptable; make test-integration stays host-only because it needs podman.
  3. Release pipeline .woodpecker/release.yaml: event: tag, ref: refs/tags/0.*; reproduces the Containerfile the way dev/ops-gateway does: an assemble step runs the dependency stage on the pinned Python image and writes one layer tarball (the venv and the hash-checked embedding model from scripts/fetch_model.py), an image step appends it to the pinned base with crane and sets the Containerfile's config (non-root uid 1000, entrypoint), and a publish step pushes with crane, reads back the registry digest, tags git.groupthink.asia/dev/people-mind-mcp:<tag> and prints the digest as the last log line. The Containerfile stays the readable definition of the image; a change to it changes the bake scripts in the same commit. The push credential is the existing dev org token svc-oci-writer (write:package, instance-wide package scope; the branch-pusher reach is an accepted residual, infra/iac#652 and #833), stored as the repository secret forgejo_package_token with events limited to the publish event. Stored secrets sit in plaintext in the Woodpecker database (infra/iac docs/runbooks/woodpecker-pipeline-authoring.md §8), so the validation lane holds no secret and a PR run publishes nothing (ci-runner trust posture, lane-build).
  4. Operator steps (not in the repo): activate the repo on ci.groupthink.asia (POST /api/repos?forge_remote_id=<id> with op://Infra/woodpecker-api/token, then PATCH {"allow_pr": true}, without which every PR run is dropped silently; runbook §1), and store the forgejo_package_token secret on the repo. Both are credential acts reserved to the operator.
  5. Open question for triage: event: tag or publish on every push to main. No estate lane uses event: tag yet (runbook §3). dev/ops-gateway publishes on every push to main and the digest pin in starbase is the deploy boundary. This issue proposes the first tag lane because the starbase pin needs one version string for both the kustomize base ?ref= and the image. The alternative is publish-on-main with a floating image tag and a vendored copy of deploy/k8s/base in starbase, so nothing in starbase references a git ref. The tag lane is the cheaper one to reverse: it adds a trigger and changes no consumer.

Acceptance

  • A PR run on validation.yaml goes green on make check (ruff, ruff format, mypy strict, pytest -m "not integration").
  • Pushing tag 0.1.0-rc.5 runs release.yaml, the image 0.1.0-rc.5 exists in the Forgejo registry, and podman pull git.groupthink.asia/dev/people-mind-mcp@<digest> returns the logged digest.
  • kubectl kustomize on a starbase overlay with ?ref=0.1.0-rc.5 renders the base.
  • The ADR amendment and README state the tag convention.

Dispatch note

codex-svd dispatch forbids edits under .woodpecker/* (forbiddenMutationCheck; dev/stables ADR 0021 has the rider remedy). This unit either goes architect-direct on a branch or through the ADR 0021 rider. Triage decides.

Human act

credential: the operator activates the repo on ci.groupthink.asia and stores forgejo_package_token (CONV-40)

Primary files

  • .woodpecker/validation.yaml (new)
  • .woodpecker/release.yaml (new)
  • docs/adr/ amendment, README.md deploy section

Blocked by

None.

Filed under: operator word "Cut issues to close the CI/CD gap as you proposed." sha256:41b61dc477f6

## Decision record (grill, 2026-11-02 09:40Z, operator accepted) This record supersedes the body below wherever they disagree. It applies to dev/mail-mind-mcp#132 as well. ADR 0008 (`docs/adr/0008-release-and-delivery.md`, branch `feat/41-release-delivery`) records the decision. 1. **Release unit.** An annotated `v`-prefixed tag on `main` names a release: `v0.1.0-rc.5` publishes image `0.1.0-rc.5`. The release filter is `refs/tags/v*`, not `refs/tags/0.*`. The reason is that Mail Mind already has released `v*` tags and a live starbase pin on `v0.10.1`. 2. **Version source.** The tag only. `pyproject.toml` stays `0.1.0.dev0` as a development marker. Nothing reads the package version at runtime. 3. **Trigger.** `event: tag`, not publish-on-main (item 5 below is ruled). The starbase pin needs one version string for `?ref=`, `newTag` and `digest`. 4. **Record.** A new ADR 0008, not an amendment. "The deploy ADR from #9" is ADR 0001 §6, and ADR 0008 refines it. The README gets a new `## Releases and deploy` section; it has no deploy section today. 5. **Immutable publish.** `bake-publish.sh` probes `crane digest <image>:<tag>` first. If the tag exists, it fails and prints the existing digest. 6. **Credential.** `forgejo_package_token` (`svc-oci-writer`) with `events: ["tag"]`. A Forgejo protected-tag rule limits `v*` to `piers`. The infra/iac#833 residual stands; this is tighter. 7. **Guards in `make check`.** A drift test asserts that the `.woodpecker/*.yaml` base digests equal the Makefile's `PYTHON_DIGEST_amd64`. A parity test asserts that the bake sets the Containerfile's user, entrypoint and command. 8. **Route.** Architect-direct, one PR. Not SVD (the dispatch-note question is ruled). 9. **No backfill.** `v0.1.0-rc.5`, built by CI, is the first tag. rc.2 to rc.4 stay digest-only. 10. **Out of scope.** The starbase pin (starbase/iac#297 or a hand PR after rc.5). The infra/iac runbook update is a separate infra/iac issue that lands after rc.5 runs green. **Corrections to the body below.** - The validation image is the amd64 digest `sha256:623674a14ef93d052bb9b0de4dbf5f28eb578a35263838941cc8aa43213c1487` (Makefile `PYTHON_DIGEST_amd64`). The Containerfile's default ARG is the arm64 digest. - `make check` reports 5 skipped, not 3. **Acceptance (replaces the list below).** - A PR run on `validation.yaml` goes green on `make check`. - Pushing `v0.1.0-rc.5` runs `release.yaml`; image `0.1.0-rc.5` exists; `podman pull git.groupthink.asia/dev/people-mind-mcp@<digest>` returns the logged digest. - A second run for the same tag fails at the publish probe and prints the existing digest. - A local `kubectl kustomize` of an overlay with `?ref=v0.1.0-rc.5` renders the base. - ADR 0008 and the README state the tag convention. **Human act (CONV-40, per repo):** activate on `ci.groupthink.asia` and `PATCH {"allow_pr": true}`; store `forgejo_package_token` with `events: ["tag"]`; add the `v*` protected-tag rule for `piers`. --- ## Problem The repo has no CI and no release automation. Every rc so far (0.1.0-rc.2, rc.3, rc.4 on 2026-11-02) was produced by hand: the architect ran `make check` on a scratch worktree before each merge, ran `make image-amd64`, pushed the image to `git.groupthink.asia/dev/people-mind-mcp`, pulled it back by digest, and opened the starbase pin PR with the digest and the commit SHA. Nothing in the repo records what a release is, so the image tag is a hand-chosen string and the starbase kustomize base pins a bare commit SHA (`?ref=902eed7…`). Woodpecker exists for this forge at `https://ci.groupthink.asia` (estate `meridian`, lane `linux`, docker backend; `dev/stables` and `infra/iac` carry `.woodpecker/` pipelines). This repo is not enabled on it and has no pipeline files. One lane in the estate already builds and publishes an image: dev/ops-gateway `.woodpecker/bake.yaml`, a daemonless crane bake to the Forgejo registry (dev/ops-gateway ADR-0008 Amendment 2026-10-04, ruled on infra/iac#652). It runs with no container daemon, no Kaniko, no buildx and no `trusted` flag, because a Woodpecker step on the meridian lane has none of those, and the runner validator refuses `privileged`, volumes, devices and `network_mode` by key name. A new bake here copies that shape; it does not need a new builder decision. ## Decision to record 1. **The annotated git tag is the release unit.** `0.1.0-rc.N` and `0.1.0` tags on `main` (no `v` prefix, matching the image tags already pushed). CI builds the image from the tag. The starbase pin references the tag three times: the kustomize base `?ref=<tag>`, `images[].newTag: <tag>`, and `images[].digest`. Record this as an ADR amendment in `docs/adr/` (the deploy ADR from #9) and in the README deploy section. 2. **Validation pipeline** `.woodpecker/validation.yaml`: `event: push` on `main` and `event: pull_request`; labels `platform: linux/amd64`, `backend: docker`, `estate: meridian`, `lane: linux` (mirror `dev/stables/.woodpecker/validation.yaml`); CONV-36 trigger-posture header at the top of the file (runbook §2); clone plugin pinned by digest; one step on a digest-pinned `python:3.12-slim-bookworm` image (the Containerfile's digest) that installs `uv` and runs `make check`. The embed tests skip without the model (3 skipped), which is acceptable; `make test-integration` stays host-only because it needs podman. 3. **Release pipeline** `.woodpecker/release.yaml`: `event: tag`, `ref: refs/tags/0.*`; reproduces the `Containerfile` the way dev/ops-gateway does: an `assemble` step runs the dependency stage on the pinned Python image and writes one layer tarball (the venv and the hash-checked embedding model from `scripts/fetch_model.py`), an `image` step appends it to the pinned base with crane and sets the Containerfile's config (non-root uid 1000, entrypoint), and a `publish` step pushes with crane, reads back the registry digest, tags `git.groupthink.asia/dev/people-mind-mcp:<tag>` and prints the digest as the last log line. The Containerfile stays the readable definition of the image; a change to it changes the bake scripts in the same commit. The push credential is the existing `dev` org token `svc-oci-writer` (`write:package`, instance-wide package scope; the branch-pusher reach is an accepted residual, infra/iac#652 and #833), stored as the repository secret `forgejo_package_token` with `events` limited to the publish event. Stored secrets sit in plaintext in the Woodpecker database (infra/iac `docs/runbooks/woodpecker-pipeline-authoring.md` §8), so the validation lane holds no secret and a PR run publishes nothing (ci-runner trust posture, lane-build). 4. **Operator steps** (not in the repo): activate the repo on `ci.groupthink.asia` (`POST /api/repos?forge_remote_id=<id>` with `op://Infra/woodpecker-api/token`, then `PATCH` `{"allow_pr": true}`, without which every PR run is dropped silently; runbook §1), and store the `forgejo_package_token` secret on the repo. Both are credential acts reserved to the operator. 5. **Open question for triage: `event: tag` or publish on every push to `main`.** No estate lane uses `event: tag` yet (runbook §3). dev/ops-gateway publishes on every push to `main` and the digest pin in starbase is the deploy boundary. This issue proposes the first `tag` lane because the starbase pin needs one version string for both the kustomize base `?ref=` and the image. The alternative is publish-on-main with a floating image tag and a vendored copy of `deploy/k8s/base` in starbase, so nothing in starbase references a git ref. The tag lane is the cheaper one to reverse: it adds a trigger and changes no consumer. ## Acceptance - A PR run on `validation.yaml` goes green on `make check` (ruff, ruff format, mypy strict, pytest `-m "not integration"`). - Pushing tag `0.1.0-rc.5` runs `release.yaml`, the image `0.1.0-rc.5` exists in the Forgejo registry, and `podman pull git.groupthink.asia/dev/people-mind-mcp@<digest>` returns the logged digest. - `kubectl kustomize` on a starbase overlay with `?ref=0.1.0-rc.5` renders the base. - The ADR amendment and README state the tag convention. ## Dispatch note `codex-svd` dispatch forbids edits under `.woodpecker/*` (`forbiddenMutationCheck`; dev/stables ADR 0021 has the rider remedy). This unit either goes architect-direct on a branch or through the ADR 0021 rider. Triage decides. ## Human act credential: the operator activates the repo on ci.groupthink.asia and stores forgejo_package_token (CONV-40) ## Primary files - `.woodpecker/validation.yaml` (new) - `.woodpecker/release.yaml` (new) - `docs/adr/` amendment, `README.md` deploy section ## Related - dev/mail-mind-mcp#132: the same pipeline shape for the sibling repo. - starbase/iac#297: Renovate opens the pin PRs once the tags exist. ## Blocked by None. Filed under: operator word "Cut issues to close the CI/CD gap as you proposed." sha256:41b61dc477f6

Release acceptance, proven 2026-11-02 on v0.1.0-rc.6 (7a77f25). #43 merged the lanes and closed this issue before any tag had run.

Criterion Evidence
The tag step accepts an annotated v* tag on main Pipeline 8 tag step: v0.1.0-rc.6 at 7a77f258… is an annotated tag on main. This needed #44: on a tag event CI_COMMIT_SHA is the tag object, not the commit.
The bake reproduces the Containerfile runtime amd64, user peoplemind, entrypoint peoplemind, cmd api --config /etc/peoplemind/config.toml, port 8420/tcp. Labels: revision 7a77f258…, version 0.1.0-rc.6.
Publish pushes and prints the digest published git.groupthink.asia/dev/people-mind-mcp:0.1.0-rc.6, digest sha256:0d7bc9932c870c30ae6ba35ec5338ce852fb56a5922378a158cbfa594211f225.
The registry serves that digest The tag resolves to the same digest, and the SHA-256 of the manifest fetched by digest matches.
The three-part pin renders kubectl kustomize of deploy/k8s/base?ref=v0.1.0-rc.6 with images: [{name: people-mind-mcp, newName: git.groupthink.asia/dev/people-mind-mcp, newTag: 0.1.0-rc.6, digest: sha256:0d7bc993…}] pins all three peoplemind containers.
A re-run of a published tag refuses Open. It needs one more restart of pipeline 8; publish should exit 1 with "already exists".

Three runs failed before the green one:

  • Pipeline 3 (rc.5): the secret had an images filter, which limits it to plugin steps. The secret was re-created without it.
  • Pipelines 6 and 7 (rc.6): Traefik cut the venv layer PATCH (51 MiB compressed) at its 60s read timeout. infra/iac#965 raised the tunnel entrypoint's timeout to 600s.

v0.1.0-rc.5 was deleted: its tree predates #44, and it never published an image. The publish token is now a token of its own, woodpecker-people-mind-mcp, not the ops-gateway token.

Release acceptance, proven 2026-11-02 on `v0.1.0-rc.6` (`7a77f25`). #43 merged the lanes and closed this issue before any tag had run. | Criterion | Evidence | | --- | --- | | The tag step accepts an annotated `v*` tag on main | Pipeline 8 `tag` step: `v0.1.0-rc.6 at 7a77f258… is an annotated tag on main`. This needed #44: on a tag event `CI_COMMIT_SHA` is the tag object, not the commit. | | The bake reproduces the Containerfile runtime | amd64, user `peoplemind`, entrypoint `peoplemind`, cmd `api --config /etc/peoplemind/config.toml`, port `8420/tcp`. Labels: revision `7a77f258…`, version `0.1.0-rc.6`. | | Publish pushes and prints the digest | `published git.groupthink.asia/dev/people-mind-mcp:0.1.0-rc.6`, digest `sha256:0d7bc9932c870c30ae6ba35ec5338ce852fb56a5922378a158cbfa594211f225`. | | The registry serves that digest | The tag resolves to the same digest, and the SHA-256 of the manifest fetched by digest matches. | | The three-part pin renders | `kubectl kustomize` of `deploy/k8s/base?ref=v0.1.0-rc.6` with `images: [{name: people-mind-mcp, newName: git.groupthink.asia/dev/people-mind-mcp, newTag: 0.1.0-rc.6, digest: sha256:0d7bc993…}]` pins all three peoplemind containers. | | A re-run of a published tag refuses | **Open.** It needs one more restart of pipeline 8; publish should exit 1 with "already exists". | Three runs failed before the green one: - Pipeline 3 (`rc.5`): the secret had an `images` filter, which limits it to plugin steps. The secret was re-created without it. - Pipelines 6 and 7 (`rc.6`): Traefik cut the venv layer PATCH (51 MiB compressed) at its 60s read timeout. infra/iac#965 raised the tunnel entrypoint's timeout to 600s. `v0.1.0-rc.5` was deleted: its tree predates #44, and it never published an image. The publish token is now a token of its own, `woodpecker-people-mind-mcp`, not the ops-gateway token.

The last criterion is proven. Pipeline 9 re-ran v0.1.0-rc.6; publish logged in, found the tag, printed sha256:0d7bc9932c870c30ae6ba35ec5338ce852fb56a5922378a158cbfa594211f225, and exited 1: publish: git.groupthink.asia/dev/people-mind-mcp:0.1.0-rc.6 already exists; a release tag is never re-published. The registry tag still resolves to that digest. Every release criterion of this issue now holds.

The last criterion is proven. Pipeline 9 re-ran `v0.1.0-rc.6`; publish logged in, found the tag, printed `sha256:0d7bc9932c870c30ae6ba35ec5338ce852fb56a5922378a158cbfa594211f225`, and exited 1: `publish: git.groupthink.asia/dev/people-mind-mcp:0.1.0-rc.6 already exists; a release tag is never re-published`. The registry tag still resolves to that digest. Every release criterion of this issue now holds.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
dev/people-mind-mcp#41
No description provided.