softdevteam / mattermost-github-integration

GitHub integration for Mattermost
Other
79 stars 50 forks source link

Add an option to MATTERMOST_WEBHOOK_URLS to be able to ignore specific event actions #32

Closed kostecky closed 7 years ago

kostecky commented 7 years ago

Github aggregates too many actions under some of their events. You may want to ignore label actions under issues, but still see issues get opened. This is an optional element to add to the tuple, so it will work whether you define it or not.

ptersilie commented 7 years ago

That's a cool idea. Thanks for the PR! Do you think people would want to edit this on a per-hook basis, or would one setting for all hooks be enough?

For example:

GITHUB_IGNORE_ACTIONS = {
    "issues": ["labeled", "close"]
}

Looks a bit cleaner than having it within the MATTERMOST_WEBHOOK_URLS. But I don't know if that's too restrictive.

kostecky commented 7 years ago

That's a good point. I like the flexibility, but to tell you the truth, my use-case matches your suggestion, so I'd be happy with one setting =)

ptersilie commented 7 years ago

Okay, if this still matches your use case, then let's go with one setting for all repos for now. We can always change it quite easily if anyone needs a more flexible setting.

Do you want to update the PR or shall I do it before I merge?

kostecky commented 7 years ago

There we are. Merge at will, unless you want me to squash it and re-pull to eliminate the unnecessary commits?

ptersilie commented 7 years ago

Great. Thanks a lot. :) We still have to edit the Readme but I will do that before I merge. I'll also squash it down to a single commit then.

kostecky commented 7 years ago

Right, my bad. Thanks!

ptersilie commented 7 years ago

No worries. :)

ptersilie commented 7 years ago

Alright. Everythin is merged! I also had to change if config.GITHUB_IGNORE_EVENTS: to hasattr(config, "GITHUB_IGNORE_EVENTS): in order to not break other users setup who don't have GITHUB_IGNORE_EVENTS in their config yet.

Would you mind checking if the master branch works for you?

kostecky commented 7 years ago

Works! Thanks again!