Skip to content

Commit c36d11f

Browse files
jdclaude
andcommitted
fix(stack): surface fetch_old_pr_heads failures instead of swallowing
The exception handler around `fetch_old_pr_heads` previously did a silent `pass`, leaving every revision-history entry stamped "unknown" with no clue why. When a real failure happens (fork remote without `refs/pull/N/head`, network error, missing permissions, …) the user has no signal that anything went wrong — they only see the symptom in the PR comment days later. Log the underlying error in orange so the cause is visible at push time. Behaviour stays non-fatal: classification still falls back to "unknown" and the push proceeds. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Change-Id: Id33459ea069be228f73fb02a7f813f16db145b71
1 parent 6bed88b commit c36d11f

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

mergify_cli/stack/push.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -589,8 +589,13 @@ async def stack_push(
589589
with console.status("Fetching old PR heads for comparison..."):
590590
try:
591591
await fetch_old_pr_heads(remote, updated_pr_numbers)
592-
except utils.CommandError:
593-
pass # Non-fatal: change type will be "unknown"
592+
except utils.CommandError as exc:
593+
# Non-fatal: change type will be "unknown" — but surface
594+
# the underlying error so the user can fix it.
595+
console.log(
596+
f"[orange]Could not fetch old PR heads; revision-history "
597+
f"change types will fall back to 'unknown': {exc}[/]",
598+
)
594599

595600
# Detect change types before force-push overwrites refs
596601
change_types: dict[str, str] = {}

0 commit comments

Comments
 (0)