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

Improve build pipeline summary publish link text with build failure warning #1150

Merged
Merged
Changes from 17 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
f0df031
Add pipeline publish link warning if job fails
andrew-m-leonard Nov 19, 2024
9c14675
Add pipeline publish link warning if job fails
andrew-m-leonard Nov 19, 2024
f6ec03f
Add pipeline publish link warning if job fails
andrew-m-leonard Nov 19, 2024
95eb4eb
Add pipeline publish link warning if job fails
andrew-m-leonard Nov 20, 2024
5bef441
Add pipeline publish link warning if job fails
andrew-m-leonard Nov 20, 2024
2f9d72f
Add pipeline publish link warning if job fails
andrew-m-leonard Nov 20, 2024
f7f1092
Add pipeline publish link warning if job fails
andrew-m-leonard Nov 20, 2024
7ceec73
Add pipeline publish link warning if job fails
andrew-m-leonard Nov 20, 2024
2918489
Add pipeline publish link warning if job fails
andrew-m-leonard Nov 21, 2024
164afc2
Add pipeline publish link warning if job fails
andrew-m-leonard Nov 21, 2024
54f0fe1
Add pipeline publish link warning if job fails
andrew-m-leonard Nov 21, 2024
2ba8f15
Add pipeline publish link warning if job fails
andrew-m-leonard Nov 21, 2024
4f28e68
Add pipeline publish link warning if job fails
andrew-m-leonard Nov 21, 2024
48890c9
Add pipeline publish link warning if job fails
andrew-m-leonard Nov 21, 2024
127e919
Add pipeline publish link warning if job fails
andrew-m-leonard Nov 21, 2024
8e527e7
Merge remote-tracking branch 'origin/master' into pipeline_pub_link_f…
andrew-m-leonard Nov 22, 2024
353efec
Add pipeline publish link warning if job fails
andrew-m-leonard Nov 22, 2024
3436cce
Add pipeline publish link warning if job fails
andrew-m-leonard Nov 25, 2024
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
41 changes: 25 additions & 16 deletions pipelines/build/common/build_base_file.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -776,11 +776,17 @@ class Builder implements Serializable {
/*
Call job to push artifacts to github. Usually it's only executed on a nightly build
*/
def publishBinary(IndividualBuildConfig config=null) {
def publishBinary(IndividualBuildConfig config=null, String jobResult, String jobUrl) {
def timestamp = new Date().format('yyyy-MM-dd-HH-mm', TimeZone.getTimeZone('UTC'))
def javaVersion=determineReleaseToolRepoVersion()
def stageName = 'BETA publish'
def releaseComment = 'BETA publish'
def releaseWarning = ''
if ( jobResult != "SUCCESS" && jobResult != "UNSTABLE" ) {
// Build was not successful, add warning and link to build job
releaseWarning = '<a href=' + jobUrl + '><span style="color:red;">WARNING: build result(<b>' + jobResult + '</b>)</span></a> : '
andrew-m-leonard marked this conversation as resolved.
Show resolved Hide resolved
}

def tag = "${javaToBuild}-${timestamp}"
if (publishName) {
tag = publishName
Expand Down Expand Up @@ -828,7 +834,7 @@ class Builder implements Serializable {
releaseToolUrl += "&TAG=${tag}&UPSTREAM_JOB_NAME=${urlJobName}&ARTIFACTS_TO_COPY=${artifactsToCopy}"

context.echo "return releaseToolUrl is ${releaseToolUrl}"
return ["${releaseToolUrl}", "${releaseComment}"]
return ["${releaseToolUrl}", "${releaseComment}", "${releaseWarning}"]
}

/*
Expand Down Expand Up @@ -975,8 +981,8 @@ class Builder implements Serializable {

copyArtifactSuccess = true
if (release) {
def (String releaseToolUrl, String releaseComment) = publishBinary(config)
releaseSummary.appendText("<li><a href=${releaseToolUrl}> ${releaseComment} ${config.VARIANT} ${publishName} ${config.TARGET_OS} ${config.ARCHITECTURE}</a></li>")
def (String releaseToolUrl, String releaseComment, String releaseWarning) = publishBinary(config, downstreamJob.getResult(), downstreamJob.getAbsoluteUrl())
releaseSummary.appendText("<li>${releaseWarning}<a href=${releaseToolUrl}> ${releaseComment} ${config.VARIANT} ${publishName} ${config.TARGET_OS} ${config.ARCHITECTURE}</a></li>")
}
}
}
Expand Down Expand Up @@ -1014,17 +1020,20 @@ class Builder implements Serializable {
flatten: true,
optional: true
)
// Archive tap files as a single tar file
context.sh """
cd ${tarDir}/
tar -czf ${tarTap} *.tap
"""
try {
context.timeout(time: pipelineTimeouts.ARCHIVE_ARTIFACTS_TIMEOUT, unit: 'HOURS') {
context.archiveArtifacts artifacts: "${tarDir}/${tarTap}"
// Archive tap files as a single tar file if we have any
def tapExists = context.sh(script: "ls -l ${tarDir}/*.tap", returnStatus:true)
if (tapExists == 0) {
context.sh """
cd ${tarDir}/
tar -czf ${tarTap} *.tap
"""
try {
context.timeout(time: pipelineTimeouts.ARCHIVE_ARTIFACTS_TIMEOUT, unit: 'HOURS') {
context.archiveArtifacts artifacts: "${tarDir}/${tarTap}"
andrew-m-leonard marked this conversation as resolved.
Show resolved Hide resolved
}
} catch (FlowInterruptedException e) {
throw new Exception("[ERROR] Archive AQAvitTapFiles.tar.gz timeout Exiting...")
}
} catch (FlowInterruptedException e) {
throw new Exception("[ERROR] Archive AQAvitTapFiles.tar.gz timeout Exiting...")
}
}
}
Expand Down Expand Up @@ -1052,8 +1061,8 @@ class Builder implements Serializable {
} else {
try {
context.timeout(time: pipelineTimeouts.PUBLISH_ARTIFACTS_TIMEOUT, unit: 'HOURS') {
def (String releaseToolUrl, String releaseComment) = publishBinary()
releaseSummary.appendText("<li><a href=${releaseToolUrl}> ${releaseComment} Rerun Link</a></li>")
def (String releaseToolUrl, String releaseComment, String releaseWarning) = publishBinary(null, currentBuild.result, "${context.BUILD_URL}")
releaseSummary.appendText("<li>${releaseWarning}<a href=${releaseToolUrl}> ${releaseComment} Rerun Link</a></li>")
}
} catch (FlowInterruptedException e) {
throw new Exception("[ERROR] Publish binary timeout (${pipelineTimeouts.PUBLISH_ARTIFACTS_TIMEOUT} HOURS) has been reached OR the downstream publish job failed. Exiting...")
Expand Down