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

Enhancements for feeds #12

Open
redstonemercury opened this issue May 11, 2017 · 3 comments
Open

Enhancements for feeds #12

redstonemercury opened this issue May 11, 2017 · 3 comments

Comments

@redstonemercury
Copy link
Contributor

We have a need for enhancements to the feeds functionality to filter the type of events we want to receive. Specifically, our needs are to get notified when a new task is opened or an existing task is resolved, but getting every comment left on a task is way too much noise for us.

I was thinking about trying to tackle this in a way that would be configurable, but wanted some guidance on how you'd like this implemented, so I'm doing it in a way that's useful to the project. There are a few ways I thought about doing it:

  1. The easiest but least configurable solution, similar to PHABS_ENABLED_FEATURES or PHABRICATOR_ENABLED_ITEMS, allow an environment variable to be set to specify what types of events to feed. Really we'd need two, one for types of items (tickets, diffs, etc.) to feed, and one for types of actions (open ticket, closed ticket, comment, etc.) to feed.

  2. Set up new commands (probably in phabs_admin.coffee) to allow users with phadmin role to specify which events/actions to feed. Would set it at a global level like the env variable option, but would allow it to be more configurable by users who don't have access to change environment variables.

  3. Update the feed(s) command in phabs_admin.coffee to allow events/actions to be set per project/room feed. E.g. phad feed create,resolve,comments on tasks,diffs from project1 to room1 Would be a lot more work, and perhaps a little verbose for your average bot user, but would allow the highest level of customization.

If you've got another opinion on the best way do this, or some pointers on where to get started, please let me know!

@mose
Copy link
Contributor

mose commented May 12, 2017

hmm this is pretty ambitious. I would tend to prefer the 3rd solution. Indeed that can require a little bit of thinking first, and modification on how feeds declaration is stored in brain. The main point being to keep the current behavior and brain declaration working.

If I were to code it, from the top of my mind, I would add optional elements in the existing regexp for the feed admin command, add the details of those extra elements in a new feeds_extra: { actions: [ ], item_types: [ ] } for the given project in the brain, and change the phab.getFeed to filter according to those extra parameters if they exist. If you feel like coding it, I would happily review your code. Otherwise, I can give it a try and code it on my own.

@redstonemercury
Copy link
Contributor Author

Yeah the regex option is sort of along the lines of what I was thinking, since there's already one for PHID-TASK.

If you feel like it would be easy for you to tackle feel free to give it a shot! I probably wouldn't be able to start on this until mid next week at the earliest, so if you want to work on it, I would be happy to test it for you in the wild :)

@mose
Copy link
Contributor

mose commented May 12, 2017

okay. Who knows, maybe I will get itchy this weekend? :) keep in touch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants