fix(workers): re-attempt platform automerge only in case of new commits #40028
+25
−0
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.
Changes
Ensures that platform automerge is only re-attempted when needed (due to rebase) instead of attempting it always for any unmerged PR.
#26567 introduced functionality to re-enable platform automerge when a PR is updated. This approach nowhere ensures that
reattemptPlatformAutomerge()is only called in case of new commits on a branch. SincereattemptPlatformAutomerge()works idempotent on all supported platforms, it also doesn't fail if auto-merge is already active, which may explain why this went unnoticed so far.The issue with the current approach is that it adds unnecessary extra HTTP requests which, in the case of GitLab with 5 retries for failed attempts, slow down renovate execution.
Context
Please select one of the following:
AI assistance disclosure
Did you use AI tools to create any part of this pull request?
Please select one option and, if yes, briefly describe how AI was used (e.g., code, tests, docs) and which tool(s) you used.
Documentation (please check one with an [x])
How I've tested my work (please select one)
I have verified these changes via:
The public repository: https://gitlab.com/entropy_cat/platform-automerge-test/-/merge_requests/2
Log before this change (only relevant parts)
Log after this change (only relevant parts)