-
Notifications
You must be signed in to change notification settings - Fork 421
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
Cannot represent matching all files against multiple patterns #423
Comments
Why this does not work?
|
My reading of the documentation is that that example is the same as:
This would add the documentation label to a PR consisting of 99 .c files and one .md file, which is not the intention. |
This is true when all files match at any of the patterns.
This is true when all files match any of the patterns.
Just so it's explicitly clear, I have PR #487 outstanding that adds this feature. |
See comment #487 (comment) which illustrates my idea of how this filter would work. |
Hello everyone! |
That looks like it satisfies this feature nicely! What's not clear from the documentation is what happens when multiple of |
Hello @dfandrich! |
Hello everyone! Thank you all for your patience! |
how would you accomplish the situation laid out in this issue with the new syntax? our goal is to avoid false positives when a bunch of files are changed in the PR that aren't actually relevant to the applied label heres a table that I think describes where each of the existing rules fails in this use case
|
@jnew1 this is what I would expect for those four patterns you show:
You wouldn't ever see a configuration like the last two, since they are impossible to ever be true. A more realistic case might be something like |
unfortunently, the first case doesn't match I think this test describes exactly the problem within this issue
for this to work,
|
The globPatterns in that test match only paths containing at least one slash. |
same issue with this test
|
That test is similar to to the existing checkIfAnyGlobMatchesAllFiles test
but with two different file extensions in changedFiles. I would expect both
tests to pass, unless this matcher is supposed to be "ANY *one* glob must match
against ALL changed files" which doesn't sounds very useful (or intuitive).
|
yes that is exactly what it is
right I believe I laid out a solution here: #423 (comment) I can look at making a PR, but this would be an API breaking change, is it work making a new rule for it? |
this new setup would break this test, which could be a legitimate use case: so perhaps we just need a new rule |
Looks like you're right. I'd be up for renaming
whereas the reverse is not true. There is no way to implement |
FWIW, #731 was opened about the issue we've been discussing in the latter comments. |
The use-case seems like it would be quite useful and natural: I would like a label to apply if ALL of the changed files are of a few certain types. For example:
This of course doesn't work as all files need to match both patterns which never happens. Another attempt:
This almost works but does not work if the change touches both
md
files andpuml
files.AFAICT there is no way to represent what I'm trying to do, but it feels like a very natural and useful case to support.
The text was updated successfully, but these errors were encountered: