Support branch event
TastyPi opened this issue · 2 comments
I'd like to be able to fire notifications when a TODO is merged into a specific branch. This is useful for things where you have to wait for something to be running in production before you can make more changes (e.g. backfills).
The way I think this could work is to have a branch: 'production'
option, and all that would do is check "does the currently checked-out branch match the given branch name?". It could potentially support RegExp
as well for more advanced matching.
Since this requires running smart_todo
across multiple branches, it would also be nice to support an --events
flag to filter which events actually get checked. So in this case, I would run smart_todo
normally in our main
branch, and then smart_todo --events branch
in the production
branch when a new release is pushed.
So this is kind of two features in one. I'd like to know:
- Is this repo open to contributions for events that Shopify might not use?
- Do these features sound reasonable to add?
- Is this repo open to contributions for events that Shopify might not use?
Yes
2. Do these features sound reasonable to add?
I'm not sure. The branch smart_todo runs should not influence the result of it. We For example run the tool on very branch and we expect the same result with the only difference being the new code existing in that branch.
But at the same time I don't think I understood the use case. If all you want is to notify people about TODOs that are in the production branch why not run smart_todo only on that branch?
In the first glance, supporting this means that smart_todo would need to know about git.
Maybe a better feature would be to allow smart todo to load plugins? In that case you could write this plugin and use in your application.
I'm ok with the a feature to filter events though.
But at the same time I don't think I understood the use case. If all you want is to notify people about TODOs that are in the production branch why not run smart_todo only on that branch?
I would want to run it both on main
for the on:
events, and in the production
branch for the branch: 'production'
events. But I don't want to duplicate notifications for the on:
events when running twice.
In the first glance, supporting this means that smart_todo would need to know about git.
Depends how it's implemented, an alternative to a branch
option could be a tag, and you add --tags production
to the CLI?
Maybe a better feature would be to allow smart todo to load plugins? In that case you could write this plugin and use in your application.
That would be cool, I imagine other companies have events specific to them that they would want to implement.