-
Notifications
You must be signed in to change notification settings - Fork 185
Support the suppress_if_match option from old svn-mailer #35
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
base: trunk
Are you sure you want to change the base?
Support the suppress_if_match option from old svn-mailer #35
Conversation
suppress_if_match is/was used to suppress emails if a later mailer section also matches the current svn event, thus allowing the first section(s) to act as a fallback if no other, more specific section matches. This brings back that functionality, avoiding duplicate emails for configurations that make use of suppress_if_match
Just curious. What is the "old svn-mailer"? I can't find this option in mailer.py (I tried to bisect the history up to gstein's work 2023/2024) but couldn't find it. Is it some ASF/Infra-local version? |
See https://issues.apache.org/jira/browse/INFRA-27061, there is a link to the version I used to generate the patch. |
The original work, I believe, is https://opensource.perlig.de/svnmailer/ which also explains how suppress_if_match works |
exclude_paths_re, | ||
params, | ||
search_logmsg_re, | ||
False)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ugh, this is not nice. Remove the if
.
self._last_group_re.append((group,
re.compile(for_paths),
exclude_paths_re,
params,
search_logmsg_re,
# Ignore if already matched
suppress_if_match == 'yes'))
Also, what guarantee is there that the true-value of suppress_if_match
can only be yes
? All I see is a new config option used in the code. Needs updated documentation in mailer.conf.example
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Belay that suggested code change, I'm blind. The docco request stands, though.
|
||
# after all the groups are done, add in the default group | ||
try: | ||
self._group_re.append((None, | ||
self._last_group_re.append((None, | ||
re.compile(self.defaults.for_paths), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix function argument indentation, please.
suppress_if_match is/was used to suppress emails if a later mailer section also matches the current svn event, thus allowing the first section(s) to act as a fallback if no other, more specific section matches.
This brings back that functionality, avoiding duplicate emails for configurations that make use of suppress_if_match