mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 10:40:07 -04:00
[jenkins] disable CI metrics for temporary feature branches (#81938)
Co-authored-by: spalger <spalger@users.noreply.github.com>
This commit is contained in:
parent
526de26f03
commit
271a799ef8
2 changed files with 15 additions and 1 deletions
|
@ -2,6 +2,7 @@ def call(branchOverride) {
|
||||||
def repoInfo = [
|
def repoInfo = [
|
||||||
branch: branchOverride ?: env.ghprbSourceBranch,
|
branch: branchOverride ?: env.ghprbSourceBranch,
|
||||||
targetBranch: env.ghprbTargetBranch,
|
targetBranch: env.ghprbTargetBranch,
|
||||||
|
targetsTrackedBranch: true
|
||||||
]
|
]
|
||||||
|
|
||||||
if (repoInfo.branch == null) {
|
if (repoInfo.branch == null) {
|
||||||
|
@ -35,6 +36,10 @@ def call(branchOverride) {
|
||||||
label: "determining merge point with '${repoInfo.targetBranch}' at origin",
|
label: "determining merge point with '${repoInfo.targetBranch}' at origin",
|
||||||
returnStdout: true
|
returnStdout: true
|
||||||
).trim()
|
).trim()
|
||||||
|
|
||||||
|
def pkgJson = readFile("package.json")
|
||||||
|
def releaseBranch = toJSON(pkgJson).branch
|
||||||
|
repoInfo.targetsTrackedBranch = releaseBranch == repoInfo.targetBranch
|
||||||
}
|
}
|
||||||
|
|
||||||
print "repoInfo: ${repoInfo}"
|
print "repoInfo: ${repoInfo}"
|
||||||
|
|
|
@ -149,7 +149,7 @@ def getTestFailuresMessage() {
|
||||||
def getBuildStatusIncludingMetrics() {
|
def getBuildStatusIncludingMetrics() {
|
||||||
def status = buildUtils.getBuildStatus()
|
def status = buildUtils.getBuildStatus()
|
||||||
|
|
||||||
if (status == 'SUCCESS' && !ciStats.getMetricsSuccess()) {
|
if (status == 'SUCCESS' && shouldCheckCiMetricSuccess() && !ciStats.getMetricsSuccess()) {
|
||||||
return 'FAILURE'
|
return 'FAILURE'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -297,3 +297,12 @@ def getFailedSteps() {
|
||||||
step.displayName != 'Check out from version control'
|
step.displayName != 'Check out from version control'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def shouldCheckCiMetricSuccess() {
|
||||||
|
// disable ciMetrics success check when a PR is targetting a non-tracked branch
|
||||||
|
if (buildState.has('checkoutInfo') && !buildState.get('checkoutInfo').targetsTrackedBranch) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue