Skip to content

Commit b66dc74

Browse files
committed
[RelEng] Fix determination of baseline drop and git diff in promotion
Fix the computation of the baseline tag by ignoring the just promoted drop. Compare against the git-tag of the input dropId since the tag of the promoted build is not yet applied at the time when the git comparison is performed. Additionally unify the computation of the git-tag for the promoted drop.
1 parent 8a4ce20 commit b66dc74

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

JenkinsJobs/Releng/promoteBuild.jenkinsfile

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ pipeline {
6262
echo "SIGNOFF_ISSUE: ${SIGNOFF_ISSUE}"
6363
def build = utilities.matchBuildIdentifier("${DROP_ID}", { iBuild ->
6464
assignEnvVariable('BUILD_LABEL', "${DROP_ID}")
65+
assignEnvVariable('DROP_GIT_TAG', "${DROP_ID}")
6566
}, { sBuild ->
6667
if (sBuild.type == 'R') {
6768
error "Releases cannot be promoted further: ${DROP_ID}"
@@ -70,6 +71,7 @@ pipeline {
7071
if ("${CHECKPOINT}") {
7172
error "Stable build DROP_ID=${DROP_ID} may only be promoted to release CHECKPOINT, which therefore must be empty: ${CHECKPOINT}"
7273
}
74+
assignEnvVariable('DROP_GIT_TAG', utilities.stableBuildGitTag("${DROP_ID}"))
7375
})
7476
assignEnvVariable('REPO_ID', "I${build.date}-${build.time}")
7577

@@ -95,6 +97,8 @@ pipeline {
9597
assignEnvVariable('DL_DROP_ID', "${DL_TYPE}-${DL_LABEL}-${build.date}${build.time}")
9698
assignEnvVariable('MAINTENANCE_BRANCH', "R${BUILD_MAJOR}_${BUILD_MINOR}_maintenance")
9799

100+
assignEnvVariable('GIT_TAG', utilities.stableBuildGitTag("${DL_DROP_ID}"))
101+
98102
if ("${SIGNOFF_ISSUE}".isEmpty()) {
99103
echo '[WARNING] SIGNOFF_ISSUE was not defined. That is valid if no Unit Tests failures but otherwise should be defined.'
100104
} else if ("${SIGNOFF_ISSUE}" ==~ '\\d+') {
@@ -149,11 +153,12 @@ pipeline {
149153
if (baselineBuilds.isEmpty() && "${DL_TYPE}" == 'S') { // For M1 usually no previous stable build exists
150154
baselineBuilds = utilities.listBuildDropDirectoriesOnRemote("${EP_ROOT}/eclipse/downloads/drops4", 'R*')
151155
}
152-
buildProperties.gitTag = utilities.stableBuildGitTag("${DL_DROP_ID}")
156+
baselineBuilds.remove(env.DL_DROP_ID) // ignore the just promoted drop when determining the latest
157+
buildProperties.gitTag = env.GIT_TAG
153158
buildProperties.gitBaselineTag = utilities.stableBuildGitTag("${baselineBuilds.last()}")
154159
echo "gitTag: ${buildProperties.gitTag}, gitBaselineTag: ${buildProperties.gitBaselineTag}"
155160
dir("${WORKSPACE}/repository") {
156-
def changedRepositories = utilities.listChangedGitRepositoryURLs(buildProperties.gitBaselineTag, buildProperties.gitTag)
161+
def changedRepositories = utilities.listChangedGitRepositoryURLs(buildProperties.gitBaselineTag, "${DROP_GIT_TAG}") // git tag of promoted build not yet created
157162
echo "Changed repositories: ${changedRepositories}"
158163
buildProperties.gitReposChanged = changedRepositories
159164
}
@@ -164,16 +169,13 @@ pipeline {
164169
}
165170
}
166171
stage('Tag Build') {
167-
environment {
168-
TAG = "${utilities.stableBuildGitTag(DL_DROP_ID)}"
169-
}
170172
steps {
171173
dir("${WORKSPACE}/repository") {
172174
script {
173175
utilities.runHereAndForEachGitSubmodule{
174176
// Enforce the (re-)creation of the tag in case of a very late respin
175-
sh 'git tag --force --annotate --message="${SIGNOFF_ISSUE}" ${TAG} HEAD'
176-
utilities.gitPushTag("${TAG}", /*force*/ true)
177+
sh 'git tag --force --annotate --message="${SIGNOFF_ISSUE}" ${GIT_TAG} HEAD'
178+
utilities.gitPushTag("${GIT_TAG}", /*force*/ true)
177179
}
178180
}
179181
}

0 commit comments

Comments
 (0)