Skip to content

Commit

Permalink
[CI] Don't do CI stats reporting/failures for feature branch PRs (#99668
Browse files Browse the repository at this point in the history
) (#99690)

Co-authored-by: Brian Seeders <[email protected]>
  • Loading branch information
kibanamachine and brianseeders authored May 10, 2021
1 parent a574539 commit 761dc11
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
10 changes: 8 additions & 2 deletions vars/githubPr.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 761dc11

Please sign in to comment.