From 6eb8cb9b73f9430f23fb0cbba00f0097013a65fd Mon Sep 17 00:00:00 2001 From: Larry Gregory Date: Thu, 5 Dec 2024 12:24:56 -0500 Subject: [PATCH 1/2] Only run quick checks for changes to renovate.json --- .../pipelines/pull_request/renovate.yml | 34 +++++++++++++++++++ .../pipelines/pull_request/pipeline.ts | 7 ++++ 2 files changed, 41 insertions(+) create mode 100644 .buildkite/pipelines/pull_request/renovate.yml diff --git a/.buildkite/pipelines/pull_request/renovate.yml b/.buildkite/pipelines/pull_request/renovate.yml new file mode 100644 index 0000000000000..6925bb4882376 --- /dev/null +++ b/.buildkite/pipelines/pull_request/renovate.yml @@ -0,0 +1,34 @@ +steps: + # - command: .buildkite/scripts/lifecycle/pre_build.sh + # label: Pre-Build + # timeout_in_minutes: 10 + # agents: + # machineType: n2-standard-2 + + # - wait + + # - command: .buildkite/scripts/steps/build_kibana.sh + # label: Build Kibana Distribution + # agents: + # machineType: n2-standard-8 + # preemptible: true + # diskSizeGb: 125 + # key: build + # if: "build.env('KIBANA_BUILD_ID') == null || build.env('KIBANA_BUILD_ID') == ''" + # timeout_in_minutes: 90 + # retry: + # automatic: + # - exit_status: '-1' + # limit: 3 + + - command: .buildkite/scripts/steps/quick_checks.sh + label: 'Quick Checks' + agents: + machineType: n2-highcpu-8 + preemptible: true + key: quick_checks + timeout_in_minutes: 60 + retry: + automatic: + - exit_status: '-1' + limit: 3 diff --git a/.buildkite/scripts/pipelines/pull_request/pipeline.ts b/.buildkite/scripts/pipelines/pull_request/pipeline.ts index ad71f70258a23..b63b6defb3e9f 100644 --- a/.buildkite/scripts/pipelines/pull_request/pipeline.ts +++ b/.buildkite/scripts/pipelines/pull_request/pipeline.ts @@ -39,6 +39,13 @@ const getPipeline = (filename: string, removeSteps = true) => { return; } + const onlyRunQuickChecks = await areChangesSkippable([/^renovate\.json$/], REQUIRED_PATHS); + if (onlyRunQuickChecks) { + pipeline.push(getPipeline('.buildkite/pipelines/pull_request/renovate.yml')); + console.log('Isolated changes to renovate.json. Skipping main PR pipeline.'); + return; + } + pipeline.push(getAgentImageConfig({ returnYaml: true })); pipeline.push(getPipeline('.buildkite/pipelines/pull_request/base.yml', false)); From 03174cb885cfd3a8480d4c127d504893934d4792 Mon Sep 17 00:00:00 2001 From: Larry Gregory Date: Fri, 6 Dec 2024 08:12:22 -0500 Subject: [PATCH 2/2] Address PR Feedback --- .../pipelines/pull_request/renovate.yml | 32 ++++++------------- .../pipelines/pull_request/pipeline.ts | 3 +- .buildkite/scripts/steps/renovate.sh | 6 ++++ 3 files changed, 17 insertions(+), 24 deletions(-) create mode 100755 .buildkite/scripts/steps/renovate.sh diff --git a/.buildkite/pipelines/pull_request/renovate.yml b/.buildkite/pipelines/pull_request/renovate.yml index 6925bb4882376..3b441cfe5375a 100644 --- a/.buildkite/pipelines/pull_request/renovate.yml +++ b/.buildkite/pipelines/pull_request/renovate.yml @@ -1,32 +1,18 @@ steps: - # - command: .buildkite/scripts/lifecycle/pre_build.sh - # label: Pre-Build - # timeout_in_minutes: 10 - # agents: - # machineType: n2-standard-2 - - # - wait + - command: .buildkite/scripts/lifecycle/pre_build.sh + label: Pre-Build + timeout_in_minutes: 10 + agents: + machineType: n2-standard-2 - # - command: .buildkite/scripts/steps/build_kibana.sh - # label: Build Kibana Distribution - # agents: - # machineType: n2-standard-8 - # preemptible: true - # diskSizeGb: 125 - # key: build - # if: "build.env('KIBANA_BUILD_ID') == null || build.env('KIBANA_BUILD_ID') == ''" - # timeout_in_minutes: 90 - # retry: - # automatic: - # - exit_status: '-1' - # limit: 3 + - wait - - command: .buildkite/scripts/steps/quick_checks.sh - label: 'Quick Checks' + - command: .buildkite/scripts/steps/renovate.sh + label: 'Renovate validation' agents: machineType: n2-highcpu-8 preemptible: true - key: quick_checks + key: renovate_validation timeout_in_minutes: 60 retry: automatic: diff --git a/.buildkite/scripts/pipelines/pull_request/pipeline.ts b/.buildkite/scripts/pipelines/pull_request/pipeline.ts index b63b6defb3e9f..29f7e567b55fa 100644 --- a/.buildkite/scripts/pipelines/pull_request/pipeline.ts +++ b/.buildkite/scripts/pipelines/pull_request/pipeline.ts @@ -41,7 +41,8 @@ const getPipeline = (filename: string, removeSteps = true) => { const onlyRunQuickChecks = await areChangesSkippable([/^renovate\.json$/], REQUIRED_PATHS); if (onlyRunQuickChecks) { - pipeline.push(getPipeline('.buildkite/pipelines/pull_request/renovate.yml')); + pipeline.push(getPipeline('.buildkite/pipelines/pull_request/renovate.yml', false)); + pipeline.push(getPipeline('.buildkite/pipelines/pull_request/post_build.yml')); console.log('Isolated changes to renovate.json. Skipping main PR pipeline.'); return; } diff --git a/.buildkite/scripts/steps/renovate.sh b/.buildkite/scripts/steps/renovate.sh new file mode 100755 index 0000000000000..cc4583e3da216 --- /dev/null +++ b/.buildkite/scripts/steps/renovate.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +set -euo pipefail + +echo '--- Renovate: validation' +.buildkite/scripts/steps/checks/renovate.sh