Skip to content

Commit bed5715

Browse files
committed
[RelEng] Consider next java release date for Y-build schedule
Explicitly specify a limited cron based schedule for Y-builds too that is either aligned with the Eclipse release or a Java-release. If no Java release happens soon after the Eclipse release the schedule ends two days before RC2 (similar to I-builds). If a Java release happens soon after the Eclipse release (and a JDT patch is provided after the Eclipse release), the Y-build schedule is extended until shortly after the java release date and the schedule and the Y-build cadence is increased in the 'RC-phase'.
1 parent bb6ee10 commit bed5715

File tree

4 files changed

+41
-10
lines changed

4 files changed

+41
-10
lines changed

JenkinsJobs/Releng/FOLDER.groovy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +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')
9192
}
9293
definition {
9394
cpsScm {

JenkinsJobs/Releng/prepareNextDevCycle.jenkinsfile

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,26 @@ pipeline {
7272
// Compute new build schedule
7373
def now = java.time.LocalDate.now()
7474
def rcEnd = rc2Date.minusDays(2) // Wednesday before RC2 is the last planned I-build and the cron-triggers should stop after
75-
def lastCompleteMonth = rcEnd.monthValue - 1
76-
// Consider end-of-year overflows
77-
def completeMonths = (now.monthValue < lastCompleteMonth) ? "${now.monthValue}-${lastCompleteMonth}" : "${now.monthValue}-12,1-${lastCompleteMonth}"
78-
assignEnvVariable('I_BUILD_SCHEDULE', """\
79-
0 18 * ${completeMonths} *
80-
0 18 1-${rcEnd.dayOfMonth} ${rcEnd.monthValue} *
81-
""".stripIndent().trim())
75+
assignEnvVariable('I_BUILD_SCHEDULE', createCronPattern(now, rcEnd, 18, '*').trim())
76+
77+
env.NEXT_JAVA_RELEASE_DATE = readParameter('NEXT_JAVA_RELEASE_DATE')
78+
def yBuildSchedule = null
79+
if ("${NEXT_JAVA_RELEASE_DATE}".isEmpty()) {
80+
yBuildSchedule = createCronPattern(now, rcEnd, 10, '2,4,6')
81+
} else {
82+
// Java releases soon after the Eclipse, therefore schedule Y-builds daily within the 'Java RC phase'
83+
def javaReleaseDate = parseDate("${NEXT_JAVA_RELEASE_DATE}")
84+
def javaRCStart = javaReleaseDate.minusDays(7)
85+
def javaRCEnd = javaReleaseDate.plusDays(2)
86+
if (javaRCStart.monthValue != javaRCEnd.monthValue) {
87+
// If this is encountered, enhance the logic to handle 'java RC' phases ranging more than one month
88+
error "Java release is not in the middle of a month"
89+
}
90+
yBuildSchedule = createCronPattern(now, javaRCStart, 10, '2,4,6') + """\
91+
0 10 ${javaRCStart.dayOfMonth}-${javaRCEnd.dayOfMonth} ${javaRCStart.monthValue} *
92+
""".stripIndent()
93+
}
94+
assignEnvVariable('Y_BUILD_SCHEDULE', yBuildSchedule.trim())
8295
}
8396
}
8497
}
@@ -165,6 +178,9 @@ pipeline {
165178
replaceAllInFile('JenkinsJobs/Builds/FOLDER.groovy', [
166179
"(?<prefix># Schedule:.*\\R)(?s).*(?<suffix>\\R'''\\))" : "\${prefix}${I_BUILD_SCHEDULE}\${suffix}",
167180
])
181+
replaceAllInFile('JenkinsJobs/YBuilds/FOLDER.groovy', [
182+
"(?<prefix># Schedule:.*\\R)(?s).*(?<suffix>\\R'''\\))" : "\${prefix}${Y_BUILD_SCHEDULE}\${suffix}",
183+
])
168184

169185
gitCommitAllExcludingSubmodules("Update versions to ${NEXT_RELEASE_VERSION} in build scripts")
170186
}
@@ -462,6 +478,16 @@ def parseDate(String dateString) {
462478
return java.time.LocalDate.parse(dateString.trim()) // expects format 'yyyy-MM-dd'
463479
}
464480

481+
private String createCronPattern(java.time.LocalDate start, java.time.LocalDate end, int hour, String daysOfWeek = '*') {
482+
def lastCompleteMonth = end.monthValue - 1
483+
// Consider end-of-year overflows
484+
def completeMonths = (start.monthValue < lastCompleteMonth) ? "${start.monthValue}-${lastCompleteMonth}" : "${start.monthValue}-12,1-${lastCompleteMonth}"
485+
return """\
486+
0 ${hour} * ${completeMonths} ${daysOfWeek}
487+
0 ${hour} 1-${end.dayOfMonth} ${end.monthValue} ${daysOfWeek}
488+
""".stripIndent()
489+
}
490+
465491
def replaceInFile(String filePath, Map<String,String> replacements) {
466492
utilities.replaceAllInFile(filePath, replacements.collectEntries{ k, v -> [java.util.regex.Pattern.quote(k), v] });
467493
}

JenkinsJobs/Releng/promoteBuild.jenkinsfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,10 @@ pipeline {
239239
utilities.replaceAllInFile('cje-production/buildproperties.txt', [
240240
'ECLIPSE_RUN_REPO="https://download.eclipse.org/eclipse/updates/.*"' : "ECLIPSE_RUN_REPO=\"${RELEASE_P2_REPOSITORY}\"",
241241
])
242-
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+
])
243246
utilities.gitCommitAllExcludingSubmodules("Update ${MAINTENANCE_BRANCH} branch with release version for ${BUILD_MAJOR}_${BUILD_MINOR}+ changes")
244247
}
245248
// Switch back to master for subsequent parts of this pipeline

JenkinsJobs/YBuilds/FOLDER.groovy

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ for (entry in config.Branches.entrySet()){
1818
spec('''TZ=America/Toronto
1919
# Format: Minute Hour Day Month Day-of-week (1-7)
2020
# - - - Beta Java Eclipse SDK builds - - -
21-
# Schedule: 10 AM every second day
22-
0 10 * * 2,4,6
21+
# 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
2324
''')
2425
}
2526
}

0 commit comments

Comments
 (0)