Repository navigation
Azure DevOps: platformAutomerge merge commit message is not updated when the PR title changes #46848
Unanswered
riksmithns
asked this question in
Request Help
Replies: 1 comment
|
This discussion seems "invisble" / "hidden" on Github. Seeing if a comment resurfaces it. (Result: It does, discussion is now visible) |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
How are you running Renovate?
Self-hosted Renovate CLI
Which platform you running Renovate on?
Other (please specify)
Which version of Renovate are you using?
44.146.3
Please tell us more about your question or problem
Platform: Azure DevOps
With
automerge: trueandplatformAutomerge: trueon Azure DevOps, Renovate enables auto-complete on its PRs and setscompletionOptions.mergeCommitMessageto the PR title. When the PR title changes later, the merge commit message is not updated, so the PR auto-completes with an outdated commit message.This happens in any run where Renovate pushes a new commit to the branch and the PR title changes, for example:
Update dependency foo to v1.2.3gets more updates and becomesUpdate all non-major dependencies, or a newer version becomes available (... to v1.2.4). The squash commit still uses the old title.rebase!<title>. Renovate rebases and restores the title, but the squash commit is namedrebase!<title>.Cause
lib/workers/repository/update/branch/index.ts, after a new commit is pushed (commitSha),platform.reattemptPlatformAutomerge()is called. This happens beforeensurePr().lib/modules/platform/azure/index.ts,reattemptPlatformAutomerge()→setPlatformAutomerge()re-reads the PR and setsmergeCommitMessage: pr.title, which is still the old title.ensurePr()→updatePr()then sets the new title ({ title, description, ... }) but does not touchcompletionOptions.mergeCommitMessage, so the stale message is kept.Possible fixes:
updatePr()in the Azure platform also setcompletionOptions.mergeCommitMessageto the new title when auto-complete is enabled. Updating onlycompletionOptionsvia the REST API (withoutautoCompleteSetBy) works and keeps the existing auto-complete owner.ensurePr()has updated the title.Minimal reproduction
Setup: Azure DevOps repo with squash merge strategy and a branch policy (so the PR doesn't complete immediately), and this config:
{ "automerge": true, "platformAutomerge": true }Scenario A (title changed by Renovate):
Update dependency foo to v1.2.3. Auto-complete is set with merge commit message = PR title.completionOptions.mergeCommitMessage(via the API) still has the old title.Scenario B (rebase requested):
rebase!<original title>.completionOptions.mergeCommitMessageisrebase!<original title>, and the squash commit message on the base branch starts withrebase!.Expected behavior
The merge commit message always matches the current PR title.
Logs (if relevant)
Logs
All reactions