Skip to content

Add "Wait for successful checks" checkbox#975

Merged
sindresorhus merged 12 commits into
masterfrom
wait-for-ci
Jan 22, 2018
Merged

Add "Wait for successful checks" checkbox#975
sindresorhus merged 12 commits into
masterfrom
wait-for-ci

Conversation

@fregante
Copy link
Copy Markdown
Member

@fregante fregante commented Jan 10, 2018

Closes #865

demo

(previous gif)

Notes:

  • The checkbox is shown only when there's a pending commit
  • The checkbox is checked by default
  • While waiting, the form is disabled
  • While waiting, closing the tab requires a confirmation
  • If a new commit is pushed while waiting, the waiting stops (i.e. form re-enabled, no action taken)
  • If the checks fail, the waiting stops

Caveats:

  • GitHub's UI can be finnicky, it doesn't always update (side note: the large "merge details" form does not update at all when the "confirm merge" form is open, but it doesn't affect the feature because I use the single commit's icon)
  • Secondary features like branch deletion and comment submission can be added separately, so at least we can see how well this performs.

This was way more involved than I had anticipated.

@hkdobrev hkdobrev self-requested a review January 12, 2018 09:34
@sindresorhus
Copy link
Copy Markdown
Member

While waiting, closing the tab requires a confirmation

I didn't get any confirmation. The tab just closed as normal. (Chrome)

@sindresorhus
Copy link
Copy Markdown
Member

Otherwise, seems to work perfectly though. And this is super useful!

@fregante
Copy link
Copy Markdown
Member Author

fregante commented Jan 21, 2018

I didn't get any confirmation. The tab just closed as normal. (Chrome)

Fixed. However it currently only handles tab closing or regular navigation, not ajaxed loads.

I could detect it, warn the user, and abort the submission, but not ask for confirmation. Implementation suggestions?

@sindresorhus sindresorhus merged commit eb0619c into master Jan 22, 2018
@sindresorhus sindresorhus deleted the wait-for-ci branch January 22, 2018 21:38
@sindresorhus
Copy link
Copy Markdown
Member

Awesome!

@bfred-it Do you wanna do a tweet about this feature with the above GIF? So I can retweet. Otherwise, I will.

@fregante
Copy link
Copy Markdown
Member Author

fregante commented Jan 22, 2018

Sure! I guess this can also be added to the highlights in the readme

@fregante
Copy link
Copy Markdown
Member Author

By "Sure" I mean you can tweet it 😄

@gaillota
Copy link
Copy Markdown
Contributor

Quick feedback: This feature blocks the merge even when there's only non-required checks remaining (eg. A deploy approval that you don't need).

Maybe the feature can be updated to block only while required checks are not met ?

@fregante
Copy link
Copy Markdown
Member Author

fregante commented May 25, 2018

Can you give me a screenshot of that? This only waits for the yellow indicator to disappear from next to the last commit. Approvals shouldn't affect the indicator.

screen shot 2018-05-25 at 14 32 39

@waldyrious
Copy link
Copy Markdown
Contributor

FYI, clicking the help button next to the checkbox, which I thought would show a modal box or tooltip with some info, actually took me straight to this issue, making me lose the changes to the commit message I had composed prior to the merge. Is this being tracked somewhere, or should I open an issue?

@busches
Copy link
Copy Markdown
Member

busches commented Sep 6, 2018 via email

@jesstelford
Copy link
Copy Markdown

It just hangs for me :(

I thought I'd successfully merged, but later realised I hadn't when I opened a new tab...


hanging
screen shot 2018-09-26 at 3 29 44 pm


new tab
screen shot 2018-09-26 at 3 32 03 pm

(note: I blanked out the details)

@jesstelford
Copy link
Copy Markdown

Can I suggest this option be unchecked by default to prevent issues like this and the one reported above?

@busches
Copy link
Copy Markdown
Member

busches commented Sep 26, 2018

I'm confused, both screenshots show it merged, but the first kept the merge options, is that the issue?

@jesstelford
Copy link
Copy Markdown

jesstelford commented Sep 26, 2018

both screenshots show it merged

Yes, that's the problem: in the first screenshot, it shows it as merged, but when I opened a second tab to look at the page fresh; it wasn't merged.

I clicked "merge" again in the second tab (it immediately completed the merge) then took the second screenshot. Meanwhile the first tab continued to hang without updating the "Merge" button / surrounding UI.

ie; if I'd not opened a second tab, the first would have just hanged forever on the screen in the first screenshot, but never actually merge.

@busches
Copy link
Copy Markdown
Member

busches commented Sep 26, 2018

If you can get another example, I think that'd be helpful. Both screenshots show it being merged at 21 minutes ago from the comment, which means it looks like the process did work or something odd happened on the GH side, since RGH does not add the merged commit message, but GH does.

@jesstelford
Copy link
Copy Markdown

jesstelford commented Sep 26, 2018

My apologies, I misunderstood the area of the screenshot you were referring to. I see now that you mean the jesstelford merged commit X into Y Z minutes ago, and not the [Confirm Merge] ☑ Wait for successful checks.

That adds another interesting layer!

To clarify the steps of what happened, I'll itemise them:

1 - Ready to merge

I saw that all my PR's checks had passed, and the [Merge] button was green (we've configured the repo to block merging unless checks are green).

I clicked [Merge]

2 - Confirm merge

The button then changed to

[Confirm Merge] ☑ Wait for successful checks

So I clicked [Confirm Merge]

3 - Waiting

The [Confirm Merge] button greyed out, and I saw a screen like this (note: this is an edited screenshot):

Waiting for checks that are already complete

4 - New tab

After reading the docs for ☑ Wait for successful checks, I decided to open the PR in a new tab because things seemed to be hanging on the original tab.

In the new Tab, I saw the same UI from step 1: a [Merge] button. No indication of the PR having been merged, and all checks were still green.

5 - Merge again

In the new tab, I clicked [Merge] followed by [Confirm Merge], and instantly saw the following screen:

Successful merge

6 - Still waiting

I checked the original tab, and noticed the [Confirm Merge] button was still visible as if it was still waiting for a check to complete, but it did show jesstelford merged commit X into Y Z minutes ago:

Still waiting even after a merge


I'll try get more granular screenshots for the next PR I do and will report back if it happened again 👍

EDIT: A thing to note in the original tab is the (incorrect) orange dot next to the commit hash. In the new tab, that is (correctly) a green check, but in both tabs, the main "X Checks have passed" was (correctly) green. Based on earlier comments, perhaps the GH UI is flakey in updating the orange dot to a green check, perhaps there's a different indicator in the UI that Refined GH can hook into?

@busches
Copy link
Copy Markdown
Member

busches commented Sep 26, 2018 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Development

Successfully merging this pull request may close these issues.

6 participants