fix(release): isolate draft visibility admission - #65
Merged
Conversation
📝 WalkthroughWalkthroughThe prerelease workflow adds a ChangesDraft admission and publication gating
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant WorkflowTrigger
participant DraftAdmission
participant Preflight
participant Publish
WorkflowTrigger->>DraftAdmission: Validate protected source and draft identity
DraftAdmission->>DraftAdmission: Checkout admitted SHA and verify draft visibility
DraftAdmission->>Preflight: Successful admission
Preflight->>Publish: Validation result
DraftAdmission->>Publish: Admission result
Publish->>Publish: Require admission and lane success
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
Comment |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
Tick the box to add this pull request to the merge queue (same as
|
slashdevcorpse
force-pushed
the
fix/release-draft-visibility
branch
from
July 21, 2026 21:23
168169d to
89cc380
Compare
This was referenced Jul 21, 2026
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.
Summary
contents: writetokenmain, the owner-triggered controller, source SHA, version, tag, and draft ID before checkoutRoot cause
Release Drafter run https://github.com/slashdevcorpse/synara/actions/runs/29865616891 failed closed because the reusable preflight had
contents: read; its token could not enumerate the private draft that the controller had just validated. Windows and publication were correctly skipped. The caller already grantscontents: write, so this change narrows that capability to a minimal admission job rather than exposing it to the heavy preflight.Verification
bun run --cwd scripts test -- lib/super-synara-workflow-contract.test.ts lib/workflow-contracts.test.ts lib/super-synara-release-state.test.ts lib/super-synara-github-payload.test.ts lib/gh-cli.test.ts(90 passed)node scripts/verify-workflow-contracts.tsoxfmt --checkon the five touched filesoxlinton the four touched TypeScript files (two existingno-array-sortwarnings only)git diff --checkAfter merge and protected-main checks, the release controller will be rerun in
windows-onlymode against the exact merged SHA.Summary by CodeRabbit
Greptile Summary
This PR isolates release-draft visibility validation into a dedicated
draft_admissionjob that holdscontents: write, fixing the root cause where the read-onlypreflightjob could not enumerate private draft releases. All native build jobs andpublishare gated on bothdraft_admissionandpreflightsucceeding, and the topology is locked by updated workflow contracts and tests.draft_admissionas a five-minute, write-scoped Ubuntu job that authenticates the caller workflow ref, protected-main status, source SHA, owner/actor, VERSION regex, TAG format, and DRAFT_ID before checkout and draft validation.preflight, replacing it with the stricter admission step; updatesPUBLISH_JOB_CONDITIONand theallowedWritePermissionallowlist accordingly.verifyDraftAdmissionJob,verifyPublicationJobDependencies) with exact-key and exact-array checks, and locks down bypass mutations.Confidence Score: 5/5
Safe to merge — narrows a concrete permission gap, and the new contract enforcement is locked down end-to-end.
The root cause (read-only preflight token blocking draft enumeration) is correctly fixed by isolating the capability to a minimal, write-scoped job. Contract changes lock the new structure with exact-key and exact-array comparisons, the allowlist is updated, and the test suite exercises every meaningful bypass mutation.
No files require special attention.
Important Files Changed
draft_admissionjob withcontents: write; gateswindows_x64,macos_arm64, andpublishon it; removes draft validation from the read-onlypreflightjob.verifyDraftAdmissionJobandverifyPublicationJobDependencies; movesSETUP_NODE_ACTIONand addsCHECKOUT_ACTIONto top-level constants; updatesPUBLISH_JOB_CONDITION.itblocks covering admission permission enforcement, authorization step mutations, validation step mutations, validator-isolation rules, and job dependency wiring.allowedWritePermissionto allowlistjobs.draft_admission.permissionsinstead ofjobs.reserve_tag.permissions.draft_admissionis valid andpreflightwithcontents: writeis rejected.Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD trigger([workflow_call]) --> draft_admission draft_admission["draft_admission\n(ubuntu-24.04, contents: write)\nAuthorize + Checkout + Setup Node + Validate draft"] trigger --> preflight preflight["preflight\n(ubuntu-24.04, contents: read)"] draft_admission --> windows_x64 preflight --> windows_x64 draft_admission --> macos_arm64 preflight --> macos_arm64 windows_x64 --> publish macos_arm64 --> publish draft_admission --> publish preflight --> publish publish["publish"]%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% flowchart TD trigger([workflow_call]) --> draft_admission draft_admission["draft_admission\n(ubuntu-24.04, contents: write)\nAuthorize + Checkout + Setup Node + Validate draft"] trigger --> preflight preflight["preflight\n(ubuntu-24.04, contents: read)"] draft_admission --> windows_x64 preflight --> windows_x64 draft_admission --> macos_arm64 preflight --> macos_arm64 windows_x64 --> publish macos_arm64 --> publish draft_admission --> publish preflight --> publish publish["publish"]Reviews (4): Last reviewed commit: "test(release): confine state validation ..." | Re-trigger Greptile