fix fetching of merge base in create merge release workflow#22156
Conversation
Apparently shallow-exclude is misbehaving (confirmed by local tests) and fetching just one level of parents after it is sometimes not enough. Switch to 10 tries to fetch 10 more levels of parents.
There was a problem hiding this comment.
Pull request overview
Adjusts the create-merge-release-into-dev-pr GitHub Actions workflow to more reliably obtain a usable merge-base between dev and the latest release/* branch when working with shallow history (where --shallow-exclude may not fetch enough ancestry).
Changes:
- Replace a single
git fetch --deepen 1with a bounded retry loop that progressively deepens history. - Add an explicit
git merge-basecheck to stop early once the histories are connected, and fail with a clear error if not found.
| - name: Get more commits to connect the history of dev and release branches | ||
| run: | | ||
| for i in $(seq 1 10); do | ||
| git fetch --deepen 10 origin "$BASE_BRANCH" "$RELEASE_BRANCH" |
There was a problem hiding this comment.
Don't know if it is intended here to fetch 10 with each of the 10 tries, or if the intend is to fetch 1 with each of the 10 tries.
There was a problem hiding this comment.
10 tries to deepen by 10 was intended
When testing locally with dev and release heads moved to what they were on Saturday, --deepen 3 once (or --deepen 1 thrice) was enough. After looking at how others try to solve the problem of fetching merge base, I think limited number of attempts to fetch more parents and doing it in bigger steps than 1 should always fetch the merge base
Apparently shallow-exclude is misbehaving (confirmed by local tests) and fetching just one level of parents after it is sometimes not enough. Switch to 10 tries to fetch 10 more levels of parents.