Skip to content

ci: fix build_openssl_presubmit() merge-base in shallow clones - #46463

Merged
jwendell merged 1 commit into
envoyproxy:mainfrom
jwendell:fix-openssl-presubmit-shallow-clone
Jul 30, 2026
Merged

ci: fix build_openssl_presubmit() merge-base in shallow clones#46463
jwendell merged 1 commit into
envoyproxy:mainfrom
jwendell:fix-openssl-presubmit-shallow-clone

Conversation

@jwendell

Copy link
Copy Markdown
Member

The CI checkout uses fetch-depth: 1 for PRs, so both git merge-base and the HEAD~1 fallback fail silently — resulting in no changed files detected and all tests skipped.

When merge-base fails, fall back to diffing against origin/${CI_TARGET_BRANCH} directly, which compares trees without needing history traversal.

The CI checkout uses `fetch-depth: 1` for PRs, so both
`git merge-base` and the `HEAD~1` fallback fail silently —
resulting in no changed files detected and all tests skipped.

When `merge-base` fails, fall back to diffing against
`origin/${CI_TARGET_BRANCH}` directly, which compares trees
without needing history traversal.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Jonh Wendell <jwendell@redhat.com>
@jwendell
jwendell requested review from agrawroh and phlax as code owners July 30, 2026 14:49
@jwendell
jwendell enabled auto-merge (squash) July 30, 2026 16:22

@phlax phlax left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would probably skip the 2 fallbacks and just make sure its unshallowed

if [[ "$(git rev-parse --is-shallow-repository)" == "true" ]]; then
    git fetch --unshallow
fi

both "last commit" and "diff from main" give wrong results in most cases

up to you tho

@jwendell
jwendell merged commit 85f0824 into envoyproxy:main Jul 30, 2026
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants