derek icon indicating copy to clipboard operation
derek copied to clipboard

Proposal: Check the branches that PRs are raised against and from

Open rgee0 opened this issue 7 years ago • 8 comments

Upon submission of a PR Derek should check the originating branch name, and if he finds master the PR closed with a message advising the user that they should re-submit from a non-master branch.

Also, check that pull request is against master / default.

rgee0 avatar Nov 04 '17 20:11 rgee0

Thank you for logging this

alexellis avatar Nov 04 '17 20:11 alexellis

Still a fan of this feature

alexellis avatar Dec 28 '17 23:12 alexellis

Derek add label: priority/low

alexellis avatar Feb 07 '18 09:02 alexellis

The idea is here that:

PRs should only be raised to target master - therefore if someone raises a PR that doesn't - apply a label.

I.e.

I raise a PR to a branch named 0.7.0 - that should add a label, I don't know what label but am open to suggestions: attention/target-branch.

2nd scenario:

Someone raises a PR from the master branch of their repo. This can be destructive to merge - especially if that person has been rebasing commits / force pushing or even altering historic commits.

Derek should add a warning comment:

It appears that you are submitting changes directly from your master branch, we encourage you to raise a new pull request from a named branch i.e. git checkout -b my_feature.

It should also add a label like: attention/source-branch

In both scenarios the user can only raise a new PR to fix the problem. This means no code is needed to remove the labels.

alexellis avatar Feb 25 '18 18:02 alexellis

So adding a label rather than closing the PR? Would this be a separate 'feature' that could be enabled / disabled in the config yaml? Would these 2 scenarios (target and origin) be separate features? Or part of a single 'branch check' feature?

johnharris85 avatar Feb 25 '18 20:02 johnharris85

This would be worth doing - even at a simplistic level - no PRs from master for instance.

alexellis avatar Mar 23 '18 18:03 alexellis

Taking this

ivanayov avatar Mar 30 '18 08:03 ivanayov

I met with Ivana and Dimitar. We think the action should be:

  • Close the PR (because you can't recover without creating a new PR from a different branch)
  • Give a comment - should say a git command to help them such as git checkout -b my_feature and raise a PR from there
  • Ivana liked the idea of the label - let's use the prefix of "review/" to match the listing in #43

alexellis avatar Apr 05 '18 13:04 alexellis