Buildkite: Skip PR builds for non-legacy branches#3343
Open
reakaleek wants to merge 1 commit into
Open
Conversation
Make the docs-build-pr check exit 0 early (reporting success on the still-required check) when a PR targets a branch that no longer carries legacy AsciiDoc docs. A new Perl helper derives each repo's legacy branch set from conf.yaml so the guard stays correct as products migrate to docs-builder, without hardcoded version patterns. Supersedes #3233, which used a single regex that broke non-stack-versioned doc sets (e.g. ECE's ms-* branches, ECK 3.x). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
A documentation preview will be available soon. Request a new doc build by commenting
If your PR continues to fail for an unknown reason, the doc build pipeline may be broken. Elastic employees can check the pipeline status here. |
Mpdreamz
requested changes
Jun 22, 2026
Mpdreamz
left a comment
Member
There was a problem hiding this comment.
This is great and love the pl checking conf.yml
I think we can hardcore main and master as fallback even if the yaml dep is missing?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Make the required
buildkite/docs-build-prcheck exit 0 early (reporting success without building) when a PR targets a branch that no longer carries legacy AsciiDoc docs.Why
As docs migrate from this legacy AsciiDoc system to docs-builder, PRs targeting already-migrated branches (stack
main/9.x, ECK3.x, etc.) still trigger the required check and run a useless build. We want those to go green instantly. The check can't simply be removed because it's required.This supersedes #3233, whose single regex
^([0-8])\.[0-9]+$broke non-stack-versioned doc sets, as reviewers flagged:cloud) uses milestone branch names (ms-119,ms-105…) → matched nothing → would have wrongly skipped every ECE build.cloud-on-k8s) is legacy only on2.x/1.x/0.x;3.xlives in docs-builder but matched^[0-8]\.→ would have wrongly built.How
.buildkite/scripts/legacy_branches.plderives each repo's legacy branch set directly fromconf.yaml— reusing the build's ownYAML::LoadFileparser and the branch-resolution convention fromlib/ES/Book.pm/lib/ES/BranchTracker.pm(LHS branch keys,map_branches,exclude_branches). It maps the GitHub repo name to the conf repo key via the top-levelrepos:URL map (handles cases likeesf→elastic-serverless-forwarder).build_pr.shconsults the helper inside the product-repo path (before cloning) and exits 0 when the target branch isn't in the repo's legacy set. Fails open on any helper error or unknown repo, so a real build is never blocked.conf.yamlmeans the guard needs no edits as products migrate — no hardcoded version patterns.Test plan
Verified the helper locally (Perl
YAMLpresent):legacy_branches.pl elasticsearch→8.19 … 0.90, no9.xlegacy_branches.pl cloud→ms-*milestones (+master), nomainlegacy_branches.pl cloud-on-k8s→0.8 … 2.16, no3.xlegacy_branches.pl elastic-serverless-forwarder→ resolves viaesfkeylegacy_branches.pl clients-team→main(provesmap_branches)shellcheck .buildkite/scripts/build_pr.shclean for the new guardBehavioral:
elasticsearch+main→ skip 0;+8.18→ build.cloud+main→ skip 0;+ms-119→ build.cloud-on-k8s+3.0→ skip 0;+2.16→ build.Notes
The guard runs on the host agent (
docs-ubuntu-2204).libyaml-perlis installed in the buildDockerfile(inside the container) but the host image's PerlYAMLstatus is unconfirmed. The fail-open behavior means no regression if it's missing — the skip simply won't take effect untillibyaml-perlis added to the agent image (verify withperl -MYAML -e1).🤖 Generated with Claude Code