-
-
Notifications
You must be signed in to change notification settings - Fork 60
Bot to check if PR is not against the master branch, and it is not a backport PR #211
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
Comments
Bedevere could leave a comment saying something like "We noticed you made a pull request against a branch other than |
From python/bedevere#111: when @terryjreedy asked about this, I realised we could use the That means the change in Bedevere could be to fail the PR consistency check if the target branch and the commit message prefix don't match, and add a comment pointing out that either the target branch needs to be changed ( |
Do we really want it as a status check though? I was thinking posting a message was good enough. |
Wait I misspoke 😅 |
Bedevere already does a status check for missing BPO references and NEWS entries, so I was figuring it made sense to tie it into that as a general "Metadata consistency check":
|
If a PR is made not against master, check the PR title. If the PR title does not match the backport pattern, post a failure status. Two ways to resolve: - reopen the PR against master - Update the PR title accordingly Depends on python/devguide#392 Closes python/core-workflow#211 Closes #111
In PR https://github.com/python/bedevere/pull/112/files, I added a new status check, and it is done only for PRs not against the master If the PR title does not match If the PR title match, it will post a success status, with the message "Valid backport PR title.". Let me know if these messages will work. At least the status will provide some indication that something is not quite right with the PR. There is not enough space there to say "alternatively, close the PR and target the master branch". |
Should not every PR against x.y have [x.y] in the title? or only backports of another PR? If the former, then the messages would be relevant but not quite right for original x.y PRs. Would this be a 'required' check, like 'bedevere/news'? |
The devguide link could explain that status failure might be because the PR is against the wrong branch, and give the solution. I believe there are at least 3 cases.
The issue that prompted me to open the duplicate bedevere issue was 2a. |
I think this should be optional, and one of the admins can make it optional.
Yes they should.
Backports of another PR will additionally have reference to the original PR I think PRs to [X.Y] that is not a backport should be rare, that is why I decided to check for both. |
If a PR is made not against master, check the PR title. If the PR title does not match the backport pattern, post a failure status. Two ways to resolve: - reopen the PR against master - Update the PR title accordingly Depends on python/devguide#392 Closes python/core-workflow#211 Closes #111
* Post a status check for backport PR title. If a PR is made not against master, check the PR title. If the PR title does not match the backport pattern, post a failure status. Two ways to resolve: - reopen the PR against master - Update the PR title accordingly Depends on python/devguide#392 Closes python/core-workflow#211 Closes #111
How to make this check successful if the PR is not against master and is not a backport? For example if it fixes 2.7 only bug? |
@serhiy-storchaka does that happen often? |
For 2.7, never checking for the GH number would be the right thing to do - even the documentation has diverged sufficiently that it's usually easier to just make two PRs than it is to even try to backport a 3.x change to 2.7. For 3.x branches, the current behaviour is likely OK - while we may occasionally get version-specific issues because master has since been refactored or otherwise changed to avoid the problem completely, that doesn't happen very often, and when it does, we can either ignore the check, or else add a reference to the refactoring or enhancement PR that made the issue inapplicable to more recent branches. |
To me, adding the 2.7 backport tag when adding others, and letting the bot tell me if it works or not, is easy. It worked for the last small doc change I merged. If a patch is a backport from master done by hand, it is easy to add (GH-NNNN) to the title when copying the title for the initial commit. Most 2.7 merges are backports. The issue here is PRs for x.y that are not backports and cannot have such a tag. Rather than having to ignore a warning, we could add a 'non backport' tag, similar to 'no issue' and 'no news', to negate the check. |
I attempted to work around this issue by editing the title on python/cpython#8659 to be self-referential, but it looks like title edits don't trigger any of the bots to re-run. |
@ncoghlan python/cpython#8659 needs to start with |
That worked, thanks! So in the absence of a dedicated label (which we may decide not to do, since this doesn't come up very often), we can use a self-reference to the same PR to make the check happy (While I was a proponent of the "just ignore it" approach, it turns out GitHub make it quite disconcerting to review a PR when even an advisory check is failing - it gets a red X in lots of places, including the page favicon, and the big green Merge button remains grey, even though it's active) |
Once in a while people make a PR against the maintenance branch, but it should be made against the
master
first.From the GitHub web UI, we can see which branch the PR is targeting to, for example
python:master
orpython:3.6
, but not when viewing it using mobile device.It is also easy to miss, basically it's another mental checklist core devs have to do before merging a PR.
Wondering if this is something bedevere can detect and remind people about?
The text was updated successfully, but these errors were encountered: