Skip to content
This repository was archived by the owner on Sep 17, 2024. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .ci/e2eKibana.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ pipeline {
environment {
REPO = 'kibana'
BASE_DIR = "src/github.com/elastic/${env.REPO}"
ELASTIC_REPO = "elastic/${env.REPO}"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you use the the gitCheckout then ORG_NAME should be there and point to elastic:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are internally using gitCheckout in the buildKibana step, although it could be the case the image is already built and we skip that part

GITHUB_APP_SECRET = 'secret/observability-team/ci/github-app'
GITHUB_CHECK_E2E_TESTS_NAME = 'E2E Tests'
PIPELINE_LOG_LEVEL = "INFO"
Expand All @@ -28,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']
Expand All @@ -53,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') {
Expand All @@ -70,7 +69,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")
}
}
Expand All @@ -94,7 +93,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

Expand Down