From a503bde4fcec198c057c31ce71918b9326b1c602 Mon Sep 17 00:00:00 2001 From: Larry Gregory Date: Tue, 17 Dec 2024 08:59:43 -0500 Subject: [PATCH] Only run quick checks for changes to renovate.json (#203153) ## Summary Introduces a new `renovate` CI pipeline to only run quick checks for PRs which only adjust the `renovate.json` configuration file. (cherry picked from commit 591d640b1fe21dc847338a535c142153f2b50e80) --- .../pipelines/pull_request/renovate.yml | 20 +++++++++++++++++++ .../pipelines/pull_request/pipeline.ts | 8 ++++++++ .buildkite/scripts/steps/renovate.sh | 6 ++++++ 3 files changed, 34 insertions(+) create mode 100644 .buildkite/pipelines/pull_request/renovate.yml create mode 100755 .buildkite/scripts/steps/renovate.sh diff --git a/.buildkite/pipelines/pull_request/renovate.yml b/.buildkite/pipelines/pull_request/renovate.yml new file mode 100644 index 0000000000000..3b441cfe5375a --- /dev/null +++ b/.buildkite/pipelines/pull_request/renovate.yml @@ -0,0 +1,20 @@ +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/renovate.sh + label: 'Renovate validation' + agents: + machineType: n2-highcpu-8 + preemptible: true + key: renovate_validation + 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 ca4ca228b0c91..54176fdc125b8 100644 --- a/.buildkite/scripts/pipelines/pull_request/pipeline.ts +++ b/.buildkite/scripts/pipelines/pull_request/pipeline.ts @@ -39,6 +39,14 @@ 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', false)); + pipeline.push(getPipeline('.buildkite/pipelines/pull_request/post_build.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)); 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