Skip to content

chore: release-please - #487

Merged
gusfcarvalho merged 1 commit into
ra/w1-s2-t01-shared-cifrom
ra/w1-s2-t02-release-please
Oct 9, 2026
Merged

gusfcarvalho merged 1 commit into
ra/w1-s2-t01-shared-cifrom
ra/w1-s2-t02-release-please

Conversation

@ccf-lisa

@ccf-lisa ccf-lisa Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Task: W1-S2-T02

Part 2 of 3 of the api onboarding stack (CCF Release Automation Design). Stacked on #486.

Adds release-please, run as ccf-release-bot by the shared release-please.yml (pinned at the v1.5.0 release commit, 899dbe5).

Removes: no workflow files. The old tag-push publish.yml is replaced in the next PR of the stack.

Changes

  • release-please-config.json: the shared release-please/defaults.json from workflows v1.5.0, copied verbatim (the shared workflow warns on drift), plus bootstrap-sha and one package . with release type go.
  • .release-please-manifest.json: seeded at 0.21.0, the latest release.
  • bootstrap-sha is 0b0cefc (current main, which is also the v0.21.0 tag).
  • .github/workflows/release-please.yml: runs on pushes to main, secrets: inherit (the ccf-release-bot secrets come from the repo's release environment once repo-settings applies).
  • ci.yml: adds the release-checks job (checks release PRs only; skipped, so passing, on any other PR) and adds it to notify.

Expected next version

v0.21.0 is the current main commit, so nothing has landed since the last release. After this stack merges, release-please sees only the onboarding commits (all of hidden types), so it opens no release PR yet. The first feature commit after that proposes 0.22.0 (a breaking change also gives 0.22.0, since bump-minor-pre-major is on), and the first fix proposes 0.21.1.

None of this stack's PR bodies has a line that reads as a conventional commit, so the squash merges add no extra commits for release-please to count.

Before this merges (human)

release-please's first run on main needs the release environment secrets, so the repo-settings apply for api must come before this PR merges (W1-S2-PRE, per-repo order).

Verified

  • Both JSON files parse, and the config has no keys that differ from the shared defaults.
  • api's go.mod has no compliance-framework dependencies, so release-checks has no final-dependency check to fail on a release PR.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: b0ecb0f7-23cc-4461-9cbb-c7fc61a8592a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ccf-lisa
ccf-lisa Bot force-pushed the ra/w1-s2-t02-release-please branch from d9a80c2 to bb46ff4 Compare October 9, 2026 14:15
@ccf-lisa
ccf-lisa Bot added this pull request to stack #489 October 9, 2026 14:16
@gusfcarvalho
gusfcarvalho merged commit 0a4c795 into main Oct 9, 2026
11 checks passed
@gusfcarvalho
gusfcarvalho deleted the ra/w1-s2-t02-release-please branch October 9, 2026 14:39
gusfcarvalho pushed a commit that referenced this pull request Oct 9, 2026
Task: W1-S2-T01

Part 1 of 3 of the api onboarding stack ([CCF Release Automation
Design](https://claude.ai/code/artifact/39df6ba0-8484-4b08-bfc4-962357843585)).

Replaces the repo's CI with a caller of the shared `ci-go-service.yml`
from compliance-framework/workflows, pinned at the v1.5.0 release commit
(`899dbe5`). The status check to require from now on is `ci / required`.

**Removes:** `.github/workflows/ci.yml` (the old `CI` workflow). It is
replaced in place by the new `ci.yml` caller. No other workflow called
it.

## What the new caller sets

- `prepare-command: make swag`, so the Swagger docs are regenerated
before vet, the tests and the make targets, as the old unit and
integration jobs did.
- `make-targets: test-integration check-diff`.
- `lint-timeout-minutes: 30` (the old lint job ran with
`--timeout=30m`).
- Triggers: `pull_request` types `[opened, edited, synchronize,
reopened, labeled, unlabeled, closed]` and pushes to `main`, as on
mock-api.
- A `notify` job calling `notify-failure.yml` with `secrets: inherit`.

## Test race fix

The stack also fixes a pre-existing test race that the new `-race` flag
surfaced: in `internal/service/scheduler/scheduler_test.go`,
`mockJob.Execute` wrote its `executed` and `execCount` fields from
overlapping cron goroutines while the test read them
(`TestCronScheduler_StartStop` failed on #487). The fields are now
`atomic.Bool` and `atomic.Int32`, read with `Load()`; no non-test code
changes. Locally, `go test -race -count=20
./internal/service/scheduler/...` passes with the fix and reported the
race in 1 of 20 runs without it. A sweep of the other test doubles found
none mutated from goroutines the code under test starts.

## Old jobs and where they run now

| Old job (check name) | Old command | New check | Notes |
| --- | --- | --- | --- |
| `lint` | golangci-lint v2.11.4, `--timeout=30m`, default linters | `ci
/ golangci-lint` | Same golangci-lint version. Reports only issues the
change adds (new-from-merge-base). api has no `.golangci.yml`, so the
shared base config applies. |
| `unit-tests` | `make swag` then `make test` | `ci / go` | `go test
-race ./...` (the race detector is new), plus gofmt, `go vet`, a `go mod
tidy` check and `go build`. |
| `integration-tests` | `make swag` then `make test-integration` | `ci /
make` | Same make target. The tests start `postgres:17.5` through
testcontainers; the old job had no workflow services, and the new runner
(ubuntu-latest) has Docker too. The old job took about 8 minutes; the
make job's timeout is 30. |
| `check-diff` | `make check-diff` (PRs only) | `ci / make` | Same make
target. It now also runs on pushes to `main`, where the old job was
skipped. |
| (none) | | `ci / common` | New: PR title check, vulnerability scan and
actionlint. |

Trigger change: the old workflow also ran on pushes to `release-*`
branches. None exist, and from T02 on, releases are cut from `main` by
release-please, so the new caller runs on `main` only.

## Legacy required checks

The `main` ruleset requires `integration-tests`, `unit-tests` and
`check-diff`, and the classic branch protection requires `unit-tests`.
None of these run after this PR, so they stay pending here. A human
removes the ruleset and the classic protection before the stack merges
(W1-S2-PRE); this PR does not touch them.

## Verified

- The caller's inputs match `ci-go-service.yml` at v1.5.0
(`prepare-command`, `make-targets`, `lint-timeout-minutes`).
- `.gitignore` covers `cover.out`, which `make test-integration` writes
before `check-diff` checks the tree.
- No other workflow references the old `ci.yml`.
- `ci / required` on this PR's head is the check to read.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: ccf-lisa[bot] <286799724+ccf-lisa[bot]@users.noreply.github.com>
gusfcarvalho pushed a commit that referenced this pull request Oct 9, 2026
Task: W1-S2-T03

Part 3 of 3 of the api onboarding stack ([CCF Release Automation
Design](https://claude.ai/code/artifact/39df6ba0-8484-4b08-bfc4-962357843585)).
Stacked on #487.

Moves the image publishing to the shared release workflows, pinned at
the v1.5.0 release commit (`899dbe5`).

**Removes:** `.github/workflows/publish.yml`. No other workflow called
it.

## Changes

- `release.yml`: calls `release-go-image.yml` on `release: published`
and publishes `ghcr.io/compliance-framework/api` (one image:
`Dockerfile`, context `.`).
- `preview.yml`: calls `preview.yml` with kind `image` and `on-main:
true`. The concurrency group is keyed by PR number, as on mock-api.
- `cut-prerelease.yml`: `workflow_dispatch` caller of
`cut-prerelease.yml`, which tags the next rc of the version the open
release-please PR proposes.
- `Dockerfile` (production stage only): declares `ARG VERSION=dev` and
restores the OCI labels the old metadata-action step added (details
below).
- `AGENTS.md`: the release paragraph described the removed publish
workflow; it now describes release-please, `release.yml`, `preview.yml`
and `cut-prerelease`.

## Published artifacts: old vs new

| | Old (`publish.yml`) | New (`release.yml` + `preview.yml`) |
| --- | --- | --- |
| Image | `ghcr.io/compliance-framework/api` | same |
| Dockerfile and stage | `Dockerfile`, last stage (`production`) | same
|
| Platforms | `linux/amd64`, `linux/arm64` (QEMU on one runner) | same,
built on native amd64 and arm64 runners and merged into one manifest
list |
| Provenance attestation | yes (build-push-action default) | yes |
| Final release `vX.Y.Z` | `X.Y.Z`, `X.Y`, `X`, `latest`, `sha-<7>` |
`X.Y.Z`, `X.Y`, `X`, `latest` |
| Release candidate `vX.Y.Z-rcN` | `X.Y.Z-rcN`, `sha-<7>` | `X.Y.Z-rcN`
|
| Push to `main` | `main`, `latest`, `sha-<7>` | `main`, `sha-<7>`
(`latest` no longer moves) |
| Push to `seed` | `seed`, `sha-<7>` | nothing (trigger removed) |
| PR | nothing | `pr-<number>` when the PR has the `preview` label |
| Build args | none | `VERSION=<version>` only (`X.Y.Z`, `X.Y.Z-rcN`,
`main-<sha7>`, `pr-<n>-<sha7>`) |
| OCI labels | metadata-action: title, description, url, source,
version, created, revision, licenses | workflow: source, revision;
Dockerfile: title, description, url, licenses, version. `created` is no
longer set |

Notes:
- The old final-release `sha-<7>` tag pointed at the tag build of the
release commit. That commit is on `main`, so the new main preview still
publishes a `sha-<7>` for it, from the main build.
- On GHCR today, `0`, `0.21`, `0.21.0` and `latest` share one digest, so
the floating `X` tag the new flow keeps was already published.
- The old flow passed no build args. The Dockerfile had no `ARG
VERSION`, so without the change above the new `VERSION` arg would be
ignored (with a build warning). It is now used only for the
`org.opencontainers.image.version` label. The binary is built exactly as
before.

## Open questions for reviewers

- The old publish workflow also ran on pushes to a `seed` branch. That
branch no longer exists, and GHCR has no `seed` tag. Is a `seed` image
still needed? This PR drops the trigger.

## Before and after merging (human)

- The release and cut-prerelease jobs mint ccf-release-bot tokens from
the repo's `release` environment, which repo-settings creates
(W1-S2-PRE, per-repo order).
- From the repo-settings apply on, rcs come only from `cut-prerelease`;
nobody pushes `v*` tags by hand.

## Verified

- Every new caller is pinned at `899dbe5` (v1.5.0), has a top-level
`permissions` block and grants `packages: write` only to the publishing
job.
- Tag rules checked against `internal/release` (`ReleaseTags`,
`PreviewTags`) at v1.5.0.
- Current GHCR tags and the `0.21.0` image config (platforms, labels,
entrypoint) checked against the table above.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: ccf-lisa[bot] <286799724+ccf-lisa[bot]@users.noreply.github.com>
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.

1 participant