balena-io-modules / balena-procbots

Process bots used for automating the development and deployment CI pipeline
https://balena-io-modules.github.io/balena-procbots/
Apache License 2.0
7 stars 3 forks source link

ProcBots: LabelNotificationBot suggestion #132

Open lurch opened 7 years ago

lurch commented 7 years ago

As suggested in https://github.com/resin-io/process/pull/80#discussion_r120873846

The Maintainer Process Guidelines added in https://github.com/resin-io/process/pull/80 mentions a spreadsheet detailing who the maintainer is for a particular component, and says "Maintainers should keep tabs on issues opened in their repo as well as HQ issues that are tagged with a label of a component they maintain.". To make this latter point easier I suggested it might be useful if each time a label for a particular component gets used in the HQ repo, some processbot could add an automatic ping to the maintainer of that component.

To keep such a bot generic and applicable in other situations, it probably makes sense to not tie it specifically to the notion of maintainers and the HQ repo, but instead have a LabelNotificationBot, which as configuration would take a set of triples of (<repo>, <label>, <user>), and then whenever the specified <label> is applied to an issue or PR in the specified <repo>, it would add a comment pinging @<user>. And it should also allow multiple users to be listed for the same combination of repo and label, e.g. a configuration of [('resin-io/repo1', 'label1', 'user1'), ('resin-io/repo1', 'label1', 'user2')] should cause LabelNotificationBot to add a (single) comment pinging both @user1 and @user2 every time the label1 label gets applied to an issue or PR in resin-io/repo1.

I don't know TypeScript myself, but maybe this would be a good HackFriday project for somebody who does? ;-)

lurch commented 7 years ago

...and of course a possible extension would be to allow a <repo> of *, to indicate that the <user> should be pinged whenever the <label> is applied to any of the repos that the bot is configured on (but this should probably be used with care).