New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update-pr-from-base-branch
sometimes doesn't add the button
#3155
Comments
update-pr-from-base-branch
sometimes doesn't show the buttonupdate-pr-from-base-branch
sometimes doesn't add the button
Yes, regarding the 4th point, a generic “if it already exists, don’t add” behavior should work. However I’ve regularly seen 2 buttons on some PRs due to this feature. |
As mentioned in #3154, I'm not seeing the button on this draft PR either (#3153) Here's the DOM: <div class="mergeability-details js-details-container Details">
<div class="branch-action-item">
<!-- '"` --><!-- </textarea></xmp> -->
<form class="branch-action-btn float-right" action="/sindresorhus/refined-github/pull/3153/ready_for_review" accept-charset="UTF-8" method="post">
<input type="hidden" name="pull_request_id" value="MDExOlB1bGxSZXF1ZXN0NDI0NjIwODMy" />
<button class="btn" type="submit" data-disable-with="">Ready for review</button>
</form>
<div class="branch-action-item-icon completeness-indicator completeness-indicator-problem">
{ICON}
</div>
<div class="h4 status-heading">This pull request is still a work in progress</div>
<span class="status-meta">Draft pull requests cannot be merged.</span>
</div>
<div class="branch-action-item js-details-container Details">
<div class="branch-action-item-icon completeness-indicator completeness-indicator-success">
{ICON}
</div>
<div class="">
<button type="button" class="btn-link float-right js-details-target" aria-expanded="true">
<span class="statuses-toggle-opened">Hide all checks</span>
<span class="statuses-toggle-closed">Show all checks</span>
</button>
<h3 class="h4 status-heading">All checks have passed</h3>
<span class="status-meta">4 successful checks</span>
</div>
<div class="merge-status-list js-updatable-content-preserve-scroll-position" data-updatable-content-scroll-position-id="merge-status-list">
<div class="merge-status-item d-flex flex-items-baseline">
<div class="merge-status-icon flex-self-center">
{ICON}
</div>
<a href="/apps/github-actions" class="d-inline-block tooltipped tooltipped-e muted-link mr-2 rounded-1" aria-label="@github-actions generated this status." style="background-color: #ffffff;">
<img class="avatar" src="https://avatars0.githubusercontent.com/in/15368?s=40&v=4" width="20" height="20" alt="@github-actions" />
</a>
<div class="text-gray col-10 css-truncate css-truncate-target">
<strong class="text-emphasized mr-2">
Test / Security (pull_request)
</strong>
Successful in 6s
</div>
<div class="d-flex col-2 flex-shrink-0">
<a class="status-actions" data-skip-pjax="" href="/sindresorhus/refined-github/pull/3153/checks?check_run_id=717653634" target="_blank" rel="noopener">Details</a>
</div>
</div>
<div class="merge-status-item d-flex flex-items-baseline">
<div class="merge-status-icon flex-self-center">
{ICON}
</div>
<a href="/apps/github-actions" class="d-inline-block tooltipped tooltipped-e muted-link mr-2 rounded-1" aria-label="@github-actions generated this status." style="background-color: #ffffff;">
<img class="avatar" src="https://avatars0.githubusercontent.com/in/15368?s=40&v=4" width="20" height="20" alt="@github-actions" />
</a>
<div class="text-gray col-10 css-truncate css-truncate-target">
<strong class="text-emphasized mr-2">
Test / AVA (pull_request)
</strong>
Successful in 43s
</div>
<div class="d-flex col-2 flex-shrink-0">
<a class="status-actions" data-skip-pjax="" href="/sindresorhus/refined-github/pull/3153/checks?check_run_id=717653603" target="_blank" rel="noopener">Details</a>
</div>
</div>
<div class="merge-status-item d-flex flex-items-baseline">
<div class="merge-status-icon flex-self-center">
{ICON}
</div>
<a href="/apps/github-actions" class="d-inline-block tooltipped tooltipped-e muted-link mr-2 rounded-1" aria-label="@github-actions generated this status." style="background-color: #ffffff;">
<img class="avatar" src="https://avatars0.githubusercontent.com/in/15368?s=40&v=4" width="20" height="20" alt="@github-actions" />
</a>
<div class="text-gray col-10 css-truncate css-truncate-target">
<strong class="text-emphasized mr-2">
Test / Lint (pull_request)
</strong>
Successful in 37s
</div>
<div class="d-flex col-2 flex-shrink-0">
<a class="status-actions" data-skip-pjax="" href="/sindresorhus/refined-github/pull/3153/checks?check_run_id=717653652" target="_blank" rel="noopener">Details</a>
</div>
</div>
<div class="merge-status-item d-flex flex-items-baseline">
<div class="merge-status-icon flex-self-center">
{ICON}
</div>
<a href="/apps/github-actions" class="d-inline-block tooltipped tooltipped-e muted-link mr-2 rounded-1" aria-label="@github-actions generated this status." style="background-color: #ffffff;">
<img class="avatar" src="https://avatars0.githubusercontent.com/in/15368?s=40&v=4" width="20" height="20" alt="@github-actions" />
</a>
<div class="text-gray col-10 css-truncate css-truncate-target">
<strong class="text-emphasized mr-2">
Test / Build (pull_request)
</strong>
Successful in 38s
</div>
<div class="d-flex col-2 flex-shrink-0">
<a class="status-actions" data-skip-pjax="" href="/sindresorhus/refined-github/pull/3153/checks?check_run_id=717653584" target="_blank" rel="noopener">Details</a>
</div>
</div>
</div>
</div>
<div class="merge-message">
<div class="select-menu d-inline-block">
<div class="BtnGroup position-relative">
<button type="button" class="btn-group-merge border-right-0 rounded-left-1 btn BtnGroup-item js-details-target" aria-expanded="false" data-details-container=".js-merge-pr" disabled="">
Merge pull request
</button>
<button type="button" class="btn-group-squash border-right-0 rounded-left-1 btn BtnGroup-item js-details-target" aria-expanded="false" data-details-container=".js-merge-pr" disabled="">
Squash and merge
</button>
<button type="button" class="btn-group-rebase border-right-0 rounded-left-1 btn BtnGroup-item js-details-target" aria-expanded="false" data-details-container=".js-merge-pr" disabled="">
Rebase and merge
</button>
<button type="button" class="btn select-menu-button BtnGroup-item" aria-label="Select merge method" disabled=""></button>
</div>
</div>
<p class="alt-merge-options text-small">
<span class="js-remove-unless-platform" data-platforms="windows,mac">
You can also
<a data-hydro-click='{"event_type":"pull_request.merge_external","payload":{"client_type":"DESKTOP","originating_url":"https://github.com/sindresorhus/refined-github/pull/3153","user_id":1402241}}' data-hydro-click-hmac="3df843dc2f8e6e67690fa56a6d07b77616a4fded79f7c13753a8b73e90f17677" href="x-github-client://openRepo/https://github.com/sindresorhus/refined-github?branch=pr%2F3153&pr=3153">open this in GitHub Desktop</a>
</span>
or view
<button name="button" type="button" class="btn-link js-details-target" aria-expanded="false" data-hydro-click='{"event_type":"pull_request.merge_external","payload":{"client_type":"GIT","originating_url":"https://github.com/sindresorhus/refined-github/pull/3153","user_id":1402241}}' data-hydro-click-hmac="370175b7a7d154ab079876458bc321f4926cb4e1a79b28d1dc8cbc5cd96e0f2a">
command line instructions</button
>.
</p>
<git-clone-help-controller class="merge-branch-manually">
{CONTENT}
</git-clone-help-controller>
</div>
</div> |
It did work on #3148 though. Here's the DOM of that page. A diff might reveal why: <div class="mergeability-details js-details-container Details">
<div class="branch-action-item">
<!-- '"` --><!-- </textarea></xmp> -->
<form class="branch-action-btn float-right" action="/sindresorhus/refined-github/pull/3148/ready_for_review" accept-charset="UTF-8" method="post">
<input type="hidden" name="pull_request_id" value="MDExOlB1bGxSZXF1ZXN0NDI0MTM0NTUy" />
<button class="btn" type="submit" data-disable-with="">Ready for review</button>
</form>
<div class="branch-action-item-icon completeness-indicator completeness-indicator-problem">
{ICON}
</div>
<div class="h4 status-heading">This pull request is still a work in progress</div>
<span class="status-meta">Draft pull requests cannot be merged.</span> <span class="status-meta rgh-update-pr-from-base-branch">You can <button type="button" class="btn-link tooltipped tooltipped-n" aria-label="Merge the master branch into octicons-v2-updates">update the base branch</button>.</span>
</div>
<div class="branch-action-item js-details-container Details">
<div class="branch-action-item-icon completeness-indicator completeness-indicator-success">
{ICON}
</div>
<div class="">
<button type="button" class="btn-link float-right js-details-target" aria-expanded="true">
<span class="statuses-toggle-opened">Hide all checks</span>
<span class="statuses-toggle-closed">Show all checks</span>
</button>
<h3 class="h4 status-heading">All checks have passed</h3>
<span class="status-meta">8 successful checks</span>
</div>
<div class="merge-status-list js-updatable-content-preserve-scroll-position" data-updatable-content-scroll-position-id="merge-status-list">
<div class="merge-status-item d-flex flex-items-baseline">
<div class="merge-status-icon flex-self-center">
{ICON}
</div>
<a href="/apps/github-actions" class="d-inline-block tooltipped tooltipped-e muted-link mr-2 rounded-1" aria-label="@github-actions generated this status." style="background-color: #ffffff;">
<img class="avatar" src="https://avatars0.githubusercontent.com/in/15368?s=40&v=4" width="20" height="20" alt="@github-actions" />
</a>
<div class="text-gray col-10 css-truncate css-truncate-target">
<strong class="text-emphasized mr-2">
Test / Security (pull_request)
</strong>
Successful in 6s
</div>
<div class="d-flex col-2 flex-shrink-0">
<a class="status-actions" data-skip-pjax="" href="/sindresorhus/refined-github/pull/3148/checks?check_run_id=716575333" target="_blank" rel="noopener">Details</a>
</div>
</div>
<div class="merge-status-item d-flex flex-items-baseline">
<div class="merge-status-icon flex-self-center">
{ICON}
</div>
<a href="/apps/github-actions" class="d-inline-block tooltipped tooltipped-e muted-link mr-2 rounded-1" aria-label="@github-actions generated this status." style="background-color: #ffffff;">
<img class="avatar" src="https://avatars0.githubusercontent.com/in/15368?s=40&v=4" width="20" height="20" alt="@github-actions" />
</a>
<div class="text-gray col-10 css-truncate css-truncate-target">
<strong class="text-emphasized mr-2">
Test / Security (push)
</strong>
Successful in 7s
</div>
<div class="d-flex col-2 flex-shrink-0">
<a class="status-actions" data-skip-pjax="" href="/sindresorhus/refined-github/pull/3148/checks?check_run_id=716575039" target="_blank" rel="noopener">Details</a>
</div>
</div>
<div class="merge-status-item d-flex flex-items-baseline">
<div class="merge-status-icon flex-self-center">
{ICON}
</div>
<a href="/apps/github-actions" class="d-inline-block tooltipped tooltipped-e muted-link mr-2 rounded-1" aria-label="@github-actions generated this status." style="background-color: #ffffff;">
<img class="avatar" src="https://avatars0.githubusercontent.com/in/15368?s=40&v=4" width="20" height="20" alt="@github-actions" />
</a>
<div class="text-gray col-10 css-truncate css-truncate-target">
<strong class="text-emphasized mr-2">
Test / AVA (pull_request)
</strong>
Successful in 41s
</div>
<div class="d-flex col-2 flex-shrink-0">
<a class="status-actions" data-skip-pjax="" href="/sindresorhus/refined-github/pull/3148/checks?check_run_id=716575321" target="_blank" rel="noopener">Details</a>
</div>
</div>
<div class="merge-status-item d-flex flex-items-baseline">
<div class="merge-status-icon flex-self-center">
{ICON}
</div>
<a href="/apps/github-actions" class="d-inline-block tooltipped tooltipped-e muted-link mr-2 rounded-1" aria-label="@github-actions generated this status." style="background-color: #ffffff;">
<img class="avatar" src="https://avatars0.githubusercontent.com/in/15368?s=40&v=4" width="20" height="20" alt="@github-actions" />
</a>
<div class="text-gray col-10 css-truncate css-truncate-target">
<strong class="text-emphasized mr-2">
Test / AVA (push)
</strong>
Successful in 36s
</div>
<div class="d-flex col-2 flex-shrink-0">
<a class="status-actions" data-skip-pjax="" href="/sindresorhus/refined-github/pull/3148/checks?check_run_id=716575076" target="_blank" rel="noopener">Details</a>
</div>
</div>
<div class="merge-status-item d-flex flex-items-baseline">
<div class="merge-status-icon flex-self-center">
{ICON}
</div>
<a href="/apps/github-actions" class="d-inline-block tooltipped tooltipped-e muted-link mr-2 rounded-1" aria-label="@github-actions generated this status." style="background-color: #ffffff;">
<img class="avatar" src="https://avatars0.githubusercontent.com/in/15368?s=40&v=4" width="20" height="20" alt="@github-actions" />
</a>
<div class="text-gray col-10 css-truncate css-truncate-target">
<strong class="text-emphasized mr-2">
Test / Lint (pull_request)
</strong>
Successful in 38s
</div>
<div class="d-flex col-2 flex-shrink-0">
<a class="status-actions" data-skip-pjax="" href="/sindresorhus/refined-github/pull/3148/checks?check_run_id=716575305" target="_blank" rel="noopener">Details</a>
</div>
</div>
<div class="merge-status-item d-flex flex-items-baseline">
<div class="merge-status-icon flex-self-center">
{ICON}
</div>
<a href="/apps/github-actions" class="d-inline-block tooltipped tooltipped-e muted-link mr-2 rounded-1" aria-label="@github-actions generated this status." style="background-color: #ffffff;">
<img class="avatar" src="https://avatars0.githubusercontent.com/in/15368?s=40&v=4" width="20" height="20" alt="@github-actions" />
</a>
<div class="text-gray col-10 css-truncate css-truncate-target">
<strong class="text-emphasized mr-2">
Test / Lint (push)
</strong>
Successful in 38s
</div>
<div class="d-flex col-2 flex-shrink-0">
<a class="status-actions" data-skip-pjax="" href="/sindresorhus/refined-github/pull/3148/checks?check_run_id=716575092" target="_blank" rel="noopener">Details</a>
</div>
</div>
<div class="merge-status-item d-flex flex-items-baseline">
<div class="merge-status-icon flex-self-center">
{ICON}
</div>
<a href="/apps/github-actions" class="d-inline-block tooltipped tooltipped-e muted-link mr-2 rounded-1" aria-label="@github-actions generated this status." style="background-color: #ffffff;">
<img class="avatar" src="https://avatars0.githubusercontent.com/in/15368?s=40&v=4" width="20" height="20" alt="@github-actions" />
</a>
<div class="text-gray col-10 css-truncate css-truncate-target">
<strong class="text-emphasized mr-2">
Test / Build (pull_request)
</strong>
Successful in 54s
</div>
<div class="d-flex col-2 flex-shrink-0">
<a class="status-actions" data-skip-pjax="" href="/sindresorhus/refined-github/pull/3148/checks?check_run_id=716575353" target="_blank" rel="noopener">Details</a>
</div>
</div>
<div class="merge-status-item d-flex flex-items-baseline">
<div class="merge-status-icon flex-self-center">
{ICON}
</div>
<a href="/apps/github-actions" class="d-inline-block tooltipped tooltipped-e muted-link mr-2 rounded-1" aria-label="@github-actions generated this status." style="background-color: #ffffff;">
<img class="avatar" src="https://avatars0.githubusercontent.com/in/15368?s=40&v=4" width="20" height="20" alt="@github-actions" />
</a>
<div class="text-gray col-10 css-truncate css-truncate-target">
<strong class="text-emphasized mr-2">
Test / Build (push)
</strong>
Successful in 40s
</div>
<div class="d-flex col-2 flex-shrink-0">
<a class="status-actions" data-skip-pjax="" href="/sindresorhus/refined-github/pull/3148/checks?check_run_id=716575057" target="_blank" rel="noopener">Details</a>
</div>
</div>
</div>
</div>
<div class="merge-message">
<div class="select-menu d-inline-block">
<div class="BtnGroup position-relative">
<button type="button" class="btn-group-merge border-right-0 rounded-left-1 btn BtnGroup-item js-details-target" aria-expanded="false" data-details-container=".js-merge-pr" disabled="">
Merge pull request
</button>
<button type="button" class="btn-group-squash border-right-0 rounded-left-1 btn BtnGroup-item js-details-target" aria-expanded="false" data-details-container=".js-merge-pr" disabled="">
Squash and merge
</button>
<button type="button" class="btn-group-rebase border-right-0 rounded-left-1 btn BtnGroup-item js-details-target" aria-expanded="false" data-details-container=".js-merge-pr" disabled="">
Rebase and merge
</button>
<button type="button" class="btn select-menu-button BtnGroup-item" aria-label="Select merge method" disabled=""></button>
</div>
</div>
<p class="alt-merge-options text-small">
<span class="js-remove-unless-platform" data-platforms="windows,mac">
You can also
<a data-hydro-click='{"event_type":"pull_request.merge_external","payload":{"client_type":"DESKTOP","originating_url":"https://github.com/sindresorhus/refined-github/pull/3148","user_id":1402241}}' data-hydro-click-hmac="fb9985c494088e7b7a2a72e03194d32ec8fedf337ac4e088e86106f3b332bec4" href="x-github-client://openRepo/https://github.com/sindresorhus/refined-github?branch=octicons-v2-updates">open this in GitHub Desktop</a>
</span>
or view
<button name="button" type="button" class="btn-link js-details-target" aria-expanded="false" data-hydro-click='{"event_type":"pull_request.merge_external","payload":{"client_type":"GIT","originating_url":"https://github.com/sindresorhus/refined-github/pull/3148","user_id":1402241}}' data-hydro-click-hmac="c46bfc4203652c7b4188359a769b8c1e1269b4a4dc14b7bb8705648743930858">
command line instructions</button
>.
</p>
<git-clone-help-controller class="merge-branch-manually">
{CONTENT}
</git-clone-help-controller>
</div>
</div> |
It makes sure you really know that you can update the base branch 😉 |
I think this was fixed |
I'm running into two other scenarios where the button isn't showing up:
It would be really useful if this feature worked in those scenarios. A partial workaround is to switch it back to a draft PR, but thats a little awkward. |
Can you moved that to a new issue? The selector will have to be updated. |
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 (9022674, 4b3fff7, 45e4323, 5787ed7, c5ab9a9, 15600fe), I haven't really tried to solve it myself.
These are the rules I worked out myself (please add more I forgot!):
unknown repository
, bail out ❌Require branches to be up to date before merging
branch setting, there is already an "Update branch" button. ❌The text was updated successfully, but these errors were encountered: