I need some help designing a TeamCity plugin. Here's our situation. We have some projects with many tests. Sometimes a flaky test is introduced into the system. We already maintain some logic that runs as a build step in every project in our build that uses the TeamCity API to tag a particular build as "valid" or "known flaky" based on an external datasource of flaky tests we are already aware of.
I would like to intercept the Build Failed message on the way to the EmailNotifier and drop it if the build does not have a "valid" tag on it. In other words, if we already have a record that the build failed because of a flaky test failing, we don't want to send an email to the committers whose commits triggered the build. Investigating the build failure is not a good use of their time.
At first, I was thinking that I needed to implement a Custom Notifier which wrapped the Email Notifier. But, now I'm thinking that I might be able to use a BuildMessagesTranslator
Is that heading in the right direction. Just looking for a hint. Or, if you've got other ideas on how to accomplish our goal of not notifying the committers when a flaky tests fails, I'd be happy to hear about that as well.