From 705d25ebf0f0b65afed8570e461c941e1adbf0ec Mon Sep 17 00:00:00 2001 From: Jan Calanog Date: Fri, 20 Jun 2025 00:41:18 +0200 Subject: [PATCH 1/2] Only build 8.x target branches --- .buildkite/pull-requests.org-wide.json | 1 + 1 file changed, 1 insertion(+) diff --git a/.buildkite/pull-requests.org-wide.json b/.buildkite/pull-requests.org-wide.json index 29fe92e4ed5a..c004ce5abc8d 100644 --- a/.buildkite/pull-requests.org-wide.json +++ b/.buildkite/pull-requests.org-wide.json @@ -12,6 +12,7 @@ "allowed_list": ["github-actions[bot]", "renovate[bot]", "mergify[bot]", "dependabot[bot]", "elastic-renovate-prod[bot]", "elastic-observability-automation[bot]"], "build_on_commit": true, "build_on_comment": true, + "target_branch": ["8.x", "8.19", "8.18", "8.17", "8.16", "8.15", "8.14", "8.13", "8.12", "8.11", "8.10", "8.9", "8.8", "8.7", "8.6", "8.5", "8.4", "8.3", "8.2", "8.1", "8.0"], "trigger_comment_regex": "run docs-build ?(?rebuild)? ?(?warnlinkcheck)? ?(?skiplinkcheck)?", "always_trigger_comment_regex": "buildkite test this ?(?rebuild)? ?(?warnlinkcheck)? ?(?skiplinkcheck)?", "skip_ci_labels": [ From bd7d0fe1e3e0cc2324ee0e8b087da73d8f2bbfea Mon Sep 17 00:00:00 2001 From: Jan Calanog Date: Fri, 20 Jun 2025 00:44:39 +0200 Subject: [PATCH 2/2] Actually, exit early if the target branch doesn't match The buildkite/docs-build-pr status check is required in some repos. This way it will stay green --- .buildkite/pull-requests.org-wide.json | 1 - .buildkite/scripts/build_pr.sh | 10 ++++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.buildkite/pull-requests.org-wide.json b/.buildkite/pull-requests.org-wide.json index c004ce5abc8d..29fe92e4ed5a 100644 --- a/.buildkite/pull-requests.org-wide.json +++ b/.buildkite/pull-requests.org-wide.json @@ -12,7 +12,6 @@ "allowed_list": ["github-actions[bot]", "renovate[bot]", "mergify[bot]", "dependabot[bot]", "elastic-renovate-prod[bot]", "elastic-observability-automation[bot]"], "build_on_commit": true, "build_on_comment": true, - "target_branch": ["8.x", "8.19", "8.18", "8.17", "8.16", "8.15", "8.14", "8.13", "8.12", "8.11", "8.10", "8.9", "8.8", "8.7", "8.6", "8.5", "8.4", "8.3", "8.2", "8.1", "8.0"], "trigger_comment_regex": "run docs-build ?(?rebuild)? ?(?warnlinkcheck)? ?(?skiplinkcheck)?", "always_trigger_comment_regex": "buildkite test this ?(?rebuild)? ?(?warnlinkcheck)? ?(?skiplinkcheck)?", "skip_ci_labels": [ diff --git a/.buildkite/scripts/build_pr.sh b/.buildkite/scripts/build_pr.sh index 506a5a6d0ee1..e18a1458c9ee 100755 --- a/.buildkite/scripts/build_pr.sh +++ b/.buildkite/scripts/build_pr.sh @@ -8,6 +8,12 @@ if [ -z ${GITHUB_PR_TARGET_BRANCH+set} ] || [ -z ${GITHUB_PR_NUMBER+set} ] || [ exit 1 fi +# We only want to build PRs if the target branch is a major version < 9 +if ! [[ $GITHUB_PR_TARGET_BRANCH =~ ^([0-8])\.[0-9]+$ ]]; then + echo "Target branch '$GITHUB_PR_TARGET_BRANCH' is not a valid version branch (must be in format X.Y where X <= 8)" + exit 0 +fi + # Configure the git author and committer information export GIT_AUTHOR_NAME='Buildkite CI' export GIT_AUTHOR_EMAIL='docs-status+buildkite@elastic.co' @@ -263,5 +269,5 @@ buildkite-agent annotate \ "
Preview url: ${PREVIEW_URL}" buildkite-agent meta-data set pr_comment:doc-preview:head " * Documentation preview - - 📚 [HTML diff](${PREVIEW_URL}/diff) - - 📙 [Preview](${PREVIEW_URL})" + - [HTML diff](${PREVIEW_URL}/diff) + - [Preview](${PREVIEW_URL})"