`update-pr-from-base-branch` sometimes doesn't add the button
See original GitHub issueE.g. in this PR the button is not added although the branch is out-of date. The feature bails out directly because I can’t merge the PR (it’s a fork of a repo I don’t have access to):
I can successfully call the update-branch
API endpoint though. I tested that in a similar PR by commenting out the lines above and clicking the button.
Because the logic when to add / don’t add the button seems quite complicated and has changed quite a bit in the past (90226744b60546d48006db95cf1352d1e7a7d580, 4b3fff7b3548c3c1132fbc47b9baf70bb9cf2380, 45e432317347f5fb8eb8cedd9c83e57e5b83354a, 5787ed70f31076256eda7ced1c2a1d89c8ebada0, c5ab9a905c8ba33eab326706b9993fcf3ebcd6e6, 15600fe3303abee0724665356de9e0cedf06517e), I haven’t really tried to solve it myself.
These are the rules I worked out myself (please add more I forgot!):
- If you can’t edit the PR (because you opened it or have repo access), bail out ❌
- If the branch is not out-of-date, bail out. ❌
- If the head is
unknown repository
, bail out ❌ - If the repo enabled the
Require branches to be up to date before merging
branch setting, there is already an “Update branch” button. ❌ - If the branch has merge conflicts and the PR is not a draft, there is already a “Resolve conflicts” button. ❌
- In all other cases, add the button. ✔️
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:8 (7 by maintainers)
Top GitHub Comments
It makes sure you really know that you can update the base branch 😉
Can you moved that to a new issue? The selector will have to be updated.