-
Notifications
You must be signed in to change notification settings - Fork 21
refactor: Add error notify and change build version number. #41
base: develop
Are you sure you want to change the base?
Conversation
Change getBuildID() to getBuildNumber() to better match project settings and build agents.
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.
Hi, thank you for your contribution.
There are a few changes that need to be done before we can get this merged. Please check the change requests.
Additionally: While sticking to develop
as branch name is fine, please update the commit messages to match the conventional commit format. You can find more information under CONTRIBUTING.md
DiscordWebHookPayload discordWebHookPayload = new DiscordWebHookPayload(); | ||
discordWebHookPayload.setEmbeds(new DiscordEmbed[]{ | ||
new DiscordEmbed( | ||
title, | ||
description, | ||
description.toString(), |
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.
Please indent this one more level.
// Check the length of the description | ||
if (description.length() > 1800) { | ||
// Truncate the description if it is too long | ||
description = new StringBuilder(description.substring(0, 1800)); |
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'd suggest to suffixx the build log with ...
if it is too long. This way, the user will know that this is not the entire log.
String url = this.sBuildServer.getRootUrl() + "/viewLog.html?buildId=" + sRunningBuild.getBuildId(); | ||
StringBuilder description = new StringBuilder("The build with the ID " + sRunningBuild.getBuildNumber() + " has failed!"); | ||
|
||
description.append("\n" + "The build has failed with the following reason: "); |
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'd maybe add another linebreak here to have a blank line between build id line and failure reasons.
Like:
The build with the ID 1 has failed!
The build has failed with the following reason:
[reason]
I leave this decision up to you. Current layout would be also fine for me.
String description = "A build with the ID " + sRunningBuild.getBuildId() + " has been started!"; | ||
String url = this.sBuildServer.getRootUrl() + "/viewLog.html?buildId=" + sRunningBuild.getBuildId(); | ||
String description = "A build with the ID " + sRunningBuild.getBuildNumber() + " has been started!"; | ||
String url = this.sBuildServer.getRootUrl() + "/viewLog.html?buildId=" + sRunningBuild.getBuildNumber(); |
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.
Please continue to use sRunningBuild.getBuildId();
here.
The URL expects the build id. If the build number is customized in the settings, the URL won't work anymore.
String description = "The build with the ID " + sRunningBuild.getBuildId() + " has succeeded!"; | ||
String url = this.sBuildServer.getRootUrl() + "/viewLog.html?buildId=" + sRunningBuild.getBuildId(); | ||
String description = "The build with the ID " + sRunningBuild.getBuildNumber() + " has succeeded!"; | ||
String url = this.sBuildServer.getRootUrl() + "/viewLog.html?buildId=" + sRunningBuild.getBuildNumber(); |
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.
Please continue to use sRunningBuild.getBuildId();
here.
The URL expects the build id. If the build number is customized in the settings, the URL won't work anymore.
description = new StringBuilder(description.substring(0, 1800)); | ||
} | ||
|
||
String url = this.sBuildServer.getRootUrl() + "/viewLog.html?buildId=" + sRunningBuild.getBuildNumber(); |
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.
Please continue to use sRunningBuild.getBuildId();
here.
The URL expects the build id. If the build number is customized in the settings, the URL won't work anymore.
String description = "The build with the ID " + sRunningBuild.getBuildId() + " has failed to start!"; | ||
String url = this.sBuildServer.getRootUrl() + "/viewLog.html?buildId=" + sRunningBuild.getBuildId(); | ||
String description = "The build with the ID " + sRunningBuild.getBuildNumber() + " has failed to start!"; | ||
String url = this.sBuildServer.getRootUrl() + "/viewLog.html?buildId=" + sRunningBuild.getBuildNumber(); |
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.
Please continue to use sRunningBuild.getBuildId();
here.
The URL expects the build id. If the build number is customized in the settings, the URL won't work anymore.
String description = "Labeling of build with the ID " + build.getBuildId() + " has failed!"; | ||
String url = this.sBuildServer.getRootUrl() + "/viewLog.html?buildId=" + build.getBuildId(); | ||
String description = "Labeling of build with the ID " + build.getBuildNumber() + " has failed!"; | ||
String url = this.sBuildServer.getRootUrl() + "/viewLog.html?buildId=" + build.getBuildNumber(); |
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.
Please continue to use sRunningBuild.getBuildId();
here.
The URL expects the build id. If the build number is customized in the settings, the URL won't work anymore.
String description = "The build with the ID " + sRunningBuild.getBuildId() + " is failing!"; | ||
String url = this.sBuildServer.getRootUrl() + "/viewLog.html?buildId=" + sRunningBuild.getBuildId(); | ||
String description = "The build with the ID " + sRunningBuild.getBuildNumber() + " is failing!"; | ||
String url = this.sBuildServer.getRootUrl() + "/viewLog.html?buildId=" + sRunningBuild.getBuildNumber(); |
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.
Please continue to use sRunningBuild.getBuildId();
here.
The URL expects the build id. If the build number is customized in the settings, the URL won't work anymore.
String description = "The build with the ID " + sRunningBuild.getBuildId() + " is probably hanging!"; | ||
String url = this.sBuildServer.getRootUrl() + "/viewLog.html?buildId=" + sRunningBuild.getBuildId(); | ||
String description = "The build with the ID " + sRunningBuild.getBuildNumber() + " is probably hanging!"; | ||
String url = this.sBuildServer.getRootUrl() + "/viewLog.html?buildId=" + sRunningBuild.getBuildNumber(); |
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.
Please continue to use sRunningBuild.getBuildId();
here.
The URL expects the build id. If the build number is customized in the settings, the URL won't work anymore.
Add error notify and change build version number.