vsteam icon indicating copy to clipboard operation
vsteam copied to clipboard

Update a Pull Request for Auto Complete

Open getSurreal opened this issue 3 years ago • 6 comments

Steps to reproduce

        $user = Get-VSTeamUser | Where-Object DisplayName -eq '{User Name}'
        Update-VSTeamPullRequest -RepositoryId $Repository.Id -PullRequestId $PR.pullRequestId -EnableAutoComplete -AutoCompleteIdentity $user

Expected behavior

PR gets updated

Actual behavior

No error, but PR is not updated

Environment data

OS

  • [ ] macOS
  • [ ] Windows
  • [x] Linux

Server

  • [ ] TFS 2017
  • [ ] TFS 2018
  • [x] Azure DevOps Server
  • [ ] Azure DevOps Service
> Get-VSTeamAPIVersion
Billing                     : 5.1-preview.1
Build                       : 5.1
Core                        : 5.1
DistributedTask             : 6.0-preview
DistributedTaskReleased     : 5.1
ExtensionsManagement        : 6.0-preview
Git                         : 5.1
Graph                       : 6.0-preview
HierarchyQuery              : 5.1-preview
MemberEntitlementManagement : 6.0-preview
Packaging                   : 6.0-preview
Pipelines                   : 5.1-preview
Policy                      : 5.1
Processes                   : 6.0-preview
Release                     : 5.1
ServiceEndpoints            : 5.0-preview
TaskGroups                  : 6.0-preview
Tfvc                        : 5.1
VariableGroups              : 5.1-preview.1
Version                     : AzD # Also tried VSTS, AzD2019U1
> $PSVersionTable
Name                           Value
----                           -----
PSVersion                      7.1.3
PSEdition                      Core
GitCommitId                    7.1.3
OS                             Linux 4.14.225-168.357.amzn2.x86_64 #1 SMP Mon Mar 15 18:00:02 UTC 2021
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

getSurreal avatar Jul 19 '21 19:07 getSurreal

I also tried to DisableAutoComplete after manually setting the auto complete. It also did nothing after returning like it did something.

getSurreal avatar Jul 19 '21 20:07 getSurreal

Do the other options work? Is it only this flag which is not working?

SebastianSchuetze avatar Jul 20 '21 07:07 SebastianSchuetze

Setting to Draft and back to Active worked

getSurreal avatar Jul 21 '21 15:07 getSurreal

Checking it today.

SebastianSchuetze avatar Sep 08 '21 06:09 SebastianSchuetze

Thanks. I checked it and it turns out this one is not implemented at all.

When updating the PR with an auto merge option the following object (with possible options in the values) is usually PATCHed:

{
   "completionOptions": {
      "autoCompleteIgnoreConfigIds": [],
      "bypassPolicy": false | true,
      "deleteSourceBranch": false | true,
      "mergeCommitMessage": "Commit Message",
      "mergeStrategy": 1 | 2 | 3 | 4,
      "transitionWorkItems": false | true
   },
   "autoCompleteSetBy": {
      "id": "user id"
   }
}

But the cmdlet is only pushing the ´autoCompleteSetBy´ property and not the rest. But the commit Message and Merge strategy objects are a minimum that need to be added. So I will implement this later.

SebastianSchuetze avatar Sep 12 '21 15:09 SebastianSchuetze

Thanks for the update. Looking forward to the fix!

getSurreal avatar Oct 14 '21 21:10 getSurreal