Repository navigation
fix(backstage-template-execution): a PR merged by hand is merged, not refused - #69
Merged
Merged
Conversation
… refused
On stuttgart-things#3911 (2026-10-21) the build PR was merged by hand while
Deploy-VMs was still running. When the run went green the gate found no
open PR and refused ("no open PR found for branch ..."): a merge-refused
card in Teams and a FAILED instance for a VM that was built and on main.
With no open PR the gate now looks up the run's PR (by number, from the
watched run; else the newest closed PR of the branch). Merged -> success,
pitched as `merged` with "was already merged by <login> (by hand)". Closed
without merge stays a refusal. List and merge calls go through githubAPI
so the path is testable.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016TtmNGbCHXQGtqnrT926ZN
This branch was successfully deployed
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.
Seen on stuttgart-things#3911 (cutover3, 2026-10-21): the build PR was merged by hand while Deploy-VMs was still running. When the run went green,
MergePullRequestfound no open PR and refused (no open PR found for branch vsphere-vm-cutover3-labda). The result was amerge-refusedcard (error) and a FAILED instance, for a VM that was built and on main.Fix: with no open PR, the gate looks up the PR:
MergeInput.PRNumber, new, optional);If it is merged, the step succeeds and pitches
mergedwith "PR #N was already merged by (by hand)".MergeResultgainsbyHand/mergedBy. A PR closed without merge stays a refusal. List and merge calls now go throughgithubAPIlike the check gate, so the path is testable.Tests:
main_merged_test.gocovers merged by number, merged by branch (no by-number call), closed-unmerged → error, and no PR at all → error. In all four, the gate never PUTs a merge.go vetandgo test ./...are green.Rollout: the workflow's activity sequence is unchanged; only the activity's input gains a field, so in-flight runs replay fine.
🤖 Generated with Claude Code
https://claude.ai/code/session_016TtmNGbCHXQGtqnrT926ZN