From 378b79626a453199b215b0d2aacaee4c8c34e13a Mon Sep 17 00:00:00 2001 From: Olga Naydyonock Date: Wed, 25 Sep 2024 13:31:35 +0300 Subject: [PATCH] added pre-commit to x-pack/agentbeat (#40965) --- .../x-pack/pipeline.xpack.agentbeat.yml | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.buildkite/x-pack/pipeline.xpack.agentbeat.yml b/.buildkite/x-pack/pipeline.xpack.agentbeat.yml index daf4603d0c9..70aa4362b86 100644 --- a/.buildkite/x-pack/pipeline.xpack.agentbeat.yml +++ b/.buildkite/x-pack/pipeline.xpack.agentbeat.yml @@ -3,7 +3,30 @@ 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" + steps: + - group: "Check/Update" + key: "x-pack-agentbeat-check-update" + + steps: + - label: "agentbeat: 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: "agentbeat: 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 + # this allows building DRA artifacts even if there is flakiness in check/update step + if: build.env("BUILDKITE_PULL_REQUEST") != "false" + depends_on: "x-pack-agentbeat-check-update" + - group: "Agentbeat tests" key: "agentbeat-mandatory-tests"