Giter VIP home page Giter VIP logo

Comments (11)

hauleth avatar hauleth commented on August 15, 2024 2

Ok, I have found what is the culprit there. The meaning of any and all is poorly defined. The issue there is that

- any: ['./*', './src/*']

and

- ./*
- ./src/*

Have different meaning. The list in any mean that any file in the PR must match all globs in the list. With all it mean that all files in the PR must match all globs in the list. So to have the same behaviour with any you need to use:

- any: ['./*']
- any: ['./src/*']

from labeler.

MaksimZhukov avatar MaksimZhukov commented on August 15, 2024 1

Hello everyone!
We have released a new major version of the action. The behaviour of the any selector was changed to match ANY file against ANY glob pattern so it became more intuitive. Please find more details in the release notes.

Could you please use the new version and provide us with your feedback?

from labeler.

hauleth avatar hauleth commented on August 15, 2024

I also spotted this. It happens if I have more than one entry in the any specifier.

from labeler.

mittalyashu avatar mittalyashu commented on August 15, 2024

Have different meaning. The list in any mean that any file in the PR must match all globs in the list. With all it mean that all files in the PR must match all globs in the list. So to have the same behaviour with any you need to use.

Nope. Still don't get it 😅

from labeler.

hauleth avatar hauleth commented on August 15, 2024

@mittalyashu assume that you have such definition any: ['src/*', '*/test/*']. Then it will apply the tag if any of the files matches all globs. So for example if your PR changes files:

  • examples/foo
  • src/test/foo

Then it will apply, as src/test/foo matches both of the globs. However if list of files would look like:

  • examples/test/foo

Then it will not match, because while */test/* matches, the src/* doesn't, so whole filter fails.

You can think of it like (using Ruby syntax):

  • any - changed_files.any? { |file| matches.all? { |match| file.matches(match) } }
  • all - changed_files.all? { |file| matches.all? { |match| file.matches(match) } }

from labeler.

mittalyashu avatar mittalyashu commented on August 15, 2024

Oh! I see.

Well, seems like the docs were not clear.

I was thinking that in the any filter, it will match any globs listed in the array.


In that case, doesn't that means any and all both plays the same role?

from labeler.

hauleth avatar hauleth commented on August 15, 2024

Not quite. all will check if all modified paths matches while any will check if any modified patch matches.

from labeler.

BrightRan avatar BrightRan commented on August 15, 2024

Another user has the similar problem:
https://github.community/t/labler-action-error-typeerror-glob-pattern-string-required-glob-pattern-string-required/140738

He gets the same error message:

##[error]TypeError: glob pattern string required
##[error]glob pattern string required

from labeler.

BrightRan avatar BrightRan commented on August 15, 2024

Hi team,

Could anyone take a look at this issue?

from labeler.

kbendick avatar kbendick commented on August 15, 2024

I'm also running into this issue. I'm unable to use any configuration that has any in it on 2.2.0.

from labeler.

smokhov avatar smokhov commented on August 15, 2024

Hit this error just now:

It appears to have labeled two things correctly before barfing out.

from labeler.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.