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

Enhancement: subscribe to components in Trac #202

Open
medmunds opened this issue Jun 28, 2024 · 2 comments
Open

Enhancement: subscribe to components in Trac #202

medmunds opened this issue Jun 28, 2024 · 2 comments
Assignees

Comments

@medmunds
Copy link

Enhancement request for Django's Trac: add a way to subscribe to notifications on components. (forum discussion)

As a maintainer of a third-party library who uses Django's email APIs, I wish I could automatically be notified about all (future) tickets with "Component: Core (Email)."

I imagine this would involve:

  • A new Trac user preference to manage a list of watched components
  • Some way to control those notifications

For that second part, I can think of at least two approaches:

  1. Auto-add CC on watched components

    Whenever a ticket's component is modified, automatically add a CC for each user watching the new component.

    Pro: can easily "mute" an individual ticket within a watched component, by just removing yourself from the CC

    Con: might generate a lot of "CC modified" notification spam to other subscribers every time a ticket's component is changed or a user adds a component to their watch list

OR

  1. New subscription rule for "watched component" notifications

    In Trac's notification preferences, allow something like this mockup (where "watched component" would link to the preference for managing the watch list):
    Subscription rules list, highlighting hypothetical new rule named 'Notify: Ticket in watched component is created or modified'

    Pros/cons: reverse of the first approach

I don't have a strong preference (and don't know which would be easier).

Incidentally, it might also be helpful to watch keywords as well as components. (But my own current needs would be covered by components.)

@bmispelon
Copy link
Member

I've hacked on this for a few hours yesterday and it seems like it might require some work, but it should be possible.

From your two proposals, I would go for number 2. It turns out that the hard part is letting a user manage a list of watched components (a requirement for both of your proposals if I understand correctly). Once you have that, it's fairly easy to write a plugin that integrates with Trac's notification system to notify users when a ticket matching their watched components is touched.

Once we have a plugin for watching components, it should be fairly easy to have the same for keywords (which seems like another good idea, thanks), but let's take it one hack step at a time 😁

@medmunds
Copy link
Author

Oh, "should be possible" is a lot more positive than I'd hoped! 😄

For managing the list of watched components, I was imagining a long list of checkboxes. Or to keep it easy, just a <select multiple> for now and improve it later. Presented in either a new preferences panel or a new child panel of Notifications/Subscriptions. And I guess stored in the user's session as a comma-separated list of component ids? (Haven't looked into Trac for over 20 years; apologies if this is all obvious stuff.)

Something like this mockup (which I generated by copying and pasting the <select> from Trac's query page, adding attrs for multiple and size=10 rows):
Trac 'Notifications' preferences panel, with proposed 'watched components' listbox showing three selected components

For managing watched keywords, the preferences panel could be even simpler: just a textedit to enter a comma-or-newline-separated list of keywords.

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