Skip to content
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

[changelog] Support multiple matchers for labels #1550

Open
netomi opened this issue Dec 7, 2023 · 2 comments
Open

[changelog] Support multiple matchers for labels #1550

netomi opened this issue Dec 7, 2023 · 2 comments
Labels
BREAKING CHANGE enhancement New feature or request
Milestone

Comments

@netomi
Copy link

netomi commented Dec 7, 2023

Right now, a single matcher is supported for items like the title or the body like explained in the documentation:

labelers:
          # The label to be applied.
          # 
        - label: 'issue'

          # Matches the text of the first commit line.
          # Value may be plain text or regex.
          # Use `regex:` as prefix to indicate a regex.
          # 
          title: 'regex:fix:'

          # Matches the full text of the commit.
          # Value may be plain text or regex.
          # Use `regex:` as prefix to indicate a regex.
          # 
          body: 'Fixes #'

it would be quite handy to additionally support a list of matchers like that:

  - label: 'dependencies'
    title:
      - 'regex:deps:i'
      - 'regex:dependencies:i'
      - 'regex:bump:i'

where if any of the matchers matches, the label will be applied. Additionally, support adding a flag after the second colon to be able to express insensitive pattern. This would be similar to the javascript notation of e.g. '/bump:/i'.

The notation for the flag might not work in a backwards compatible way, but having the possibility to express case-insensitive pattern in an easy way would be certainly useful imho.

@netomi netomi added the enhancement New feature or request label Dec 7, 2023
@aalmiray
Copy link
Member

aalmiray commented Dec 7, 2023

As a workaround you could use regex:deps|dependencies|bump.
Migrating the title property from scalar to list/array is a non-compatible change which should be made in v2 IMHO.

@aalmiray aalmiray changed the title Support multiple matchers for labels [changelog] Support multiple matchers for labels Dec 7, 2023
@aalmiray aalmiray added this to the v2.0.0-M1 milestone Dec 7, 2023
@netomi
Copy link
Author

netomi commented Dec 7, 2023

ty for providing the workaround, that certainly helps.

Also I realized you can specify flags in a java regexp pattern like that in the regexp itself:

(?idmsuxU-idmsuxU) - Nothing, but turns match flags i d m s u x U on - off

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BREAKING CHANGE enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants