Skip to content

Commit 4b96d97

Browse files
committed
[RelEng] Compute release dates from provided SimRel dates
1 parent 414b044 commit 4b96d97

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
}
9287
definition {
9388
cpsScm {

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()
@@ -53,25 +55,28 @@ pipeline {
5355
assignEnvVariable('PREVIOUS_RELEASE_CANDIDATE_I_BUILD', "I${previousIdMatcher.group('date')}-${previousIdMatcher.group('time')}")
5456
previousIdMatcher = null // release matcher as it's not serializable
5557

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

7277
// Compute new build schedule
7378
def now = java.time.LocalDate.now()
74-
def rcEnd = rc2Date.minusDays(2) // Wednesday before RC2 is the last planned I-build and the cron-triggers should stop after
79+
def rcEnd = eclipseReleaseDates.RC2.minusDays(2) // Wednesday before RC2 is the last planned I-build and the cron-triggers should stop after
7580
def lastCompleteMonth = rcEnd.monthValue - 1
7681
// Consider end-of-year overflows
7782
def completeMonths = (now.monthValue < lastCompleteMonth) ? "${now.monthValue}-${lastCompleteMonth}" : "${now.monthValue}-12,1-${lastCompleteMonth}"
@@ -422,12 +427,10 @@ pipeline {
422427
echo "Skipping .eclipsefdn repository of : ${organisation}"
423428
continue
424429
}
425-
githubAPI.createMilestone(organisation, repository, "${NEXT_RELEASE_VERSION} M1", "${NEXT_RELEASE_VERSION} Milestone 1", "${M1_DATE}")
426-
githubAPI.createMilestone(organisation, repository, "${NEXT_RELEASE_VERSION} M2", "${NEXT_RELEASE_VERSION} Milestone 2", "${M2_DATE}")
427-
githubAPI.createMilestone(organisation, repository, "${NEXT_RELEASE_VERSION} M3", "${NEXT_RELEASE_VERSION} Milestone 3", "${M3_DATE}")
428-
githubAPI.createMilestone(organisation, repository, "${NEXT_RELEASE_VERSION} RC1", "${NEXT_RELEASE_VERSION} Release Candidate 1", "${RC1_DATE}")
429-
githubAPI.createMilestone(organisation, repository, "${NEXT_RELEASE_VERSION} RC2", "${NEXT_RELEASE_VERSION} Release Candidate 2", "${RC2_DATE}")
430-
githubAPI.createMilestone(organisation, repository, "${NEXT_RELEASE_VERSION}", "${NEXT_RELEASE_VERSION} Release", "${GA_DATE}")
430+
releaseEvents.each{ name, description ->
431+
def title = "${NEXT_RELEASE_VERSION}" + (name != 'GA' ? " ${name}" : '')
432+
githubAPI.createMilestone(organisation, repository, title, "${NEXT_RELEASE_VERSION} ${description}", env."${name}_DATE")
433+
}
431434
}
432435
}
433436
}

0 commit comments

Comments
 (0)