Skip to content

fix: refuse a release merge when the guard cannot read the PR - #335

Merged
SebTardif merged 3 commits into
mainfrom
fix/release-guard-fail-closed
Nov 24, 2026
Merged

SebTardif merged 3 commits into
mainfrom
fix/release-guard-fail-closed

Conversation

@SebTardif

Copy link
Copy Markdown
Contributor

Summary

The release merge guard exits 2 when it cannot read the pull request title. That used to print "safe to merge". The title chore(main): release patchloom 0.10.0 is still a release, and any autorelease: label counts too.

The MCP tools/call test waits for the server to exit before deleting its directory, then retries if Windows still has the folder locked.

Why

On the 0.10.0 release, the guard printed that pull request 332 was not a release. A later run classified that same title. A failed gh lookup must not be treated as permission to merge.

Verification

  • bash scripts/guard-no-release-merge.test.sh: the 0.10.0 title exits 1, an approved bypass exits 0, a failed gh and an empty title exit 2.
  • Live bash scripts/guard-no-release-merge.sh 332 exits 1.
  • npm run check: 462 passed, 3 skipped, line coverage 92.63%, package ok.

Checklist

  • All commits in this pull request are signed off with git commit -s
  • I ran npm run check and it passes
  • I updated docs if user-facing behavior changed
  • I am contributing this work under the repository license (MIT)

A failed gh lookup used to print that the pull was safe to merge.
The 0.10.0 title is chore(main): release patchloom 0.10.0. The guard
now exits 2 when the title cannot be read, and any autorelease label
counts as a release. A fake-gh test covers that title.

Signed-off-by: Sebastien Tardif <SebTardif@ncf.ca>
On Windows the tools/call test deleted the server cwd while the
process still held it, so rmdir failed with EBUSY. Wait for exit,
then retry the delete.

Signed-off-by: Sebastien Tardif <SebTardif@ncf.ca>
github-actions[bot]
github-actions Bot previously approved these changes Nov 24, 2026
macOS /bin/bash treats "${repo_args[@]}" as unbound when the array is
empty and set -u is on. The guard then exited before it could read the
title. Call gh with --repo only when GH_REPO is set.

Signed-off-by: Sebastien Tardif <SebTardif@ncf.ca>
@SebTardif
SebTardif marked this pull request as ready for review November 24, 2026 06:41
@SebTardif
SebTardif merged commit 3c9156a into main Nov 24, 2026
23 of 24 checks passed
@SebTardif
SebTardif deleted the fix/release-guard-fail-closed branch November 24, 2026 06:41
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