question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`update-pr-from-base-branch` sometimes doesn't add the button

See original GitHub issue

E.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):

https://github.com/sindresorhus/refined-github/blob/7589633720493550e359468ffdb4294858b74646/source/features/update-pr-from-base-branch.tsx#L97-L105

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:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
FloEdelmanncommented, May 30, 2020

It makes sure you really know that you can update the base branch 😉

1reaction
fregantecommented, Nov 4, 2020

Can you moved that to a new issue? The selector will have to be updated.

Read more comments on GitHub >

github_iconTop Results From Across the Web

`update-pr-from-base-branch` sometimes doesn't add the button
E.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...
Read more >
github - "Create pull request" button missing when basing pull ...
The solution I found was to pull down a local branch of the commit that I wanted and then push my local branch...
Read more >
More ways to keep your pull request branch up-to-date
To update by rebasing, click the drop down menu next to the Update Branch button, click Update with rebase, and then click Rebase...
Read more >
Pull changes to your local Git repo - Azure - Microsoft Learn
Update branches with merge or rebase; Download changes and update branches with pull. Download changes with fetch. Git fetch downloads remote ...
Read more >
How to submit a pull request | Zell Liew
Here' what you need to do is click on the “Create pull request button”. Setting base branch to master and compare branch to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found