-
Notifications
You must be signed in to change notification settings - Fork 3.5k
feat(ci): support exhaustive tests for PRs (code changes or GH comment) #18327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,26 +1,66 @@ | ||
| { | ||
| "jobs": [ | ||
| { | ||
| "enabled": true, | ||
| "pipeline_slug": "logstash-pull-request-pipeline", | ||
| "allow_org_users": true, | ||
| "allowed_repo_permissions": ["admin", "write"], | ||
| "allowed_list": ["dependabot[bot]", "mergify[bot]", "github-actions[bot]", "elastic-vault-github-plugin-prod[bot]"], | ||
| "set_commit_status": true, | ||
| "build_on_commit": true, | ||
| "build_on_comment": true, | ||
| "trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it))", | ||
| "always_trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it))", | ||
| "skip_ci_labels": [ ], | ||
| "skip_target_branches": [ ], | ||
| "skip_ci_on_only_changed": [ | ||
| "^.github/", | ||
| "^docs/", | ||
| "^.mergify.yml$", | ||
| "^.pre-commit-config.yaml", | ||
| "\\.md$" | ||
| ], | ||
| "always_require_ci_on_changed": [ ] | ||
| } | ||
| ] | ||
| } | ||
| "jobs": [ | ||
| { | ||
| "enabled": true, | ||
| "pipeline_slug": "logstash-pull-request-pipeline", | ||
| "allow_org_users": true, | ||
| "allowed_repo_permissions": [ | ||
| "admin", | ||
| "write" | ||
| ], | ||
| "allowed_list": [ | ||
| "dependabot[bot]", | ||
| "mergify[bot]", | ||
| "github-actions[bot]", | ||
| "elastic-vault-github-plugin-prod[bot]" | ||
| ], | ||
| "set_commit_status": true, | ||
| "build_on_commit": true, | ||
| "build_on_comment": true, | ||
| "trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it))", | ||
| "always_trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it))", | ||
| "skip_ci_labels": [], | ||
| "skip_target_branches": [], | ||
| "skip_ci_on_only_changed": [ | ||
| "^.github/", | ||
| "^docs/", | ||
| "^.mergify.yml$", | ||
| "^.pre-commit-config.yaml", | ||
| "\\.md$" | ||
| ], | ||
| "always_require_ci_on_changed": [] | ||
| }, | ||
| { | ||
| "enabled": true, | ||
| "pipeline_slug": "logstash-smart-exhaustive-tests-pipeline", | ||
| "allow_org_users": true, | ||
| "allowed_repo_permissions": [ | ||
| "admin", | ||
| "write" | ||
| ], | ||
| "allowed_list": [ | ||
| "dependabot[bot]", | ||
| "mergify[bot]", | ||
| "github-actions[bot]" | ||
| ], | ||
| "set_commit_status": true, | ||
| "build_on_commit": true, | ||
| "build_on_comment": true, | ||
| "trigger_comment_regex": "^/?run\s+exhaustive\s+tests$", | ||
| "always_trigger_comment_regex": "^/?run\s+exhaustive\s+tests$", | ||
| "always_trigger_comment_regex": "^(?:(?:/run\\W+)(?:exhaustive)\\W+(?:tests))", | ||
| "skip_ci_labels": [], | ||
| "skip_target_branches": [], | ||
| "skip_ci_on_only_changed": [ | ||
| "^.github/", | ||
| "^docs/", | ||
| "^.mergify.yml$", | ||
| "^.pre-commit-config.yaml", | ||
| "\\.md$" | ||
| ], | ||
| "always_require_ci_on_changed": [ | ||
| "^qa/acceptance/" | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| steps: | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As long as the BK pr bot does not support running the very first build for PRs. We use this intermediate pipeline. This will help with running faster builds regardless, although it adds the complexity for maintaining a new pipeline. |
||
| - label: "Trigger logstash-exhaustive-tests-pipeline for PRs with qa/acceptance/ changes" | ||
| if: build.pull_request.id != null | ||
| plugins: | ||
| - monorepo-diff#v1.0.1: | ||
| diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD" | ||
| interpolation: false | ||
| watch: | ||
| - path: | ||
| - ^qa/acceptance/ | ||
|
v1v marked this conversation as resolved.
|
||
| - ^ci/acceptance_tests.sh | ||
| - .buildkite/smart_exhaustive_tests_pipeline.yml | ||
| config: | ||
| trigger: "logstash-exhaustive-tests-pipeline" | ||
| build: | ||
| commit: "${BUILDKITE_COMMIT}" | ||
| branch: "${BUILDKITE_BRANCH}" | ||
| env: | ||
| - BUILDKITE_PULL_REQUEST=${BUILDKITE_PULL_REQUEST} | ||
| - BUILDKITE_PULL_REQUEST_BASE_BRANCH=${BUILDKITE_PULL_REQUEST_BASE_BRANCH} | ||
| - GITHUB_PR_LABELS=${GITHUB_PR_LABELS} | ||
| - ELASTIC_SLACK_NOTIFICATIONS_ENABLE=false | ||
|
|
||
| - label: "Trigger logstash-exhaustive-tests-pipeline for GitHub comments" | ||
| if: build.env("GITHUB_PR_TRIGGER_COMMENT") != "" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What happens if a file has changed in the
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Two different events:
Each event should be treated independently. Otherwise, what do you mean by your question?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Understood. We want to execute the tests in both cases and every time when push and the right files have changed or when a comment that matches has made. |
||
| trigger: "logstash-exhaustive-tests-pipeline" | ||
| build: | ||
| commit: "${BUILDKITE_COMMIT}" | ||
| branch: "${BUILDKITE_BRANCH}" | ||
| env: | ||
| - BUILDKITE_PULL_REQUEST=${BUILDKITE_PULL_REQUEST} | ||
| - BUILDKITE_PULL_REQUEST_BASE_BRANCH=${BUILDKITE_PULL_REQUEST_BASE_BRANCH} | ||
| - GITHUB_PR_LABELS=${GITHUB_PR_LABELS} | ||
| - ELASTIC_SLACK_NOTIFICATIONS_ENABLE=false | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is
"elastic-vault-github-plugin-prod[bot]"included here byt not forlogstash-smart-exhaustive-tests-pipeline?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was already there, no idea the rationale, but I think we don't need it in this case in the new pipeline.
That's the GH ephemeral token app. I don't think PRs created by that user affect any files that could trigger
lostash-smart-exhaustive-tests-pipeline.