From fdc46f3bd9f1a6202d97484adbe1b687b5741391 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Fri, 14 Jun 2024 15:12:48 +0000 Subject: [PATCH] [8.14](backport #4906) [CI] Monorepo diff plugin for integration tests (#4922) * [CI] Monorepo diff plugin for integration tests (#4906) * [CI] Monorepo diff plugin for integration tests * [CI] Monorepo diff plugin for integration tests * [CI] Monorepo diff plugin for integration tests * [CI] Monorepo diff plugin for integration tests * Debug * Debug * Debug * Debug * Debug * Debug * Debug * Debug * Debug * Debug * Cleanup * Cleanup * added missing watch paths (cherry picked from commit fd8d1ee1a01bdd5cbde408f047c20699d432f8be) # Conflicts: # .buildkite/pull-requests.json * Fixed conflicts * Fixed conflicts --------- Co-authored-by: Pavel Zorin --- .buildkite/pipeline.yml | 48 +++++++++++++++++++++++++++++++++++ .buildkite/pull-requests.json | 8 +++--- 2 files changed, 52 insertions(+), 4 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 6c73bf31c09..daeacdebe67 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -232,3 +232,51 @@ steps: image: "family/core-ubuntu-2204" env: - GH_VERSION=2.4.0 + + # Trigger for pull requests + - label: "Trigger Integration tests for Pull request" + if: | + (build.pull_request.id != null && !build.env("GITHUB_PR_LABELS") =~ /skip-it/) || + build.env("GITHUB_PR_TRIGGER_COMMENT") =~ /.*extended.*/ + + plugins: + - monorepo-diff#v1.0.1: + diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD" + watch: + - path: + - internal/ + - dev-tools/ + - pkg/ + - testing/ + - version/ + - specs/ + - .agent-versions.json + - .go-version + - .package-version + - go.mod + - go.sum + - magefile.go + - main.go + + - .buildkite/integration.pipeline.yml + - .buildkite/pipeline.yml + - .buildkite/scripts/ + - .buildkite/hooks/ + + config: + trigger: "elastic-agent-extended-testing" + 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} + + # Trigger for branches + - label: "Triggering Integration tests for branches" + if: build.pull_request.id == null + trigger: "elastic-agent-extended-testing" + build: + commit: "${BUILDKITE_COMMIT}" + branch: "${BUILDKITE_BRANCH}" diff --git a/.buildkite/pull-requests.json b/.buildkite/pull-requests.json index 6b6ef40b827..ea69758a384 100644 --- a/.buildkite/pull-requests.json +++ b/.buildkite/pull-requests.json @@ -9,11 +9,11 @@ "set_commit_status": true, "build_on_commit": true, "build_on_comment": true, - "trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it))|^/test$", - "always_trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it))|^/test$", - "skip_ci_labels": [ ], + "trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it|extended))|^/test\\W*(?:extended|)", + "always_trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it|extended))|^/test\\W*(?:extended|)", + "skip_ci_labels": [ "skip-ci" ], "skip_target_branches": [ ], - "skip_ci_on_only_changed": [ ], + "skip_ci_on_only_changed": [ "^.ci/", "^changelog", "^docs/", "\\.md$", "^docker-compose.yml", "^.pre-commit-config.yaml", "skaffold.yaml", "^Dockerfile.skaffold", "^Dockerfile"], "always_require_ci_on_changed": [ ] }, {