Skip to content
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
80 changes: 37 additions & 43 deletions JenkinsJobs/Releng/promoteBuild.jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,14 @@ pipeline {
The name (or, build id) of the build to promote. Typically would be a value such as 'I20250714-1800'.
It must match the name of the build on the build machine.
''')
string(name: 'CHECKPOINT', trim: true, description: 'M1, M3, RC1, RC2, RC3 etc (blank for final releases).')
string(name: 'SIGNOFF_BUG', trim: true, description: 'The issue that was used to "signoff" the checkpoint. If there are no unit test failures, this can be left blank. Otherwise a link is added to test page explaining that "failing unit tests have been investigated".')
string(name: 'CHECKPOINT', trim: true, description: 'M1, M2, M3, RC1, RC2, RC2a etc. (blank for final releases).')
string(name: 'SIGNOFF_ISSUE', trim: true, description: '''
The issue that was used to "signoff" this checkpoint.
The value is the number of the corresponding GitHub issue of the <a href="https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/issues">eclipse-platform/eclipse.platform.releng.aggregator</a> repository.
<br>
If there are no unit test failures, this can be left blank.
Otherwise a link is added to test page explaining that "failing unit tests have been investigated".
''')
}
agent {
label 'basic'
Expand All @@ -43,7 +49,7 @@ pipeline {
echo "DRY_RUN: ${DRY_RUN}"
echo "DROP_ID: ${DROP_ID}"
echo "CHECKPOINT: ${CHECKPOINT}"
echo "SIGNOFF_BUG: ${SIGNOFF_BUG}"
echo "SIGNOFF_ISSUE: ${SIGNOFF_ISSUE}"
def idMatcher = null
if ((idMatcher = "${DROP_ID}" =~ /I(?<date>\d{8})-(?<time>\d{4})/).matches()) {
assignEnvVariable('BUILD_LABEL', "${DROP_ID}")
Expand Down Expand Up @@ -81,13 +87,10 @@ pipeline {
assignEnvVariable('DL_DROP_ID', "${DL_TYPE}-${DL_LABEL}-${buildTimestamp}")
assignEnvVariable('MAINTENANCE_BRANCH', "R${BUILD_MAJOR}_${BUILD_MINOR}_maintenance")

if ("${SIGNOFF_BUG}".isEmpty()) {
echo '''\
[WARNING] SIGNOFF_BUG was not defined. That is valid if no Unit Tests failures but otherwise should be defined.
Can be added by hand to buildproperties.php in drop site, if in fact there were errors, and simply forgot to specify.
'''.stripIndent()
} else if ("${SIGNOFF_BUG}" ==~ '\\d+') {
assignEnvVariable('SIGNOFF_BUG', "https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/issues/${SIGNOFF_BUG}")
if ("${SIGNOFF_ISSUE}".isEmpty()) {
echo '[WARNING] SIGNOFF_ISSUE was not defined. That is valid if no Unit Tests failures but otherwise should be defined.'
} else if ("${SIGNOFF_ISSUE}" ==~ '\\d+') {
assignEnvVariable('SIGNOFF_ISSUE', "https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/issues/${SIGNOFF_ISSUE}")
}

if (params.DRY_RUN) { // Clear 'try-outs' area on the starge server
Expand Down Expand Up @@ -139,18 +142,7 @@ pipeline {

echo 'Promote Eclipse'
dir("${WORKSPACE}/eclipse") {
renameBuildDrop('eclipse/downloads/drops4', "${DROP_ID}", "${BUILD_LABEL}", "${DL_DROP_ID}", "${DL_LABEL}") {
sh '''
echo "\\$NEWS_ID = \\"${BUILD_MAJOR}.${BUILD_MINOR}\\";" >> 'buildproperties.php'
echo "\\$ACK_ID = \\"${BUILD_MAJOR}.${BUILD_MINOR}\\";" >> 'buildproperties.php'
echo "\\$README_ID = \\"${BUILD_MAJOR}.${BUILD_MINOR}\\";" >> 'buildproperties.php'

# SIGNOFF_BUG should not be defined if there are no JUnit failures to investigate and explain
if [[ -n "${SIGNOFF_BUG}" ]]; then
echo -e "<p>Any unit test failures below have been investigated and found to be test-related and do not affect the quality of the build.\\nSee the <a href=\\"${SIGNOFF_BUG}\\">sign-off page</a> for details.</p>" > 'testNotes.html'
fi
'''
}
renameBuildDrop('eclipse/downloads/drops4', "${DROP_ID}", "${BUILD_LABEL}", "${DL_DROP_ID}", "${DL_LABEL}")
}
}
}
Expand All @@ -164,7 +156,7 @@ pipeline {
script {
utilities.runHereAndForEachGitSubmodule{
// Enforce the (re-)creation of the tag in case of a very late respin
sh 'git tag --force --annotate --message="${SIGNOFF_BUG}" ${TAG} HEAD'
sh 'git tag --force --annotate --message="${SIGNOFF_ISSUE}" ${TAG} HEAD'
utilities.gitPushTag("${TAG}", /*force*/ true)
}
}
Expand Down Expand Up @@ -319,15 +311,15 @@ pipeline {
}
}

def renameBuildDrop(String baseDropPath, String oldDropID, String oldBuildLabel, String newDropID, String newBuildLabel, Closure extraTasks=null) {
def renameBuildDrop(String baseDropPath, String oldDropID, String oldBuildLabel, String newDropID, String newBuildLabel) {
def sourcePath="${EP_ROOT}/${baseDropPath}/${oldDropID}"
def targetPath="${EP_ROOT}/${env.DRY_RUN_PREFIX ?: ''}${baseDropPath}/${newDropID}"

sh """#!/bin/bash -xe

# Copy drop-directory to new location
ssh genie.releng@projects-storage.eclipse.org mkdir -p '${targetPath}'
# Create this marker first to ensure the page is never without
# Create this marker first to ensure the page is never visible without it (until it's published)
ssh genie.releng@projects-storage.eclipse.org touch '${targetPath}/buildHidden'

ssh genie.releng@projects-storage.eclipse.org cp -r '${sourcePath}/.' '${targetPath}'
Expand Down Expand Up @@ -355,32 +347,34 @@ EOF
ssh genie.releng@projects-storage.eclipse.org sed --in-place --expression 's/${oldBuildLabel}/${newBuildLabel}/g' ${targetPath}/checksum/*
"""

// Update buildproperties.php to new names
def newTypeName = null
// Update buildproperties.json to new names
sh "scp genie.releng@projects-storage.eclipse.org:${sourcePath}/buildproperties.json buildproperties.json"
utilities.modifyJSON('buildproperties.json') { buildProperties ->
buildProperties.identifier = newDropID
buildProperties.label = newBuildLabel
if ("${DL_TYPE}" == 'R') {
newTypeName = 'Release'
buildProperties.kind = 'Release'
} else if (newBuildLabel.contains('RC')) {
newTypeName = 'Release Candidate'
buildProperties.kind = 'Release Candidate'
} else if ("${DL_TYPE}" == 'S') {
newTypeName = 'Stable'
buildProperties.kind = 'Stable'
} else {
error "Unexpected DL_TYPE value, ${DL_TYPE}"
}
def newProperties = [
BUILD_ID: "${newBuildLabel}",
BUILD_TYPE: "${DL_TYPE}",
BUILD_TYPE_NAME: "${newTypeName}",
]
def buildPropertiesPHP = sh(returnStdout: true, script: "ssh genie.releng@projects-storage.eclipse.org cat ${sourcePath}/buildproperties.php")
for (entry in newProperties) {
//TODO: update this to modify the buildproperties.json with the new names/labels and updated filenames/size(?)
buildPropertiesPHP = buildPropertiesPHP.replaceFirst('\\$' + entry.key + ' = "[^"]+"', '\\$' + entry.key + ' = "' + entry.value + '"')
buildProperties.values().each{ value ->
if (value instanceof List) {
value.each{ fileData ->
if('name' in fileData) {
fileData.name = fileData.name.replace(oldBuildLabel, newBuildLabel)
}
}
}
}
if (env.SIGNOFF_ISSUE) {
buildProperties.signOffIssue = env.SIGNOFF_ISSUE
}
}
writeFile(file: 'buildproperties.php', text: buildPropertiesPHP)

if (extraTasks) {
extraTasks()
}
sh """#!/bin/bash -xe
# Copy locally modified files to the download server
scp -r . genie.releng@projects-storage.eclipse.org:${targetPath}/
Expand Down
8 changes: 8 additions & 0 deletions sites/eclipse/build/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ <h3 id="tests">Summary of Unit Test Results</h3>
<p>
<span id="test-completion-state">No</span> integration and unit test configurations are complete.
</p>
<p id="signOff-issue-container"></p>
<table id="tests-overview-table">
<thead>
<tr>
Expand Down Expand Up @@ -150,6 +151,13 @@ <h3 id="swt">SWT Binary and Source
document.getElementById('test-completion-state').innerHTML = `${completedTests} of ${testResults.length}`
})

if (build.signOffIssue) {
const signOffLabel = build.signOffIssue.replace('https://github.com/', '').replace('/issues/', '#')
const signOffSection = document.getElementById('signOff-issue-container')
signOffSection.innerHTML = `Any unit test failures below have been investigated and found to be test-related and to not affect the quality of the build.<br>
For details, see <a href="${build.signOffIssue}">${signOffLabel}</a>.`
}

// Inject resource files
const dataTables = Array.from(mainElement.getElementsByClassName("files-table"))
for (const table of dataTables) {
Expand Down
Loading