[CI] Don't do CI stats reporting/failures for feature branch PRs (#99668)

This commit is contained in:
Brian Seeders 2021-05-10 16:38:32 -04:00 committed by GitHub
parent 38116e89fd
commit 7262ac53c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 3 deletions

2
Jenkinsfile vendored
View file

@ -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()

View file

@ -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) {