[9.4][ML] Make changelog validation robust to shallow-clone merge base#3121
Merged
edsavage merged 1 commit intoJul 27, 2026
Merged
Conversation
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>
|
Pinging @elastic/ml-core (Team:ML) |
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.
Backport of #3119 to keep the
Validate changelog entriesstep 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 runsgit diff origin/<base>...HEAD. For a PR branched from an older commit the shallow histories have no merge base, so git aborts withfatal: ...no merge base(exit 128); as it runs in a command substitution underset -e, the script died before its own soft-skip handler and hard-failed the step. This guards the diff withif, deepens history to recover the merge base and retries, and soft-skips only as a last resort.CI-only change; no production impact. Labelled
>buildso its own changelog check is skipped.