-
Notifications
You must be signed in to change notification settings - Fork 414
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
Adding support for configuring when matrix projects notify. #547
Conversation
Hey, I'll take a look at this soon, could you add the needed tests please? |
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.
looking good
@@ -168,6 +176,14 @@ public CommitInfoChoice getCommitInfoChoice() { | |||
return commitInfoChoice; | |||
} | |||
|
|||
public MatrixTriggerMode getMatrixTriggerMode() { | |||
if (matrixTriggerMode == null) { | |||
return MatrixTriggerMode.ONLY_CONFIGURATIONS; |
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.
can you initialise it to this and have the getter just be dumb?
@@ -341,20 +362,20 @@ public SlackNotifier(CommitInfoChoice commitInfoChoice) { | |||
public SlackNotifier(final String baseUrl, final String teamDomain, final String authToken, final boolean botUser, final String room, final String tokenCredentialId, | |||
final String sendAs, final boolean startNotification, final boolean notifyAborted, final boolean notifyFailure, | |||
final boolean notifyNotBuilt, final boolean notifySuccess, final boolean notifyUnstable, final boolean notifyRegression, final boolean notifyBackToNormal, | |||
final boolean notifyRepeatedFailure, final boolean includeTestSummary, final boolean includeFailedTests, | |||
final boolean notifyRepeatedFailure, final boolean includeTestSummary, final boolean includeFailedTests, MatrixTriggerMode matrixTriggerMode, |
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.
need to deprecate the old constructor and add a new one, modifying the constructor breaks compatibility
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.
I noticed an unused import when I was reviewing this so I've added a checkstyle rule for it,
Resolved conflicts for you but can you take a look please
public MatrixAggregator createAggregator(MatrixBuild matrixBuild, Launcher launcher, BuildListener buildListener) { | ||
return new MatrixAggregator(matrixBuild, launcher, buildListener) { | ||
@Override | ||
public boolean startBuild() throws InterruptedException, IOException { |
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.
IntelliJ says these exception declarations are unneeded?
public boolean startBuild() throws InterruptedException, IOException { | |
public boolean startBuild() { |
} | ||
|
||
@Override | ||
public boolean endBuild() throws InterruptedException, IOException { |
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.
IntelliJ says these exception declarations are unneeded?
public boolean endBuild() throws InterruptedException, IOException { | |
public boolean startBuild() { |
…ing compatibility and removing unnecessary invocations/exceptions.
The build is currently failing for findbug violations:
Honestly not sure why it's picking those up, all the other methods in there seem to start with a capital. Any idea @Casz? |
no idea why findbugs is looking at messages 😆 I'd suggest updating parent pom and getting spotbugs instead. Should be setup to ignore them. |
findbugs-exclude.xml
Outdated
<FindBugsFilter> | ||
<Match> | ||
<Class name="~.*\.Messages" /> | ||
<Bug pattern="NM_METHOD_NAMING_CONVENTION" /> |
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.
This shouldn't be needed...
Please update parent POM to the least instead, should solve your issue |
@Casz Forgive my ignorance, but I'm not a Java developer. Can you give me more detail on what you're asking? |
Revert last addition and change the parent pom to the latest version: https://github.com/jenkinsci/plugin-pom/blob/master/CHANGELOG.md Lines 6 to 10 in a68a8b0
3.33 is already quite old please bump to latest, which is 3.42
|
Updating to 3.42 gives the same errors with spotbugs:
|
I think it is mocking that is pulling them into view Could you try fixing them to lower case? |
This adds support for users to configure whether a matrix project notifies:
This implementation solves #198 by pulling in similar logic from the hipchat and email-ext plugin.
While this does add the matrix-project as a dependency, this seems to be the pattern for how other publishers handle this, as seen by the plugins mentioned above. If this is acceptable, I'll add tests and request final review for merging.
Fixes #198