Skip to content
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

Fix concurrent build back to normal notification missed #576

Merged
merged 2 commits into from
May 30, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/jenkins/plugins/slack/ActiveNotifier.java
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public void completed(AbstractBuild r) {
if (null != previousBuild) {
do {
previousBuild = previousBuild.getPreviousCompletedBuild();
} while (null != previousBuild && previousBuild.getResult() == Result.ABORTED);
} while ((null != previousBuild && previousBuild.getResult() == Result.ABORTED) || previousBuild.getNumber() == r.getNumber());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems ok, have you tested it out?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, I was able to reproduce the error on the local Jenkins instance created by running the plugin. I confirmed that when I made my change the notification properly showed up as well as logging the last build properly, fixing #568 too.

I'll check out the failing build and push more changes if need be.

if (null != previousBuild) {
log.info(key, "found #%d as previous completed, non-aborted build", previousBuild.getNumber());
} else {
Expand Down