Skip to content

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

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

Humbedooh
Copy link
Member

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

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
@dsahlberg-apache-org
Copy link
Collaborator

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?

@sebbASF
Copy link
Contributor

sebbASF commented Aug 14, 2025

See https://issues.apache.org/jira/browse/INFRA-27061, there is a link to the version I used to generate the patch.

@Humbedooh
Copy link
Member Author

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))
Copy link
Member

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.

Copy link
Member

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),
Copy link
Member

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.

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

Successfully merging this pull request may close these issues.

4 participants