diff --git a/Jenkinsfile b/Jenkinsfile index 4c8f126b4883b..db5ae306e6e2e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,7 +6,7 @@ kibanaLibrary.load() kibanaPipeline(timeoutMinutes: 210, checkPrChanges: true, setCommitStatus: true) { slackNotifications.onFailure(disabled: !params.NOTIFY_ON_FAILURE) { githubPr.withDefaultPrComments { - ciStats.trackBuild(requireSuccess: githubPr.isPr()) { + ciStats.trackBuild(requireSuccess: githubPr.isTrackedBranchPr()) { catchError { retryable.enable() kibanaPipeline.allCiTasks() diff --git a/vars/githubPr.groovy b/vars/githubPr.groovy index a2a3a81f253a0..594d54f2c5b5e 100644 --- a/vars/githubPr.groovy +++ b/vars/githubPr.groovy @@ -64,6 +64,10 @@ def isPr() { return !!(env.ghprbPullId && env.ghprbPullLink && env.ghprbPullLink =~ /\/elastic\/kibana\//) } +def isTrackedBranchPr() { + return isPr() && (env.ghprbTargetBranch == 'master' || env.ghprbTargetBranch == '6.8' || env.ghprbTargetBranch =~ /[7-8]\.[x0-9]+/) +} + def getLatestBuildComment() { return getComments() .reverse() @@ -234,8 +238,10 @@ def getNextCommentMessage(previousCommentInfo = [:], isFinal = false) { messages << getTestFailuresMessage() - if (isFinal) { - messages << ciStats.getMetricsReport() + catchErrors { + if (isFinal && isTrackedBranchPr()) { + messages << ciStats.getMetricsReport() + } } if (info.builds && info.builds.size() > 0) {