Repository navigation
Add update-pr-from-base-branch feature - #1950
Conversation
#1904) Co-authored-by: Federico Brigante <[email protected]>
|
The commit above was created with this feature 🎉 371960a |
| import * as icons from '../libs/icons'; | ||
|
|
||
| export async function mergeBranches(repoUrl: string, base: string, head: string) { | ||
| const result = await api.v3(`repos/${repoUrl}/merges`, { |
There was a problem hiding this comment.
The v4 API doesn't support this?
|
Re: default vs master terminology. Isn't it technically a third option - i.e. whatever is the "base" branch for the PR? For example if my default branch is |
|
I used |
This comment has been minimized.
This comment has been minimized.
update-pr-from-base-branch feature
This will also perform the merge 🌈
|
Seems to work, however:
This doesn't work correctly. I made a PR (sindresorhus/sindre-playground#4), then updated a file in master, and reloaded the PR, got the "Update branch" button, clicked it, got "Updating branch...", then it disappeared, and then reappeared again, if I click it now, it just switches to "Updating branch...", but nothing happens. If I reload the page 1 minute later, the button no longer shows. I have a feeling that this is caused by the API taking some time to update its status or something. Still, it's not a very good experience for users. |
Yeah that’s the second-last to-do on my list, I think I’ll just have to disable the feature after the merge because it’s unlikely to be needed right away |
dcdd1c5 to
839f4b8
Compare
|
Looks good now. The only problem is that when you click "Update branch", then it updates, and you refresh the page, the button is there again, as the API is slow to update... I don't think we can do anything about that though. |
|
Thanks all |



Closes #1236
masterwas force-pushedThe name is simplified tomasterbecause people get it but it works on any branchTasks: all resolved
Tasks
Merge with master, it needs a description field because of Add description field to features #2030
Make less prominent, this shouldn't look like a necessary step.
HELP: Where/how should we show this button? Does it make sense there? This is what I got so far, which doesn't look right (warning icon, too prominent)
The button might not appear sometimes; I'll fix this once we figure out where to place it 👆
Only show if necessary, like when a branch is stale or when GH already shows it
HELP: how do we find out whether a branch is stale? Edit: maybe this https://developer.github.com/v3/repos/commits/#compare-two-commits
Handle errors. I'll probably change the API to just
ignoreHTTPStatus: falseinstead ofaccept404. API reference: https://developer.github.com/v3/repos/merging/Handle conflict (i.e. console error) with
add-co-authors(fixed in Reliable merge box handlers #2019)Handle possible caching issue after merging (the button reappears)
[-] Update readme
cc @rarkins @sindresorhus
Test
Test it on any PR. It should depend on:
Outdated screenshot https://user-images.githubusercontent.com/1402241/56434750-842de800-6308-11e9-9092-75cd703d4414.png