Skip to content

Commit d40d6cd

Browse files
committed
Remove fallback retarget, add debugging for auto-retarget
Instead of silently falling back to manual retarget when GitHub's auto-retarget doesn't trigger, fail with debug info to understand the root cause.
1 parent 8672aa8 commit d40d6cd

1 file changed

Lines changed: 17 additions & 9 deletions

File tree

tests/test_e2e.sh

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -564,15 +564,23 @@ echo >&2 "0d. Merging NoAct PR1 (without action installed)..."
564564
merge_pr_with_retry "$NOACT_PR1_URL"
565565
echo >&2 "NoAct PR1 merged. Branch should be auto-deleted and PR2 auto-retargeted."
566566

567-
# Wait for GitHub to auto-retarget PR2 to main, or manually retarget if needed
568-
if ! wait_for_pr_base_change "$NOACT_PR2_NUM" "main" 5; then
569-
# GitHub's auto-retarget didn't trigger, manually retarget
570-
echo >&2 "Auto-retarget didn't occur, manually retargeting PR2 to main..."
571-
log_cmd gh pr edit "$NOACT_PR2_NUM" --repo "$REPO_FULL_NAME" --base main
572-
if ! wait_for_pr_base_change "$NOACT_PR2_NUM" "main" 5; then
573-
echo >&2 "❌ Failed to retarget PR2 to main"
574-
exit 1
575-
fi
567+
# Debug: Check if the branch was actually deleted
568+
echo >&2 "Checking if noact_feature1 branch was deleted..."
569+
if gh api "/repos/$REPO_FULL_NAME/branches/noact_feature1" &>/dev/null; then
570+
echo >&2 "❌ Branch noact_feature1 still exists! Auto-delete may not have worked."
571+
echo >&2 "Repo settings:"
572+
gh api "/repos/$REPO_FULL_NAME" --jq '{delete_branch_on_merge}' >&2
573+
exit 1
574+
else
575+
echo >&2 "✅ Branch noact_feature1 was deleted."
576+
fi
577+
578+
# Wait for GitHub to auto-retarget PR2 to main
579+
if ! wait_for_pr_base_change "$NOACT_PR2_NUM" "main"; then
580+
echo >&2 "❌ GitHub did not auto-retarget PR2 to main"
581+
echo >&2 "Debug info:"
582+
gh pr view "$NOACT_PR2_NUM" --repo "$REPO_FULL_NAME" --json baseRefName,state,headRefName >&2
583+
exit 1
576584
fi
577585

578586
# Capture diff after retarget

0 commit comments

Comments
 (0)