Shields: Configuring Ranger

Created on 29 Aug 2019  ยท  28Comments  ยท  Source: badges/shields

:clipboard: Description

I noticed that you installed Ranger but have not yet used it to automate merging PRs, closing issues, or handling other tasks.

Have you had any trouble with it, or need any help configuring it? I am here to help! ๐Ÿ‘

If not, feel free to close this issue (or have Ranger do it for you ๐Ÿ™‚)

question

Most helpful comment

The automatic branch updating is working!

Screen Shot 2019-09-03 at 8 25 59 PM

All 28 comments

hi @mfix22, thanks for reaching out. We did try to use it a while back on our PRs but were unable to get it to work. I still think we'd really benefit from the functionality, but we didn't really have time to dig into why it wasn't working/what we may have been missing/etc.

If you have any insight on how we could get it working that would be great!

One example of a PR where we tried: https://github.com/badges/shields/pull/3526

Hey @calebcartwright sorry to hear that! I would love to help make sure it is working correctly for you. I see that all the checks passed on your PR, so that is looking good โœ… Did you have any other protections on the master branch at all?

On a fresh clone of the repo, I see that Ranger is working fine, https://github.com/mfix22/shields/pull/1#event-2592619178, so I am assuming it has something to do with your other integrations, most likely CI/CD.

If you could try again with a small/dummy PR, that would be great, otherwise I will try and set up CircleCI on my fork to better recreate the situation.

We use quite a lot of branch protection rules on this repo. My assumption is that one of these rules is preventing repo ranger from being able to merge for us. We have the following rules enabled:

  • Require pull request reviews before merging
  • Required approving reviews: 1
  • Dismiss stale pull request approvals when new commits are pushed
  • Require status checks to pass before merging
  • Require branches to be up to date before merging
  • Include administrators
  • Restrict who can push to matching branches: Organization and repository administrators, badges/shields-core

Any thoughts?

While its nice that you've proactively contacted us about this, one of the reasons we've not followed this up at all is that its not very obvious how to contact you with a support query. Even if your code is not public, have you considered setting up a public issues-only repo or something?
Thanks

Just wanted to say @mfix22 that a merge queue we could kick off after an approving review that would take care of updating the branch, waiting for tests to pass (except LGTM and Docker, which take too long), and then squash-merging, would be _super helpful_ for this project. I'd estimate it would save 1โ€“2 hours of maintainer time a week.

While it's nice that you've proactively contacted us about this, one of the reasons we've not followed this up at all is that its not very obvious how to contact you with a support query. Even if your code is not public, have you considered setting up a public issues-only repo or something?
Thanks

@chris48s this is great feedback, thank you. We have a public feedback form you can contact me at here: https://reporanger.com/feedback, however, I will also set up a public issues-only repo for tracking bugs/issues here: https://github.com/reporanger/feedback.

@paulmelnikow that is great to hear โ€”ย I would absolutely love to help you save those hours.

If you add the "squash when passing" label to a PR, Ranger will automatically squash-merge the PR once all the required statuses are passing, following all integration status checks, branch protection rules, etc.

I you can add the label to a branch in need of merging, I can investigate why it might not be being merged.

Can you look at the example @calebcartwright posted? https://github.com/badges/shields/pull/3526

I just added it to #3880 which is already up to date, with tests already passing. I don't see an out-of-date branch ready to merge, though if someone sees one, let's try adding the label.

Can you look at the example @calebcartwright posted? #3526

On it ๐Ÿ‘Œ

3880 has the necessary approvals.

Screen Shot 2019-08-29 at 1 34 23 PM

This is what we have under "restrict who can push to matching branches".

Screen Shot 2019-08-29 at 1 34 48 PM

Do we need to add a user for Ranger?

Hey @paulmelnikow I think you are right! The public status listing (https://api.github.com/repos/badges/shields/pulls/3880) shows that the PR has a mergeable_state of clean, which means "good to go", however Ranger is getting the status: blocked which means that is is not able to merge the PR.

Can you try adding Ranger to an approved list you mentioned above? We have never seen this specific set of branch blocking rules before so I _really_ appreciate you are letting me debug this ๐Ÿ™‚

I can only add GitHub users. Which user is it?

@repo-ranger is the username.

It's added!

Screen Shot 2019-08-29 at 2 16 52 PM

Looks like the PR was merged!

Great! ๐Ÿ‘ Thanks for working through this with me. I added another set of logging to our backend that will help me understand this issue faster in the future ๐Ÿ‘Œ

Now that we got it working, are there any other features you would like help automating? On other repos I maintain, I configure things like: automatically deleting HEAD branches, deleting ":+1:" comments, stuff like that ๐Ÿ™‚

Awesome!

Will it update an out-of-date branch before attempting to merge it? That's the thing we need for this to be useful.

Will it update an out-of-date branch before attempting to merge it?

And would we need that to be done via a dependabot command on dependabot opened PRs to avoid merge conflicts, and if so can ranger support that?

Something like: If author is dependabot AND branch out-of-date then comment @dependabot rebase (code fenced here to avoid actually mentioning and confusing dependabot ๐Ÿ˜„)

We are actively building out that feature, but trying to figure out how to best fit it in with the rest of Ranger's config.

I will ping in this thread, or in a new issue immediately once the feature ships.

Thanks for helping with this. Even without the ability to auto-@dependabot rebase this will probably save a bit of time.
It would be helpful to mention in the documentation that users need to manually give @repo-ranger write access to master in the branch protection config as well as authorising the app. I suspect we won't be the only users not to understand this.

@chris48s done! reporanger.com/docs#e526831839a841748cc551d214f0c546

Also I have just pushed the feature that will keep a branch up to date as long as your branch protection rules require that. Would you like me to enable that feature for you repo?

Nice. Yes. Lets give it a try. Thanks

@mfix22 I noticed the merge queue is waiting on LGTM to run, which is not a required check, mostly because it is sometimes very slow!

Can I request a feature that only the _required_ checks must pass in order to merge?

Or alternatively, that we can list certain checks to ignore?

The automatic branch updating is working!

Screen Shot 2019-09-03 at 8 25 59 PM

Hey @paulmelnikow ๐Ÿ‘‹ looks like Ranger no longer has permission to merge your branches. Did a branch protection rule recently get updated? You might have to give Ranger write access to re-enable PR merging.

You can find how to handle this under the "Branch Protection" section of the Repo Ranger docs

Seems to have just merged one in #5026 no?

Oh, okay. Great!

Thanks for reaching out!

We had an issue where maintainers couldn't click the "Update Branch" button. It might have been due to a setting on the PR or maybe it was some GitHub fluke. See https://github.com/badges/shields/pull/5008#issuecomment-622978456

Maybe that was related?

That could be! Thanks @paulmelnikow. I'm just glad it is still working ๐Ÿ‘

Was this page helpful?
0 / 5 - 0 ratings

Related issues

irgolic picture irgolic  ยท  3Comments

kerolloz picture kerolloz  ยท  3Comments

PyvesB picture PyvesB  ยท  3Comments

Fazendaaa picture Fazendaaa  ยท  3Comments

salaros picture salaros  ยท  3Comments