Clarify planned local and CI credential selection
This commit is contained in:
@@ -5,12 +5,14 @@
|
||||
Initial planning document for the next release after v0.10.0. These proposals
|
||||
capture the requested direction and recommended design work. Recommendations
|
||||
remain proposals until adopted; the release number and exact API are unassigned.
|
||||
This document adds no implementation or release gates.
|
||||
Explicit local and CI credential selection is adopted as the planned direction;
|
||||
implementation is pending. This document adds no implementation or release gates.
|
||||
|
||||
The objectives are to make local hosted delivery straightforward, expose useful
|
||||
readiness diagnostics, exercise a configured workflow on demand, and support
|
||||
release identifiers beyond stable Semantic Versioning. Keep routine consumer
|
||||
configuration small and put reusable work behind ReleaseKit's existing facades.
|
||||
readiness diagnostics, exercise configured delivery capabilities on demand,
|
||||
and support release identifiers beyond stable Semantic Versioning. Keep routine
|
||||
consumer configuration small and put reusable work behind ReleaseKit's existing
|
||||
facades.
|
||||
|
||||
## Current baseline
|
||||
|
||||
@@ -33,28 +35,75 @@ configuration small and put reusable work behind ReleaseKit's existing facades.
|
||||
Builds, delivery, receipts, recovery records, and CI launchers consume that
|
||||
identity. The [package inventory](../internal/overview.md) describes ownership.
|
||||
|
||||
## 1. Make token files the primary hosted-delivery configuration
|
||||
## 1. Select local and CI credentials explicitly
|
||||
|
||||
Present an explicitly configured file such as `.releasekit/gitea-token` as the
|
||||
standard local workflow. Retain configurable environment credentials for CI and
|
||||
other operators who prefer them. File support already exists; the work is to
|
||||
settle selection semantics and make examples, diagnostics, and guidance agree.
|
||||
Recent releases completed the Git tag push but failed hosted delivery because
|
||||
the expected token environment variable was unavailable. Persistent local file
|
||||
credentials and automatic CI secret injection should make setup routine.
|
||||
|
||||
Recommended behavior is to use `token_file` when configured and report a missing,
|
||||
unreadable, or blank file as an error. Profiles selecting environment credentials
|
||||
continue to use `token_env`. Resolve the interaction of both fields in Open
|
||||
Decisions before changing today's precedence. Preserve repository-root-relative
|
||||
and absolute paths and whitespace trimming.
|
||||
Adopt separate local and CI credential declarations in one shared profile.
|
||||
Ordinary local delivery reads the configured local token file directly.
|
||||
`ci-deliver` reads the configured environment variable inside the CI delivery
|
||||
job. The invocation selects the context explicitly; ambient environment values
|
||||
do not choose the context or override local file credentials. Each context
|
||||
reports problems with its own selected source, without falling back to the other.
|
||||
|
||||
Illustrative profile fragment; exact field spelling remains to be finalized:
|
||||
|
||||
```json
|
||||
{
|
||||
"delivery": {
|
||||
"credentials": {
|
||||
"local": {
|
||||
"token_file": ".releasekit/gitea-token"
|
||||
},
|
||||
"ci": {
|
||||
"token_environment_variable": "RELEASEKIT_DELIVERY_TOKEN"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Local setup consists of saving the token once and configuring its path.
|
||||
ReleaseKit reads it on each local invocation, including after workstation
|
||||
reboots. This workflow requires no manually exported workstation variable,
|
||||
shell startup configuration, or consumer-owned credential-loading script.
|
||||
Preserve repository-root-relative and absolute file paths and whitespace
|
||||
trimming. Missing, unreadable, or blank selected files are errors.
|
||||
|
||||
Woodpecker stores the CI token persistently and injects it into each delivery
|
||||
job. Maintain an explicitly commented mapping such as:
|
||||
|
||||
```yaml
|
||||
# Woodpecker supplies this variable inside the CI delivery job.
|
||||
# Workstation environment setup is unnecessary.
|
||||
environment:
|
||||
RELEASEKIT_DELIVERY_TOKEN:
|
||||
from_secret: GITEA_RELEASE_TOKEN
|
||||
```
|
||||
|
||||
Here `GITEA_RELEASE_TOKEN` names a Woodpecker stored secret;
|
||||
`RELEASEKIT_DELIVERY_TOKEN` names the variable available to ReleaseKit inside
|
||||
that job. An unset or blank selected CI variable is an error. Consumers can
|
||||
reference an existing suitable secret. The local token file stays on the
|
||||
workstation; CI uses its stored secret. ReleaseKit owns the
|
||||
maintained workflow integration. Secret-registration automation is outside
|
||||
this work.
|
||||
|
||||
Keep loading in the CLI and pass the resolved token explicitly through
|
||||
`DeliveryDestination`. The library remains independent of ambient credentials.
|
||||
Errors identify the selected source without including secret contents. The
|
||||
existing `forbidden_files` check remains available to exclude the token path
|
||||
from committed candidates; explain its use alongside Git ignore rules.
|
||||
Errors identify the execution context and selected source without including
|
||||
secret contents. The existing `forbidden_files` check remains available to
|
||||
exclude the local token path from committed candidates; explain its use
|
||||
alongside Git ignore rules.
|
||||
|
||||
Update local examples and the maintainer runbook to lead with file-based setup,
|
||||
while CI examples demonstrate the chosen environment selection. Document any
|
||||
precedence change and the configuration needed to preserve existing workflows.
|
||||
Update local examples, CI templates, adoption guidance, and the maintainer
|
||||
runbook together. Explain the migration from today's `delivery.token_file`,
|
||||
`delivery.token_env`, and environment-over-file precedence to context-specific
|
||||
selection. Use the terms “local token file,” “Woodpecker stored secret,” and
|
||||
“CI delivery job environment variable” consistently. A shared profile carries
|
||||
both declarations; consumers maintain their paths and secret references.
|
||||
|
||||
## 2. Add configuration and input readiness validation
|
||||
|
||||
@@ -64,13 +113,27 @@ operations. It should distinguish malformed configuration, unavailable local
|
||||
inputs, and remote verification failures. Its report should identify both what
|
||||
was checked and the limits of that evidence.
|
||||
|
||||
Use the same explicit local or CI context and credential resolver as delivery.
|
||||
Default workstation diagnostics to local context and provide an explicit CI
|
||||
context selection for invocation inside the delivery job. Keep execution
|
||||
context separate from network use: local-context validation can contact the
|
||||
forge, and CI-context validation can perform offline checks.
|
||||
|
||||
Recommended scope:
|
||||
|
||||
- Reuse profile parsing and operation-specific validation for module selection,
|
||||
build settings, delivery destination, and publication endpoint expectations.
|
||||
- Check selected token sources for availability, readability, and nonblank
|
||||
content. Check declared local inputs relevant to the requested operation.
|
||||
Report missing required inputs as errors.
|
||||
- For local delivery, check the selected file's availability, readability, and
|
||||
nonblank content. For CI delivery, check the named variable in the running
|
||||
job's environment. Credential requirements apply to the selected operation
|
||||
and context; source publication retains its independent Git authentication.
|
||||
- Report the context, selected credential source, destination, and checks
|
||||
completed, with secret values omitted. A workstation check can inspect a CI
|
||||
declaration, but verification of injected credentials requires execution
|
||||
inside the CI job. Mark that evidence as unverified when it is unavailable.
|
||||
- Check declared inputs for the requested preparation stage. Configuration
|
||||
readiness can precede generated artifacts; delivery using existing artifacts
|
||||
checks their availability. Report missing required inputs as errors.
|
||||
- Use native Git and SSH configuration for Git authentication. SSH agents,
|
||||
hardware-backed keys, custom commands, and HTTPS credentials are viable inputs;
|
||||
the existence of a conventional private-key file is not universal evidence of
|
||||
@@ -96,6 +159,15 @@ tag, creates a temporary hosted release, verifies the selected operations, and
|
||||
removes the resources it created. This provides write evidence beyond read-only
|
||||
preflight. It is a live operation using real credentials and remote resources.
|
||||
|
||||
Select local or CI context explicitly and reuse delivery's credential resolver
|
||||
and readiness checks. A local exercise reads the local token file directly.
|
||||
An exercise invoked inside Woodpecker reads the job's injected variable.
|
||||
Report the context and credential source alongside capability outcomes. Success
|
||||
on a workstation establishes evidence for local delivery; CI credential
|
||||
write verification uses an exercise in the CI job. Provide maintained examples
|
||||
for both contexts so consumers can repeat diagnostics without a production
|
||||
release version or credential-export scripts.
|
||||
|
||||
Recommend an isolated diagnostic tag namespace and a clearly marked hosted
|
||||
release, distinct from production version tags. Existing release immutability
|
||||
continues to apply to actual releases. The command should use the configured
|
||||
@@ -124,8 +196,11 @@ The design must account for these concrete outcomes:
|
||||
Creating a tag and page proves only those operations and cleanup. If asset
|
||||
delivery is selected, recommend a small diagnostic attachment with read-back
|
||||
verification to exercise that path too. This does not certify an asynchronous
|
||||
CI workflow, every application build, or future availability. Settle the
|
||||
command's advertised scope in Open Decisions.
|
||||
CI workflow, every application build, or future availability. Report artifact
|
||||
generation separately from upload verification; a diagnostic attachment
|
||||
establishes upload evidence only. Evidence from the diagnostic tag namespace
|
||||
also has that scope; production tag rules may differ. Settle the command's
|
||||
advertised scope in Open Decisions.
|
||||
|
||||
Implement reusable coordination internally with a proportionate facade API;
|
||||
keep CLI parsing, credential loading, reporting, and process exits in the CLI.
|
||||
@@ -177,7 +252,9 @@ change that policy.
|
||||
1. Settle the open decisions and describe the selected CLI, configuration, and
|
||||
identity contracts. Keep unchanged SemVer integrations simple.
|
||||
2. Consolidate credential selection and operation-specific validation. Implement
|
||||
file-primary configuration and the readiness command using those paths.
|
||||
explicit local and CI credential declarations and context selection across
|
||||
delivery, readiness validation, and the delivery exercise. Align Woodpecker
|
||||
secret mappings and document migration from the existing fields.
|
||||
3. Add live diagnostic coordination, narrowly scoped backend operations, outcome
|
||||
reporting, and cleanup recovery.
|
||||
4. Extend version identity and carry it through publication, builds, delivery,
|
||||
@@ -187,38 +264,39 @@ change that policy.
|
||||
release notes. Review the assembled implementation and run appropriate
|
||||
offline checks, including compiled facade and dependency-boundary checks.
|
||||
|
||||
Regression coverage should address credential selection and missing inputs;
|
||||
local versus online validation and agent-based Git authentication; diagnostic
|
||||
collisions, partial creation, lost acknowledgments, cancellation, and cleanup
|
||||
failures; and version/date boundaries and identity consistency across operations
|
||||
Regression coverage should address local file loading with workstation token
|
||||
variables absent or set to conflicting values; CI variable loading with the
|
||||
local file absent; context-specific missing-input errors; and shared resolution
|
||||
across delivery, readiness, and exercises. Verify that diagnostics identify
|
||||
context and evidence limits without exposing token contents. Cover offline
|
||||
versus online validation in each context and agent-based Git authentication;
|
||||
diagnostic collisions, partial creation, lost acknowledgments, cancellation,
|
||||
and cleanup failures; and version/date boundaries and identity consistency across
|
||||
operations
|
||||
and stored formats. Use temporary Git remotes and local HTTP fixtures in the
|
||||
default suite. Real forge exercises stay explicitly opt-in. This outline has
|
||||
no pilot releases or intermediate external review gates.
|
||||
|
||||
## Open Decisions
|
||||
|
||||
### Credential selection when both fields are present
|
||||
### Credential schema and migration
|
||||
|
||||
**Recommendation:** An explicit `token_file` selects the file authoritatively;
|
||||
environment-only profiles select the environment. This makes the primary local
|
||||
configuration predictable and exposes a broken file immediately. Existing
|
||||
profiles using both fields need migration guidance and a separate CI profile
|
||||
or another deliberate source-selection mechanism.
|
||||
|
||||
**Alternative:** Keep environment-over-file precedence and change only the
|
||||
recommended workflow. This preserves today's CI overrides and avoids a
|
||||
compatibility change, while ambient environment state can still supersede the
|
||||
configured file. Confirm whether first-class file support requires a behavior
|
||||
change or primarily a documentation change.
|
||||
Explicit local and CI selection is decided in item 1. Finalize the field names,
|
||||
diagnostic context-selection syntax, and migration handling for existing flat
|
||||
credential fields. Keep the common local-file and CI-secret workflow in one
|
||||
profile and provide actionable migration diagnostics. The illustrated
|
||||
`RELEASEKIT_DELIVERY_TOKEN` name requires coordinated workflow and profile
|
||||
updates if adopted.
|
||||
|
||||
### Readiness selection and network use
|
||||
|
||||
**Recommendation:** Default `validate` to local checks for the operations
|
||||
declared by the profile, with explicit operation selection and online
|
||||
verification available. This supports offline preparation and narrower CI
|
||||
contexts. The report must make unchecked remote access visible.
|
||||
**Recommendation:** Default `validate` to offline checks for the operations
|
||||
declared by the profile in the selected local or CI context, with explicit
|
||||
operation selection and online verification available. This supports offline
|
||||
preparation and narrower CI contexts. Report unchecked remote access and CI
|
||||
credential injection that has not been verified inside a job.
|
||||
|
||||
**Alternative:** Verify configured remote access by default, with a local-only
|
||||
**Alternative:** Verify configured remote access by default, with an offline
|
||||
option. This gives stronger immediate readiness evidence but makes a routine
|
||||
configuration check depend on service availability and credentials for every
|
||||
selected remote operation.
|
||||
@@ -227,8 +305,10 @@ selected remote operation.
|
||||
|
||||
**Recommendation:** Exercise Git tag push, hosted-page creation, selected asset
|
||||
upload, and cleanup directly, with accurate capability reporting. This gives
|
||||
useful write evidence in one invocation. It adds cleanup state and deletion
|
||||
permissions and cannot establish asynchronous CI success.
|
||||
useful write evidence in one invocation using the selected context's credentials.
|
||||
Run the CI-context exercise inside the CI job to verify secret injection.
|
||||
It adds cleanup state and deletion permissions and cannot establish
|
||||
asynchronous CI success.
|
||||
|
||||
**Alternative:** Run the exercise in a dedicated sandbox repository through
|
||||
the actual CI workflow. This can cover automation while isolating production
|
||||
|
||||
Reference in New Issue
Block a user