Skip to content

fix(release): allow tag cuts when main requires pull requests - #29985

Merged
nwparker merged 1 commit into
mainfrom
nwparker/release-protected-main
Oct 17, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/release-protected-main

Conversation

@nwparker

@nwparker nwparker commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​82 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​82
Prod 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​14 $\color{#cf222e}{\Huge{\mathbf{−}}}$​9 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​5

ELI5

Main now requires pull requests, so cutting a release fails before its tag is pushed. Keep that protection and let the release publish its tag without changing main.

What Changed

The cut workflow still attempts its normal version fast-forward. If GitHub specifically rejects it with GH013 and the pull-request requirement, it logs the reason, leaves main unchanged, and pushes the release tag. Other main push errors and all tag push errors still fail.

Why

The fresh cut from main was rejected by the new rule. The release already builds from a detached version commit, so main does not need a direct update. This preserves branch protection without adding a privileged token or weakening the release checks.

Linked Issue

Release recovery; no existing issue.

Visual Proof

N/A — release automation only.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated

45 focused tests pass on macOS. Six new tests execute the actual workflow shell with simulated git responses: protected main, allowed fast-forward, unrelated rule rejection, connection failure, off-main cut, and tag rejection. Permission and macOS dispatch contracts also pass. Changed-code quality and formatting pass. PR CI will exercise the changed workflow and tests before merging.

Review

Self-reviewed that the fallback recognizes the specific pull-request rule, never forces a push, and leaves artifact/publication gates intact.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Main may retain its previous package version when direct updates are prohibited. The release tag carries the new version. No app, SSH, mobile, remote protocol, or Git provider behavior changes.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

📝 Walkthrough

When a release source is the tip of main, the workflow attempts to push the version-bump commit to main. If branch protection rejects the push with the specified pull-request-only error, the workflow continues to push the release tag. Other main push errors stop the release. Off-main releases push only the tag. New tests cover these push outcomes, and the release documentation describes the updated behavior.

Priority: ➖ Normal

Merge Risk: 🔵 Low · up to 2fdf1

The release workflow can publish a tag when main is protected. It may also publish one when the rejection lists additional rule violations, which the stated policy says should stop the cut. This is an edge case with a bounded impact, so the change is mergeable with owner awareness.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (2 skipped: 2 … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: allowing release tags when main requires pull requests.
Description check Passed The description covers the change, user impact, rationale, testing, review notes, and checklist. The Linked Issue section does not provide an actual issue, but the rest of the description is complete …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description covers the change, user impact, rationale, testing, review notes, and checklist. The Linked Issue section does not provide an actual issue, but the rest of the description is complete and focused.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (2 skipped: 2 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8086b997-89f8-45b5-b1a1-cc5c02732995
📥 Commits

Reviewing files that changed from the base of the PR and between a87aa4c and 2fdf18f.

📒 Files selected for processing: 3
  • .github/CONTRIBUTING.md
  • .github/workflows/release-cut.yml
  • config/scripts/release-protected-main-push.test.mjs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

push_log="$RUNNER_TEMP/release-push-main.log"
if git push origin "HEAD:refs/heads/main" >"$push_log" 2>&1; then
cat "$push_log"
elif grep -Fq 'GH013' "$push_log" && grep -Fq 'Changes must be made through a pull request.' "$push_log"; then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Reject GH013 responses with additional rule violations.

If GitHub reports both the pull-request rule and another violation, both grep checks succeed. The workflow then pushes the release tag, although the stated policy requires other main push errors to stop the cut. GH013 responses can contain both a pull-request requirement and a signature violation. Accept the fallback only when the pull-request requirement is the sole reported violation, and add a mixed-violation test. (github.com)

@nwparker
nwparker merged commit de1f6e3 into main Oct 17, 2026
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant