Skip to content

Commit 43530cb

Browse files
committed
[RelEng] Adapt build promotion to new build website
Additionally display a possible SIGNOFF_ISSUE at a promoted website. Follow-up on #3554
1 parent e22de39 commit 43530cb

File tree

2 files changed

+45
-43
lines changed

2 files changed

+45
-43
lines changed

JenkinsJobs/Releng/promoteBuild.jenkinsfile

Lines changed: 37 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,14 @@ pipeline {
2121
The name (or, build id) of the build to promote. Typically would be a value such as 'I20250714-1800'.
2222
It must match the name of the build on the build machine.
2323
''')
24-
string(name: 'CHECKPOINT', trim: true, description: 'M1, M3, RC1, RC2, RC3 etc (blank for final releases).')
25-
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".')
24+
string(name: 'CHECKPOINT', trim: true, description: 'M1, M2, M3, RC1, RC2, RC2a etc. (blank for final releases).')
25+
string(name: 'SIGNOFF_ISSUE', trim: true, description: '''
26+
The issue that was used to "signoff" this checkpoint.
27+
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.
28+
<br>
29+
If there are no unit test failures, this can be left blank.
30+
Otherwise a link is added to test page explaining that "failing unit tests have been investigated".
31+
''')
2632
}
2733
agent {
2834
label 'basic'
@@ -43,7 +49,7 @@ pipeline {
4349
echo "DRY_RUN: ${DRY_RUN}"
4450
echo "DROP_ID: ${DROP_ID}"
4551
echo "CHECKPOINT: ${CHECKPOINT}"
46-
echo "SIGNOFF_BUG: ${SIGNOFF_BUG}"
52+
echo "SIGNOFF_ISSUE: ${SIGNOFF_ISSUE}"
4753
def idMatcher = null
4854
if ((idMatcher = "${DROP_ID}" =~ /I(?<date>\d{8})-(?<time>\d{4})/).matches()) {
4955
assignEnvVariable('BUILD_LABEL', "${DROP_ID}")
@@ -81,13 +87,10 @@ pipeline {
8187
assignEnvVariable('DL_DROP_ID', "${DL_TYPE}-${DL_LABEL}-${buildTimestamp}")
8288
assignEnvVariable('MAINTENANCE_BRANCH', "R${BUILD_MAJOR}_${BUILD_MINOR}_maintenance")
8389

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

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

140143
echo 'Promote Eclipse'
141144
dir("${WORKSPACE}/eclipse") {
142-
renameBuildDrop('eclipse/downloads/drops4', "${DROP_ID}", "${BUILD_LABEL}", "${DL_DROP_ID}", "${DL_LABEL}") {
143-
sh '''
144-
echo "\\$NEWS_ID = \\"${BUILD_MAJOR}.${BUILD_MINOR}\\";" >> 'buildproperties.php'
145-
echo "\\$ACK_ID = \\"${BUILD_MAJOR}.${BUILD_MINOR}\\";" >> 'buildproperties.php'
146-
echo "\\$README_ID = \\"${BUILD_MAJOR}.${BUILD_MINOR}\\";" >> 'buildproperties.php'
147-
148-
# SIGNOFF_BUG should not be defined if there are no JUnit failures to investigate and explain
149-
if [[ -n "${SIGNOFF_BUG}" ]]; then
150-
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'
151-
fi
152-
'''
153-
}
145+
renameBuildDrop('eclipse/downloads/drops4', "${DROP_ID}", "${BUILD_LABEL}", "${DL_DROP_ID}", "${DL_LABEL}")
154146
}
155147
}
156148
}
@@ -164,7 +156,7 @@ pipeline {
164156
script {
165157
utilities.runHereAndForEachGitSubmodule{
166158
// Enforce the (re-)creation of the tag in case of a very late respin
167-
sh 'git tag --force --annotate --message="${SIGNOFF_BUG}" ${TAG} HEAD'
159+
sh 'git tag --force --annotate --message="${SIGNOFF_ISSUE}" ${TAG} HEAD'
168160
utilities.gitPushTag("${TAG}", /*force*/ true)
169161
}
170162
}
@@ -319,15 +311,15 @@ pipeline {
319311
}
320312
}
321313

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

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

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

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

358-
// Update buildproperties.php to new names
359-
def newTypeName = null
350+
// Update buildproperties.json to new names
351+
sh "scp genie.releng@projects-storage.eclipse.org:${sourcePath}/buildproperties.json buildproperties.json"
352+
utilities.modifyJSON('buildproperties.json') { buildProperties ->
353+
buildProperties.identifier = newDropID
354+
buildProperties.label = newBuildLabel
360355
if ("${DL_TYPE}" == 'R') {
361-
newTypeName = 'Release'
356+
buildProperties.kind = 'Release'
362357
} else if (newBuildLabel.contains('RC')) {
363-
newTypeName = 'Release Candidate'
358+
buildProperties.kind = 'Release Candidate'
364359
} else if ("${DL_TYPE}" == 'S') {
365-
newTypeName = 'Stable'
360+
buildProperties.kind = 'Stable'
366361
} else {
367362
error "Unexpected DL_TYPE value, ${DL_TYPE}"
368363
}
369-
def newProperties = [
370-
BUILD_ID: "${newBuildLabel}",
371-
BUILD_TYPE: "${DL_TYPE}",
372-
BUILD_TYPE_NAME: "${newTypeName}",
373-
]
374-
def buildPropertiesPHP = sh(returnStdout: true, script: "ssh genie.releng@projects-storage.eclipse.org cat ${sourcePath}/buildproperties.php")
375-
for (entry in newProperties) {
376-
//TODO: update this to modify the buildproperties.json with the new names/labels and updated filenames/size(?)
377-
buildPropertiesPHP = buildPropertiesPHP.replaceFirst('\\$' + entry.key + ' = "[^"]+"', '\\$' + entry.key + ' = "' + entry.value + '"')
364+
buildProperties.values().each{ value ->
365+
if (value instanceof List) {
366+
value.each{ fileData ->
367+
if('name' in fileData) {
368+
fileData.name = fileData.name.replace(oldBuildLabel, newBuildLabel)
369+
}
370+
}
371+
}
372+
}
373+
if (env.SIGNOFF_ISSUE) {
374+
buildProperties.signOffIssue = env.SIGNOFF_ISSUE
375+
}
378376
}
379-
writeFile(file: 'buildproperties.php', text: buildPropertiesPHP)
380377

381-
if (extraTasks) {
382-
extraTasks()
383-
}
384378
sh """#!/bin/bash -xe
385379
# Copy locally modified files to the download server
386380
scp -r . genie.releng@projects-storage.eclipse.org:${targetPath}/

sites/eclipse/build/index.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ <h3 id="tests">Summary of Unit Test Results</h3>
4343
<p>
4444
<span id="test-completion-state">No</span> integration and unit test configurations are complete.
4545
</p>
46+
<p id="signOff-issue-container"></p>
4647
<table id="tests-overview-table">
4748
<thead>
4849
<tr>
@@ -150,6 +151,13 @@ <h3 id="swt">SWT Binary and Source
150151
document.getElementById('test-completion-state').innerHTML = `${completedTests} of ${testResults.length}`
151152
})
152153

154+
if (build.signOffIssue) {
155+
const signOffLabel = build.signOffIssue.replace('https://github.com/', '').replace('/issues/', '#')
156+
const signOffSection = document.getElementById('signOff-issue-container')
157+
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>
158+
For details, see <a href="${build.signOffIssue}">${signOffLabel}</a>.`
159+
}
160+
153161
// Inject resource files
154162
const dataTables = Array.from(mainElement.getElementsByClassName("files-table"))
155163
for (const table of dataTables) {

0 commit comments

Comments
 (0)