Skip to content

Commit 84c0484

Browse files
committed
Fix ghstack merge bot failing to parse PR stack header
Summary: ghstack 0.15.0 changed the header URL in PR bodies from `Stack from [ghstack](https://github.com/ezyang/ghstack)` to `Stack from [ghstack](https://github.com/ezyang/ghstack/tree/0.15.0)`. The exact string match in `propose_ghstack_orig_pr.py` no longer matched, causing every ghstack_land workflow run to fail since May 14. Use `startswith("Stack from [ghstack]")` instead to be resilient to URL changes. Test Plan: Verified the new pattern matches both the old format (`https://github.com/ezyang/ghstack`) and the new format (`https://github.com/ezyang/ghstack/tree/0.15.0`). This PR was authored with the help of Claude. Reviewers:
1 parent 88faab2 commit 84c0484

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

.github/scripts/propose_ghstack_orig_pr.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,9 @@ def extract_stack_from_body(pr_body: str) -> List[int]:
5252
"""
5353

5454
prs = []
55-
ghstack_begin = (
56-
"Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom):"
57-
)
5855
ghstack_begin_seen = False
5956
for line in pr_body.splitlines():
60-
if ghstack_begin in line:
57+
if line.startswith("Stack from [ghstack]"):
6158
ghstack_begin_seen = True
6259
if not ghstack_begin_seen:
6360
continue

0 commit comments

Comments
 (0)