Skip to content

[9.4][ML] Make changelog validation robust to shallow-clone merge base#3121

Merged
edsavage merged 1 commit into
elastic:9.4from
edsavage:backport/9.4/changelog-validate-merge-base
Jul 27, 2026
Merged

[9.4][ML] Make changelog validation robust to shallow-clone merge base#3121
edsavage merged 1 commit into
elastic:9.4from
edsavage:backport/9.4/changelog-validate-merge-base

Conversation

@edsavage

Copy link
Copy Markdown
Contributor

Backport of #3119 to keep the Validate changelog entries step robust on this release branch now that the overall build status (buildkite/ml-cpp-pr-builds) is a required check here.

The step shallow-fetches the base (--depth=1) then runs git diff origin/<base>...HEAD. For a PR branched from an older commit the shallow histories have no merge base, so git aborts with fatal: ...no merge base (exit 128); as it runs in a command substitution under set -e, the script died before its own soft-skip handler and hard-failed the step. This guards the diff with if, deepens history to recover the merge base and retries, and soft-skips only as a last resort.

CI-only change; no production impact. Labelled >build so its own changelog check is skipped.

The validate-changelogs step fetches the PR base with --depth=1 and then
runs a three-dot diff (origin/<base>...HEAD). When a PR branched from an
older commit, the shallow histories share no common ancestor and git aborts
with 'fatal: origin/main...HEAD: no merge base' (exit 128). As the diff runs
in a command substitution under 'set -e', the script died before its own
DIFF_EXIT soft-skip handler could run, hard-failing the step.

Guard the diff with 'if' (suppressing set -e), progressively deepen both
histories to recover a merge base and retry, and only soft-skip as a last
resort. This matters now that the overall build status is a required check:
a CI clone-depth limitation must not block an otherwise valid PR.

Co-authored-by: Cursor <cursoragent@cursor.com>
@elasticsearchmachine

Copy link
Copy Markdown

Pinging @elastic/ml-core (Team:ML)

@edsavage edsavage changed the title [ML] Make changelog validation robust to shallow-clone merge base (9.4) [9.4][ML] Make changelog validation robust to shallow-clone merge base Jul 27, 2026
@edsavage
edsavage merged commit 3053906 into elastic:9.4 Jul 27, 2026
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants