From 12913fb55f0c733414840821c5406dc6d4443785 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Mon, 19 Apr 2021 11:03:09 +0200 Subject: [PATCH 1/2] fix: do not use GT_REPO variable, use fixed repo name Because the repo is always Kibana, let's use it --- .ci/e2eKibana.groovy | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.ci/e2eKibana.groovy b/.ci/e2eKibana.groovy index 448fe53925..ede544df5c 100644 --- a/.ci/e2eKibana.groovy +++ b/.ci/e2eKibana.groovy @@ -7,6 +7,7 @@ pipeline { environment { REPO = 'kibana' BASE_DIR = "src/github.com/elastic/${env.REPO}" + ELASTIC_REPO = "elastic/${env.REPO}" GITHUB_APP_SECRET = 'secret/observability-team/ci/github-app' GITHUB_CHECK_E2E_TESTS_NAME = 'E2E Tests' PIPELINE_LOG_LEVEL = "INFO" @@ -70,7 +71,7 @@ def checkPermissions(){ error("Only PRs from Elasticians can be tested with Fleet E2E tests") } - if(!hasCommentAuthorWritePermissions(repoName: 'elastic/kibana', commentId: env.GT_COMMENT_ID)){ + if(!hasCommentAuthorWritePermissions(repoName: "${env.ELASTIC_REPO}", commentId: env.GT_COMMENT_ID)){ error("Only Elasticians can trigger Fleet E2E tests") } } @@ -94,7 +95,7 @@ def runE2ETests(String suite) { def prID = getID() def token = githubAppToken(secret: "${env.GITHUB_APP_SECRET}") - def pullRequest = githubApiCall(token: token, url: "https://api.github.com/repos/${env.GT_REPO}/pulls/${prID}") + def pullRequest = githubApiCall(token: token, url: "https://api.github.com/repos/${env.ELASTIC_REPO}/pulls/${prID}") def baseRef = pullRequest?.base?.ref def headSha = pullRequest?.head?.sha From 4316c17243ca96a482d27dba27a76e7a30c20ea5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Mon, 19 Apr 2021 11:03:22 +0200 Subject: [PATCH 2/2] chore: remove unused echo --- .ci/e2eKibana.groovy | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.ci/e2eKibana.groovy b/.ci/e2eKibana.groovy index ede544df5c..33777a0cd9 100644 --- a/.ci/e2eKibana.groovy +++ b/.ci/e2eKibana.groovy @@ -29,8 +29,7 @@ pipeline { [key: 'GT_REPO', value: '$.repository.full_name'], [key: 'GT_PR', value: '$.issue.number'], [key: 'GT_BODY', value: '$.comment.body'], - [key: 'GT_COMMENT_ID', value: '$.comment.id'], - [key: 'GT_PAYLOAD', value: '$'] + [key: 'GT_COMMENT_ID', value: '$.comment.id'] ], genericHeaderVariables: [ [key: 'x-github-event', regexpFilter: 'comment'] @@ -54,7 +53,6 @@ pipeline { PATH = "${env.HOME}/bin:${env.HOME}/node_modules:${env.HOME}/node_modules/.bin:${env.PATH}" } steps { - echo(message: "$env.GT_PAYLOAD") checkPermissions() buildKibanaDockerImage(refspec: getBranch()) catchError(buildResult: 'UNSTABLE', message: 'Unable to run e2e tests', stageResult: 'FAILURE') {