shayki5 / azure-devops-create-pr-task

Azure Pipelines task to create PR in Azure DevOps or GitHub during a build or release pipeline
https://marketplace.visualstudio.com/items?itemName=ShaykiAbramczyk.CreatePullRequest
MIT License
58 stars 35 forks source link

alwaysCreatePr does not work #181

Closed hosswald closed 10 months ago

hosswald commented 10 months ago

We enabled alwaysCreatePr, but still received the error "TF401179: An active pull request for the source and target branch already exists".

Logs with diagnostics:

2023-11-15T09:58:14.6632714Z ##[debug]Evaluating condition for step: 'Merge into release-candidate branch'
2023-11-15T09:58:14.6646435Z ##[debug]Evaluating: eq(variables['CurrentBranch'], variables['ReleaseBranch'])
2023-11-15T09:58:14.6647260Z ##[debug]Evaluating eq:
2023-11-15T09:58:14.6648633Z ##[debug]..Evaluating indexer:
2023-11-15T09:58:14.6661895Z ##[debug]....Evaluating variables:
2023-11-15T09:58:14.6665681Z ##[debug]....=> Object
2023-11-15T09:58:14.6670696Z ##[debug]....Evaluating String:
2023-11-15T09:58:14.6671219Z ##[debug]....=> 'CurrentBranch'
2023-11-15T09:58:14.6675356Z ##[debug]..=> 'master'
2023-11-15T09:58:14.6676043Z ##[debug]..Evaluating indexer:
2023-11-15T09:58:14.6676575Z ##[debug]....Evaluating variables:
2023-11-15T09:58:14.6677020Z ##[debug]....=> Object
2023-11-15T09:58:14.6677361Z ##[debug]....Evaluating String:
2023-11-15T09:58:14.6677794Z ##[debug]....=> 'ReleaseBranch'
2023-11-15T09:58:14.6678459Z ##[debug]..=> 'master'
2023-11-15T09:58:14.6682023Z ##[debug]=> True
2023-11-15T09:58:14.6687430Z ##[debug]Expanded: eq('master', 'master')
2023-11-15T09:58:14.6688035Z ##[debug]Result: True
2023-11-15T09:58:14.6766545Z ##[section]Starting: Merge into release-candidate branch
2023-11-15T09:58:14.8168842Z ==============================================================================
2023-11-15T09:58:14.8169647Z Task         : Create Pull Request
2023-11-15T09:58:14.8170041Z Description  : Automatically create a Pull Request for Azure DevOps or GitHub repository from Build or Release pipeline, supports also multi target branch.
2023-11-15T09:58:14.8171132Z Version      : 1.2.371
2023-11-15T09:58:14.8171391Z Author       : Shayki Abramczyk
2023-11-15T09:58:14.8172896Z Help         : [More Information](https://github.com/shayki5/azure-devops-create-pr-task/blob/master/README.md)
2023-11-15T09:58:14.8173646Z ==============================================================================
2023-11-15T09:58:17.1415728Z ##[debug]VstsTaskSdk 0.10.0 commit 787a46ec0a2df5b4d12c2e801bd3f319975c054c
2023-11-15T09:58:17.1417876Z ##[debug]Entering RunTask.
2023-11-15T09:58:17.1420651Z ##[debug]INPUT_SOURCEBRANCH: 'refs/heads/master'
2023-11-15T09:58:17.1421362Z ##[debug]INPUT_TARGETBRANCH: 'quality'
2023-11-15T09:58:17.1422334Z ##[debug]INPUT_TITLE: 'Merge refs/heads/master into quality'
2023-11-15T09:58:17.1423082Z ##[debug]INPUT_DESCRIPTION (empty)
2023-11-15T09:58:17.1423811Z ##[debug]INPUT_REVIEWERS: 'req:***@***.com'
2023-11-15T09:58:17.1424676Z ##[debug]INPUT_TAGS (empty)
2023-11-15T09:58:17.1425207Z ##[debug]INPUT_REPOTYPE: 'Azure DevOps'
2023-11-15T09:58:17.1425818Z ##[debug]INPUT_ISDRAFT: 'false'
2023-11-15T09:58:17.1426398Z ##[debug] Converted to bool: False
2023-11-15T09:58:17.1426960Z ##[debug]INPUT_AUTOCOMPLETE: 'true'
2023-11-15T09:58:17.1427525Z ##[debug] Converted to bool: True
2023-11-15T09:58:17.1428142Z ##[debug]INPUT_MERGESTRATEGY: 'Merge (No fast-forward)'
2023-11-15T09:58:17.1428840Z ##[debug]INPUT_DELETESOURCH (empty)
2023-11-15T09:58:17.1429532Z ##[debug] Converted to bool: False
2023-11-15T09:58:17.1430088Z ##[debug]INPUT_DELETESOURCE: 'false'
2023-11-15T09:58:17.1430677Z ##[debug] Converted to bool: False
2023-11-15T09:58:17.1431847Z ##[debug]INPUT_COMMITMESSAGE: '[hotfix sync] Merge latest changes from "refs/heads/master" (5cdb2ba213cc50fe4c10a24ca5f5593fd304a1f7 - v1.33.45 [skip ci])'
2023-11-15T09:58:17.1433103Z ##[debug]INPUT_TRANSITIONWORKITEMS: 'false'
2023-11-15T09:58:17.1433690Z ##[debug] Converted to bool: False
2023-11-15T09:58:17.1434250Z ##[debug]INPUT_LINKWORKITEMS: 'true'
2023-11-15T09:58:17.1434808Z ##[debug] Converted to bool: True
2023-11-15T09:58:17.1435353Z ##[debug]INPUT_PROJECTID (empty)
2023-11-15T09:58:17.1435896Z ##[debug]INPUT_GITREPOSITORYID (empty)
2023-11-15T09:58:17.1436505Z ##[debug]INPUT_GITHUBREPOSITORY: 'myproject'
2023-11-15T09:58:17.1437134Z ##[debug]INPUT_PASSPULLREQUESTIDBACKTOADO: 'false'
2023-11-15T09:58:17.1438925Z ##[debug] Converted to bool: False
2023-11-15T09:58:17.1452750Z ##[debug]INPUT_ISFORKED: 'false'
2023-11-15T09:58:17.1455382Z ##[debug] Converted to bool: False
2023-11-15T09:58:17.1455915Z ##[debug]INPUT_BYPASSPOLICY: 'false'
2023-11-15T09:58:17.1456387Z ##[debug] Converted to bool: False
2023-11-15T09:58:17.1456842Z ##[debug]INPUT_BYPASSREASON (empty)
2023-11-15T09:58:17.1457306Z ##[debug]INPUT_ALWAYSCREATEPR: 'true'
2023-11-15T09:58:17.1457770Z ##[debug] Converted to bool: True
2023-11-15T09:58:17.1458523Z ##[debug]INPUT_GITHUBAUTOMERGE: 'false'
2023-11-15T09:58:17.1459003Z ##[debug] Converted to bool: False
2023-11-15T09:58:17.1459475Z ##[debug]INPUT_GITHUBMERGECOMMITTITLE (empty)
2023-11-15T09:58:17.1460011Z ##[debug]INPUT_GITHUBMERGECOMMITMESSAGE (empty)
2023-11-15T09:58:17.1460552Z ##[debug]INPUT_GITHUBMERGESTRATEGY: 'merge'
2023-11-15T09:58:17.1461080Z ##[debug]INPUT_GITHUBDELETESOURCEBRANCH: 'false'
2023-11-15T09:58:17.1461612Z ##[debug] Converted to bool: False
2023-11-15T09:58:17.1462227Z ##[debug]ENDPOINT_URL_SystemVssConnection: 'https://dev.azure.com/***/'
2023-11-15T09:58:17.1462975Z ##[debug]ENDPOINT_AUTH_SystemVssConnection: '********'
2023-11-15T09:58:17.1463565Z ##[debug]ENDPOINT_DATA_SystemVssConnection (empty)
2023-11-15T09:58:17.1463984Z Creating Azure DevOps Pull Request
2023-11-15T09:58:17.1464251Z The repository is: myproject
2023-11-15T09:58:17.1464481Z The Source Branch is: refs/heads/master
2023-11-15T09:58:17.1464794Z The Target Branch is: refs/heads/quality
2023-11-15T09:58:17.1465132Z The Title is: Merge refs/heads/master into quality
2023-11-15T09:58:17.1465483Z The Description is: 
2023-11-15T09:58:17.1466044Z The Reviewers are: req:***@***.com
2023-11-15T09:58:17.1466645Z The tags are: 
2023-11-15T09:58:17.1466808Z Is Draft Pull Request: False
2023-11-15T09:58:17.1467098Z Auto-Complete: True
2023-11-15T09:58:17.1467292Z Link Work Items: True
2023-11-15T09:58:17.1467472Z Bypass: False
2023-11-15T09:58:17.1467633Z Bypass Reason: 
2023-11-15T09:58:17.1467804Z DeleteSourceBranch ist set to: False
2023-11-15T09:58:17.1468708Z ##[debug]GET https://dev.azure.com/***/myproject/_apis/git/repositories/myproject/refs?filter=heads with 0-byte payload
2023-11-15T09:58:17.1470018Z ##[debug]received -1-byte response of content type application/json; charset=utf-8; api-version=7.1
2023-11-15T09:58:17.1470935Z ##[debug]Available branches in repository 'myproject':
2023-11-15T09:58:17.1573639Z ##[debug]refs/heads/*** [removed, 339 branches in total]
2023-11-15T09:58:17.1678129Z ##[debug]GET https://dev.azure.com/***/myproject/_apis/git/repositories/myproject/diffs/commits?baseVersion=quality&targetVersion=master&api-version=4.0&diffCommonCommit=true&$top=2 with 0-byte payload
2023-11-15T09:58:17.2325730Z ##[debug]received 1253-byte response of content type application/json; charset=utf-8; api-version=4.0
2023-11-15T09:58:17.2334820Z AlwaysCreatePr flag is true. Trying to perform a Pull Request...
2023-11-15T09:58:17.2368201Z The source branch is ahead by 15 commits. Perform a Pull Request...
2023-11-15T09:58:17.2436292Z Getting reviewer identities from TFS collection / Azure DevOps organization: https://dev.azure.com/***/
2023-11-15T09:58:17.2462178Z ##[debug]req:***@***.com
2023-11-15T09:58:18.0336256Z ##[debug]Looking for identity of reviewer: ***@***.com at https://vssps.dev.azure.com/***/_apis/identities?api-version=7.0&searchFilter=MailAddress&filterValue=***@***.com
2023-11-15T09:58:18.0339437Z ##[debug]GET https://vssps.dev.azure.com/***/_apis/identities?api-version=7.0&searchFilter=MailAddress&filterValue=***@***.com with 0-byte payload
2023-11-15T09:58:18.0878690Z ##[debug]received 1335-byte response of content type application/json; charset=utf-8; api-version=7.0
2023-11-15T09:58:18.0958077Z ##[debug]***@***.com ***
2023-11-15T09:58:18.1001572Z The reviewers are: req:***@***.com
2023-11-15T09:58:18.2692384Z ##[debug]POST https://dev.azure.com/***/myproject/_apis/git/repositories/myproject/commitsBatch?api-version=4.0 with -1-byte payload
2023-11-15T09:58:18.4982773Z ##[debug]received 10391-byte response of content type application/json; charset=utf-8; api-version=4.0
2023-11-15T09:58:18.5023391Z ##[debug]@{count=15; value=System.Object[]}
2023-11-15T09:58:18.5128746Z ##[debug]@{id=49776; url=https://dev.azure.com/***/_apis/wit/workItems/49776}
2023-11-15T09:58:18.5142250Z ##[debug]@{id=49776; url=https://dev.azure.com/***/_apis/wit/workItems/49776}
2023-11-15T09:58:18.5160596Z ##[debug]@{id=49776; url=https://dev.azure.com/***/_apis/wit/workItems/49776}
2023-11-15T09:58:18.5201879Z ##[debug]@{id=49776; url=https://dev.azure.com/***/_apis/wit/workItems/49776}
2023-11-15T09:58:18.5301927Z ##[debug]49776
2023-11-15T09:58:18.5321664Z ##[debug]@{id=49776; url=https://dev.azure.com/***/_apis/wit/workItems/49776}
2023-11-15T09:58:18.5342629Z ##[debug]49776
2023-11-15T09:58:18.5360786Z ##[debug]49776
2023-11-15T09:58:18.5378573Z ##[debug]@{id=49776; url=https://dev.azure.com/***/_apis/wit/workItems/49776}
2023-11-15T09:58:18.5396410Z ##[debug]49776
2023-11-15T09:58:18.5413691Z ##[debug]49776
2023-11-15T09:58:18.5429655Z ##[debug]49776
2023-11-15T09:58:18.6052896Z {
2023-11-15T09:58:18.6053126Z     "description":  "",
2023-11-15T09:58:18.6053403Z     "labels":  "",
2023-11-15T09:58:18.6053583Z     "WorkItemRefs":  [
2023-11-15T09:58:18.6053878Z                          {
2023-11-15T09:58:18.6054124Z                              "id":  "49776",
2023-11-15T09:58:18.6054437Z                              "url":  ""
2023-11-15T09:58:18.6054746Z                          }
2023-11-15T09:58:18.6054944Z                      ],
2023-11-15T09:58:18.6055272Z     "isDraft":  "False",
2023-11-15T09:58:18.6055533Z     "sourceRefName":  "refs/heads/master",
2023-11-15T09:58:18.6055918Z     "targetRefName":  "refs/heads/quality",
2023-11-15T09:58:18.6056319Z     "title":  "Merge refs/heads/master into quality",
2023-11-15T09:58:18.6056686Z     "forkSource":  "",
2023-11-15T09:58:18.6056898Z     "reviewers":  [
2023-11-15T09:58:18.6057069Z                       {
2023-11-15T09:58:18.6057966Z                           "id":  "***",
2023-11-15T09:58:18.6058375Z                           "isRequired":  true
2023-11-15T09:58:18.6058694Z                       }
2023-11-15T09:58:18.6058890Z                   ]
2023-11-15T09:58:18.6059048Z }
2023-11-15T09:58:18.6086247Z ##[debug]POST https://dev.azure.com/***/myproject/_apis/git/repositories/myproject/pullrequests?api-version=7.0 with -1-byte payload
2023-11-15T09:58:18.9879545Z ##[warning]{"$id":"1","innerException":null,"message":"TF401179: An active pull request for the source and target branch already exists.","typeName":"Microsoft.TeamFoundation.Git.Server.GitPullRequestExistsException, Microsoft.TeamFoundation.Git.Server","typeKey":"GitPullRequestExistsException","errorCode":0,"eventId":3000}
2023-11-15T09:58:18.9891111Z ##[debug]Processed: ##vso[task.logissue type=warning]{"$id":"1","innerException":null,"message":"TF401179: An active pull request for the source and target branch already exists.","typeName":"Microsoft.TeamFoundation.Git.Server.GitPullRequestExistsException, Microsoft.TeamFoundation.Git.Server","typeKey":"GitPullRequestExistsException","errorCode":0,"eventId":3000}
2023-11-15T09:58:18.9895121Z ##[debug]Leaving RunTask.
2023-11-15T09:58:19.0198665Z ##[section]Finishing: Merge into release-candidate branch
hosswald commented 10 months ago

Misunderstood the meaning of the setting, sorry.