Skip to content

Commit 65ca5a3

Browse files
committed
[RelEng] Split stream, branch and schedule configuration for I/Y builds
Split the configuration of built branches per stream and specify it individually per build type (I- and Y-build). Additionally specify individually per build type and stream the cron trigger schedule of the corresponding build. This allows to configure all managed builds individually. When preparing a new release, add new and move old stream as before. But preserve the old build's schedule and don't overwrite especially the Y-build schedule with the new streams schedule even if a Java release is imminent (this wrongly happened before). For Y builds, also add the new stream immediately, but disable it, when a java release is imminent and the the new BETA-Java branch is not created. The old stream's Y-build can then continue until the Java release to feed the P-build and the new build can be activated once ready.
1 parent 3d806a6 commit 65ca5a3

File tree

10 files changed

+68
-58
lines changed

10 files changed

+68
-58
lines changed

JenkinsJobs/AutomatedTests/I_unit_tests.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def TEST_CONFIGURATIONS = [
88
[os: 'win32' , ws:'win32', arch: 'x86_64' , javaVersion: 21, agentLabel: 'qa6xd-win11' , javaHome: "'C:\\\\Program Files\\\\Eclipse Adoptium\\\\jdk-21.0.5.11-hotspot'" ],
99
]
1010

11-
for (STREAM in config.Branches.keySet()){
11+
for (STREAM in config.I.streams.keySet()){
1212
def MAJOR = STREAM.split('\\.')[0]
1313
def MINOR = STREAM.split('\\.')[1]
1414
for (TEST_CONFIG in TEST_CONFIGURATIONS){

JenkinsJobs/Builds/FOLDER.groovy

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,20 @@ folder('Builds') {
44
description('Eclipse periodic build jobs.')
55
}
66

7-
for (entry in config.Branches.entrySet()){
8-
def STREAM = entry.key
9-
def BRANCH = entry.value
7+
config.I.streams.each{ STREAM, configuration ->
108

119
pipelineJob('Builds/I-build-' + STREAM){
1210
description('Daily Eclipse Integration builds.')
1311
properties {
1412
pipelineTriggers {
1513
triggers {
1614
cron {
17-
spec('''TZ=America/Toronto
15+
spec(configuration.schedule ? """TZ=America/Toronto
1816
# Format: Minute Hour Day Month Day-of-week (1-7)
1917
# - - - Integration Eclipse SDK builds - - -
2018
# Schedule: 6 PM every day until end of RC2
21-
0 18 * 8-10 *
22-
0 18 1-26 11 *
23-
''')
19+
${configuration.schedule}
20+
""" : '')
2421
}
2522
}
2623
}
@@ -29,7 +26,7 @@ for (entry in config.Branches.entrySet()){
2926
cpsScm {
3027
lightweight(true)
3128
scm {
32-
github('eclipse-platform/eclipse.platform.releng.aggregator', BRANCH)
29+
github('eclipse-platform/eclipse.platform.releng.aggregator', configuration.branch)
3330
}
3431
scriptPath('JenkinsJobs/Builds/build.jenkinsfile')
3532
}

JenkinsJobs/JobDSL.json

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
{
2-
"Branches": {
3-
"4.38": "master"
2+
"I": {
3+
"streams": {
4+
"4.38": {
5+
"branch": "master",
6+
"schedule": "0 18 * 8-10 *\n0 18 1-26 11 *"
7+
}
8+
}
9+
},
10+
"Y": {
11+
"streams": {
12+
"4.38": {
13+
"branch": "master",
14+
"disabled": "true",
15+
"schedule": "0 10 * 8-10 2,4,6\n0 10 1-26 11 2,4,6"
16+
}
17+
}
418
}
5-
}
19+
}

JenkinsJobs/Releng/FOLDER.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ Useful for debugging and to very that the pipeline behaves as intended.
8888
stringParam('RC1_DATE', null, 'Release-Candidate 1 end date in the format yyyy-mm-dd, for example: 2025-08-22')
8989
stringParam('RC2_DATE', null, 'Release-Candidate 2 end date in the format yyyy-mm-dd, for example: 2025-08-29')
9090
stringParam('GA_DATE', null, 'Final general availability release date in the format yyyy-mm-dd, for example: 2025-09-10')
91-
stringParam('NEXT_JAVA_RELEASE_DATE', null, 'Release date of the next nww Java version, if it is released shortly after the Eclipse release (i.e. shortly after the <em>GA_DATE</em> specified above, usually for odd release versions), else left blank (usually for even releases). Value is in the format yyyy-mm-dd, for example: 2025-09-16')
91+
stringParam('NEXT_JAVA_RELEASE_DATE', null, 'Release date of the next Java version, if it is released shortly after the Eclipse release (i.e. shortly after the <em>GA_DATE</em> specified above, <b>usual for odd release versions</b>), else left blank (<b>usual for even releases</b>). Value is in the format yyyy-mm-dd, for example: 2025-09-16')
9292
}
9393
definition {
9494
cpsScm {

JenkinsJobs/Releng/prepareNextDevCycle.jenkinsfile

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ pipeline {
2929
nextVersionMatcher = null // release matcher as it's not serializable
3030

3131
env.PREVIOUS_RELEASE_CANDIDATE_ID = readParameter('PREVIOUS_RELEASE_CANDIDATE_ID')
32+
def buildPropertiesTxt = sh(script: "curl --fail https://download.eclipse.org/eclipse/downloads/drops4/${PREVIOUS_RELEASE_CANDIDATE_ID}/buildproperties.txt", returnStdout: true)
33+
def buildProperties = readProperties(text: buildPropertiesTxt)
34+
assignEnvVariable('IS_JAVA_RELEASE_IMMINENT', !buildProperties.NEXT_JAVA_RELEASE_DATE.replace('"','').isEmpty()) // Remove surrounding quotes
35+
3236
def previousIdMatcher = null
3337
if ((previousIdMatcher = env.PREVIOUS_RELEASE_CANDIDATE_ID =~ /(?<type>[SR])-(?<major>\d+)\.(?<minor>\d+)(\.(?<service>\d+))?(?<checkpoint>(M|RC)\d+[a-z]?)?-(?<date>\d{8})(?<time>\d{4})/).matches()) {
3438
def checkpoint = previousIdMatcher.group('checkpoint')
@@ -39,8 +43,6 @@ pipeline {
3943
assignEnvVariable('PREVIOUS_RELEASE_CANDIDATE_GIT_TAG', "${previousIdMatcher.group('type')}${PREVIOUS_RELEASE_VERSION_MAJOR}_${PREVIOUS_RELEASE_VERSION_MINOR}${(checkpoint || previousServiceVersion != '0') ? ('_' + previousServiceVersion) : ''}${checkpoint ? ('_' + checkpoint) : ''}")
4044

4145
} else if ((previousIdMatcher = env.PREVIOUS_RELEASE_CANDIDATE_ID =~ /I(?<date>\d{8})-(?<time>\d{4})/).matches()) {
42-
def buildPropertiesTxt = sh(script: "curl --fail https://download.eclipse.org/eclipse/downloads/drops4/${PREVIOUS_RELEASE_CANDIDATE_ID}/buildproperties.txt", returnStdout: true)
43-
def buildProperties = readProperties(text: buildPropertiesTxt)
4446
assignEnvVariable('PREVIOUS_RELEASE_VERSION_MAJOR', buildProperties.STREAMMajor.replace('"','')) // Remove surrounding quotes
4547
assignEnvVariable('PREVIOUS_RELEASE_VERSION_MINOR', buildProperties.STREAMMinor.replace('"','')) // Remove surrounding quotes
4648
assignEnvVariable('PREVIOUS_RELEASE_CANDIDATE_TAG', "${PREVIOUS_RELEASE_CANDIDATE_ID}")
@@ -156,6 +158,7 @@ pipeline {
156158
"STREAMMajor=\".*\"" : "STREAMMajor=\"${NEXT_RELEASE_VERSION_MAJOR}\"",
157159
"STREAMMinor=\".*\"" : "STREAMMinor=\"${NEXT_RELEASE_VERSION_MINOR}\"",
158160
"ECLIPSE_RUN_REPO=\".*\"" : "ECLIPSE_RUN_REPO=\"https://download.eclipse.org/eclipse/updates/${NEXT_RELEASE_VERSION}-I-builds/\"",
161+
"NEXT_JAVA_RELEASE_DATE=\".*\"" : "NEXT_JAVA_RELEASE_DATE=\"${NEXT_JAVA_RELEASE_DATE}\"",
159162
])
160163
replaceInFile('eclipse.platform.releng.tychoeclipsebuilder/eclipse.platform.repository/platform.p2.inf', [
161164
"${PREVIOUS_RELEASE_VERSION} Release" : "${NEXT_RELEASE_VERSION} Release",
@@ -170,17 +173,21 @@ pipeline {
170173
"for ${PREVIOUS_RELEASE_VERSION}.0 builds" : "for ${NEXT_RELEASE_VERSION}.0 builds",
171174
])
172175
script {
173-
utilities.modifyJSON('JenkinsJobs/JobDSL.json') { jobs ->
174-
jobs.Branches["${PREVIOUS_RELEASE_VERSION}"] = env.MAINTENANCE_BRANCH
175-
jobs.Branches["${NEXT_RELEASE_VERSION}"] = 'master'
176+
utilities.modifyJSON('JenkinsJobs/JobDSL.json') { builds ->
177+
// Create I-build for new stream and move previous I-build to maintenance branch to allow late re-spins
178+
builds.I.streams["${NEXT_RELEASE_VERSION}"] = [ branch: 'master', schedule: env.I_BUILD_SCHEDULE ]
179+
builds.I.streams["${PREVIOUS_RELEASE_VERSION}"].branch = env.MAINTENANCE_BRANCH
180+
builds.I.streams["${PREVIOUS_RELEASE_VERSION}"].schedule = '' // schedule should already be inactive, but clear it to be sure
181+
182+
//Create Y-build for new stream
183+
builds.Y.streams["${NEXT_RELEASE_VERSION}"] = [ branch: 'master', disabled: env.IS_JAVA_RELEASE_IMMINENT, schedule: env.Y_BUILD_SCHEDULE ]
184+
// If a new Java version is released shortly after the previous release, that Java release will happen in the next days from the point when this is executed.
185+
// In that case Y-builds for the old stream continue on maintenance branch (with pre-defined schedule) to provide P-builds upon Java release.
186+
// Then the Y-build for the new stream is initially disabled and enabled manually later, when the beta branch for the subsequent Java release is set up.
187+
// If no Java release is scheduled soon, the old Y-build stream will just be dormat (like the old I-build), but don't reset its schedule to not overwrite it in the other case.
188+
builds.Y.streams["${PREVIOUS_RELEASE_VERSION}"].branch = env.MAINTENANCE_BRANCH
176189
}
177190
}
178-
replaceAllInFile('JenkinsJobs/Builds/FOLDER.groovy', [
179-
"(?<prefix># Schedule:.*\\R)(?s).*(?<suffix>\\R'''\\))" : "\${prefix}${I_BUILD_SCHEDULE}\${suffix}",
180-
])
181-
replaceAllInFile('JenkinsJobs/YBuilds/FOLDER.groovy', [
182-
"(?<prefix># Schedule:.*\\R)(?s).*(?<suffix>\\R'''\\))" : "\${prefix}${Y_BUILD_SCHEDULE}\${suffix}",
183-
])
184191

185192
gitCommitAllExcludingSubmodules("Update versions to ${NEXT_RELEASE_VERSION} in build scripts")
186193
}
@@ -248,8 +255,12 @@ pipeline {
248255
sh 'git checkout -b prepareMaintenance ${MAINTENANCE_BRANCH}'
249256

250257
script {
251-
utilities.modifyJSON('JenkinsJobs/JobDSL.json') { jobs ->
252-
jobs.Branches["${PREVIOUS_RELEASE_VERSION}"] = env.MAINTENANCE_BRANCH
258+
utilities.modifyJSON('JenkinsJobs/JobDSL.json') { builds ->
259+
builds.values().each{ buildType ->
260+
def build = buildType.streams["${PREVIOUS_RELEASE_VERSION}"]
261+
build.branch = env.MAINTENANCE_BRANCH
262+
build.schedule = ''
263+
}
253264
}
254265
}
255266
replaceInFile('JenkinsJobs/Builds/build.jenkinsfile', [
@@ -258,10 +269,6 @@ pipeline {
258269
replaceInFile('JenkinsJobs/Builds/DockerImagesBuild.jenkinsfile', [
259270
'-b master' : "-b ${MAINTENANCE_BRANCH}",
260271
])
261-
replaceAllInFile('JenkinsJobs/Builds/FOLDER.groovy', [
262-
"spec\\('''(?s).+?'''\\)" : "spec('')",
263-
"'master'" : "'${MAINTENANCE_BRANCH}'",
264-
])
265272
replaceInFile('cje-production/buildproperties.txt', [
266273
'BRANCH="master"' : "BRANCH=\"${MAINTENANCE_BRANCH}\"",
267274
])
@@ -468,8 +475,8 @@ def readParameter(String name) {
468475
}
469476

470477
@NonCPS
471-
def assignEnvVariable(String name, String value) {
472-
env."${name}" = value
478+
def assignEnvVariable(String name, Object value) {
479+
env[name] = value?.toString()
473480
println("${name}=${value}")
474481
}
475482

JenkinsJobs/Releng/promoteBuild.jenkinsfile

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,9 @@ pipeline {
218218
'previousReleaseVersion=.*' : "previousReleaseVersion=${BUILD_MAJOR}.${BUILD_MINOR}",
219219
'previousReleaseVersionRepo=.*' : "previousReleaseVersionRepo=${BUILD_MAJOR}.${BUILD_MINOR}",
220220
])
221-
utilities.modifyJSON('JenkinsJobs/JobDSL.json') { jobs -> // Remove old I-build job for this release
222-
jobs.Branches.remove("${BUILD_MAJOR}.${BUILD_MINOR}")
221+
utilities.modifyJSON('JenkinsJobs/JobDSL.json') { builds ->
222+
// Remove old I/Y-build jobs for this release
223+
builds.values().each{ build -> build.streams.remove("${BUILD_MAJOR}.${BUILD_MINOR}") }
223224
}
224225

225226
utilities.gitCommitAllExcludingSubmodules("Update previous release version to ${BUILD_MAJOR}.${BUILD_MINOR} GA across build scripts")
@@ -239,10 +240,6 @@ pipeline {
239240
utilities.replaceAllInFile('cje-production/buildproperties.txt', [
240241
'ECLIPSE_RUN_REPO="https://download.eclipse.org/eclipse/updates/.*"' : "ECLIPSE_RUN_REPO=\"${RELEASE_P2_REPOSITORY}\"",
241242
])
242-
// Disable Y-build schedule only after the previous releases job is not updated (on the master) anymore, because Y-build jobs run beyond the Eclipse release if a new java release is imminent
243-
utilities.replaceAllInFile('JenkinsJobs/YBuilds/FOLDER.groovy', [
244-
"spec\\('''(?s).+?'''\\)" : "spec('')",
245-
])
246243
utilities.gitCommitAllExcludingSubmodules("Update ${MAINTENANCE_BRANCH} branch with release version for ${BUILD_MAJOR}_${BUILD_MINOR}+ changes")
247244
}
248245
// Switch back to master for subsequent parts of this pipeline

JenkinsJobs/YBuilds/FOLDER.groovy

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,21 @@ folder('YPBuilds') {
55
description('Builds and tests for the beta java builds.')
66
}
77

8-
for (entry in config.Branches.entrySet()){
9-
def STREAM = entry.key
10-
def BRANCH = entry.value
8+
config.Y.streams.each{ STREAM, configuration ->
119

1210
pipelineJob('YPBuilds/Y-build-' + STREAM){
1311
description('Daily Maintenance Builds.')
12+
disabled(configuration.disabled?.toBoolean() ?: false)
1413
properties {
1514
pipelineTriggers {
1615
triggers {
1716
cron {
18-
spec('''TZ=America/Toronto
17+
spec(configuration.schedule ? """TZ=America/Toronto
1918
# Format: Minute Hour Day Month Day-of-week (1-7)
2019
# - - - Beta Java Eclipse SDK builds - - -
2120
# Schedule: 10 AM every second day (and every day in Java RC phase)
22-
0 10 * 8-10 2,4,6
23-
0 10 1-26 11 2,4,6
24-
''')
21+
${configuration.schedule}
22+
""" : '')
2523
}
2624
}
2725
}
@@ -30,7 +28,7 @@ for (entry in config.Branches.entrySet()){
3028
cpsScm {
3129
lightweight(true)
3230
scm {
33-
github('eclipse-platform/eclipse.platform.releng.aggregator', BRANCH)
31+
github('eclipse-platform/eclipse.platform.releng.aggregator', configuration.branch)
3432
}
3533
scriptPath('JenkinsJobs/Builds/build.jenkinsfile')
3634
}

JenkinsJobs/YBuilds/Y_unit_tests.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def TEST_CONFIGURATIONS = [
88
[os: 'win32' , ws:'win32', arch: 'x86_64' , javaVersion: 21, agentLabel: 'qa6xd-win11' , javaHome: "'C:\\\\Program Files\\\\Eclipse Adoptium\\\\jdk-21.0.5.11-hotspot'" ],
99
]
1010

11-
for (STREAM in config.Branches.keySet()){
11+
for (STREAM in config.Y.streams.keySet()){
1212
def MAJOR = STREAM.split('\\.')[0]
1313
def MINOR = STREAM.split('\\.')[1]
1414
for (TEST_CONFIG in TEST_CONFIGURATIONS){

RELENG.md

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,10 @@
66

77
The (Create Jobs)[https://ci.eclipse.org/releng/job/Create%20Jobs/] job is used to populate the jenkins subfolders with the jobs defined in (JenkinsJobs)[JenkinsJobs] groovy files. There are 2 Process Job DSLs steps, the first looks for FOLDER.groovy files and creates the folders, the second creates the jobs themselves.
88

9-
Since not every folder needs to be updated every release cycle (for example (JenkinsJobs/YBuilds)[JenkinsJobs/YBuilds]) the currently active folders need to be explicitly listed in the Process Job DSLs step of the build. Likewise, unless you want the YBuilds to be recreated when they are no longer needed, the YBuilds folder will need to be removed from Create Jobs after the release.
10-
119
Create Jobs *must be run manually*. Unfortunately JobDSL needs to be run by a specific user, so the build cannot be automatically started by a timer or when it detects jenkins changes without installing an additional plugin like (Authorize Project)[https://plugins.jenkins.io/authorize-project/], which supposedly still works but is abandoned and I (Sam) have not had time to investigate further or find alternatives. This means that while any committer can make changes to the Jenkins Jobs in git, someone with Jenkins rights will have to start the build to implement those changes.
1210

13-
Exceptions:
14-
- (StartSmokeTests)[https://ci.eclipse.org/releng/job/Start-smoke-tests/] predates the rest of the groovy migrations and changing the script to fit JobDSL would have just complicated it with little gain so it was left as is. The source file ((StartSmokeTests.groovy)[JenkinsJobs/SmokeTests/StartSmokeTests.groovy]) is kept with the rest of the smoke test groovy files, but if JobDSL tries to build it it fails so instead of following the normal `JenkinsJobs/FOLDER/*.groovy` format, smoke tests are listed in Create Jobs as `JenkinsJobs/SmokeTests/smoke_*.groovy` specifically.
15-
16-
Currently jobs also need to be deleted manually.
11+
Obsolete jobs have to be deleted manually.
12+
They are not deleted automatically as some may be are still in use for a short time (e.g. Y-builds if a java-release is imminent) or to serve as reference in case the new jobs have problems.
1713

1814
**The JenkinsJobs Folder**
1915

@@ -52,12 +48,12 @@ The builds themselves and their unit tests are in the (Y Builds)[JenkinsJobs/YBu
5248

5349
## Setting Up New Builds
5450

55-
When the JDT team is ready they will raise an issue to create new Y and P builds and supply the name of the new branch, usually BETA_JAVA##.
51+
When the JDT team is ready they will raise an issue to create new Y builds and supply the name of the new branch, usually `BETA_JAVA##`.
5652

5753
**Things to Do:**
58-
* Update the Y-build (Y_build.groovy)[JenkinsJobs/YBuilds/Y_build.groovy].
54+
* Update the Y-build configuration in the (build.jenkinsfile)[JenkinsJobs/Builds/build.jenkinsfile]
5955
- Update `branchLabel` and `typeName` to the name of the new java version
56+
* Remove the disablement of the current stream in the Y-build configuration in the (JobDSL.json)[JenkinsJobs/JobDSL.json] (should be the only Y-build stream).
6057
* Update and rename the java repository files in (cje-production/streams)[cje-production/streams]
61-
- Repos without a BETA_JAVA## branch should be set to master
62-
* Add unit tests for the new java version in (JenkinsJobs/YBuilds)[JenkinsJobs/YBuilds]
63-
* Add Y builds to (Create Jobs)[https://ci.eclipse.org/releng/job/Create%20Jobs/] in Jenkins if they've been removed
58+
- Repos without a `BETA_JAVA##` branch should be set to master
59+
* Add unit tests for the new java version in (JenkinsJobs/YBuilds)[JenkinsJobs/YBuilds] and (build.jenkinsfile)[JenkinsJobs/Builds/build.jenkinsfile]

cje-production/buildproperties.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ TMP_DIR="tmp"
3333
DOWNLOAD_HOST="download.eclipse.org"
3434
BUILD_TO_COMPARE_SITE="ftp.osuosl.org/pub/eclipse/eclipse/updates"
3535
LOCAL_REPO="localMavenRepo"
36+
NEXT_JAVA_RELEASE_DATE=""
3637

3738
# Base builder parameters
3839
BASEBUILDER_TAG="4.37"

0 commit comments

Comments
 (0)