diff --git a/Jenkinsfile b/Jenkinsfile index f90178d79da..176d35272c7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -130,15 +130,41 @@ pipeline { cleanup { // Required to enable the flaky test reporting with GitHub. Workspace exists since the post/always runs earlier dir("${BASE_DIR}"){ - // TODO analyzeFlakey does not support other release branches but the master branch. notifyBuildResult(prComment: true, slackComment: true, slackNotify: (isBranch() || isTag()), - analyzeFlakey: true, flakyReportIdx: "reporter-beats-beats-master") + analyzeFlakey: !isTag(), flakyReportIdx: "reporter-beats-beats-${getIdSuffix()}") } } } } +/** +* There are only two supported branches, master and 7.x +*/ +def getIdSuffix() { + if(isPR()) { + return getBranchIndice(env.CHANGE_TARGET) + } + if(isBranch()) { + return getBranchIndice(env.BRANCH_NAME) + } +} + +/** +* There are only two supported branches, master and 7.x +*/ +def getBranchIndice(String compare) { + if (compare?.equals('master') || compare.equals('7.x')) { + return compare + } else { + if (compare.startsWith('7.')) { + return '7.x' + } + } + return 'master' +} + + /** * This method is the one used for running the parallel stages, therefore * its arguments are passed by the beatsStages step.