fix(forgejo): document dry-run release lookup contract #1010
No reviewers
Labels
No labels
bump
major
bump
minor
bump
patch
kind/bug
kind/chore
kind/docs
kind/feature
priority/critical
priority/high
priority/low
priority/medium
size/L
size/M
size/S
size/XL
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
frankenbit/release-toolkit!1010
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "sentry/957-dry-run-release-read-current"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Refs #957
Decision
Config.DryRunstill keeps the deliberate release-preview short-circuit:GetReleaseByTagmakes no request so a dry-run preview follows the create path, matching the retiredforgejo-api.shbehavior recorded by #557. Ordinary network reads execute normally; the draft-policy probes have separate, unchanged preview shortcuts.The sentinel decision is explicit: keep the behavior, but change the dry-run lookup result from
ErrNotFoundtoErrDryRunLookup. A real Forgejo 404 remainsErrNotFound, so a skipped lookup cannot be mistaken for evidence that a release is absent.Caller audit
Every production caller of
GetReleaseByTagwas checked:internal/decide.pendingCutEvidence(the #958 recovery evidence) mapsErrNotFoundfrom an executing query toEvidenceAbsent, but mapsErrDryRunLookuptoEvidenceUnknown.cmd/rt/decide.gointentionally constructs the read-only client withoutDryRun, including forrt decide --dry-run, so this path executes its evidence reads.internal/release.cutter.Fire(thert releasepath, whose client is dry-run when requested) accepts either a real absence or the deliberate preview skip and continues to the create-summary path. It does not claim a replay.No other production caller exists. The existing
ListDraftReleasesandCanSeeDraftsdry-run policy shortcuts are unchanged and are called out separately in the client contract.Verification
TestDryRunReadPolicy: an ordinaryGetDefaultBranchread executes once under dry-run;GetReleaseByTagmakes no request and returns onlyErrDryRunLookup.TestGetReleaseByTagNotFoundSentinel: an executing 404 returns onlyErrNotFound.go test -count=1 ./...,go vet ./...,go build ./...,gofmt, andgit diff --checkpass.This change does not touch #925.
APPROVED — exact head
254a731187.Reviewed the #957 dry-run lookup contract and all affected callers. GetReleaseByTag now distinguishes a real 404 (ErrNotFound) from a deliberately skipped Config.DryRun lookup (ErrDryRunLookup); pendingCutEvidence maps the latter to unknown, while cmd/rt/decide keeps its safeguard read executing in --dry-run. The release cutter preserves the dry-run create-summary path without treating the skipped lookup as absence. The call-site audit found no other consumers needing adjustment.
Verification at this head: targeted Forgejo, pending-evidence, and cutter tests pass; go test -count=1 ./..., go vet ./..., go build ./..., bats tests (118/118), repository gofmt, and git diff --check all pass. Server head is exact and all 25 status contexts are success. No findings.
APPROVED — exact head
254a731187.Reviewed the #957 dry-run lookup contract and all affected callers. GetReleaseByTag now distinguishes a real 404 (ErrNotFound) from a deliberately skipped Config.DryRun lookup (ErrDryRunLookup); pendingCutEvidence maps the latter to unknown, while cmd/rt/decide keeps its safeguard read executing in --dry-run. The release cutter preserves the dry-run create-summary path without treating the skipped lookup as absence. The call-site audit found no other consumers needing adjustment.
Verification at this head: targeted Forgejo, pending-evidence, and cutter tests pass; go test -count=1 ./..., go vet ./..., go build ./..., bats tests (118/118), repository gofmt, and git diff --check all pass. Server head is exact and all 25 status contexts are success. No findings.