Support the suppress_if_match option from old svn-mailer#35
Support the suppress_if_match option from old svn-mailer#35Humbedooh wants to merge 1 commit intoapache:trunkfrom
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.
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.
Belay that suggested code change, I'm blind. The docco request stands, though.
There was a problem hiding this comment.
Regarding the use of 'yes': several other options behave in the same way.
There was a problem hiding this comment.
Indeed they have and they're documented in mailer.conf.example. This one should be, too.
| 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.
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