From ecc521545d949ddf756dedf4cdb575635d68b9f5 Mon Sep 17 00:00:00 2001 From: Olga Naydyonock Date: Tue, 24 Sep 2024 15:30:12 +0300 Subject: [PATCH] Add pre-commit step to beats pipelines (#40560) Added pre-commit check to beats pipelines to validate if no merge-conflicts exist --- .buildkite/auditbeat/auditbeat-pipeline.yml | 14 +++++++++++++- .../deploy/kubernetes/deploy-k8s-pipeline.yml | 13 +++++++++++++ .buildkite/filebeat/filebeat-pipeline.yml | 15 ++++++++++++++- .buildkite/heartbeat/heartbeat-pipeline.yml | 15 ++++++++++++++- .buildkite/libbeat/pipeline.libbeat.yml | 14 +++++++++++++- .buildkite/metricbeat/pipeline.yml | 14 +++++++++++++- .buildkite/packetbeat/pipeline.packetbeat.yml | 14 +++++++++++++- .buildkite/winlogbeat/pipeline.winlogbeat.yml | 14 +++++++++++++- .buildkite/x-pack/pipeline.xpack.auditbeat.yml | 14 +++++++++++++- .../x-pack/pipeline.xpack.dockerlogbeat.yml | 14 +++++++++++++- .buildkite/x-pack/pipeline.xpack.filebeat.yml | 16 ++++++++++++++-- .buildkite/x-pack/pipeline.xpack.heartbeat.yml | 14 +++++++++++++- .buildkite/x-pack/pipeline.xpack.libbeat.yml | 14 +++++++++++++- .buildkite/x-pack/pipeline.xpack.metricbeat.yml | 14 +++++++++++++- .buildkite/x-pack/pipeline.xpack.osquerybeat.yml | 14 +++++++++++++- .buildkite/x-pack/pipeline.xpack.packetbeat.yml | 14 +++++++++++++- .buildkite/x-pack/pipeline.xpack.winlogbeat.yml | 14 +++++++++++++- 17 files changed, 224 insertions(+), 17 deletions(-) diff --git a/.buildkite/auditbeat/auditbeat-pipeline.yml b/.buildkite/auditbeat/auditbeat-pipeline.yml index 703c322cb4bc..d11f067c4815 100644 --- a/.buildkite/auditbeat/auditbeat-pipeline.yml +++ b/.buildkite/auditbeat/auditbeat-pipeline.yml @@ -19,6 +19,8 @@ env: IMAGE_WIN_2019: "family/platform-ingest-beats-windows-2019" IMAGE_WIN_2022: "family/platform-ingest-beats-windows-2022" + IMAGE_BEATS_WITH_HOOKS_LATEST: "docker.elastic.co/ci-agent-images/platform-ingest/buildkite-agent-beats-ci-with-hooks:latest" + # Other deps ASDF_MAGE_VERSION: 1.15.0 @@ -40,7 +42,7 @@ steps: automatic: - limit: 1 agents: - image: "docker.elastic.co/ci-agent-images/platform-ingest/buildkite-agent-beats-ci-with-hooks:latest" + image: "${IMAGE_BEATS_WITH_HOOKS_LATEST}" cpu: "4000m" memory: "8Gi" useCustomGlobalHooks: true @@ -48,6 +50,16 @@ steps: - github_commit_status: context: "auditbeat: check/update" + - label: "Auditbeat: Run pre-commit" + command: "pre-commit run --all-files" + agents: + image: "${IMAGE_BEATS_WITH_HOOKS_LATEST}" + memory: "2Gi" + useCustomGlobalHooks: true + notify: + - github_commit_status: + context: "auditbeat: pre-commit" + - wait: ~ # with PRs, we want to run mandatory tests only if check/update step succeed # for other cases, e.g. merge commits, we want to run mundatory test (and publish) independently of other tests diff --git a/.buildkite/deploy/kubernetes/deploy-k8s-pipeline.yml b/.buildkite/deploy/kubernetes/deploy-k8s-pipeline.yml index 525ae0cd22fd..e53ae0c0c703 100644 --- a/.buildkite/deploy/kubernetes/deploy-k8s-pipeline.yml +++ b/.buildkite/deploy/kubernetes/deploy-k8s-pipeline.yml @@ -8,11 +8,24 @@ env: # Other deps ASDF_KIND_VERSION: "0.20.0" + IMAGE_BEATS_WITH_HOOKS_LATEST: "docker.elastic.co/ci-agent-images/platform-ingest/buildkite-agent-beats-ci-with-hooks:latest" + steps: - group: "Deploy/K8S" if: build.env("BUILDKITE_PULL_REQUEST") != "false" steps: + - label: "Deploy/K8S: Run pre-commit" + command: "pre-commit run --all-files" + agents: + image: "${IMAGE_BEATS_WITH_HOOKS_LATEST}" + cpu: "2000m" + memory: "4Gi" + useCustomGlobalHooks: true + notify: + - github_commit_status: + context: "deploy/k8s: pre-commit" + - label: "Checks" command: | set -euo pipefail diff --git a/.buildkite/filebeat/filebeat-pipeline.yml b/.buildkite/filebeat/filebeat-pipeline.yml index 473f523d20c9..f92730b158cb 100644 --- a/.buildkite/filebeat/filebeat-pipeline.yml +++ b/.buildkite/filebeat/filebeat-pipeline.yml @@ -18,6 +18,8 @@ env: IMAGE_WIN_2019: "family/platform-ingest-beats-windows-2019" IMAGE_WIN_2022: "family/platform-ingest-beats-windows-2022" + IMAGE_BEATS_WITH_HOOKS_LATEST: "docker.elastic.co/ci-agent-images/platform-ingest/buildkite-agent-beats-ci-with-hooks:latest" + #Deps ASDF_MAGE_VERSION: 1.15.0 @@ -32,6 +34,7 @@ env: steps: - group: "Check/Update" key: "filebeat-check-update" + steps: - label: "Filebeat: Run check/update" command: | @@ -42,7 +45,7 @@ steps: automatic: - limit: 1 agents: - image: "docker.elastic.co/ci-agent-images/platform-ingest/buildkite-agent-beats-ci-with-hooks:0.3" + image: "${IMAGE_BEATS_WITH_HOOKS_LATEST}" cpu: "4000m" memory: "8Gi" useCustomGlobalHooks: true @@ -50,6 +53,16 @@ steps: - github_commit_status: context: "filebeat: check/update" + - label: "Filebeat: Run pre-commit" + command: "pre-commit run --all-files" + agents: + image: "${IMAGE_BEATS_WITH_HOOKS_LATEST}" + memory: "2Gi" + useCustomGlobalHooks: true + notify: + - github_commit_status: + context: "filebeat: pre-commit" + - wait: ~ # with PRs, we want to run mandatory tests only if check/update step succeed # for other cases, e.g. merge commits, we want to run mundatory test (and publish) independently of other tests diff --git a/.buildkite/heartbeat/heartbeat-pipeline.yml b/.buildkite/heartbeat/heartbeat-pipeline.yml index d046661de402..abdc8f73e330 100644 --- a/.buildkite/heartbeat/heartbeat-pipeline.yml +++ b/.buildkite/heartbeat/heartbeat-pipeline.yml @@ -18,9 +18,12 @@ env: IMAGE_WIN_2019: "family/platform-ingest-beats-windows-2019" IMAGE_WIN_2022: "family/platform-ingest-beats-windows-2022" + IMAGE_BEATS_WITH_HOOKS_LATEST: "docker.elastic.co/ci-agent-images/platform-ingest/buildkite-agent-beats-ci-with-hooks:latest" + # Other deps ASDF_MAGE_VERSION: 1.15.0 ASDF_NODEJS_VERSION: 18.17.1 + ASDF_PYTHON_VERSION: 3.10.9 # Unit tests RACE_DETECTOR: "true" @@ -40,7 +43,7 @@ steps: automatic: - limit: 1 agents: - image: "docker.elastic.co/ci-agent-images/platform-ingest/buildkite-agent-beats-ci-with-hooks:latest" + image: "${IMAGE_BEATS_WITH_HOOKS_LATEST}" cpu: "4000m" memory: "8Gi" useCustomGlobalHooks: true @@ -48,6 +51,16 @@ steps: - github_commit_status: context: "hearbeat: check/update" + - label: "Heartbeat: Run pre-commit" + command: "pre-commit run --all-files" + agents: + image: "${IMAGE_BEATS_WITH_HOOKS_LATEST}" + memory: "2Gi" + useCustomGlobalHooks: true + notify: + - github_commit_status: + context: "heartbeat: pre-commit" + - wait: ~ # with PRs, we want to run mandatory tests only if check/update step succeed # for other cases, e.g. merge commits, we want to run mundatory test (and publish) independently of other tests diff --git a/.buildkite/libbeat/pipeline.libbeat.yml b/.buildkite/libbeat/pipeline.libbeat.yml index 57892523478f..b19cd0ae7517 100644 --- a/.buildkite/libbeat/pipeline.libbeat.yml +++ b/.buildkite/libbeat/pipeline.libbeat.yml @@ -9,6 +9,8 @@ env: GCP_HI_PERF_MACHINE_TYPE: "c2d-highcpu-16" IMAGE_UBUNTU_X86_64: "family/platform-ingest-beats-ubuntu-2204" + IMAGE_BEATS_WITH_HOOKS_LATEST: "docker.elastic.co/ci-agent-images/platform-ingest/buildkite-agent-beats-ci-with-hooks:latest" + #Deps ASDF_MAGE_VERSION: 1.15.0 @@ -30,7 +32,7 @@ steps: automatic: - limit: 1 agents: - image: "docker.elastic.co/ci-agent-images/platform-ingest/buildkite-agent-beats-ci-with-hooks:latest" + image: "${IMAGE_BEATS_WITH_HOOKS_LATEST}" cpu: "4000m" memory: "8Gi" useCustomGlobalHooks: true @@ -38,6 +40,16 @@ steps: - github_commit_status: context: "libbeat: check/update" + - label: "Libbeat: Run pre-commit" + command: "pre-commit run --all-files" + agents: + image: "${IMAGE_BEATS_WITH_HOOKS_LATEST}" + memory: "2Gi" + useCustomGlobalHooks: true + notify: + - github_commit_status: + context: "libbeat: pre-commit" + - wait: ~ # with PRs, we want to run mandatory tests only if check/update step succeed # for other cases, e.g. merge commits, we want to run mundatory test (and publish) independently of other tests diff --git a/.buildkite/metricbeat/pipeline.yml b/.buildkite/metricbeat/pipeline.yml index 86b08834278e..3ec9af58bf64 100644 --- a/.buildkite/metricbeat/pipeline.yml +++ b/.buildkite/metricbeat/pipeline.yml @@ -18,6 +18,8 @@ env: IMAGE_WIN_2019: "family/platform-ingest-beats-windows-2019" IMAGE_WIN_2022: "family/platform-ingest-beats-windows-2022" + IMAGE_BEATS_WITH_HOOKS_LATEST: "docker.elastic.co/ci-agent-images/platform-ingest/buildkite-agent-beats-ci-with-hooks:latest" + # Integration Tests K8S_VERSION: "v1.29.0" ASDF_KIND_VERSION: "0.20.0" @@ -45,7 +47,7 @@ steps: automatic: - limit: 1 agents: - image: "docker.elastic.co/ci-agent-images/platform-ingest/buildkite-agent-beats-ci-with-hooks:latest" + image: "${IMAGE_BEATS_WITH_HOOKS_LATEST}" cpu: "4000m" memory: "8Gi" useCustomGlobalHooks: true @@ -53,6 +55,16 @@ steps: - github_commit_status: context: "metricbeat: check/update" + - label: "Metricbeat: Run pre-commit" + command: "pre-commit run --all-files" + agents: + image: "${IMAGE_BEATS_WITH_HOOKS_LATEST}" + memory: "2Gi" + useCustomGlobalHooks: true + notify: + - github_commit_status: + context: "metricbeat: pre-commit" + - wait: ~ # with PRs, we want to run mandatory tests only if check/update step succeed # for other cases, e.g. merge commits, we want to run mundatory test (and publish) independently of other tests diff --git a/.buildkite/packetbeat/pipeline.packetbeat.yml b/.buildkite/packetbeat/pipeline.packetbeat.yml index ec5a8a5cc7c2..3237644dfabb 100644 --- a/.buildkite/packetbeat/pipeline.packetbeat.yml +++ b/.buildkite/packetbeat/pipeline.packetbeat.yml @@ -19,6 +19,8 @@ env: IMAGE_WIN_2019: "family/platform-ingest-beats-windows-2019" IMAGE_WIN_2022: "family/platform-ingest-beats-windows-2022" + IMAGE_BEATS_WITH_HOOKS_LATEST: "docker.elastic.co/ci-agent-images/platform-ingest/buildkite-agent-beats-ci-with-hooks:latest" + #Deps ASDF_MAGE_VERSION: 1.15.0 @@ -40,7 +42,7 @@ steps: automatic: - limit: 1 agents: - image: "docker.elastic.co/ci-agent-images/platform-ingest/buildkite-agent-beats-ci-with-hooks:latest" + image: "${IMAGE_BEATS_WITH_HOOKS_LATEST}" cpu: "4000m" memory: "8Gi" useCustomGlobalHooks: true @@ -48,6 +50,16 @@ steps: - github_commit_status: context: "packetbeat: check/update" + - label: "Packetbeat: Run pre-commit" + command: "pre-commit run --all-files" + agents: + image: "${IMAGE_BEATS_WITH_HOOKS_LATEST}" + memory: "2Gi" + useCustomGlobalHooks: true + notify: + - github_commit_status: + context: "packetbeat: pre-commit" + - wait: ~ # with PRs, we want to run mandatory tests only if check/update step succeed # for other cases, e.g. merge commits, we want to run mundatory test (and publish) independently of other tests diff --git a/.buildkite/winlogbeat/pipeline.winlogbeat.yml b/.buildkite/winlogbeat/pipeline.winlogbeat.yml index 76a7443ac2f2..d8986a72a54e 100644 --- a/.buildkite/winlogbeat/pipeline.winlogbeat.yml +++ b/.buildkite/winlogbeat/pipeline.winlogbeat.yml @@ -13,6 +13,8 @@ env: IMAGE_WIN_2019: "family/platform-ingest-beats-windows-2019" IMAGE_WIN_2022: "family/platform-ingest-beats-windows-2022" + IMAGE_BEATS_WITH_HOOKS_LATEST: "docker.elastic.co/ci-agent-images/platform-ingest/buildkite-agent-beats-ci-with-hooks:latest" + # Other deps ASDF_MAGE_VERSION: 1.15.0 @@ -36,7 +38,7 @@ steps: automatic: - limit: 1 agents: - image: "docker.elastic.co/ci-agent-images/platform-ingest/buildkite-agent-beats-ci-with-hooks:latest" + image: "${IMAGE_BEATS_WITH_HOOKS_LATEST}" cpu: "4000m" memory: "8Gi" useCustomGlobalHooks: true @@ -44,6 +46,16 @@ steps: - github_commit_status: context: "winlogbeat: check/update" + - label: "Winlogbeat: Run pre-commit" + command: "pre-commit run --all-files" + agents: + image: "${IMAGE_BEATS_WITH_HOOKS_LATEST}" + memory: "2Gi" + useCustomGlobalHooks: true + notify: + - github_commit_status: + context: "winlogbeat: pre-commit" + - wait: ~ # with PRs, we want to run mandatory tests only if check/update step succeed # for other cases, e.g. merge commits, we want to run mundatory test (and publish) independently of other tests diff --git a/.buildkite/x-pack/pipeline.xpack.auditbeat.yml b/.buildkite/x-pack/pipeline.xpack.auditbeat.yml index 40ef8c65aef2..7cebeab4787d 100644 --- a/.buildkite/x-pack/pipeline.xpack.auditbeat.yml +++ b/.buildkite/x-pack/pipeline.xpack.auditbeat.yml @@ -19,6 +19,8 @@ env: IMAGE_WIN_2019: "family/platform-ingest-beats-windows-2019" IMAGE_WIN_2022: "family/platform-ingest-beats-windows-2022" + IMAGE_BEATS_WITH_HOOKS_LATEST: "docker.elastic.co/ci-agent-images/platform-ingest/buildkite-agent-beats-ci-with-hooks:latest" + # Other deps ASDF_MAGE_VERSION: 1.15.0 @@ -43,7 +45,7 @@ steps: automatic: - limit: 1 agents: - image: "docker.elastic.co/ci-agent-images/platform-ingest/buildkite-agent-beats-ci-with-hooks:latest" + image: "${IMAGE_BEATS_WITH_HOOKS_LATEST}" cpu: "4000m" memory: "8Gi" useCustomGlobalHooks: true @@ -51,6 +53,16 @@ steps: - github_commit_status: context: "x-pack/auditbeat: check/update" + - label: "x-pack/auditbeat: Run pre-commit" + command: "pre-commit run --all-files" + agents: + image: "${IMAGE_BEATS_WITH_HOOKS_LATEST}" + memory: "2Gi" + useCustomGlobalHooks: true + notify: + - github_commit_status: + context: "x-pack/auditbeat: pre-commit" + - wait: ~ # with PRs, we want to run mandatory tests only if check/update step succeed # for other cases, e.g. merge commits, we want to run mundatory test (and publish) independently of other tests diff --git a/.buildkite/x-pack/pipeline.xpack.dockerlogbeat.yml b/.buildkite/x-pack/pipeline.xpack.dockerlogbeat.yml index 72e5d8e24b93..54b3451b23e0 100644 --- a/.buildkite/x-pack/pipeline.xpack.dockerlogbeat.yml +++ b/.buildkite/x-pack/pipeline.xpack.dockerlogbeat.yml @@ -10,6 +10,8 @@ env: IMAGE_UBUNTU_X86_64: "family/platform-ingest-beats-ubuntu-2204" + IMAGE_BEATS_WITH_HOOKS_LATEST: "docker.elastic.co/ci-agent-images/platform-ingest/buildkite-agent-beats-ci-with-hooks:latest" + # Other deps ASDF_MAGE_VERSION: 1.15.0 @@ -30,7 +32,7 @@ steps: automatic: - limit: 1 agents: - image: "docker.elastic.co/ci-agent-images/platform-ingest/buildkite-agent-beats-ci-with-hooks:latest" + image: "${IMAGE_BEATS_WITH_HOOKS_LATEST}" cpu: "4000m" memory: "8Gi" useCustomGlobalHooks: true @@ -38,6 +40,16 @@ steps: - github_commit_status: context: "x-pack/dockerlogbeat: check/update" + - label: "x-pack/dockerlogbeat: Run pre-commit" + command: "pre-commit run --all-files" + agents: + image: "${IMAGE_BEATS_WITH_HOOKS_LATEST}" + memory: "2Gi" + useCustomGlobalHooks: true + notify: + - github_commit_status: + context: "x-pack/dockerlogbeat: pre-commit" + - wait: ~ # with PRs, we want to run mandatory tests only if check/update step succeed # for other cases, e.g. merge commits, we want to run mundatory test (and publish) independently of other tests diff --git a/.buildkite/x-pack/pipeline.xpack.filebeat.yml b/.buildkite/x-pack/pipeline.xpack.filebeat.yml index 29732955f7cf..57b15927d617 100644 --- a/.buildkite/x-pack/pipeline.xpack.filebeat.yml +++ b/.buildkite/x-pack/pipeline.xpack.filebeat.yml @@ -18,6 +18,8 @@ env: IMAGE_WIN_2019: "family/platform-ingest-beats-windows-2019" IMAGE_WIN_2022: "family/platform-ingest-beats-windows-2022" + IMAGE_BEATS_WITH_HOOKS_LATEST: "docker.elastic.co/ci-agent-images/platform-ingest/buildkite-agent-beats-ci-with-hooks:latest" + # Other deps ASDF_MAGE_VERSION: 1.15.0 @@ -39,13 +41,23 @@ steps: automatic: - limit: 1 agents: - image: "docker.elastic.co/ci-agent-images/platform-ingest/buildkite-agent-beats-ci-with-hooks:0.3" + image: "${IMAGE_BEATS_WITH_HOOKS_LATEST}" cpu: "4000m" memory: "8Gi" useCustomGlobalHooks: true notify: - github_commit_status: - context: "x-pack-filebeat: check/update" + context: "x-pack/filebeat: check/update" + + - label: "x-pack/filebeat: Run pre-commit" + command: "pre-commit run --all-files" + agents: + image: "${IMAGE_BEATS_WITH_HOOKS_LATEST}" + memory: "2Gi" + useCustomGlobalHooks: true + notify: + - github_commit_status: + context: "x-pack/filebeat: pre-commit" - wait: ~ # with PRs, we want to run mandatory tests only if check/update step succeed diff --git a/.buildkite/x-pack/pipeline.xpack.heartbeat.yml b/.buildkite/x-pack/pipeline.xpack.heartbeat.yml index 6695957179d7..414eeb06e752 100644 --- a/.buildkite/x-pack/pipeline.xpack.heartbeat.yml +++ b/.buildkite/x-pack/pipeline.xpack.heartbeat.yml @@ -19,6 +19,8 @@ env: IMAGE_WIN_2019: "family/platform-ingest-beats-windows-2019" IMAGE_WIN_2022: "family/platform-ingest-beats-windows-2022" + IMAGE_BEATS_WITH_HOOKS_LATEST: "docker.elastic.co/ci-agent-images/platform-ingest/buildkite-agent-beats-ci-with-hooks:latest" + # pipeline specific ELASTIC_SYNTHETICS_CAPABLE: "true" @@ -44,7 +46,7 @@ steps: automatic: - limit: 1 agents: - image: "docker.elastic.co/ci-agent-images/platform-ingest/buildkite-agent-beats-ci-with-hooks:latest" + image: "${IMAGE_BEATS_WITH_HOOKS_LATEST}" cpu: "4000m" memory: "8Gi" useCustomGlobalHooks: true @@ -52,6 +54,16 @@ steps: - github_commit_status: context: "x-pack/heartbeat: check/update" + - label: "x-pack/heartbeat: Run pre-commit" + command: "pre-commit run --all-files" + agents: + image: "${IMAGE_BEATS_WITH_HOOKS_LATEST}" + memory: "2Gi" + useCustomGlobalHooks: true + notify: + - github_commit_status: + context: "x-pack/heartbeat: pre-commit" + - wait: ~ # with PRs, we want to run mandatory tests only if check/update step succeed # for other cases, e.g. merge commits, we want to run mundatory test (and publish) independently of other tests diff --git a/.buildkite/x-pack/pipeline.xpack.libbeat.yml b/.buildkite/x-pack/pipeline.xpack.libbeat.yml index 0a21b6a914c9..431ae1aed819 100644 --- a/.buildkite/x-pack/pipeline.xpack.libbeat.yml +++ b/.buildkite/x-pack/pipeline.xpack.libbeat.yml @@ -12,6 +12,8 @@ env: IMAGE_WIN_2019: "family/platform-ingest-beats-windows-2019" IMAGE_WIN_2022: "family/platform-ingest-beats-windows-2022" + IMAGE_BEATS_WITH_HOOKS_LATEST: "docker.elastic.co/ci-agent-images/platform-ingest/buildkite-agent-beats-ci-with-hooks:latest" + GCP_DEFAULT_MACHINE_TYPE: "c2d-highcpu-8" GCP_HI_PERF_MACHINE_TYPE: "c2d-highcpu-16" GCP_WIN_MACHINE_TYPE: "n2-standard-8" @@ -36,7 +38,7 @@ steps: automatic: - limit: 1 agents: - image: "docker.elastic.co/ci-agent-images/platform-ingest/buildkite-agent-beats-ci-with-hooks:latest" + image: "${IMAGE_BEATS_WITH_HOOKS_LATEST}" cpu: "4000m" memory: "8Gi" useCustomGlobalHooks: true @@ -44,6 +46,16 @@ steps: - github_commit_status: context: "x-pack/libbeat: check/update" + - label: "x-pack/libbeat: Run pre-commit" + command: "pre-commit run --all-files" + agents: + image: "${IMAGE_BEATS_WITH_HOOKS_LATEST}" + memory: "2Gi" + useCustomGlobalHooks: true + notify: + - github_commit_status: + context: "x-pack/libbeat: pre-commit" + - wait: ~ # with PRs, we want to run mandatory tests only if check/update step succeed # for other cases, e.g. merge commits, we want to run mundatory test (and publish) independently of other tests diff --git a/.buildkite/x-pack/pipeline.xpack.metricbeat.yml b/.buildkite/x-pack/pipeline.xpack.metricbeat.yml index b18b21ecde37..e616dd053897 100644 --- a/.buildkite/x-pack/pipeline.xpack.metricbeat.yml +++ b/.buildkite/x-pack/pipeline.xpack.metricbeat.yml @@ -18,6 +18,8 @@ env: IMAGE_WIN_2019: "family/platform-ingest-beats-windows-2019" IMAGE_WIN_2022: "family/platform-ingest-beats-windows-2022" + IMAGE_BEATS_WITH_HOOKS_LATEST: "docker.elastic.co/ci-agent-images/platform-ingest/buildkite-agent-beats-ci-with-hooks:latest" + # Other deps ASDF_MAGE_VERSION: 1.15.0 @@ -41,7 +43,7 @@ steps: automatic: - limit: 1 agents: - image: "docker.elastic.co/ci-agent-images/platform-ingest/buildkite-agent-beats-ci-with-hooks:latest" + image: "${IMAGE_BEATS_WITH_HOOKS_LATEST}" cpu: "4000m" memory: "8Gi" useCustomGlobalHooks: true @@ -49,6 +51,16 @@ steps: - github_commit_status: context: "x-pack/metricbeat: check/update" + - label: "x-pack/metricbeat: Run pre-commit" + command: "pre-commit run --all-files" + agents: + image: "${IMAGE_BEATS_WITH_HOOKS_LATEST}" + memory: "2Gi" + useCustomGlobalHooks: true + notify: + - github_commit_status: + context: "x-pack/metricbeat: pre-commit" + - wait: ~ # with PRs, we want to run mandatory tests only if check/update step succeed # for other cases, e.g. merge commits, we want to run mundatory test (and publish) independently of other tests diff --git a/.buildkite/x-pack/pipeline.xpack.osquerybeat.yml b/.buildkite/x-pack/pipeline.xpack.osquerybeat.yml index ba6b57a8b0fe..9c397f95d79a 100644 --- a/.buildkite/x-pack/pipeline.xpack.osquerybeat.yml +++ b/.buildkite/x-pack/pipeline.xpack.osquerybeat.yml @@ -15,6 +15,8 @@ env: IMAGE_WIN_2019: "family/platform-ingest-beats-windows-2019" IMAGE_WIN_2022: "family/platform-ingest-beats-windows-2022" + IMAGE_BEATS_WITH_HOOKS_LATEST: "docker.elastic.co/ci-agent-images/platform-ingest/buildkite-agent-beats-ci-with-hooks:latest" + # Other deps ASDF_MAGE_VERSION: 1.15.0 @@ -36,7 +38,7 @@ steps: automatic: - limit: 1 agents: - image: "docker.elastic.co/ci-agent-images/platform-ingest/buildkite-agent-beats-ci-with-hooks:latest" + image: "${IMAGE_BEATS_WITH_HOOKS_LATEST}" cpu: "4000m" memory: "8Gi" useCustomGlobalHooks: true @@ -44,6 +46,16 @@ steps: - github_commit_status: context: "x-pack/osquerybeat: check/update" + - label: "x-pack/osquerybeat: Run pre-commit" + command: "pre-commit run --all-files" + agents: + image: "${IMAGE_BEATS_WITH_HOOKS_LATEST}" + memory: "2Gi" + useCustomGlobalHooks: true + notify: + - github_commit_status: + context: "x-pack/osquerybeat: pre-commit" + - wait: ~ # with PRs, we want to run mandatory tests only if check/update step succeed # for other cases, e.g. merge commits, we want to run mundatory test (and publish) independently of other tests diff --git a/.buildkite/x-pack/pipeline.xpack.packetbeat.yml b/.buildkite/x-pack/pipeline.xpack.packetbeat.yml index 168094f35127..abf9950b9272 100644 --- a/.buildkite/x-pack/pipeline.xpack.packetbeat.yml +++ b/.buildkite/x-pack/pipeline.xpack.packetbeat.yml @@ -19,6 +19,8 @@ env: IMAGE_WIN_2019: "family/platform-ingest-beats-windows-2019" IMAGE_WIN_2022: "family/platform-ingest-beats-windows-2022" + IMAGE_BEATS_WITH_HOOKS_LATEST: "docker.elastic.co/ci-agent-images/platform-ingest/buildkite-agent-beats-ci-with-hooks:latest" + #Deps ASDF_MAGE_VERSION: 1.15.0 @@ -40,7 +42,7 @@ steps: automatic: - limit: 1 agents: - image: "docker.elastic.co/ci-agent-images/platform-ingest/buildkite-agent-beats-ci-with-hooks:latest" + image: "${IMAGE_BEATS_WITH_HOOKS_LATEST}" cpu: "4000m" memory: "8Gi" useCustomGlobalHooks: true @@ -48,6 +50,16 @@ steps: - github_commit_status: context: "x-pack/packetbeat: check/update" + - label: "x-pack/packetbeat: Run pre-commit" + command: "pre-commit run --all-files" + agents: + image: "${IMAGE_BEATS_WITH_HOOKS_LATEST}" + memory: "2Gi" + useCustomGlobalHooks: true + notify: + - github_commit_status: + context: "x-pack/packetbeat: pre-commit" + - wait: ~ # with PRs, we want to run mandatory tests only if check/update step succeed # for other cases, e.g. merge commits, we want to run mundatory test (and publish) independently of other tests diff --git a/.buildkite/x-pack/pipeline.xpack.winlogbeat.yml b/.buildkite/x-pack/pipeline.xpack.winlogbeat.yml index b77198a32c6f..f0a1b30c2536 100644 --- a/.buildkite/x-pack/pipeline.xpack.winlogbeat.yml +++ b/.buildkite/x-pack/pipeline.xpack.winlogbeat.yml @@ -11,6 +11,8 @@ env: GCP_WIN_MACHINE_TYPE: "n2-standard-8" GCP_HI_PERF_MACHINE_TYPE: "c2d-highcpu-16" + IMAGE_BEATS_WITH_HOOKS_LATEST: "docker.elastic.co/ci-agent-images/platform-ingest/buildkite-agent-beats-ci-with-hooks:latest" + # Other deps ASDF_MAGE_VERSION: 1.15.0 @@ -31,7 +33,7 @@ steps: automatic: - limit: 1 agents: - image: "docker.elastic.co/ci-agent-images/platform-ingest/buildkite-agent-beats-ci-with-hooks:latest" + image: "${IMAGE_BEATS_WITH_HOOKS_LATEST}" cpu: "4000m" memory: "8Gi" useCustomGlobalHooks: true @@ -39,6 +41,16 @@ steps: - github_commit_status: context: "x-pack/winlogbeat: check/update" + - label: "x-pack/winlogbeat: Run pre-commit" + command: "pre-commit run --all-files" + agents: + image: "${IMAGE_BEATS_WITH_HOOKS_LATEST}" + memory: "2Gi" + useCustomGlobalHooks: true + notify: + - github_commit_status: + context: "x-pack/winlogbeat: pre-commit" + - wait: ~ # with PRs, we want to run mandatory tests only if check/update step succeed # for other cases, e.g. merge commits, we want to run mundatory test (and publish) independently of other tests