[Feature Request] az repos pr create
should allow Azure Repos to dynamically choose targetRef
#1431
Labels
Feature
Feature Work required.
Is your feature request related to a problem? Please describe.
There is a new feature in Azure Repos where a repository can configure custom target branches. When these branches are configured, the PR create page in the Web UI will dynamically choose a target branch based on the first-parent commit history.
This issue's request is that this behavior becomes enabled in
az repos pr create
when the user does not specify a target branch in the CLI.Describe the solution you'd like
I have a working implementation in my fork: see diff here. I started creating a PR but then saw that we needed signoff on the approach.
There are two main pieces here:
IgnoreTargetRefAndChooseDynamically
member to theGitPullRequest
object. Since this is an addition to the object model, it will be included in the POST body of the request to create a PR. Older versions of Azure DevOps Server will ignore this member, but newer versions (and the Azure DevOps cloud service) will recognize it as a signal to ignore theTargetRef
value and instead enable the new logic, when configured. This parameter was the decision of the Azure Repos team instead of makingTargetRef
optional, which was considered a backwards compatibility break. The currentaz repos pr create
logic only interacts with thev5_0
model, but all existing models are updated. Further, the latest released model does not yet have this parameter (introduced in ~September 2024 clients).Additional context
I'm the author of this feature in the Azure Repos backend (and of the linked docs). I assisted several major repositories within Microsoft to configure this setting, including the Windows and Office monorepos. I'm contributing client-side changes to
az repos
and thedev
CLIs as we have users creating PRs with those tools.The text was updated successfully, but these errors were encountered: