From d34bf31bf7b8ae53dc5bc161306b13b478744086 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 27 Oct 2020 16:39:39 +0000 Subject: [PATCH] [CI][flaky] Support 7.x branches and PRs --- Jenkinsfile | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index ab40d182e81e..d7eae69e8bf3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -129,15 +129,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.