Complete rehearsal guidance and integrated verification

This commit is contained in:
2026-12-05 23:48:37 +00:00
parent 3524d8bbb6
commit dd9e177420
23 changed files with 739 additions and 32 deletions

View File

@@ -1,6 +1,6 @@
# Command line
ReleaseKit currently provides eight commands. The exit statuses below belong
The exit statuses below belong
to the native executable. `go run` examples are convenient for source execution,
but the Go driver maps a nonzero child exit status to 1. Use the built executable
or `./scripts/release` for publication when distinct statuses are needed.
@@ -368,3 +368,40 @@ consumers without a declared
ReleaseKit module dependency can use the separately installed-tool command.
See the [delivery guide](consumers/delivery.md#woodpecker-tag-workflows) for
compatible Go environments, retries, and preparation details.
## Rehearsal and recovery
```sh
releasekit test [--repo DIR] [--config FILE] [--ref REF] [--record-dir DIR] [--timeout DURATION] [--cleanup-timeout DURATION] [--json]
releasekit test-resume --record FILE [--token-file FILE] [--woodpecker-token-file FILE] [--timeout DURATION] [--cleanup-timeout DURATION] [--json]
releasekit test-cleanup --record FILE [--token-file FILE] [--woodpecker-token-file FILE] [--cleanup-timeout DURATION] [--json]
```
`test` captures `HEAD` or `--ref`, reads the profile from that commit, and
pushes a temporary annotated diagnostic tag. It observes the selected
Woodpecker delivery step, verifies its recorded page and artifact evidence,
and attempts cleanup only after matching CI runs are quiescent. It does not
require a clean checkout, choose a production version, or cancel CI. The
observation timeout defaults to 30 minutes; `--timeout 0` waits until the
context is canceled. Cleanup defaults to two minutes and its timeout must be
positive.
The command reports the exact private record path. Recovery always requires
that explicit path; it never selects a newest attempt. Local credentials come
from the recorded commit's profile unless file overrides are supplied. With
both overrides, recovery can load credentials without the recorded profile;
the checkout remains necessary for Git operations. `test-resume` observes and
then cleans; `test-cleanup` reports cleanup independently of prior verification.
Human output uses the current durable executable in its recovery commands when
available. If it was a temporary Go-run executable, use a supported ReleaseKit
tool with the same record after that executable disappears.
The [rehearsal guide](consumers/rehearsal.md) covers permissions and the limits
of the result.
With `--json`, each command emits one `schema_version: 1` object with safe
identity, workflow, build, verification and cleanup outcomes, resource links,
remaining resources and diagnostics. Status 0 means verification and cleanup
succeeded for `test` or `test-resume`, or cleanup succeeded for `test-cleanup`.
Status 2 denotes usage, configuration or required input failure before effects;
1 denotes a known failure or reporting error; 3 denotes unresolved CI or
remote state or pending cleanup. An error can accompany useful partial results.

View File

@@ -21,8 +21,10 @@ The current profile fields are:
| `validation` | No | Optional shared checks selected by ReleaseKit. |
| `build` | No | Optional main package, binary name, and selected `GOOS/GOARCH` target strings. |
| `delivery` | No | Optional selected forge and destination fields for tagged-source delivery. |
| `readiness` | No | Optional explicit files to check during readiness. |
| `rehearsal` | No | Diagnostic selector and Woodpecker observation settings, required for a rehearsal. |
`module_dir` names the selected module's physical location in the repository;
When Go is selected, `module_dir` names the module's physical location;
ReleaseKit reads its declared import path from that module's own `go.mod`. The
physical directory and declared path are distinct: a declared `/v2` module can
live either at `integrations/core` or `integrations/core/v2`, while both use the
@@ -45,6 +47,13 @@ facade's `Check`, `Publish`, `Build`, and `Deliver` and the CLI candidate and
delivery commands use the selected format. See the [command reference](cli.md)
for invocation details.
After its selected prefix, `semver` accepts stable `MAJOR.MINOR.PATCH` with
no leading zeroes in numeric components. `date` accepts `YYYY-MM-DD` or
`YYYY-MM-DD.R` with a valid Gregorian date and positive, unpadded revision;
the first release has no suffix. `year-month` accepts `YYYY.MM.R`, with a
two-digit month and a required nonnegative, unpadded revision. Years range
from 0001 through 9999. ReleaseKit preserves the selected identifier spelling.
Each check requires a nonempty `args` array whose first element names the
executable. Arguments are passed directly to the child process; ReleaseKit does
not parse a shell command string. Select a shell explicitly when a check needs
@@ -221,8 +230,9 @@ delivery-permission deficiency. It does not guarantee later release or asset
writes. Local artifact size and digest checks follow preflight and still finish
before hosted writes.
Credential loading runs only for `deliver` and `ci-deliver`. `check`, `publish`,
and `build` do not read the token file or require a token. The CLI passes the
`validate` loads only credentials for selected operations. `test` and recovery
commands load their selected local credentials; `check`, `publish`, and `build`
do not read a delivery token. The CLI passes the
resolved value explicitly to the library operation. `ci-deliver` checks the
destination before downloading application dependencies for a binary build;
the later delivery performs a fresh check. Page-only CI relies on delivery's

View File

@@ -30,6 +30,8 @@ go mod tidy
```
Select a release that implements the API, profile, and workflow you are adopting.
The [next-release migration draft](../roadmap/next-release-migration.md) covers
the new source selections, credential contexts, and rehearsal workflow.
The vanity module path starts with v0.5.0. Versions through v0.4.2 declare the
original module path and use their corresponding historical instructions.
The module-release interface requires a release containing that feature;

View File

@@ -49,6 +49,8 @@ source and the same HEAD before and after compilation; binary delivery requires
that fact. This observation is not a source snapshot or attestation guarantee.
An explicit `Source` with `GoEnabled` can select general source publication and
a calendar format or a product major independent of the module import path.
The optional [rehearsal](rehearsal.md) uses its own diagnostic version and
verifies temporary artifacts through the actual CI delivery job.
Go commands run from `ModuleDir`, so `MainPackage` is interpreted within that
module. The default output directory is `<module>/dist`; a relative `OutputDir`

View File

@@ -49,6 +49,9 @@ needs no `go.mod` or Go toolchain, and its automatic file inputs include nested
`go.mod` files as data. The candidate reports its source scope and selection;
module fields are empty when Go is disabled.
An optional [rehearsal](rehearsal.md) checks the tagged CI delivery workflow
independently of this local candidate validation.
When Go is selected, ReleaseKit runs one `go test -mod=readonly -count=1 ./...` suite from the
selected module directory with the available compatible local Go toolchain.
Set `Validation.Go.Race` to run that

View File

@@ -17,6 +17,9 @@ mode. The profile or API request selects the physical source directory. The opti
before any build or hosted request. Page-only source delivery does not require a
Go module or compiler.
The optional [rehearsal](rehearsal.md) runs this delivery machinery in the
tag-triggered CI job with a diagnostic identity and read-back verification.
## CI preparation
Use `PrepareTaggedCheckout` when a disposable CI checkout must be verified

View File

@@ -35,6 +35,10 @@ For general source publication, set `Source` as described in the
[candidate check guide](check.md#local-candidate-check). `PublicationResult`
also reports the selected source directory and capabilities.
Publication does not require a hosted delivery rehearsal. The optional
[rehearsal](rehearsal.md) uses separately recorded temporary resources and does
not change the production tag's completion or immutability rules.
The optional `ValidationSpec.SharedFiles` selects additional committed files
for enabled file checks. Its nil and empty-slice behavior is described in the
[candidate check guide](check.md#local-candidate-check).

View File

@@ -44,6 +44,7 @@ check makes the command unsuccessful; an offline omission alone does not. Status
2 reports usage, configuration, or required-input errors; status 1 reports
other failures, cancellation, or output failure. Actual CI secret injection
requires a job or rehearsal result and is not established by local readiness.
See the [rehearsal guide](rehearsal.md) for that separate live diagnostic.
The Go facade's `Validate` accepts explicit selections and tokens and returns a
`ValidationReport` with a `ReadinessError` when selected checks fail. The CLI

View File

@@ -0,0 +1,69 @@
# Rehearse tagged delivery
A rehearsal exercises the real tag-triggered Woodpecker delivery workflow before
choosing a production version. It creates a temporary diagnostic tag and page,
verifies the job's page and any binary and checksum contents, and removes only
recorded diagnostic resources after CI is quiescent. Routine `publish` remains
complete when its production source tag is confirmed; rehearsal is an optional,
explicit diagnostic.
Configure `delivery` with both local and CI credential selections. Configure
`rehearsal.woodpecker` with the CI server URL, its numeric repository ID, the
exact workflow and delivery step names, and a separate local Woodpecker API
token file. The `rehearsal.selector` defaults to `root`; multi-product
repositories select the corresponding maintained mapping row. The
[configuration reference](../config.md) defines the fields. The
[root workflow](../../examples/woodpecker/tag-delivery.yml),
[self-bootstrap workflow](../../examples/woodpecker/releasekit-source-delivery.yml),
[multi-product example](../../examples/multi-module/README.md), and
[source-only example](../../examples/source-only/README.md) show the dispatch
and CI secret injection.
The local forge credential must be able to read and delete the diagnostic
release and its assets, the CI delivery credential must be able to create them,
and native Git authentication must permit creating and deleting the diagnostic tag. The separate Woodpecker credential needs read
access to the repository, pipelines, workflows, steps, and logs. CI must inject
the configured delivery token into the actual tagged job; local readiness
cannot establish that injection. Keep local token files private and ignored by
Git. Do not register them as CI secrets through ReleaseKit.
```sh
releasekit validate --operation rehearsal
releasekit test --json
releasekit test --ref HEAD~1 --timeout 45m
```
The selected profile must be committed in the checkout at the captured commit.
The branch, index, and worktree need not be a final release candidate and are
not changed by capture. The diagnostic version and tag identify a random
attempt; neither is a production release identifier. The actual CI job builds
and delivers through the selected profile, then reads back its page and declared
assets while build output remains available. A page-only profile generates no
binary artifacts.
The output separates workflow execution, build, hosted verification, and
cleanup. It records a private attempt under the Git common directory, or in an
explicit ignored/private `--record-dir`. If observation fails or cleanup cannot
establish quiescence, retain the exact printed record and use:
```sh
releasekit test-resume --record /path/to/attempt.json
releasekit test-cleanup --record /path/to/attempt.json
```
Recovery reads the committed profile selected by the record, using current local
credential files. `--token-file` and `--woodpecker-token-file` override those
paths. The library's `Rehearse`, `ResumeRehearsal`, and `CleanupRehearsal`
accept credentials explicitly and do not load ambient tokens. Their result and
error may both contain useful information. `RehearsalTimeout` values use the
same nanosecond units as `time.Duration`; a zero observation timeout waits for
context cancellation, and a zero cleanup timeout selects the two-minute default.
Cleanup rechecks every matching pipeline and the recorded tag and page identity.
An active or unobservable job, missing pipeline evidence, or a conflicting
resource leaves cleanup pending or reports a conflict. Cancellation stops local
observation and does not cancel the CI job. A fresh bounded cleanup context may
still clean resources when quiescence is established. CI history, notifications,
webhooks, and later operator-initiated reruns are outside the cleanup result.
See the [record and result formats](../integrations/rehearsal-records.md) for
transport and retained evidence.

View File

@@ -9,6 +9,13 @@ publication and version selection, diagnostic version, and full tag. A
16-byte random attempt ID is represented by 32 lowercase hexadecimal digits;
the tag and injected version include the same ID.
The manifest fields are `schema_version`, `attempt_id`, `selector`, `commit`,
`profile_path`, `profile_sha256`, `source_dir`, `go_enabled`, optional
`module_path`, `publication_mode`, `version_format`, `version_prefix`,
`diagnostic_version`, and `tag`. The diagnostic ref has the form
`releasekit-test/<selector>/<attempt-id>`; the injected version is
`releasekit-test-<attempt-id>`.
The manifest is verified against the actual annotated tag target, the event
commit, the selected dispatch row, the exact committed profile bytes, and the
normalized selection decoded from those bytes. The tag namespace alone is not
@@ -17,8 +24,7 @@ captured commit rather than the current working tree.
Private attempt records use `format_version: 1` and retain the manifest, Git
endpoint and remote, forge and Woodpecker destinations, planned page and asset
identities,
tag object, observed resource IDs, timestamps, and outcomes. They do not store
identities, tag object, observed resource IDs, timestamps, and outcomes. They do not store
resolved forge or Woodpecker tokens. Endpoints and paths may themselves contain
sensitive information, so treat records as private. By default they are stored
under the Git common directory in `releasekit/rehearsals/<attempt-id>.json`.
@@ -44,6 +50,13 @@ and rejects malformed, conflicting, or mismatched evidence without echoing the
raw log. The page and declared assets are read back before managed build output
is removed.
The result uses the manifest fields plus `scope` (`page` or
`page-and-assets`), `build`, `delivery`, `verification`, `page_id`,
`artifacts` entries with `name`, `size`, and `sha256`, and optional safe
`diagnostics`. A successful result requires complete delivery and verification
and a positive page ID. For asset scope it also requires the planned artifacts,
including the checksum manifest.
The start coordinator records tag creation and push intent before dispatch. It
keeps matching pipeline numbers, workflow and step observations, the job result,
and partial outcomes in the selected attempt record. A timeout or cancellation

View File

@@ -7,14 +7,16 @@ two Go facades and a command-line interface:
working setup and read-only access, `Check` validates
one local candidate, `Publish` validates and publishes its exact annotated
source tag, `Build` compiles selected application targets, and `Deliver`
delivers a tagged note page and any declared assets. `PrepareTaggedCheckout`
delivers a tagged note page and any declared assets. `Rehearse`,
`ResumeRehearsal`, and `CleanupRehearsal` coordinate explicitly recorded
temporary diagnostics. `PrepareTaggedCheckout`
and `PrepareBuildDependencies` provide explicit local CI preparation.
- `buildinfo` is the small runtime facade. `Version` reports the injected
application version, the main-module version when available, or `dev`.
- `cmd/releasekit` is the executable interface. Its `version`, `validate`, `check`,
`publish`, `reconcile`, `publication-attempts`, `build`, `deliver`, and
`ci-deliver` commands adapt profiles and command output to the supported
library operations.
`publish`, `reconcile`, `publication-attempts`, `build`, `deliver`,
`ci-deliver`, `test`, `test-resume`, and `test-cleanup` commands adapt
profiles and command output to the supported library operations.
See the [CLI contract](../cli.md), [configuration reference](../config.md),
[candidate check guide](../consumers/check.md),
@@ -22,7 +24,8 @@ See the [CLI contract](../cli.md), [configuration reference](../config.md),
[publication record format](../integrations/publication-records.md),
[build guide](../consumers/build.md),
[delivery guide](../consumers/delivery.md),
[readiness guide](../consumers/readiness.md), and
[readiness guide](../consumers/readiness.md),
[rehearsal guide](../consumers/rehearsal.md), and
[runtime version guide](../consumers/runtime-version.md) for task-oriented use.
Go declarations and GoDoc remain the owners of exact exported contracts.

View File

@@ -13,6 +13,12 @@ when the intended annotated tag is successfully
pushed, or when one exact-object recovery query confirms that the push
succeeded. CI and consumer installation are not completion checks.
An optional [delivery rehearsal](consumers/rehearsal.md) exercises the same
tagged CI workflow with temporary diagnostic resources before a release. It is
not a publication gate. Configure the committed profile's Woodpecker settings
and separate local token before invoking it, and retain any reported record
until cleanup is resolved.
## Prepare a candidate
For local hosted-page delivery, save a Gitea personal access token in

View File

@@ -781,6 +781,18 @@ selection, and CI secret source selection.
## Stage 15: Complete documentation and integrated verification
**Completed:** Canonical guides, integration formats, package inventory, the
maintainer procedure, and an unnumbered migration draft describe the delivered
behavior and the pre-release pin convention. Four assembled offline fixtures
cover legacy Go modules, Go application source releases, calendar-version
binaries, and YAML/JSON-only sources through readiness, candidate checking,
publication, delivery, diagnostic verification, cleanup, and saved recovery.
Compiled facade checks cover the new rehearsal operations. The offline
`go test ./...` suite, `go run ./internal/apicheck`, shell syntax and local-link
checks, and race tests for the facade, CLI, rehearsal, Woodpecker, Git, and
Gitea packages pass. A live consumer rehearsal and the next release remain
subsequent operator work.
1. Update canonical configuration, CLI, GoDoc, consumer adoption/check/build/
publication/delivery guides, integration schemas, internal inventory, and
maintainer runbook as their behavior lands. Add focused readiness/rehearsal

View File

@@ -0,0 +1,58 @@
# Next release migration draft
The next ReleaseKit release number is not yet assigned. This is migration
preparation for that release, not a published release note. Select and publish
a compatible ReleaseKit version before replacing the illustrative `v0.10.0`
pins in source-only examples. Until then, exercise the current source with the
local fixtures described in [development guidance](../development.md).
## Credentials and readiness
Move the former `delivery.token_file` to
`delivery.credentials.local.token_file`, and move `delivery.token_env` to
`delivery.credentials.ci.token_environment_variable`. Keep existing CI secret
names and job environment variable names where possible. A CI declaration with
no variable name defaults to `RELEASEKIT_DELIVERY_TOKEN`; it does not fall back
to the local token file. Local `deliver` and `test` use the local selection,
while `ci-deliver` uses the CI environment. `validate --context ci` explicitly
selects CI credentials for readiness.
For a live rehearsal, configure a separate local Woodpecker API token, numeric
repository ID, exact workflow and step, and selector in `rehearsal`. Grant the
local forge and Git credentials the diagnostic deletion permissions they need;
the CI secret still needs delivery write access. The [rehearsal guide](../consumers/rehearsal.md)
describes the evidence boundary and retained CI history, notifications, and
webhook effects.
## Source and version selection
Profiles omitting all of `source`, `go`, `publication`, and `version` retain
legacy Go-module publication and prefixed stable SemVer. A non-null selection
object selects the explicit model: declare `go: {}` to retain Go checks or
builds, choose `publication.mode: "go-module"` only for module publication,
and otherwise use general `source` publication. A source-only profile can use
`source: {}` without an application `go.mod`. The [configuration reference](../config.md)
owns defaults, physical directories, tag prefixes, and identifier grammars.
Source publication can select stable SemVer, Gregorian `date`, or `year-month`
identifiers. Source tags use the selected physical source prefix by default;
Go module publication retains declared path-major compatibility. Applications
can release a product major or calendar identifier independently of the Go
module path when using source publication. Update release-note paths and
workflow tag filters to match the chosen format.
## Tools, workflows, and recovery
Commit the installed-tool `.releasekit-version` pin for a source-only product,
or select a tool dependency in each Go module. Upgrade the tool and tagged CI
workflow together. The maintained multi-product selector uses four columns:
selector, production tag pattern, tool module directory, and profile path; `-`
selects the installed pinned tool. Add the diagnostic tag filter and ensure its
selector maps to the same committed profile as production delivery.
Regenerate old build receipts with the current `build` command before using
`deliver --assets`; receipts bind source selection and artifact identity.
Existing publication records remain explicit inputs to `reconcile` and do not
become rehearsal records. Rehearsal recovery similarly requires the exact
attempt record and supports explicit credential-file overrides. Neither recovery
path selects an attempt automatically.