From f111211d26afd194945fa048bccedcb63cb94362 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Wed, 28 Oct 2020 16:28:18 +0000 Subject: [PATCH] [CI][flaky] Support 7.x branches and PRs (#22197) (#22229) --- Jenkinsfile | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index f90178d79da5..176d35272c75 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.