From f5c49305dcfba923836de4b5da25779f0e088a03 Mon Sep 17 00:00:00 2001 From: Cas Donoghue Date: Sat, 1 Nov 2025 09:16:35 -0700 Subject: [PATCH 1/2] Backport smart exhaustive tests (#18386) * feat(ci): support exhaustive tests for PRs (code changes or GH comment) (#18327) * bk: fix regex and add new file (#18382) * bk(smart exhaustive tests): tune the steps to support GH comments and changesets (#18383) * chore: remove test file for exhaustive tests and normalise github commands (#18384) --------- Co-authored-by: Victor Martinez (cherry picked from commit 906d5bd63e24c28f7e9e53bb8efa04780f8f7397) # Conflicts: # .buildkite/pull-requests.json --- .buildkite/pull-requests.json | 68 +++++++++++++++++++ .../smart_exhaustive_tests_pipeline.yml | 31 +++++++++ catalog-info.yaml | 51 ++++++++++++++ 3 files changed, 150 insertions(+) create mode 100644 .buildkite/smart_exhaustive_tests_pipeline.yml diff --git a/.buildkite/pull-requests.json b/.buildkite/pull-requests.json index 03d61a9b23..69554dbdf3 100644 --- a/.buildkite/pull-requests.json +++ b/.buildkite/pull-requests.json @@ -1,4 +1,5 @@ { +<<<<<<< HEAD "jobs": [ { "enabled": true, @@ -20,3 +21,70 @@ } ] } +======= + "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$", + "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/", + "^ci/acceptance_tests.sh" + ] + } + ] +} +>>>>>>> 906d5bd6 (Backport smart exhaustive tests (#18386)) diff --git a/.buildkite/smart_exhaustive_tests_pipeline.yml b/.buildkite/smart_exhaustive_tests_pipeline.yml new file mode 100644 index 0000000000..61021283f4 --- /dev/null +++ b/.buildkite/smart_exhaustive_tests_pipeline.yml @@ -0,0 +1,31 @@ +steps: + - label: "Trigger logstash-exhaustive-tests-pipeline for PRs with qa/acceptance/ changes" + if: build.pull_request.id != null && build.env("GITHUB_PR_TRIGGER_COMMENT") != "run exhaustive tests" + plugins: + - monorepo-diff#v1.0.1: + diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD" + interpolation: false + watch: + - path: + - ^qa/acceptance/ + - ^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}" + ELASTIC_SLACK_NOTIFICATIONS_ENABLED: false + + - label: "Trigger logstash-exhaustive-tests-pipeline for GitHub comments" + if: build.env("GITHUB_PR_TRIGGER_COMMENT") == "run exhaustive tests" + trigger: "logstash-exhaustive-tests-pipeline" + build: + commit: "HEAD" + branch: "pull/${BUILDKITE_PULL_REQUEST}/merge" + env: + BUILDKITE_PULL_REQUEST: "${BUILDKITE_PULL_REQUEST}" + ELASTIC_SLACK_NOTIFICATIONS_ENABLED: false diff --git a/catalog-info.yaml b/catalog-info.yaml index d9605574f3..7df5f86765 100644 --- a/catalog-info.yaml +++ b/catalog-info.yaml @@ -476,6 +476,57 @@ spec: # SECTION END: Exhaustive tests pipeline # ************************************** +# **************************************** +# SECTION START: Smart exhaustive tests pipeline +# **************************************** + +--- +# yaml-language-server: $schema=https://gist.githubusercontent.com/elasticmachine/988b80dae436cafea07d9a4a460a011d/raw/rre.schema.json +apiVersion: backstage.io/v1alpha1 +kind: Resource +metadata: + name: logstash-smart-exhaustive-tests-pipeline + description: 'Logstash Smart Exhaustive tests pipeline' + links: + - title: 'Logstash Smart Exhaustive tests pipeline' + url: https://buildkite.com/elastic/logstash-smart-exhaustive-tests-pipeline +spec: + type: buildkite-pipeline + owner: group:logstash + system: platform-ingest + implementation: + apiVersion: buildkite.elastic.dev/v1 + kind: Pipeline + metadata: + name: "Logstash Smart Exhaustive tests pipeline" + description: '🔍 Run smart exhaustive tests against Logstash using different operating systems' + spec: + repository: elastic/logstash + pipeline_file: ".buildkite/smart_exhaustive_tests_pipeline.yml" + provider_settings: + build_pull_request_forks: false + build_pull_requests: true # requires filter_enabled and filter_condition settings as below when used with buildkite-pr-bot + build_branches: false + build_tags: false + filter_enabled: true + filter_condition: >- + build.creator.name == 'elasticmachine' && build.pull_request.id != null + cancel_intermediate_builds: true + skip_intermediate_builds: true + teams: + ingest-fp: + access_level: MANAGE_BUILD_AND_READ + logstash: + access_level: MANAGE_BUILD_AND_READ + ingest-eng-prod: + access_level: MANAGE_BUILD_AND_READ + everyone: + access_level: READ_ONLY + +# ************************************** +# SECTION END: Smart exhaustive tests pipeline +# ************************************** + # ******************************************** # Declare supported plugin tests pipeline # ******************************************** From 2eee7755e6530d09d04ee80e7bfe8c24498b5677 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Sun, 2 Nov 2025 11:18:38 +0100 Subject: [PATCH 2/2] fix --- .buildkite/pull-requests.json | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/.buildkite/pull-requests.json b/.buildkite/pull-requests.json index 69554dbdf3..b35882d6d6 100644 --- a/.buildkite/pull-requests.json +++ b/.buildkite/pull-requests.json @@ -1,27 +1,4 @@ { -<<<<<<< HEAD - "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": [ - "^docs/" - ], - "always_require_ci_on_changed": [ ] - } - ] - } -======= "jobs": [ { "enabled": true, @@ -87,4 +64,3 @@ } ] } ->>>>>>> 906d5bd6 (Backport smart exhaustive tests (#18386))