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 return for build Failure messages #275

Merged
merged 2 commits into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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 build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ jacocoTestReport {
}
}

String version = '5.4.1'
String version = '5.5.0'

task updateVersion {
doLast {
Expand Down
9 changes: 4 additions & 5 deletions vars/buildMessage.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/
/** Library to find a pattern in jenkins build log.
/** Library to search string in jenkins build log.
@param Map args = [:] args A map of the following parameters
@param args.search <required> - Use 'pass' to get the components passed and 'fail' for components failed.
@param args.search <required> - String to be searched in build logs.
*/
import com.cloudbees.groovy.cps.NonCPS
import org.apache.commons.io.IOUtils
Expand All @@ -29,9 +29,8 @@ def call(Map args = [:]){
message.add(line)
}
}
//if no match returns as Build failed
if(message.isEmpty()){
message=["The search QUERY_STRING not identified in build log"]
if (message.isEmpty()) {
message = null
}
return message
}
2 changes: 1 addition & 1 deletion vars/createBuildFailureGithubIssue.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ void call(Map args = [:]) {
def failureMessages = args.message
List<String> failedComponents = []

if (failureMessages.size() == 1 && failureMessages[0] == 'Build failed') {
if (failureMessages == null) {
println('No component failed, skip creating github issue.')
}
else {
Expand Down
Loading