Repository navigation
fix(worktrees): do not refuse ordinary merges as CI inspect failures - #761
Conversation
…760) The blast-radius gate fail-closed on git diff main...HEAD when only origin/main existed, and on a missing worktree directory. Both showed a Sign off banner that could not unblock the merge. Co-authored-by: Cursor <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 449a8fff75
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| add(name); | ||
| if (!name.startsWith("refs/") && !name.includes("://")) { | ||
| add(`refs/heads/${name}`); | ||
| add(`origin/${name}`); |
There was a problem hiding this comment.
Prefer the exact remote ref over DWIM shorthand
When the local base branch is absent and the repository has both refs/remotes/origin/main and a tag named origin/main, this candidate succeeds first but resolves to the tag because Git gives refs/tags/* precedence over refs/remotes/* for ambiguous names (gitrevisions: specifying revisions). Consequently, listChangedPaths can compare against an attacker-controlled or stale tag and return no CI paths—for example, when the workflow matches that tag but differs from the real remote base—allowing mergeWorktree or mergePr to bypass the required workflow sign-off. Probe or return refs/remotes/origin/${name} directly instead of accepting the ambiguous shorthand.
Useful? React with 👍 / 👎.
Summary
git diff main...HEADwhen onlyorigin/mainexisted, and on a missing worktree directory. Both showed a Sign off banner that could not unblock the merge.main→origin/main), restore a missing worktree from its branch, and stop prefixing inspect-failed as aCI_WORKFLOW:sign-off.Closes #760.
Test plan
node --test electron/test/blast-radius.test.js(8 pass)mainMade with Cursor