From 44f0913267621b8da06f288f8ece02db2b07a465 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Wed, 14 Apr 2021 10:23:26 +0200 Subject: [PATCH 1/2] fix: add NodeJS to PATH (#1035) * fix: add NodeJS to PATH * fix: use proper Github API for retrieving the comment by ID * chore: use existing step from the shared library --- .ci/e2eKibana.groovy | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/.ci/e2eKibana.groovy b/.ci/e2eKibana.groovy index f9c833623d..b285e69c4f 100644 --- a/.ci/e2eKibana.groovy +++ b/.ci/e2eKibana.groovy @@ -48,6 +48,10 @@ pipeline { stages { stage('Process GitHub Event') { agent { label 'ubuntu-20' } + environment { + HOME = "${env.WORKSPACE}/${BASE_DIR}" + PATH = "${env.HOME}/bin:${env.HOME}/node_modules:${env.HOME}/node_modules/.bin:${env.PATH}" + } steps { checkPermissions() buildKibanaDockerImage(refspec: getBranch()) @@ -65,7 +69,7 @@ def checkPermissions(){ error("Only PRs from Elasticians can be tested with Fleet E2E tests") } - if(!hasCommentAuthorWritePermissions(env.GT_PR, env.GT_COMMENT_ID)){ + if(!hasCommentAuthorWritePermissions(repoName: 'elastic/kibana', commentId: env.GT_COMMENT_ID)){ error("Only Elasticians can trigger Fleet E2E tests") } } @@ -88,16 +92,6 @@ def getDockerTag(){ return "pr${params.kibana_pr}" } -def hasCommentAuthorWritePermissions(prId, commentId){ - def repoName = "elastic/kibana" - def token = getGithubToken() - def url = "https://api.github.com/repos/${repoName}/issues/${prId}/comments/${commentId}" - def comment = githubApiCall(token: token, url: url, noCache: true) - def json = githubRepoGetUserPermission(token: token, repo: repoName, user: comment?.user?.login) - - return json?.permission == 'admin' || json?.permission == 'write' -} - def runE2ETests(String suite) { log(level: 'DEBUG', text: "Triggering '${suite}' E2E tests for PR-${env.GT_PR}.") From a2a52ba431e0496e7a52b681be03be9e7706a516 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Wed, 14 Apr 2021 13:10:58 +0200 Subject: [PATCH 2/2] fix: apply X version for non-master branches (#1037) --- .ci/e2eKibana.groovy | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.ci/e2eKibana.groovy b/.ci/e2eKibana.groovy index b285e69c4f..9ac52601ed 100644 --- a/.ci/e2eKibana.groovy +++ b/.ci/e2eKibana.groovy @@ -96,7 +96,10 @@ def runE2ETests(String suite) { log(level: 'DEBUG', text: "Triggering '${suite}' E2E tests for PR-${env.GT_PR}.") // Kibana's maintenance branches follow the 7.11, 7.12 schema. - def branchName = "${env.GT_BASE_REF}.x" + def branchName = "${env.GT_BASE_REF}" + if (${env.GT_BASE_REF} != "master") { + branchName = "${env.GT_BASE_REF}.x" + } def e2eTestsPipeline = "e2e-tests/e2e-testing-mbp/${branchName}" def parameters = [