diff --git a/docs/adr/0007-general-source-release-identity.md b/docs/adr/0007-general-source-release-identity.md new file mode 100644 index 0000000..6ea4ca8 --- /dev/null +++ b/docs/adr/0007-general-source-release-identity.md @@ -0,0 +1,102 @@ +# ADR 0007: Identify source releases independently of Go module publication + +## Status + +Draft for review. Upon acceptance, supersedes the requirement in +[ADR 0005](0005-module-release-scope.md) that every release selects a Go module. +Its module-scoped validation and Go module publication conventions continue +to apply to those uses. + +## Date + +2026-12-05 + +## Context + +ReleaseKit manages releases from Git repositories. A Git commit identifies +the source revision; a release tag gives that revision a published name. +Release notes describe the release, and a hosting service can present those +notes with downloadable files. Continuous integration (CI) runs automated +build and delivery jobs for the selected source. + +Repositories contain different kinds of products. A configuration repository +may contain only YAML or JSON. A Go application may be distributed as compiled +executables. A Go library publishes versions that other Go programs download +through Go's module system. These products share tagging, validation, hosted +pages, and recovery needs. + +ReleaseKit's existing model requires a Go module, a unit of Go source declared +in a `go.mod` file. It also applies Go module version rules to application +releases. Those rules connect published major versions to module import paths. +An application's product version can evolve independently when users obtain +binaries or build a checked-out source revision. + +[ADR 0002](0002-routine-releases.md) prioritizes shared release mechanics and +small consumer integrations. A common source-release model supports these +products while preserving Go's requirements where they apply. + +## Decision + +A release identifies a Git repository, exact committed revision, selected +source scope (the directory being released), version, complete tag, and +release note. ReleaseKit carries that identity consistently through validation, +publication, builds, hosted delivery, diagnostics, and recovery. + +Configuration expresses three distinct choices: the source being released, +Go validation and build capabilities, and publication through Go's module +system. Go module publication adds its version and tag rules to the common +source-release model. + +Go applications derive their source scope from the selected module, keeping +one directory setting for builds and validation. Source-only repositories +default to the repository root. File checks and release notes follow the +selected source scope. Common Git and publication checks apply to both. + +General source releases support Semantic Versioning and the selected calendar +formats. Callers supply the version. General source tags use the selected +source directory as their default prefix, with a product-prefix override. +Go module publication uses Go's module tag conventions. + +Module-path major-version compatibility applies when Go module publication +is selected. Go builds and tests use the selected module independently of +that choice. For example, an application can retain `example.com/myapp` as +its module path while distributing binaries under the product tag `v2.0.0`. +Publishing versions for import by Go programs or installation through +`go install …@VERSION` selects Go module publication and its compatibility +rules. + +Source-only repositories receive tagging, publication, hosted pages, +readiness checks, recovery, and delivery rehearsals through the shared +workflow. Applicable file checks and configured product checks validate their +contents. Go modules retain their Go test suite. + +Existing profiles retain documented module-publication defaults. New examples +state the publication choice explicitly. Module-backed consumers retain the +tool-version selection in [ADR 0004](0004-module-selected-tooling.md). +Source-only repositories record the ReleaseKit version in one committed file +read by both the maintained local launcher and CI tool setup. + +## Alternatives considered + +- Requiring a Go module for every release preserves one existing path but + gives configuration repositories an unrelated dependency declaration. +- Applying Go publication rules to every Go application couples product + versions to import paths even for binary distribution. +- Separate release engines for each product type duplicate tagging, + validation, hosted delivery, and recovery mechanics. + +## Consequences + +Configuration repositories and Go applications can share ReleaseKit's release +workflow while selecting capabilities appropriate to their distribution. +Consumers maintain product facts and one tool-version declaration for local +and CI use. + +The API, configuration, validation, and saved release evidence must distinguish +source scope, Go capabilities, and module publication. Existing Go consumers +retain their established module conventions, and general source releases gain +independent product versioning. + +Exact fields, version grammars, and stored formats belong in the public +contracts as implementation lands. ReleaseKit's own releases continue to +follow its adopted Semantic Versioning policy. diff --git a/docs/adr/0008-woodpecker-rehearsal-lifecycle.md b/docs/adr/0008-woodpecker-rehearsal-lifecycle.md new file mode 100644 index 0000000..2a50431 --- /dev/null +++ b/docs/adr/0008-woodpecker-rehearsal-lifecycle.md @@ -0,0 +1,113 @@ +# ADR 0008: Rehearse Woodpecker delivery with recorded temporary resources + +## Status + +Draft for review. + +## Date + +2026-12-05 + +## Context + +A successful Git tag push can be followed by failed delivery. Missing +credentials, build failures, or upload errors can leave a release without its +hosted page or expected downloads. Woodpecker is the continuous integration +(CI) service that runs the delivery workflow after receiving the tag event. +A ReleaseKit profile records the product, selected source, build targets, +and delivery destination. + +Read-only readiness checks establish available configuration and access +evidence. Developers also need to exercise the actual workflow, including +building executables and uploading their contents, before publishing a +production version. + +A rehearsal creates real remote resources. A workstation can disconnect while +Woodpecker continues running, and a failed request can leave the outcome of a +remote write uncertain. ReleaseKit needs an explicit lifecycle for observing +the attempt, verifying its result, and removing its temporary resources. + +## Decision + +ReleaseKit provides an optional end-to-end delivery rehearsal. One local +invocation records an attempt, pushes a uniquely named diagnostic tag, observes +the actual Woodpecker delivery workflow, and coordinates verification and +cleanup. Production releases retain their immutable tags and contents. + +The attempt records its exact commit, selected source and profile, diagnostic +tag, and diagnostic version used by builds. ReleaseKit supplies this identity +and a temporary release note through its maintained workflow. The identity +connects the tag event, CI execution, verification result, and recovery record. + +Woodpecker runs the same configured tool setup, builds, credential mapping, +and shared delivery mechanics used for production. The job creates a clearly +marked temporary hosted page in the configured repository and uploads the +declared artifacts, such as executables and their checksums. Source-only +profiles exercise page-only delivery. + +Content verification runs inside the delivery job, where the generated files +are available for comparison with uploaded contents. The job emits a structured +result associated with the recorded rehearsal. The ReleaseKit process on the +workstation coordinates the attempt. It confirms both successful execution of the expected workflow and its matching result. +Page-only results verify the hosted page and identify that scope. + +Local Git operations use native Git authentication. Operations against the +repository hosting service (the forge) and Woodpecker read their respective +local credential files directly. Woodpecker supplies +the delivery credential from its stored secret to the job. This exercises the +job's actual credential configuration while keeping workstation setup persistent. + +Cleanup follows successful and failed attempts. It targets the recorded +diagnostic tag, hosted page, and uploaded assets by their exact identities. +ReleaseKit establishes completion of the relevant CI job before deleting +resources, so an active job cannot recreate them after cleanup is reported +complete. Uncertain CI or remote state leaves cleanup pending or unknown, +with the attempt record and recovery instructions available. + +Interrupting local observation preserves the record and lets the CI job +continue independently. Explicit resume-observation and cleanup operations +recover the same attempt. Cleanup uses bounded attempts that can run after +the original local operation has been canceled. ReleaseKit observes uncertain +remote writes before classifying their outcome. + +Reports distinguish workflow execution, artifact generation, hosted-content +verification, and cleanup. They identify remaining resources and provide +instructions for continued observation or cleanup. The coordinator retains +enough evidence to recover after interruption or service unavailability. + +Rehearsals are explicitly requested diagnostics. Ordinary source publication +continues to complete at the successful production tag push, with hosted +delivery tracked separately. A rehearsal waits for CI because its purpose is +to verify that workflow. + +## Alternatives considered + +- Direct local API exercises verify local write capabilities while leaving + CI credential injection and application builds unexercised. +- A separate sandbox repository isolates events but exercises that + repository's permissions and workflow configuration. +- Canceling CI when the workstation command stops couples the job's lifetime + to the local connection and requires CI cancellation permissions. +- Deleting resources immediately on local interruption allows an active job + to recreate them after cleanup. + +## Consequences + +Developers gain repeatable evidence for the selected source, profile, CI +environment, and delivery destination without consuming a production version. +The rehearsal uses shared build and delivery behavior and preserves existing +releases. + +The coordinator needs Woodpecker observation access and permission to remove +diagnostic forge resources. ReleaseKit owns attempt tracking, verification, +and recovery; consumers adopt the maintained workflow and supply product +configuration and credentials. + +Successful cleanup removes temporary release resources. CI history, +notifications, and webhook effects can persist. Evidence applies to the +diagnostic tag namespace and the services exercised at that time; production +tag rules and future availability remain separate considerations. + +The lifecycle requires public outcomes for partial verification and pending +cleanup. Exact command names, record formats, and result transport belong in +the implementation's public contracts.