Skip to content

fix fetching of merge base in create merge release workflow#22156

Merged
toy merged 1 commit intodevfrom
fix-fetching-merge-base-for-workflow
Mar 3, 2026
Merged

fix fetching of merge base in create merge release workflow#22156
toy merged 1 commit intodevfrom
fix-fetching-merge-base-for-workflow

Conversation

@toy
Copy link
Contributor

@toy toy commented Mar 2, 2026

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.

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.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 1 with a bounded retry loop that progressively deepens history.
  • Add an explicit git merge-base check to stop early once the histories are connected, and fail with a clear error if not found.

Copy link
Contributor

@ulferts ulferts left a comment

Choose a reason for hiding this comment

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

@toy Change makes sense to me. I pose a question on the code though to double check if the change it its current form is actually intended.

- 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"
Copy link
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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

@toy toy merged commit 90eb9c7 into dev Mar 3, 2026
19 checks passed
@toy toy deleted the fix-fetching-merge-base-for-workflow branch March 3, 2026 11:38
@github-actions github-actions bot locked and limited conversation to collaborators Mar 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants