huserben / TfsExtensions

Extensions for TFS 2015+ such as custom Widgets (require TFS 2017) and Build Tasks
MIT License
45 stars 22 forks source link

Nested branch not working #155

Closed FelixS90 closed 3 years ago

FelixS90 commented 3 years ago

Minimal working example

Pipeline_A is triggered from Pipeline_B. Both are in the same project and both have the respective branch. The example works if the branch is of the form refs/heads/a, but not if refs/heads/b/c, i.e. "nested".

- task: benjhuser.tfs-extensions-build-tasks.trigger-build-task.TriggerBuild@3
  displayName: 'Trigger Pipeline'
  inputs:
    buildDefinition: <pipeline_a>
    ignoreSslCertificateErrors: true
    useSameBranch: true
    waitForQueuedBuildsToFinish: true
    waitForQueuedBuildsToFinishRefreshTime: 30
    authenticationMethod: 'OAuth Token'
    password: $(System.AccessToken)

Actual

Error message: Error: Could not queue the build because there were validation errors or warnings.
Will wait 1 seconds before retrying request...
Error during request (2/5)
Error message: Error: Could not queue the build because there were validation errors or warnings.
Will wait 2 seconds before retrying request...
Error during request (3/5)
Error message: Error: Could not queue the build because there were validation errors or warnings.
Will wait 4 seconds before retrying request...
Error during request (4/5)
Error message: Error: Could not queue the build because there were validation errors or warnings.
Will wait 8 seconds before retrying request...
Error during request (5/5)
Error message: Error: Could not queue the build because there were validation errors or warnings.

Expected

Working.

It seems that the branch is correctly identified since it prints: Using same branch as source version: refs/heads/b/c Might be that the problem is in the TFSRestService as it seems to be handed over as such in taskrunner.js. Not sure though.

huserben commented 3 years ago

Hi @FelixS90

Thanks for reporting this. I will need to check this out and come back to you. You are right that we go via the TFSRestService, however I think I've seen the message before and that's something that the REST Endpoint from Azure DevOps returns...

I will investigate and come back to you once I know more.

FelixS90 commented 3 years ago

Thanks a lot. Looking forward to 👍

huserben commented 3 years ago

I tried to reproduce the problem, but for me it seems to work just fine.

Are you by chance using an on premise Azure DevOps Server/TFS?