feat(ci): cut a Release for every published Image #54

Merged
piscis merged 23 commits from piscis/releases into main 2026-10-10 13:19:37 +00:00
Owner

Summary

Base images are tracked and guarded, and every published Image gets a Release named like its Image tag.

 ci.yml on pull_request
+  make check-title        # title is a Conventional Commit (also re-runs on a title edit)
   make lint
+  make test               # scripts/release-test.sh, fixture repos + a local API stub
+  make check-rebuild      # a base image changed but the Image tag didn't → fail, names the Pin edit
   make verify-pin / build-multiarch / smoke-test-multiarch
+  make release-notes      # dry run of the Release, creates nothing

 ci.yml on push to / dispatch from main
   … build, smoke test
   scripts/publish.sh
+  make release            # Release for the Image tag if none exists yet; tag = Image's revision label
scripts/release.sh dry-run|post [--tag X.Y.Z-rN] [--target <rev>]
  target   = --target, else the published Image's org.opencontainers.image.revision
  previous = nearest Release tag that is an ancestor of target (never semver sorting)
  header   = Upstream Version (linked), changed/unchanged since previous, Rebuild number
  body     = git-cliff (digest-pinned, history via stdin): feat/fix/perf/breaking,
             minus scopes scripts, skills, renovate, agents, ci
  post     = GET release by tag → 200: nothing; 404: POST /releases (Forgejo creates the tag)
  • Renovate: the dockerfile manager is on next to the Pin manager. Go build image and distroless base come in one weekly PR, fix(deps): update base images, with digest + minor (no major) for Go. Its notes tell the reviewer to raise the Rebuild; the guard fails it until they do.
  • Token: the release step uses secrets.RELEASE_TOKEN || github.token. Forgejo v16's source gives a task token write on its own repo with no scope limits, so the automatic token should be enough; the first dispatch on main confirms it (see docs/agents/forgejo.md).
  • Backfill (done): Release 3.2.0-r1, tag on 7f2e214, the revision label of that Image. A second post run created nothing.
  • Release-it from an earlier setup in another repo was rejected for git-cliff (ADR 0005, in #53).

Evidence

  • Guard. Before: no check. After: throwaway commit acf3b4e (distroless digest dropped, Pin unchanged), reverted in 0424bba, failed CI run 6162:
    ERROR: A base image changed against origin/main, but the Image tag is still 3.2.0-r1:
    ERROR: Merging it would publish nothing. In pin.env, set REBUILD_OF=v3.2.0 and REBUILD=2.
    
  • Title check. Before: any title. After: editing only the title to Cut a Release for every published Image started run 6164, which failed with check-title: FAIL: '…' is not a Conventional Commit. Restoring it started run 6165, green, without a push.
  • Notes. With #53 merged locally and a local 3.2.0-r1 tag, make release-notes prints: v3.2.0 … unchanged since 3.2.0-r1, Rebuild: 2, Bug fixes Build the Image with Go 1.27, as Go 1.25 is out of support; #43 and #44 (scripts) are left out. On CI's dind the preview targets 7f2e214 from the registry label.
  • Renovate. Before: a dry run detects only forgejo-mcp. After: it detects golang and gcr.io/distroless/static-debian12 in branch renovate/base-images, titled fix(deps): update base images; the Pin PR stays chore(deps): update upstream forgejo-mcp to ….

Merge Danger

Door: two-way, except for Releases: each push to main that publishes a new Image tag creates a Release and a git tag, which stay unless deleted by hand.

Blast Radius: CI

PRs that change a base image without a Rebuild, or carry a non-conventional title (a WIP: draft included), now fail. If the automatic token can't create Releases, the release step on main fails after publishing; the Image is still published, and adding RELEASE_TOKEN then re-running repairs it.

Closes #47
Closes #48
Closes #49
Closes #50
Closes #51
Closes #52

## Summary Base images are tracked and guarded, and every published Image gets a Release named like its Image tag. ```diff ci.yml on pull_request + make check-title # title is a Conventional Commit (also re-runs on a title edit) make lint + make test # scripts/release-test.sh, fixture repos + a local API stub + make check-rebuild # a base image changed but the Image tag didn't → fail, names the Pin edit make verify-pin / build-multiarch / smoke-test-multiarch + make release-notes # dry run of the Release, creates nothing ci.yml on push to / dispatch from main … build, smoke test scripts/publish.sh + make release # Release for the Image tag if none exists yet; tag = Image's revision label ``` ```text scripts/release.sh dry-run|post [--tag X.Y.Z-rN] [--target <rev>] target = --target, else the published Image's org.opencontainers.image.revision previous = nearest Release tag that is an ancestor of target (never semver sorting) header = Upstream Version (linked), changed/unchanged since previous, Rebuild number body = git-cliff (digest-pinned, history via stdin): feat/fix/perf/breaking, minus scopes scripts, skills, renovate, agents, ci post = GET release by tag → 200: nothing; 404: POST /releases (Forgejo creates the tag) ``` - **Renovate:** the dockerfile manager is on next to the Pin manager. Go build image and distroless base come in one weekly PR, `fix(deps): update base images`, with digest + minor (no major) for Go. Its notes tell the reviewer to raise the Rebuild; the guard fails it until they do. - **Token:** the release step uses `secrets.RELEASE_TOKEN || github.token`. Forgejo v16's source gives a task token write on its own repo with no scope limits, so the automatic token should be enough; the first dispatch on main confirms it (see `docs/agents/forgejo.md`). - **Backfill (done):** Release [`3.2.0-r1`](https://code.vicoli.de/vicoli-oss/docker-forgejo-mcp/releases/tag/3.2.0-r1), tag on `7f2e214`, the revision label of that Image. A second post run created nothing. - Release-it from an earlier setup in another repo was rejected for git-cliff (ADR 0005, in #53). ## Evidence - **Guard.** Before: no check. After: throwaway commit `acf3b4e` (distroless digest dropped, Pin unchanged), reverted in `0424bba`, failed CI run 6162: ``` ERROR: A base image changed against origin/main, but the Image tag is still 3.2.0-r1: ERROR: Merging it would publish nothing. In pin.env, set REBUILD_OF=v3.2.0 and REBUILD=2. ``` - **Title check.** Before: any title. After: editing only the title to `Cut a Release for every published Image` started run 6164, which failed with `check-title: FAIL: '…' is not a Conventional Commit`. Restoring it started run 6165, green, without a push. - **Notes.** With #53 merged locally and a local `3.2.0-r1` tag, `make release-notes` prints: `v3.2.0 … unchanged since 3.2.0-r1`, `Rebuild: 2`, Bug fixes `Build the Image with Go 1.27, as Go 1.25 is out of support`; #43 and #44 (`scripts`) are left out. On CI's dind the preview targets `7f2e214` from the registry label. - **Renovate.** Before: a dry run detects only `forgejo-mcp`. After: it detects `golang` and `gcr.io/distroless/static-debian12` in branch `renovate/base-images`, titled `fix(deps): update base images`; the Pin PR stays `chore(deps): update upstream forgejo-mcp to …`. ## Merge Danger **Door:** two-way, except for Releases: each push to main that publishes a new Image tag creates a Release and a git tag, which stay unless deleted by hand. **Blast Radius:** CI PRs that change a base image without a Rebuild, or carry a non-conventional title (a `WIP:` draft included), now fail. If the automatic token can't create Releases, the release step on main fails after publishing; the Image is still published, and adding `RELEASE_TOKEN` then re-running repairs it. Closes #47 Closes #48 Closes #49 Closes #50 Closes #51 Closes #52
ci: fail a pull request that changes a base image without a new Image tag (#47)
All checks were successful
ci / build (pull_request) Successful in 16s
d5c5f34e03
test(ci): THROWAWAY base-image change without a Rebuild
Some checks failed
ci / build (pull_request) Failing after 13s
acf3b4e744
piscis changed title from feat: cut a Release for every published Image to Cut a Release for every published Image 2026-10-10 11:46:49 +00:00
piscis changed title from Cut a Release for every published Image to feat: cut a Release for every published Image 2026-10-10 11:47:00 +00:00
scripts/release.sh dry-run prints the notes of the Release for the Image tag
and the create-release payload, creating nothing. git-cliff runs as a
digest-pinned image fed through a tar on stdin; the header comes from the
Pin at the target commit, the previous Release from git ancestry.
docs/agents/releases.md lists the internal scopes.
Merge remote-tracking branch 'origin/piscis/releases' into piscis/releases-48
All checks were successful
ci / build (pull_request) Successful in 14s
fbc7fb80d1
# Conflicts:
#	Makefile
Turn on the Dockerfile manager next to the Pin manager. The Go build image
(digest and minor updates, no major) and the distroless runtime base arrive
together as "chore(deps): update base images", Mondays before 04:00. The PR
notes tell the reviewer to raise the Rebuild per pin.env's header; until then
make check-rebuild fails the PR. Renovate doesn't raise it itself (ADR 0003).

semanticCommits is set top-level: the bot already auto-detected chore(deps)
titles, and a local dry run otherwise shows them without a prefix.
Merge branch 'piscis/releases-50' into piscis/releases
All checks were successful
ci / build (pull_request) Successful in 12s
36c19d82d4
ci: create the Release after publishing (#52)
All checks were successful
ci / build (pull_request) Successful in 54s
1203d6f4cc
piscis changed title from feat: cut a Release for every published Image to feat(ci): cut a Release for every published Image 2026-10-10 12:05:30 +00:00
- release-test.sh exited 0 untested when run without make: ${VAR:?} under the EXIT trap.
  Both scripts now check with [ -n … ] || fail, as docs/agents/releases.md says.
- release.sh asks the registry for the same manifest types as publish.sh.
- usage() prints the header's Usage block by its markers, not by line numbers.
- IMAGE_REPO's default notes that it must match ci.yml.
scripts/base-image-refs.awk reads the base-image refs: the # syntax frontend, each FROM's
image (not an earlier stage), each COPY --from=<image> (not a stage), with FROM \ continuation
lines joined. A ref set by an ARG fails with a message, since the guard can't resolve it.
ci.yml's header merges its two "on a pull request it first" paragraphs into one in step order;
the README's step list and make targets add make test, make release and make release-notes in
CI's order. ci.yml notes that release.sh's IMAGE_REPO default must match its env.
fix(renovate): commit base-image rounds as fix(deps), so their Release lists them
All checks were successful
ci / build (pull_request) Successful in 52s
9aa7b66537
cliff.toml skips chore(deps), so a Rebuild for new base images got no notes at all. A local
dry run shows "fix(deps): update base images" for the group and still
"chore(deps): update upstream forgejo-mcp to v3.2.0" for the Pin; make check-title passes both.
piscis merged commit 36a400da7b into main 2026-10-10 13:19:37 +00:00
piscis deleted branch piscis/releases 2026-10-10 13:19:38 +00:00
Sign in to join this conversation.
No description provided.