Files
notarius/docs/roadmap/releasekit.md

253 lines
14 KiB
Markdown
Raw Normal View History

2026-11-23 17:50:37 +00:00
# Native ReleaseKit Adoption
## Purpose
Adopt ReleaseKit's native release workflow and runtime version accessor, replacing
Notarius-owned release machinery with a versioned tool, a small declarative
profile, and concise project-specific documentation. ReleaseKit owns common
validation, publication, build, and recovery mechanics. Notarius supplies product
facts, compatibility decisions, and any justified product-specific checks.
This is a feature roadmap, not an implementation sequence. It authorizes no
release publication. Resolve the decisions below before preparing the staged
implementation plan.
## Reviewed Baseline
The reviewed upstream release is **ReleaseKit v0.10.0**, module
`go.maximumdirect.net/releasekit`, at commit
`82bac1a3ab935beddd4b8789d1e07f52135d4243`. The local checkout at
`../ReleaseKit` matches that tag and upstream `main` at review time.
Canonical references for this selected version:
- [Adoption](https://forge.maximumdirect.net/base-layer/releasekit/src/tag/v0.10.0/docs/consumers/adoption.md).
- [Profile configuration](https://forge.maximumdirect.net/base-layer/releasekit/src/tag/v0.10.0/docs/config.md).
- [Candidate checking](https://forge.maximumdirect.net/base-layer/releasekit/src/tag/v0.10.0/docs/consumers/check.md).
- [Source publication and recovery](https://forge.maximumdirect.net/base-layer/releasekit/src/tag/v0.10.0/docs/consumers/publish.md).
- [Runtime version](https://forge.maximumdirect.net/base-layer/releasekit/src/tag/v0.10.0/docs/consumers/runtime-version.md).
- [Builds](https://forge.maximumdirect.net/base-layer/releasekit/src/tag/v0.10.0/docs/consumers/build.md)
and [delivery](https://forge.maximumdirect.net/base-layer/releasekit/src/tag/v0.10.0/docs/consumers/delivery.md).
Notarius currently has:
- `scripts/release.sh`, which guards a committed candidate, invokes validation,
pushes `main`, creates a lightweight tag, pushes that tag, and handles ambiguous
publication results.
- `scripts/check-release-source.sh`, which checks the release note, runs the
default Go suite, builds `cmd/notarius` with a private linker override, and
checks the executable's version output.
- `scripts/release_test.go`, with custom Git fixtures and publication tests.
These three files total 323 lines.
- `internal/buildinfo`, with custom stable-version parsing, linker override,
module-version fallback, and tests. `internal/cli.RunWithOptions` obtains this
version before constructing the CommandKit application.
- `.woodpecker/release.yml`, which repeats advisory validation on tag events.
- [Release Policy](../policy/release.md) and [Source Releases](../release.md),
defining source-only delivery, lightweight tags, and the custom commands.
Both modules declare Go 1.27.0. Adoption does not require a Go-series increase.
Notarius's selected release toolchain is currently Go 1.27.0; ReleaseKit's own
maintainer toolchain is not automatically a Notarius requirement.
## Target End State
### Native tool and small profile
Register `go.maximumdirect.net/releasekit/cmd/releasekit` at v0.10.0 as a Go tool
dependency. Also import `go.maximumdirect.net/releasekit/buildinfo` for runtime
identity. Both uses share the module-selected version.
Use a root `releasekit.json` with product `Notarius`, the root Go module, and
authoritative remote `origin`. Use native defaults where they express the selected
behavior; omit unnecessary settings. Build and delivery fields depend on the
decisions below. Do not add a separate Notarius configuration schema for releases.
Invoke the tool by its full package path. If a convenience launcher is useful,
keep it to the upstream host-target selection and direct argument forwarding,
with repository-directory selection if needed. It must not reimplement release
guards, validation orchestration, Git publication, or recovery. Do not add an
application release subcommand or a custom Go release executable.
Review `go.mod` and `go.sum` changes, including shared dependency version selection:
Go tool dependencies participate in the application's module graph. Update
applicable attribution for the runtime import and any copied material under the
[OSS policy](../policy/oss.md), using the selected upstream source revision.
### Native publication and recovery
Adopt these intentional changes rather than preserving the old workflow through
compatibility wrappers:
- Prepare and commit the version-matched release note, then push the candidate
to `origin/main` before invoking native `publish`.
- Let ReleaseKit check the clean candidate and authoritative branch, validate
it, create an **annotated** tag, and publish that exact tag object.
- Use native publication evidence, attempt discovery, and explicit-record
reconciliation for failed or ambiguous publication. Link upstream for record
storage, diagnostic sensitivity, exit statuses, and recovery semantics.
- Use native `check` only as an optional candidate diagnostic, not as a mandatory
preliminary invocation that duplicates `publish` validation.
Historical lightweight tags and published notes remain unchanged. Source
publication completes at confirmed tag publication, independently of CI or any
optional hosted delivery. Recovery must not become a routine successful-push
read-back gate. No new manual approval, signing, consumer-installation, or
provider-availability gate is part of this work.
### Proportionate native validation
ReleaseKit owns the single offline default test suite and its native candidate
checks. Remove the duplicated suite command from Notarius-owned release code.
Prepare dependencies and the selected toolchain separately from offline
validation, following upstream conventions.
Preserve the rationale for exercising the built CLI and injected version, subject
to Open Decision 2. Use ReleaseKit's native build machinery rather than retaining
custom linker flags or a shell build/version checker.
Other native checks, including full vet, race testing, formatting, Markdown,
module-distribution checks, forbidden paths, and file-size limits, are optional
capabilities, not automatically new Notarius release requirements. Enable one
only for a selected, concrete need; otherwise keep it disabled. Full native
adoption means delegating mechanics, not enabling every available restriction.
### Native runtime identity
Read `buildinfo.Version()` from ReleaseKit and pass its result to the existing
CommandKit application. Remove Notarius's private override, version resolver,
associated package, and tests of those replaced internals. Do not wrap the native
accessor merely to retain stable-tag parsing or the old fallback spelling.
Accept ReleaseKit's native fallback `dev` instead of `development`. Keep
CommandKit's version command and report formats; this is an identity-source
change, not a new application presentation layer. Update relevant CLI tests to
exercise supported application behavior without mutable version globals.
### Minimal release automation
Remove `.woodpecker/release.yml`'s redundant post-publication check. Native
`check` requires a clean candidate on `main` with no existing release tag, so it
is not a drop-in command for that detached/tagged job.
If hosted delivery is selected, use the maintained ReleaseKit consumer
tag-delivery workflow and native `ci-deliver`, adapted only for Notarius's actual
profile and CI environment. Keep source publication and delivery outcomes
separate. Do not copy delivery automation or introduce forge credentials when
delivery is not selected.
## Required Repository Changes
- Add the module-selected tool and runtime dependency in `go.mod`/`go.sum`, plus
the small native `releasekit.json` profile.
- Remove both custom release scripts and their publication-test fixture suite.
Keep only any genuinely useful, thin native launcher.
- Replace runtime version wiring and remove `internal/buildinfo`; adjust the
affected CommandKit CLI tests.
- Remove the redundant advisory release CI job, or replace it with native
delivery only if that distribution option is approved.
- Rewrite `docs/release.md` around Notarius's selected native workflow. Include
product-specific preparation, actual entry commands, selected toolchain,
release-note location/footer, delivery choice, and upstream recovery links.
- Update `docs/policy/release.md` for annotated tags, pre-pushed `main`, native
validation ownership, the selected build gate, and any approved delivery
change. Preserve versioning, immutability, and compatibility decisions not
changed by this roadmap. Avoid restating upstream implementation mechanics as
additional local guarantees.
- Update `docs/cli.md` for native runtime identity, and relevant links or local
integration statements in README, `docs/development.md`, and internal docs.
Document upstream features through canonical upstream links, not a duplicated
ReleaseKit manual or a separate local field-by-field profile reference.
- Maintain `docs/oss/attribution.md` and license texts as applicable. Do not
rewrite published release notes or tags to retrofit adoption.
- Reconcile the packaged-artifact backlog item in `future.md` with the approved
distribution decision, retaining any portion that remains deferred.
No changes to pipeline behavior, extraction contracts, artifact schemas, cache
identity, or runtime configuration are part of this scope. A new ADR is not
required solely to record this tooling adoption; the release policy and runbook
own the selected release contract and procedure.
## Verification And Acceptance
The adoption is complete when:
- The selected registered tool runs with the intended version, including through
any retained launcher; no old release entry point remains in current guidance.
- Candidate validation and publication are native ReleaseKit operations, with no
duplicate application implementation or repeated mandatory suite invocation.
- The executable receives its identity through the native accessor. An ordinary
development build and a native version-injected build report the appropriate
identity through CommandKit.
- Product facts and any selected targets/delivery destination are accurate and
release policy, runbook, profile, and automation agree.
- Maintained examples and the normal offline Go suite pass after dependency and
version-wiring changes; run vet/build checks appropriate to those changes.
- Focused consumer verification covers actual wiring, not a copied ReleaseKit
publication test suite. If an end-to-end publication check is warranted, use a
disposable checkout and local bare Git remote, never the live Notarius remote.
- Documentation links and relevant attribution have been checked. Existing
historical release records remain intact.
Do not publish a real release, create hosted pages, or upload assets merely to
verify adoption. Native integration must be verifiable without production API
keys or a new release tag on `origin`.
## Open Decisions
### 1. Which release deliverables should Notarius publish?
**Recommendation: retain source-only delivery for the initial adoption.**
Publish the annotated source tag and committed release note, without hosted
release objects or downloadable binaries. Notarius's current audience already
builds from source, and its deployment workflow has not established a need for
binary distribution. This is the smallest operational surface and requires no
forge API credential or delivery job. ReleaseKit-native adoption remains complete
with this choice; delivery is a separately selectable capability.
**Alternative: source tags plus a hosted release-note page, without binaries.**
ReleaseKit can publish the complete committed note through native page-only
delivery. This improves release discoverability with little application code,
but adds forge credentials, profile destination settings, and an independently
recoverable delivery operation. If selected, omit build targets from the
page-delivery profile; use a separate small native validation profile if the
build gate below is retained. This prevents validation-only builds from becoming
downloadable assets by virtue of shared profile settings.
**Alternative: source tags, a hosted page, and native binary assets.**
This makes installation easier where Go/private-module build access is
inconvenient. ReleaseKit can build, name, hash, deliver, and reconcile the assets
without custom packaging code. It nevertheless introduces target selection and
ongoing distribution/support work. If chosen, agree on a small explicit Linux
target set; macOS binaries are a separate convenience choice. Windows support,
OS packages, containers, signatures, and custom archives do not follow
automatically from selecting binaries. Keep delivery completion distinct from
successful source publication under every option.
### 2. How should the executable/version validation gate map to native builds?
**Recommendation: retain the protection through one native Linux/amd64 build
target.** Declare `./cmd/notarius`, binary name `notarius`, and that target in
the validation profile. ReleaseKit's candidate path builds into temporary
storage and checks a native executable's injected version; these temporary
products are not published. This replaces the current custom gate with native
machinery and avoids a broad build matrix.
This is a small deliberate change from a strictly host-only build: on another
host ReleaseKit also performs its native version check, while still compiling
the selected Linux target. The current profile has no host-only target keyword;
do not implement custom target interpolation to conceal that difference.
**Alternative: use the native source-only baseline without a build selection.**
This has the smallest profile and retains the default test suite, but deliberately
drops the release gate exercising linker injection and the actual executable.
Ordinary CLI tests are useful but do not provide the same end-to-end evidence.
Choose this only as an explicit revision of the current gate rationale.
**Alternative: request upstream host-only build/version validation.**
This would preserve the exact current scope with no target selection or local
build implementation. It is a useful possible upstream enhancement, but the
reviewed release does not provide it, so making it a prerequisite would delay
adoption. Prefer the existing native option unless exact host-only scope is
important enough to justify that dependency.