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

Slack daily build status does not report latest in-progress build correctly #1164

Merged
Merged
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
26 changes: 17 additions & 9 deletions tools/nightly_build_and_test_stats.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ def getBuildIDsByPlatform(String trssUrl, String jdkVersion, String srcTag, Map
echo "Finished getting build IDs by platform."
}

// Return our best guess at the url for the first pipeline that generated builds from a specific tag.
// Return our best guess at the url for the latest pipeline that generated builds from a specific tag.
// This pipeline is expected to have attempted to build JDKs for all supported platforms.
def getBuildUrl(String trssUrl, String variant, String featureRelease, String publishName, String scmRef) {
def functionBuildUrl = ["", "", ""]
Expand All @@ -284,6 +284,7 @@ def getBuildUrl(String trssUrl, String variant, String featureRelease, String pu
def pipelineJson = new JsonSlurper().parseText(pipeline)

if (pipelineJson.size() > 0) {
def foundBuildTimestamp = 0
pipelineJson.each { job ->
def overridePublishName = ""
def buildScmRef = ""
Expand All @@ -306,11 +307,18 @@ def getBuildUrl(String trssUrl, String variant, String featureRelease, String pu
if (featureReleaseInt == 8) {
// alpine-jdk8u cannot be distinguished from jdk8u by the scmRef alone, so check for "x64AlpineLinux" in the targetConfiguration
if ((featureRelease == "alpine-jdk8u" && containsX64AlpineLinux) || (featureRelease != "alpine-jdk8u" && !containsX64AlpineLinux)) {
functionBuildUrl = [job.buildUrl, job._id, job.status]
if (job.timestamp > foundBuildTimestamp) {
functionBuildUrl = [job.buildUrl, job._id, job.status]
foundBuildTimestamp = job.timestamp
echo "Found latest "+featureRelease+" pipeline with this ID: "+job._id+" buildNumber: "+job.buildNum
}
}
} else {
functionBuildUrl = [job.buildUrl, job._id, job.status]
echo "Found "+featureRelease+" pipeline with this ID: "+job._id
if (job.timestamp > foundBuildTimestamp) {
functionBuildUrl = [job.buildUrl, job._id, job.status]
foundBuildTimestamp = job.timestamp
echo "Found latest "+featureRelease+" pipeline with this ID: "+job._id+" buildNumber: "+job.buildNum
}
}
}
}
Expand Down Expand Up @@ -958,8 +966,8 @@ node('worker') {
if (reproducibleBuilds.containsKey(featureRelease)) {
def (reproBuildUrl, reproBuildTrss, reproBuildStatus) = getBuildUrl(trssUrl, variant, featureRelease, releaseName.replaceAll("-beta", ""), releaseName.replaceAll("-beta", "").replaceAll("-ea", "")+"_adopt")

if ( reproBuildUrl != "" && callWgetSafely("${trssUrl}/api/getBuildHistory?buildUrl=${reproBuildUrl}") ==~ /.*name.:.enableTests.,.value.:true.*/ ) {
echo "This pipeline has testing enabled: ${reproBuildUrl}"
if ( reproBuildUrl != "" ) {
echo "Latest pipeline: ${reproBuildUrl}"
echo "This pipeline's current status is ${reproBuildStatus}"

getReproducibilityPercentage(featureRelease, reproBuildTrss, trssUrl, releaseName, reproducibleBuilds)
Expand Down Expand Up @@ -991,9 +999,9 @@ node('worker') {
errorMsg += "\nBuild repro summary: "+summaryOfRepros
}
} else {
// Ignore test results if the tests for this pipeline were intentionally disabled, or if we cannot find a likely pipeline job.
reproducibleBuilds[featureRelease][0] = "N/A - Tests disabled"
echo "This pipeline is either a blank string, or does not have testing enabled: ${reproBuildUrl}"
// Ignore if we cannot find a likely pipeline job.
reproducibleBuilds[featureRelease][0] = "N/A"
echo "This pipeline is blank string"
}
}
}
Expand Down
Loading