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

label config issue #30

Open
yeeteing opened this issue Jul 28, 2021 · 5 comments
Open

label config issue #30

yeeteing opened this issue Jul 28, 2021 · 5 comments
Labels
bug Something isn't working

Comments

@yeeteing
Copy link

yeeteing commented Jul 28, 2021

Describe the bug

  1. descriptionMatches was being activated even the pattern is being shown in commit. I thought descriptionMatches is only valid for pull request description, and commit should not trigger the labeling generation.

  2. For:

{
  "bugfix": {
      "requires": 1,
      "conditions": [
        {
          "type": "branchMatches",
          "pattern": "/^fix|^bug/i"
        },
        {
          "type": "titleMatches",
          "pattern": "/bug|fix/i"
        }
      ]
    }
}

I would assume that "requires": means how many conditions need to match in order to activate the labeling generator.
So, if "requires" is 1, is that mean I just need one "conditions" to be valid to activate the bugfix label?

  1. Pull request title is "add something", I would assume this will trigger the auto labeling base on the config I have below:
"feature": {
      "requires": 1,
      "conditions": [
        {
          "type": "branchMatches",
          "pattern": "/^feature/i"
        },
        {
          "type": "titleMatches",
          "pattern": "/create|add|generat|buil|allow/i"
        },
        {
          "type": "descriptionMatches",
          "pattern": "/create|add|generat|buil|allow/i"
        }
      ]
    }
@yeeteing yeeteing added the bug Something isn't working label Jul 28, 2021
@yeeteing yeeteing changed the title json config issue label config issue Jul 28, 2021
@TGTGamer
Copy link

Heya @yeeteing

Sorry but I'm a little slow today and struggling to follow your issue.

  1. descriptionMatches was being activated even the pattern is being shown in commit. I thought descriptionMatches is only valid for pull request description, and commit should not trigger the labeling generation.

So is the commit being added to a branch that has an open pull request?
And this is then triggering the descriptionMatches config?
Is that right?

I would assume that "requires": means how many conditions need to match in order to activate the labeling generator.
So, if "requires" is 1, is that mean I just need one "conditions" to be valid to activate the bugfix label?

You are right. If it requires: 1, it will activate if 1 or more condition matches. In branch #24 there is an $and, $or and $only which I don't believe have been ported over to this project yet.

  1. Pull request title is "add something", I would assume this will trigger the auto labeling base on the config I have below:

Yes, this would trigger the auto labeling. IF you are not triggering it, could you provide the logs so we can investigate?

To provide the logs: Please set the ACTIONS_RUNNER_DEBUG secret to true to enable debug logging, rerun the labeler workflow

You can see an example of how we utilize this function here: https://github.com/Videndum/action-masterminds/blob/4ad0ff689353b86a122b3c0c5eace7303a7cd998/.github/allconfigs.json#L1071-L1083

@yeeteing
Copy link
Author

So is the commit being added to a branch that has an open pull request?
And this is then triggering the descriptionMatches config?
Is that right?

Yup, correct.
I also noticed that even though I didn't include descriptionMatches config, it's still triggered the auto labeling when I have some keyword being added in the description of the PR.

 "modified": {
      "requires": 1,
      "conditions": [
        {
          "type": "branchMatches",
          "pattern": "/modif|change|update/i"
        },
        {
          "type": "titleMatches",
          "pattern": "/restructure|modif|change|update|move|moving/i"
        }
      ]
    }

@TGTGamer
Copy link

@yeeteing can you link me or screenshot the open PR for me please

@yeeteing
Copy link
Author

yeeteing commented Oct 7, 2021

I did not get any log
Screen Shot 2021-10-07 at 12 22 43 PM

@yeeteing
Copy link
Author

yeeteing commented Oct 7, 2021

Screen Shot 2021-10-07 at 12 23 11 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants