Originally created by: dscho
As mentioned in https://github.com/git/git/pull/937#issuecomment-752087607, we'd like to close PRs that are clearly bogus, such as PRs by new contributors trying to merge next into maint or anything similarly undesirable.
Some ideas for heuristics:
.c or .h or even .py file(s), without adjusting anything else
Originally posted by: dscho
/cc @webstech
Originally posted by: tussi003
Originally posted by: webstech
Update: Ready to open PR
Playing with this. This comment is tracking what is and isn't working. Running a test which analyzes the git/git open PRs and many of the closed bogus PRs. Reject means close the PR and warn means add a label to the PR. This is a WIP.
Open PRs
1. Three have changes to a single source and could be rejected
Closed PRs
1. Reject files with a space in the name
2. Reject files with extensions longer than 8 characters
3. Reject updates to certain filenames (or adding similarly named files) (eg README, SECURITy.md)
4. Warn for files with no type
5. Warn for files with small additions and no deletions (see open prs above)
6. Warn for files with zero additions and multiple deletions (possibly deleted file)
Current testing results:
Checking 47 Open PRs
==> PR 924 warned: Label
validateadded for this reason:File
builtin/init-db.cexpecting more than one change.==> PR 907 warned: Label
validateadded for this reason:File
sha1dc/sha1.cexpecting more than one change.==> PR 859 warned: Label
validateadded for this reason:File
userdiff.cexpecting more than one change.==> PR 857 warned: Label
validateadded for this reason:File
.circleci/config.ymlexpecting more than one change.==> PR 834 failed: PR is being closed:
Could not resolve to a Repository with the name 'lukaspupkalipinski/git'.
==> PR 790 warned: Label
validateadded for this reason:File
README.mdnot expected to be updated==> PR 767 warned: Label
validateadded for this reason:File
gitweb/READMEnot expected to be updated==> PR 765 failed: PR is being closed:
File
.gitmodulesnot allowed in root directory.Checking 34 Closed PRs
???> PR 953 true did not fail: Update sha1collisiondetection
==> PR 949 failed: PR is being closed:
File
.github/workflows/msbuild.ymlmarbbmervlinbisgmail.comnot allowed with multi-part name==> PR 947 warned: Label
validateadded for this reason:File
IdiotaSECURITY.mdnot expected to be updated==> PR 946 failed: PR is being closed:
File
SECURITY.mdmarvol120has an invalid extension.==> PR 940 failed: PR is being closed:
Request author is not commit author.
==> PR 935 failed: PR is being closed:
Request author is not commit author.
==> PR 933 failed: PR is being closed:
File
test_autotestnot allowed in root directory.==> PR 926 warned: Label
validateadded for this reason:File
SECURITY.mdnot expected to be updated???> PR 910 true did not fail: Simplified merge logic
==> PR 908 warned: Label
validateadded for this reason:File
SECURITY.mdnot expected to be updated???> PR 903 true did not fail: Update apply.h
==> PR 901 warned: Label
validateadded for this reason:File
README.mdnot expected to be updated???> PR 900 true did not fail: Update blob.c
==> PR 899 failed: PR is being closed:
File
dheeraj_guptanot allowed in root directory.==> PR 893 failed: PR is being closed:
File
vowel consonantnot allowed in root directory.==> PR 892 failed: PR is being closed:
File
Binary searchnot allowed in root directory.==> PR 891 failed: PR is being closed:
File
concatenate one stringnot allowed in root directory.==> PR 889 failed: PR is being closed:
File
Array Duplicacynot allowed in root directory.==> PR 888 failed: PR is being closed:
File
sum of arraysnot allowed in root directory.==> PR 886 failed: PR is being closed:
File
Swap2arraynot allowed in root directory.==> PR 883 warned: Label
validateadded for this reason:File
apply.cexpecting more than one change.==> PR 868 failed: PR is being closed:
Request author is not commit author.
==> PR 860 warned: Label
validateadded for this reason:File
SECURITY.mdnot expected to be updated==> PR 858 warned: Label
validateadded for this reason:File
SECURITY.mdnot expected to be updated==> PR 849 failed: PR is being closed:
File
capstone-projectnot allowed in root directory.==> PR 845 failed: PR is being closed:
File
capstone-projectnot allowed in root directory.==> PR 840 failed: PR is being closed:
Request author is not commit author.
==> PR 839 warned: Label
validateadded for this reason:File
README.mdnot expected to be updated==> PR 813 warned: Label
validateadded for this reason:File
SECURITY.mdnot expected to be updated==> PR 794 warned: Label
validateadded for this reason:File
.gitignoreexpecting more than one change.==> PR 789 failed: PR is being closed:
File
gitpodnot allowed in root directory.==> PR 786 warned: Label
validateadded for this reason:File
.github/workflows/main.ymlexpecting more than one change.==> PR 783 failed: PR is being closed:
File
Drygo1992not allowed in root directory.Originally posted by: dscho
I like the idea of testing for expected file extensions, and for the requestor not being the author (for new users; I often contribute on others' behalf).
Not so sure about disallowing
SECURITY.md: It would actually be good for us to have one.Likewise, I'm unsure about
.gitmodules: we do unfortunately have a submodule.And disallowing a single change would probably have too many false hits: typo fixes are valuable, for example.
Originally posted by: webstech
There are a number of PRs that included bogus
SECURITY.md(or similarly named) files so it was included but not as a closer.The PR adds a label for a number of situations. It could be changed to always add a label for now. In that situation, only a new user PR that appears to touch several files would not be flagged. Really do not want to close valid PRs.
Noting this problem appears to be happening with git/git and not with gitgitgadget/git.
Originally posted by: webstech
This is the Jest test for testing open PRs and select closed PRs. The check for closed has to be turned off in ci-helper.ts. The list of closed PRs is generally what would be considered to be 'bogus PRs'.
newuser.test.ts.zip