#11875 closed enhancement (fixed)
Notification subscriber config section
Reported by: | Peter Suter | Owned by: | Peter Suter |
---|---|---|---|
Priority: | normal | Milestone: | 1.1.5 |
Component: | notification | Version: | |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: |
Added a new |
||
API Changes: |
Added |
||
Internal Changes: |
Description
Trac already has a few notification config options to control default subscriptions:
always_notify_updater
always_notify_reporter
always_notify_owner
never_notify_self
(soon?)
But we don't want always_notify_close_reporter_except_when_reporter_closed_the_ticket
. :)
The new INotificationSubscriber makes it easy to add new such rules, but if we provide more implementations we may actually need more config options. Also there could now be different message formats, distribution transports, default subscription priorities (and required authentication and later maybe permissions and more).
We could instead try to add a [notification-subscriber]
section:
[notification-subscriber] always_notify_updater=TicketUpdaterSubscriber always_notify_updater.default=email, 100, always, text/plain always_notify_reporter=TicketReportedSubscriber always_notify_reporter.default=email, 100, always, text/plain always_notify_owner=TicketOwnerSubscriber always_notify_owner.default=email, 100, always, text/plain always_notify_owner.requires_authentication=True always_notify_owner.permission=CUSTOM_CONFIG_NOTIFY_OWNER_PERMISSION ...
(Or some equivalent notation.)
Attachments (0)
Change History (15)
comment:1 by , 10 years ago
Milestone: | next-dev-1.1.x → 1.1.3 |
---|---|
Owner: | set to |
Status: | new → assigned |
comment:2 by , 10 years ago
Committed preliminary refactoring in [13552]:
INotificationSubscriber.default_subscriptions()
now includes the format (so it can easily be configured in this proposed [notification-subscriber]
section.)
comment:3 by , 10 years ago
Milestone: | 1.1.3 → 1.1.4 |
---|
follow-up: 5 comment:4 by , 10 years ago
Replying to jomae in #11934:
- Unlike options in trac.ini, no way to known easily subscriber class's name. If the section is introduced, I think we should provide subscribers wiki page like TracIni and/or subscribers manager panel in admin page.
Good idea. Maybe TracIni#notification-subscriber-section
could use a [[SubscriberList]]
macro?
comment:5 by , 10 years ago
Replying to psuter:
Good idea. Maybe
TracIni#notification-subscriber-section
could use a[[SubscriberList]]
macro?
Yeah. Sounds good.
comment:6 by , 10 years ago
Updated in changeset:T11875-notification-subrscriber-config-section-2/psuter.hg with a [[SubscriberList]]
macro.
comment:8 by , 10 years ago
In log:psuter.hg@T11875_notification_subscriber_config_section_3:
- Updated tests
- Default settings: I assume for new environments
[notification-subscriber]
should have defaults equivalent to the previous[notification] always_notify_*
defaults, mirroring the upgrade step. So far the onlyConfigSection
with default values seem to be[ticket-workflow]
(which has a custom IEnvironmentSetupParticipant) and[repositories]
(which has special handling in trac-admin initenv). - Invalidate cache: If the parsed subscriber configuration is cached, that cache must be invalidated, or configuration changes have no effect.
comment:9 by , 10 years ago
comment:10 by , 10 years ago
Committed in [13933].
TracNotification may need an updated wiki:1.1/TracNotification now.
By the way, is there a guideline for using trac.util.lazy
or trac.cache.cached
?
comment:11 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
I added a short section in wiki:1.1/TracNotification@2. Feel free to improve it.
comment:12 by , 10 years ago
AlwaysEmailSubscriber
cannot be configured using [notification-subscribers]
section. I've filed in #12036.
comment:13 by , 9 years ago
Unless I'm missing something, #2247 was implemented in this ticket. I've closed that ticket as a duplicate. We now have a Never Notify: I Update a Ticket preference, which I've been using for some time to avoid receiving notifications when I create or update a ticket.
comment:14 by , 8 years ago
Doesn't this feature seem underdocumented for you, guys? I'm trying to figure how to get from Trac 1.2 the same behaviour as from 1.0 with NeverNotifyUpdaterPlugin. I've dug into sources and still all I comprehend is a vague idea of "I probably have to implement Subscriber plugin to unsubscribe ticket updater". "Never Notify: I Update a Ticket preference" is nice, but asking all users to tinker with notification preferences manually instead of setting sensible defaults in trac.ini
is suboptimal, don't you think? TracNotification includes [notification-subscribers]
section twice, but it really does not make any clearer how to send notifications, let's say, for owner, reporter and all the updaters except current one.
comment:15 by , 8 years ago
Some more documentation has been added in TracNotification@92.
Please ask further questions on the MailingList, thanks.
Proposed changes in psuter.hg@T11875-notification-subrscriber-config-section.
A preliminary steps changes the interface
INotificationSubscriber
sodefault_subscriptions()
also yieldsformat
(e.g. 'text/plain').A new
parse_subscriber_config()
function (similar to parse_workflow_config()) parses[notification-subscriber]
. The result is cached in theNotificationSystem
, and used to yield default subscriptions.An upgrade step converts the old settings:
Creating a new section:
always_notify_updater = true
would add two more lines:For a future
never_notify_self
(#2247) one could instead append:Distributor, priority and format could also be changed:
(
never_notify_self
might benefit from a.priority = 99
.)