Skip to content

Commit a97ae46

Browse files
committed
[RelEng] Compute release dates from provided SimRel dates
1 parent 65ca5a3 commit a97ae46

File tree

2 files changed

+24
-26
lines changed

2 files changed

+24
-26
lines changed

JenkinsJobs/Releng/FOLDER.groovy

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,7 @@ Useful for debugging and to very that the pipeline behaves as intended.
8282
''')
8383
stringParam('NEXT_RELEASE_VERSION', null, 'Version of the release to prepare, for example: 4.37')
8484
stringParam('PREVIOUS_RELEASE_CANDIDATE_ID', null, 'Id of the current release-candiate for the previous release, for example: S-4.36RC2-202505281830')
85-
stringParam('M1_DATE', null, 'Milestone 1 end date in the format yyyy-mm-dd, for example: 2025-07-04')
86-
stringParam('M2_DATE', null, 'Milestone 2 end date in the format yyyy-mm-dd, for example: 2025-07-25')
87-
stringParam('M3_DATE', null, 'Milestone 3 end date in the format yyyy-mm-dd, for example: 2025-08-15')
88-
stringParam('RC1_DATE', null, 'Release-Candidate 1 end date in the format yyyy-mm-dd, for example: 2025-08-22')
89-
stringParam('RC2_DATE', null, 'Release-Candidate 2 end date in the format yyyy-mm-dd, for example: 2025-08-29')
90-
stringParam('GA_DATE', null, 'Final general availability release date in the format yyyy-mm-dd, for example: 2025-09-10')
85+
stringParam('NEXT_SIMREL_NAME', null, 'The name of the Simultanious Release that is targeted by the prepared release in the format yyyy-mm, for example: 2026-03')
9186
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')
9287
}
9388
definition {

JenkinsJobs/Releng/prepareNextDevCycle.jenkinsfile

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11

2+
def releaseEvents = [ M1: 'Milestone 1', M2: 'Milestone 2', M3: 'Milestone 3', RC1: 'Release Candidate 1', RC2: 'Release Candidate 2', GA: 'Release' ]
3+
24
pipeline {
35
options {
46
timestamps()
@@ -55,25 +57,28 @@ pipeline {
5557
assignEnvVariable('PREVIOUS_RELEASE_CANDIDATE_I_BUILD', "I${previousIdMatcher.group('date')}-${previousIdMatcher.group('time')}")
5658
previousIdMatcher = null // release matcher as it's not serializable
5759

58-
//TODO: Read the dates from the calender instead of provide a structured document somewhere?
59-
// E.g. next to: https://github.com/eclipse-simrel/.github/blob/main/wiki/SimRel/2025-09.md
60-
def m1Date = parseDate(readParameter('M1_DATE'))
61-
def m2Date = parseDate(readParameter('M2_DATE'))
62-
def m3Date = parseDate(readParameter('M3_DATE'))
63-
def rc1Date = parseDate(readParameter('RC1_DATE'))
64-
def rc2Date = parseDate(readParameter('RC2_DATE'))
65-
def gaDate = parseDate(readParameter('GA_DATE'))
66-
if (!(m1Date < m2Date && m2Date < m3Date && m3Date < rc1Date && rc1Date < rc2Date && rc2Date < gaDate)) {
67-
error "Dates are not in strictly ascending order: ${M1_DATE}, ${M2_DATE}, ${M3_DATE}, ${RC1_DATE}, ${RC2_DATE}, ${GA_DATE}"
60+
env.NEXT_SIMREL_NAME = readParameter('NEXT_SIMREL_NAME')
61+
def simRelMatcher = env.NEXT_SIMREL_NAME =~ /(?<year>\d{4})-(?<month>\d{2})/
62+
if (!simRelMatcher.matches()) {
63+
error "Unexpected format for NEXT_SIMREL_NAME: ${NEXT_SIMREL_NAME}"
64+
}
65+
assignEnvVariable('NEXT_RELEASE_YEAR', simRelMatcher.group('year'))
66+
assignEnvVariable('NEXT_RELEASE_MONTH', simRelMatcher.group('month'))
67+
assignEnvVariable('NEXT_RELEASE_NAME', "${NEXT_SIMREL_NAME}")
68+
simRelMatcher = null // release matcher as it's not serializable
69+
70+
def simRelDatesRaw = sh(script: "curl --fail https://raw.githubusercontent.com/eclipse-simrel/.github/refs/heads/machine-readable-dates/wiki/SimRel/${NEXT_SIMREL_NAME}_dates.json", returnStdout: true)
71+
def simRelDates = readJSON(text: simRelDatesRaw)
72+
def eclipseReleaseDates = releaseEvents.collectEntries{ name, _ ->
73+
def date = parseDate(simRelDates[name]).minusDays(name == 'GA' ? 0 : 7) // All Eclipse-TLPs have offset -7 days
74+
assignEnvVariable("${name}_DATE", date)
75+
return [name, date]
6876
}
69-
assignEnvVariable('NEXT_RELEASE_YEAR', gaDate.year.toString())
70-
assignEnvVariable('NEXT_RELEASE_MONTH', String.format("%02d", gaDate.monthValue))
71-
assignEnvVariable('NEXT_RELEASE_NAME', "${NEXT_RELEASE_YEAR}-${NEXT_RELEASE_MONTH}")
7277
assignEnvVariable('MAINTENANCE_BRANCH', "R${PREVIOUS_RELEASE_VERSION_MAJOR}_${PREVIOUS_RELEASE_VERSION_MINOR}_maintenance")
7378

7479
// Compute new build schedule
7580
def now = java.time.LocalDate.now()
76-
def rcEnd = rc2Date.minusDays(2) // Wednesday before RC2 is the last planned I-build and the cron-triggers should stop after
81+
def rcEnd = eclipseReleaseDates.RC2.minusDays(2) // Wednesday before RC2 is the last planned I-build and the cron-triggers should stop after
7782
assignEnvVariable('I_BUILD_SCHEDULE', createCronPattern(now, rcEnd, 18, '*').trim())
7883

7984
env.NEXT_JAVA_RELEASE_DATE = readParameter('NEXT_JAVA_RELEASE_DATE')
@@ -445,12 +450,10 @@ pipeline {
445450
echo "Skipping .eclipsefdn repository of : ${organisation}"
446451
continue
447452
}
448-
githubAPI.createMilestone(organisation, repository, "${NEXT_RELEASE_VERSION} M1", "${NEXT_RELEASE_VERSION} Milestone 1", "${M1_DATE}")
449-
githubAPI.createMilestone(organisation, repository, "${NEXT_RELEASE_VERSION} M2", "${NEXT_RELEASE_VERSION} Milestone 2", "${M2_DATE}")
450-
githubAPI.createMilestone(organisation, repository, "${NEXT_RELEASE_VERSION} M3", "${NEXT_RELEASE_VERSION} Milestone 3", "${M3_DATE}")
451-
githubAPI.createMilestone(organisation, repository, "${NEXT_RELEASE_VERSION} RC1", "${NEXT_RELEASE_VERSION} Release Candidate 1", "${RC1_DATE}")
452-
githubAPI.createMilestone(organisation, repository, "${NEXT_RELEASE_VERSION} RC2", "${NEXT_RELEASE_VERSION} Release Candidate 2", "${RC2_DATE}")
453-
githubAPI.createMilestone(organisation, repository, "${NEXT_RELEASE_VERSION}", "${NEXT_RELEASE_VERSION} Release", "${GA_DATE}")
453+
releaseEvents.each{ name, description ->
454+
def title = "${NEXT_RELEASE_VERSION}" + (name != 'GA' ? " ${name}" : '')
455+
githubAPI.createMilestone(organisation, repository, title, "${NEXT_RELEASE_VERSION} ${description}", env["${name}_DATE"])
456+
}
454457
}
455458
}
456459
}

0 commit comments

Comments
 (0)