Skip to content

Commit

Permalink
Fixes, improvements, and jdk versions update for build triage script (a…
Browse files Browse the repository at this point in the history
…doptium#3896)

Includes:
- Removing jdk22
- Adding jdk23 and 24
- Splits build and test failures into seperate sections
- Displays a short list of trss grid views for triaged pipelines
- Various bug fixes and improvements

Signed-off-by: Adam Farley <[email protected]>
  • Loading branch information
adamfarley authored Jul 31, 2024
1 parent 757b462 commit dd82c15
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-autotriage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: "Run Build Auto Triage"
run: bash "${PWD}/${TRIAGE_SCRIPT}" jdk8u jdk11u jdk17u jdk21u jdk22 jdk23head
run: bash "${PWD}/${TRIAGE_SCRIPT}" jdk8u jdk11u jdk17u jdk21u jdk23 jdk24head

- name: Create Issue From File
env:
Expand Down
68 changes: 53 additions & 15 deletions tooling/build_autotriage/build_autotriage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ declare -a arrayOfErrorLinesForFailedJobs
declare -a arrayOfAllJDKVersions
declare -a arrayOfUs
declare -a buildIssues
declare -a arrayOfPipelinesToTriage

headJDKVersion=9999

Expand Down Expand Up @@ -121,7 +122,7 @@ wasPipelineStartedByUser() {
sampleBuildNum="${jsonEntry:11}"
fi
if [[ ! "${sampleBuildName}_${sampleBuildNum}" =~ none ]]; then
continue
break
fi
done

Expand Down Expand Up @@ -214,17 +215,17 @@ identifyFailedBuildsInTimerPipelines() {
latestJdk8Pipelines[2]=$latestTimerPipeline
echo "Found Arm32 Linux JDK8 pipeline here: https://ci.adoptium.net/job/build-scripts/job/openjdk8-pipeline/${latestTimerJenkinsJobID}"
fi
elif [[ ${latestJdk8Pipelines[0]} == "none" ]]; then
elif [[ $jsonEntry =~ betaTrigger\_8ea\\\" && ${latestJdk8Pipelines[0]} == "none" ]]; then
if wasPipelineStartedByUser "$latestTimerPipeline" "${jdkJenkinsJobVersion}"; then
latestJdk8Pipelines[0]=$latestTimerPipeline
echo "Found core JDK8 pipeline here: https://ci.adoptium.net/job/build-scripts/job/openjdk8-pipeline/${latestTimerJenkinsJobID}"
fi
fi
if [[ ${latestJdk8Pipelines[0]} != "none" && ${latestJdk8Pipelines[1]} != "none" && ${latestJdk8Pipelines[2]} != "none" ]]; then
echo "Found all 3 pipelines for JDK8."
break
if [[ ${latestJdk8Pipelines[0]} != "none" && ${latestJdk8Pipelines[1]} != "none" && ${latestJdk8Pipelines[2]} != "none" ]]; then
echo "Found all 3 pipelines for JDK8."
break
fi
fi
fi
else
if [[ $jsonEntry =~ ^\"startBy\"\:\"timer ]]; then
if wasPipelineStartedByUser "$latestTimerPipeline" "${jdkJenkinsJobVersion}"; then
Expand Down Expand Up @@ -256,6 +257,17 @@ identifyFailedBuildsInTimerPipelines() {
if [[ ! ${arrayOfAllJDKVersions[v]} -eq 8 ]]; then
echo "Found TRSS pipeline id for ${jdkJenkinsJobVersion} - ${latestTimerPipeline}"
echo "Whose URL is: https://ci.adoptium.net/job/build-scripts/job/openjdk${arrayOfAllJDKVersions[v]}-pipeline/${latestTimerJenkinsJobID}/"
arrayOfPipelinesToTriage+=("JDK${arrayOfAllJDKVersions[v]}: https://trss.adoptium.net/resultSummary?parentId=${latestTimerPipeline}")
else
if [[ ${latestJdk8Pipelines[0]} != "none" ]]; then
arrayOfPipelinesToTriage+=("JDK8: https://trss.adoptium.net/resultSummary?parentId=${latestJdk8Pipelines[0]}")
fi
if [[ ${latestJdk8Pipelines[1]} != "none" ]]; then
arrayOfPipelinesToTriage+=("JDK8 Alpine: https://trss.adoptium.net/resultSummary?parentId=${latestJdk8Pipelines[1]}")
fi
if [[ ${latestJdk8Pipelines[2]} != "none" ]]; then
arrayOfPipelinesToTriage+=("JDK8 Arm32 Linux: https://trss.adoptium.net/resultSummary?parentId=${latestJdk8Pipelines[2]}")
fi
fi

# Now grab a full list of builds launched by this pipeline.
Expand Down Expand Up @@ -415,27 +427,53 @@ generateOutputFile() {
echo "Build failures: ${totalBuildFailures}"
echo "Test failures: ${totalTestFailures}"
echo ""
echo "# TRSS Pipeline Links"
if [[ ${#arrayOfPipelinesToTriage[@]} -gt 0 ]]; then
for pipelineTrssLink in "${arrayOfPipelinesToTriage[@]}"
do
echo "${pipelineTrssLink}"
done
fi
echo ""
if [[ ${#arrayOfFailedJobs[@]} -gt 0 ]]; then
echo "# Failed Builds"
outputForFailedBuilds=""
outputForFailedTests=""
for failedJobIndex in "${!arrayOfFailedJobs[@]}"
do
regexID="${arrayOfRegexsForFailedJobs[failedJobIndex]}"
echo "Failure: ${arrayOfFailedJobs[failedJobIndex]}"
jobTriageOutput="Failure: ${arrayOfFailedJobs[failedJobIndex]}\n"
if [[ ${regexID} =~ Unmatched ]]; then
echo "Cause: ${arrayOfErrorLinesForFailedJobs[failedJobIndex]}"
jobTriageOutput+="Cause: ${arrayOfErrorLinesForFailedJobs[failedJobIndex]}\n"
else
echo "Cause: ${arrayOfRegexMetadata[regexID]}"
jobTriageOutput+="Cause: ${arrayOfRegexMetadata[regexID]}\n"
preventable="yes"
if [[ "${arrayOfRegexPreventability[regexID]}" -gt 0 ]]; then
preventable="no"
fi
echo "Preventable: ${preventable}"
echo "\`\`\`"
echo "${arrayOfErrorLinesForFailedJobs[failedJobIndex]}"
echo "\`\`\`"
jobTriageOutput+="Preventable: ${preventable}\n"
jobTriageOutput+="\`\`\`\n"
jobTriageOutput+="${arrayOfErrorLinesForFailedJobs[failedJobIndex]}\n"
jobTriageOutput+="\`\`\`\n"
fi
jobTriageOutput+="\n"
if [[ ${arrayOfFailureSources[regexID]} -eq 1 ]]; then
outputForFailedTests+="${jobTriageOutput}"
else
outputForFailedBuilds+="${jobTriageOutput}"
fi
echo ""
done
echo "# Failed Builds"
if [[ -n "${outputForFailedBuilds}" ]]; then
echo -e "${outputForFailedBuilds}"
else
echo "None."
fi
echo "# Builds with Failed Tests (suspected)"
if [[ -n "${outputForFailedTests}" ]]; then
echo -e "${outputForFailedTests}"
else
echo "None."
fi
echo "# End of list"
else
echo "All build jobs passed. Huzzah!"
Expand Down

0 comments on commit dd82c15

Please sign in to comment.