derek
derek copied to clipboard
Proposal: Check the branches that PRs are raised against and from
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.
Thank you for logging this
Still a fan of this feature
Derek add label: priority/low
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.
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?
This would be worth doing - even at a simplistic level - no PRs from master for instance.
Taking this
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