chore(azure): simplify calculation for getMergeMethod#42849
Merged
jamietanna merged 2 commits intomainfrom Apr 24, 2026
Merged
Conversation
Instead of the complicated check we were previously performing which: - recovered from errors if `policyConfigurations` wasn't undefined, or other errors occurred - trimmed the field names and checked if they were one of the `GitPullRequestMergeStrategy` options We can instead rewrite this with stronger types and compile time checks to confirm that the mapping from a policy configuration matches the different `GitPullRequestMergeStrategy`s. This provides a clearer intent for what this code is doing. This changes behaviour slightly - previously, the first JSON key defined that was a `GitPullRequestMergeStrategy` would be used (which is JSON implementation specific), whereas now it is a defined order. We also add coverage for the new behaviour. Co-authored-by: Claude Sonnet 4.6 <jamie.tanna+claude-code@mend.io>
Contributor
Author
|
Wondering if we should do it as a "fix" to:
? |
viceice
approved these changes
Apr 24, 2026
Contributor
|
🎉 This PR is included in version 43.141.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Instead of the complicated check we were previously performing which:
policyConfigurationswasn't undefined, orother errors occurred
GitPullRequestMergeStrategyoptionsWe can instead rewrite this with stronger types and compile time checks
to confirm that the mapping from a policy configuration matches the
different
GitPullRequestMergeStrategys.This provides a clearer intent for what this code is doing.
This changes behaviour slightly - previously, the first JSON key defined
that was a
GitPullRequestMergeStrategywould be used (which is JSONimplementation specific), whereas now it is a defined order.
We also add coverage for the new behaviour.
Context
Please select one of the below:
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: