fix(release): validate merged release PRs through the pinned contract - #14
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rewrites the reusable validate workflow (stage 2) so its version-file semantics come from the pinned release-contract script instead of a second inline implementation, and gives it an explicit recovery path for merged release PRs that failed validation.
Contract consolidation (#6). The validate job now checks out the toolkit at
workflows-ref, derives the release-file set fromrelease-contract.mjs files, downloads the version files at the base, release, and previous-tag commits (raw bytes via the contents API - it still never checks out consumer code), and runs the newrelease-contract.mjs validate-releasecommand:validateReleasePr(branch/title/base/same-repo/changed-files shape) composed withvalidateVersionFiles(synchronized versions, progression, floor rules including the pendingminAppVersionraise from #3) andvalidatePreviousTagHistoryplus tag identity/floor checks. The inline reimplementation of version parsing, floor comparison, recorded-floor lookup, and the pending-floor exception is gone; prepare, validate, and release now share one semantic model. API-shaped forensics (PR provenance, commit structure, tree SHA, ancestry, tag resolution) stay inline, and the recovery-branch + dispatch writes moved to a separate step that only runs after the contract passes.Recovery path (#9). The
EVENT_SHA === releaseShapin made any post-merge recovery impossible once the default branch moved (PodNotes 2.19.3, chhoumann/PodNotes#291/#293). Validate now accepts exactly two event identities: the merge event (default branch at the merge commit, unchanged predicate) or an explicitworkflow_dispatchfrom the current default-branch head - the same trusted recovery source model stage 3 already uses. Everything else is re-derived from the PR number and fails closed; the stage-3 higher-tag and tag-target checks make a replayed old release inert. The trigger stub template gains theworkflow_dispatchrecovery trigger and aworkflows-refpin, and the README documents dispatch recovery as canonical with webhook redelivery as the merge-time-exact alternative.Also included, kept in lockstep with the rewrite:
release-runnamespace preflight in the dispatch step (same failure mode as release-prepare: preflight the release/* refname namespace before createRef #10'sreleasebranch, but it would strike after the maintainer already merged).workflows-refdefaults bumped tov3across the three reusables; templates pin@v3and set an explicitrelease-policy(follow-up to Make commit-to-release policy a consumer input instead of toolkit constant #7 so a toolkit ref move can never change a consumer's classification).release-policydocs, stray-branch migration-checklist item, updated lockstep guidance.Fixes #6
Fixes #9