From a65fa3bbafbd619530828de2fc676f93901fb309 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Fri, 28 Nov 2025 15:11:08 +0100 Subject: [PATCH 1/2] ci: use if_changed (#47775) (cherry picked from commit da79b6ecce2fd9cc9403f8041aea10616ba93c57) # Conflicts: # .buildkite/pipeline.yml --- .buildkite/pipeline.yml | 958 ++++++++++++++++++---------------------- 1 file changed, 440 insertions(+), 518 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 0b01341137ad..7e6fef462df0 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -1,34 +1,34 @@ # yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json steps: +<<<<<<< HEAD +======= + +>>>>>>> da79b6ecc (ci: use if_changed (#47775)) - label: "Trigger Auditbeat" if: build.pull_request.id != null - plugins: - - monorepo-diff#v1.5.1: - diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD" - interpolation: false - watch: - - path: - - .go-version - - auditbeat/ - - .buildkite/auditbeat/ - - .buildkite/scripts - - .buildkite/hooks/ - #OSS - - go.mod - - pytest.ini - - dev-tools/ - - libbeat/** - - testing/** - config: - trigger: "auditbeat" - 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} + if_changed: + include: + - ".go-version" + - "auditbeat/**" + - ".buildkite/auditbeat/**" + - .buildkite/pipeline.yml + - ".buildkite/scripts/**" + - ".buildkite/hooks/**" + #OSS + - "go.mod" + - "pytest.ini" + - "dev-tools/**" + - "libbeat/**" + - "testing/**" + trigger: "auditbeat" + 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} - label: "Triggering Build for Auditbeat" if: build.pull_request.id == null @@ -39,32 +39,28 @@ steps: - label: "Trigger Heartbeat" if: build.pull_request.id != null - plugins: - - monorepo-diff#v1.5.1: - diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD" - interpolation: false - watch: - - path: - - .go-version - - heartbeat/ - - .buildkite/heartbeat/ - - .buildkite/scripts - - .buildkite/hooks/ - #OSS - - go.mod - - pytest.ini - - dev-tools/ - - libbeat/** - - testing/** - config: - trigger: "heartbeat" - 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} + if_changed: + include: + - .go-version + - heartbeat/** + - .buildkite/heartbeat/** + - .buildkite/pipeline.yml + - .buildkite/scripts/** + - .buildkite/hooks/** + #OSS + - go.mod + - pytest.ini + - dev-tools/** + - libbeat/** + - testing/** + trigger: "heartbeat" + 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} - label: "Triggering Build for Heartbeat" if: build.pull_request.id == null @@ -75,33 +71,29 @@ steps: - label: "Trigger Filebeat" if: build.pull_request.id != null - plugins: - - monorepo-diff#v1.5.1: - diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD" - interpolation: false - watch: - - path: - - .go-version - - filebeat/ - - .buildkite/filebeat/ - # CI related scripts - - .buildkite/scripts - - .buildkite/hooks/ - #OSS - - go.mod - - pytest.ini - - dev-tools - - libbeat/** - - testing/** - config: - trigger: "filebeat" - 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} + if_changed: + include: + - .go-version + - filebeat/ + - .buildkite/filebeat/ + # CI related scripts + - .buildkite/pipeline.yml + - .buildkite/scripts/** + - .buildkite/hooks/** + #OSS + - go.mod + - pytest.ini + - dev-tools + - libbeat/** + - testing/** + trigger: "filebeat" + 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} - label: "Triggering Build for Filebeat" if: build.pull_request.id == null @@ -112,35 +104,31 @@ steps: - label: "Trigger x-pack/filebeat" if: build.pull_request.id != null - plugins: - - monorepo-diff#v1.5.1: - diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD" - interpolation: false - watch: - - path: - - .go-version - - filebeat/ - - x-pack/filebeat/ - - x-pack/libbeat/ - - .buildkite/x-pack/pipeline.xpack.filebeat.yml - - .buildkite/scripts - - .buildkite/hooks/ - - .buildkite/deploy/docker/docker-compose.yml - #OSS - - go.mod - - pytest.ini - - dev-tools/ - - libbeat/** - - testing/** - config: - trigger: "beats-xpack-filebeat" - 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} + if_changed: + include: + - .go-version + - filebeat/ + - x-pack/filebeat/ + - x-pack/libbeat/** + - .buildkite/x-pack/pipeline.xpack.filebeat.yml + - .buildkite/pipeline.yml + - .buildkite/scripts/** + - .buildkite/hooks/** + - .buildkite/deploy/docker/docker-compose.yml + #OSS + - go.mod + - pytest.ini + - dev-tools/** + - libbeat/** + - testing/** + trigger: "beats-xpack-filebeat" + 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} - label: "Triggering Build for x-pack/filebeat" if: build.pull_request.id == null @@ -151,32 +139,28 @@ steps: - label: "Trigger x-pack/dockerlogbeat" if: build.pull_request.id != null - plugins: - - monorepo-diff#v1.5.1: - diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD" - interpolation: false - watch: - - path: - - .go-version - - x-pack/dockerlogbeat/ - - .buildkite/x-pack/pipeline.xpack.dockerlogbeat.yml - - .buildkite/hooks/ - - .buildkite/scripts - #OSS - - go.mod - - pytest.ini - - dev-tools/ - - libbeat/** - - testing/** - config: - trigger: "beats-xpack-dockerlogbeat" - 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} + if_changed: + include: + - .go-version + - x-pack/dockerlogbeat/ + - .buildkite/x-pack/pipeline.xpack.dockerlogbeat.yml + - .buildkite/pipeline.yml + - .buildkite/hooks/** + - .buildkite/scripts/** + #OSS + - go.mod + - pytest.ini + - dev-tools/** + - libbeat/** + - testing/** + trigger: "beats-xpack-dockerlogbeat" + 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} - label: "Triggering Build for x-pack/dockerlogbeat" if: build.pull_request.id == null @@ -187,32 +171,28 @@ steps: - label: "Trigger Metricbeat" if: build.pull_request.id != null - plugins: - - monorepo-diff#v1.5.1: - diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD" - interpolation: false - watch: - - path: - - .go-version - - metricbeat/ - - .buildkite/metricbeat/ - - .buildkite/scripts - - .buildkite/hooks/ - #OSS - - go.mod - - pytest.ini - - dev-tools/ - - libbeat/** - - testing/** - config: - trigger: "beats-metricbeat" - 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} + if_changed: + include: + - .go-version + - metricbeat/** + - .buildkite/metricbeat/ + - .buildkite/pipeline.yml + - .buildkite/scripts/** + - .buildkite/hooks/** + #OSS + - go.mod + - pytest.ini + - dev-tools/** + - libbeat/** + - testing/** + trigger: "beats-metricbeat" + 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} - label: "Triggering Build for Metricbeat" if: build.pull_request.id == null @@ -223,35 +203,31 @@ steps: - label: "Trigger x-pack/metricbeat" if: build.pull_request.id != null - plugins: - - monorepo-diff#v1.5.1: - diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD" - interpolation: false - watch: - - path: - - .go-version - - metricbeat/ - - x-pack/metricbeat/ - - x-pack/libbeat/common/aws - - .buildkite/x-pack/pipeline.xpack.metricbeat.yml - - .buildkite/scripts - - .buildkite/hooks/ - - .buildkite/deploy/docker/docker-compose.yml - #OSS - - go.mod - - pytest.ini - - dev-tools/ - - libbeat/** - - testing/** - config: - trigger: "beats-xpack-metricbeat" - 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} + if_changed: + include: + - .go-version + - metricbeat/** + - x-pack/metricbeat/** + - x-pack/libbeat/common/aws + - .buildkite/x-pack/pipeline.xpack.metricbeat.yml + - .buildkite/pipeline.yml + - .buildkite/scripts/** + - .buildkite/hooks/** + - .buildkite/deploy/docker/docker-compose.yml + #OSS + - go.mod + - pytest.ini + - dev-tools/** + - libbeat/** + - testing/** + trigger: "beats-xpack-metricbeat" + 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} - label: "Triggering Build for x-pack/metricbeat" if: build.pull_request.id == null @@ -262,35 +238,31 @@ steps: - label: "Trigger x-pack/osquerybeat" if: build.pull_request.id != null - plugins: - - monorepo-diff#v1.5.1: - diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD" - interpolation: false - watch: - - path: - - .go-version - - x-pack/osquerybeat/** - - .buildkite/x-pack/pipeline.xpack.osquerybeat.yml - - .buildkite/scripts/** - - .buildkite/hooks/** - # x-pack - - libbeat/** - - x-pack/libbeat/** - #OSS - - go.mod - - pytest.ini - - dev-tools/ - - libbeat/** - - testing/** - config: - trigger: "beats-xpack-osquerybeat" - 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} + if_changed: + include: + - .go-version + - x-pack/osquerybeat/** + - .buildkite/x-pack/pipeline.xpack.osquerybeat.yml + - .buildkite/pipeline.yml + - .buildkite/scripts/** + - .buildkite/hooks/** + # x-pack + - libbeat/** + - x-pack/libbeat/** + #OSS + - go.mod + - pytest.ini + - dev-tools/** + - libbeat/** + - testing/** + trigger: "beats-xpack-osquerybeat" + 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} - label: "Triggering Build for x-pack/osquerybeat" if: build.pull_request.id == null @@ -301,33 +273,29 @@ steps: - label: "Trigger x-pack/winlogbeat" if: build.pull_request.id != null - plugins: - - monorepo-diff#v1.5.1: - diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD" - interpolation: false - watch: - - path: - - .go-version - - winlogbeat/ - - x-pack/winlogbeat/ - - .buildkite/x-pack/pipeline.xpack.winlogbeat.yml - - .buildkite/scripts - - .buildkite/hooks/ - #OSS - - go.mod - - pytest.ini - - dev-tools/** - - libbeat/** - - testing/** - config: - trigger: "beats-xpack-winlogbeat" - 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} + if_changed: + include: + - .go-version + - winlogbeat/** + - x-pack/winlogbeat/** + - .buildkite/x-pack/pipeline.xpack.winlogbeat.yml + - .buildkite/pipeline.yml + - .buildkite/scripts/** + - .buildkite/hooks/** + #OSS + - go.mod + - pytest.ini + - dev-tools/** + - libbeat/** + - testing/** + trigger: "beats-xpack-winlogbeat" + 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} - label: "Triggering Build for x-pack/winlogbeat" if: build.pull_request.id == null @@ -338,28 +306,24 @@ steps: - label: "Trigger Deploy/K8S" if: build.pull_request.id != null - plugins: - - monorepo-diff#v1.5.1: - diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD" - interpolation: false - watch: - - path: - - .go-version - - .buildkite/deploy/kubernetes/** - - .buildkite/hooks/ - - .buildkite/scripts - - deploy/kubernetes/** - - metricbeat/module/kubernetes/** - - libbeat/docs/version.asciidoc - config: - trigger: "deploy-k8s" - 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} + if_changed: + include: + - .go-version + - .buildkite/deploy/kubernetes/** + - .buildkite/pipeline.yml + - .buildkite/hooks/** + - .buildkite/scripts/** + - deploy/kubernetes/** + - metricbeat/module/kubernetes/** + - libbeat/docs/version.asciidoc + trigger: "deploy-k8s" + 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} - label: "Triggering Build for Deploy/K8S" if: build.pull_request.id == null @@ -370,31 +334,27 @@ steps: - label: "Trigger Libbeat" if: build.pull_request.id != null - plugins: - - monorepo-diff#v1.5.1: - diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD" - interpolation: false - watch: - - path: - - .go-version - - libbeat/ - - .buildkite/libbeat/pipeline.libbeat.yml - - .buildkite/scripts - - .buildkite/hooks - #OSS - - go.mod - - pytest.ini - - dev-tools/ - - testing/ - config: - trigger: "beats-libbeat" - 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} + if_changed: + include: + - .go-version + - libbeat/** + - .buildkite/libbeat/pipeline.libbeat.yml + - .buildkite/pipeline.yml + - .buildkite/scripts/** + - .buildkite/hooks/** + #OSS + - go.mod + - pytest.ini + - dev-tools/** + - testing/** + trigger: "beats-libbeat" + 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} - label: "Triggering Build for Libbeat" if: build.pull_request.id == null @@ -405,33 +365,29 @@ steps: - label: "Trigger x-pack/libbeat" if: build.pull_request.id != null - plugins: - - monorepo-diff#v1.5.1: - diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD" - interpolation: false - watch: - - path: - - .go-version - - libbeat/ - - x-pack/libbeat/ - - .buildkite/x-pack/pipeline.xpack.libbeat.yml - - .buildkite/scripts - - .buildkite/hooks - # x-pack - - go.mod - - pytest.ini - - dev-tools/ - - libbeat/ - - testing/ - config: - trigger: "beats-xpack-libbeat" - 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} + if_changed: + include: + - .go-version + - libbeat/** + - x-pack/libbeat/** + - .buildkite/x-pack/pipeline.xpack.libbeat.yml + - .buildkite/pipeline.yml + - .buildkite/scripts/** + - .buildkite/hooks/** + # x-pack + - go.mod + - pytest.ini + - dev-tools/** + - libbeat/** + - testing/** + trigger: "beats-xpack-libbeat" + 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} - label: "Triggering Build for x-pack/libbeat" if: build.pull_request.id == null @@ -442,29 +398,25 @@ steps: - label: "Trigger x-pack/otel" if: build.pull_request.id != null - plugins: - - monorepo-diff#v1.5.1: - diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD" - interpolation: false - watch: - - path: - - .go-version - - x-pack/otel/ - - .buildkite/x-pack/pipeline.xpack.otel.yml - - .buildkite/scripts - - .buildkite/hooks - - go.mod - - dev-tools/ - - testing/ - config: - trigger: "beats-xpack-otel" - 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} + if_changed: + include: + - .go-version + - x-pack/otel/** + - .buildkite/x-pack/pipeline.xpack.otel.yml + - .buildkite/pipeline.yml + - .buildkite/scripts/** + - .buildkite/hooks/** + - go.mod + - dev-tools/** + - testing/** + trigger: "beats-xpack-otel" + 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} - label: "Triggering Build for x-pack/otel" if: build.pull_request.id == null @@ -475,34 +427,30 @@ steps: - label: "Trigger x-pack/auditbeat" if: build.pull_request.id != null - plugins: - - monorepo-diff#v1.5.1: - diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD" - interpolation: false - watch: - - path: - - .go-version - - auditbeat/ - - x-pack/auditbeat/ - - .buildkite/x-pack/pipeline.xpack.auditbeat.yml - - .buildkite/scripts/ - - .buildkite/hooks/ - # x-pack - - go.mod - - pytest.ini - - dev-tools/ - - libbeat/ - - testing/ - - x-pack/libbeat/ - config: - trigger: "beats-xpack-auditbeat" - 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} + if_changed: + include: + - .go-version + - auditbeat/** + - x-pack/auditbeat/ + - .buildkite/x-pack/pipeline.xpack.auditbeat.yml + - .buildkite/pipeline.yml + - .buildkite/scripts/** + - .buildkite/hooks/** + # x-pack + - go.mod + - pytest.ini + - dev-tools/** + - libbeat/** + - testing/** + - x-pack/libbeat/** + trigger: "beats-xpack-auditbeat" + 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} - label: "Triggering Build for x-pack/auditbeat" if: build.pull_request.id == null @@ -513,34 +461,30 @@ steps: - label: "Trigger x-pack/heartbeat" if: build.pull_request.id != null - plugins: - - monorepo-diff#v1.5.1: - diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD" - interpolation: false - watch: - - path: - - .go-version - - heartbeat/ - - x-pack/heartbeat/ - - .buildkite/x-pack/pipeline.xpack.heartbeat.yml - - .buildkite/scripts/ - - .buildkite/hooks/ - # x-pack - - go.mod - - pytest.ini - - dev-tools/ - - libbeat/ - - testing/ - - x-pack/libbeat/ - config: - trigger: "beats-xpack-heartbeat" - 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} + if_changed: + include: + - .go-version + - heartbeat/** + - x-pack/heartbeat/** + - .buildkite/x-pack/pipeline.xpack.heartbeat.yml + - .buildkite/pipeline.yml + - .buildkite/scripts/** + - .buildkite/hooks/** + # x-pack + - go.mod + - pytest.ini + - dev-tools/** + - libbeat/** + - testing/** + - x-pack/libbeat/** + trigger: "beats-xpack-heartbeat" + 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} - label: "Triggering Build for x-pack/heartbeat" if: build.pull_request.id == null @@ -551,34 +495,30 @@ steps: - label: "Trigger x-pack/packetbeat" if: build.pull_request.id != null - plugins: - - monorepo-diff#v1.5.1: - diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD" - interpolation: false - watch: - - path: - - .go-version - - packetbeat/ - - x-pack/packetbeat/ - - .buildkite/x-pack/pipeline.xpack.packetbeat.yml - - .buildkite/scripts/ - - .buildkite/hooks/ - # x-pack - - go.mod - - pytest.ini - - dev-tools/ - - libbeat/ - - testing/ - - x-pack/libbeat/ - config: - trigger: "beats-xpack-packetbeat" - 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} + if_changed: + include: + - .go-version + - packetbeat/** + - x-pack/packetbeat/** + - .buildkite/x-pack/pipeline.xpack.packetbeat.yml + - .buildkite/pipeline.yml + - .buildkite/scripts/** + - .buildkite/hooks/** + # x-pack + - go.mod + - pytest.ini + - dev-tools/** + - libbeat/** + - testing/** + - x-pack/libbeat/** + trigger: "beats-xpack-packetbeat" + 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} - label: "Triggering Build for x-pack/packetbeat" if: build.pull_request.id == null @@ -589,32 +529,28 @@ steps: - label: "Trigger Winlogbeat" if: build.pull_request.id != null - plugins: - - monorepo-diff#v1.5.1: - diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD" - interpolation: false - watch: - - path: - - .go-version - - winlogbeat/ - - .buildkite/winlogbeat/pipeline.winlogbeat.yml - - .buildkite/scripts - - .buildkite/hooks - #OSS - - go.mod - - pytest.ini - - dev-tools/ - - libbeat/ - - testing/ - config: - trigger: "beats-winlogbeat" - 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} + if_changed: + include: + - .go-version + - winlogbeat/** + - .buildkite/winlogbeat/pipeline.winlogbeat.yml + - .buildkite/pipeline.yml + - .buildkite/scripts/** + - .buildkite/hooks/** + #OSS + - go.mod + - pytest.ini + - dev-tools/** + - libbeat/** + - testing/** + trigger: "beats-winlogbeat" + 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} - label: "Triggering Build for Winlogbeat" if: build.pull_request.id == null @@ -625,32 +561,28 @@ steps: - label: "Trigger Packetbeat" if: build.pull_request.id != null - plugins: - - monorepo-diff#v1.5.1: - diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD" - interpolation: false - watch: - - path: - - .go-version - - packetbeat/ - - .buildkite/packetbeat/pipeline.packetbeat.yml - - .buildkite/scripts/ - - .buildkite/hooks/ - #OSS - - go.mod - - pytest.ini - - dev-tools/ - - libbeat/ - - testing/ - config: - trigger: "beats-packetbeat" - 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} + if_changed: + include: + - .go-version + - packetbeat/** + - .buildkite/packetbeat/pipeline.packetbeat.yml + - .buildkite/pipeline.yml + - .buildkite/scripts/** + - .buildkite/hooks/** + #OSS + - go.mod + - pytest.ini + - dev-tools/** + - libbeat/** + - testing/** + trigger: "beats-packetbeat" + 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} - label: "Triggering Build for Packetbeat" if: build.pull_request.id == null @@ -661,46 +593,36 @@ steps: - label: "Trigger Agentbeat" if: build.pull_request.id != null - plugins: - - monorepo-diff#v1.5.1: - diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD" - interpolation: false - watch: - - path: - - .go-version - - auditbeat/ - - filebeat/ - - heartbeat/ - - metricbeat/ - - osquerybeat/ - - packetbeat/ - - - x-pack/agentbeat/ - - x-pack/auditbeat/ - - x-pack/filebeat/ - - x-pack/heartbeat/ - - x-pack/metricbeat/ - - x-pack/osquerybeat/ - - x-pack/packetbeat/ - - - .buildkite/x-pack/pipeline.xpack.agentbeat.yml - - .buildkite/scripts/ - - .buildkite/hooks/ - #OSS - - go.mod - - pytest.ini - - dev-tools/ - - libbeat/ - - testing/ - config: - trigger: "beats-xpack-agentbeat" - 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} + if_changed: + include: + - .go-version + - auditbeat/** + - filebeat/** + - heartbeat/** + - metricbeat/** + - osquerybeat/** + - packetbeat/** + + - x-pack/agentbeat/** + - x-pack/auditbeat/** + - x-pack/filebeat/** + - x-pack/heartbeat/** + - x-pack/metricbeat/** + - x-pack/osquerybeat/** + - x-pack/packetbeat/** + + - .buildkite/x-pack/pipeline.xpack.agentbeat.yml + - .buildkite/pipeline.yml + - .buildkite/scripts/** + - .buildkite/hooks/** + trigger: "beats-xpack-agentbeat" + 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} - label: "Triggering Build for Agentbeat" if: build.pull_request.id == null From 101010676d4567270581274a21e3f06fbabc7635 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Fri, 28 Nov 2025 15:25:23 +0100 Subject: [PATCH 2/2] Apply suggestion from @v1v --- .buildkite/pipeline.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 7e6fef462df0..157100699d11 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -1,10 +1,6 @@ # yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json steps: -<<<<<<< HEAD -======= - ->>>>>>> da79b6ecc (ci: use if_changed (#47775)) - label: "Trigger Auditbeat" if: build.pull_request.id != null if_changed: