MicrosoftDocs / azure-devops-docs

This repo is the home of the official Azure DevOps documentation for Microsoft. GitHub Issues filed in this repository should be for problems with the documentation.
https://docs.microsoft.com/azure/devops/
Creative Commons Attribution 4.0 International
830 stars 2.45k forks source link

GithubRelease@0 Azure-Pipelines task: Fix casing of the gitHubConnection yaml key #4199

Closed pragmatrix closed 5 years ago

pragmatrix commented 5 years ago

yAMl keys are case sensitive and the the YaMl connection key for the GithubRelease@0 task is gitHubConnection and not githubConnection. Copying one of the examples caused some irritating and hard to track down problems documented here: https://github.com/microsoft/azure-pipelines-tasks/issues/10294.

This PR corrects the examples.

PRMerger13 commented 5 years ago

@pragmatrix : Thanks for your contribution! The author, @davidstaheli, has been notified to review your proposed change.

davidstaheli commented 5 years ago

Thank you for this, @pragmatrix! It looks good and we should merge it. But @vtbassmatt, my understanding is that Azure Pipelines treats input names case-insensitively. Is that right?

pragmatrix commented 5 years ago

The problem in the issue referenced disappeared after changing the key as recommended by @mdmdakbar. I personally copied the key from a previously working script, so may be the case-sensitivity was changed recently.

vtbassmatt commented 5 years ago

Hmm, as long as a task is built using the task-lib, task names should be case-insensitive. I'll check with the RM folks internally to see what's different about their tasks.

davidstaheli commented 5 years ago

Since this can no longer be reproduced, I'll close this PR. Feel free to re-open if needed.

pragmatrix commented 5 years ago

@davidstaheli I reproduced it here:

https://dev.azure.com/pragmatrix-github/rust-skia/_build/results?buildId=1111

... click the first Build and open the "Release to GitHub job" marked red.

with the GitHubRelease@0 task configuration:

https://github.com/rust-skia/rust-skia/blob/a84353f6aa88bd35b72863bac6fb584f2e47f6a4/azure-pipelines-template.yml#L107-L120

Can you work based on that, or do you need a minimal repro?

Diagnostic Log:

##[debug]gitHubConnection=e52eaa22-feb4-4f41-bb9f-e15cc972dc98
##[debug]task result: Failed
##[error]Endpoint auth data not present: e52eaa22-feb4-4f41-bb9f-e15cc972dc98
##[debug]Processed: ##vso[task.issue type=error;]Endpoint auth data not present: e52eaa22-feb4-4f41-bb9f-e15cc972dc98
##[debug]Processed: ##vso[task.complete result=Failed;]Endpoint auth data not present: e52eaa22-feb4-4f41-bb9f-e15cc972dc98
e52eaa22-feb4-4f41-bb9f-e15cc972dc98 exists false
##[debug]e52eaa22-feb4-4f41-bb9f-e15cc972dc98 exists false
##[debug]task result: Failed
##[error]Error: Invalid GitHub service endpoint: e52eaa22-feb4-4f41-bb9f-e15cc972dc98.
##[debug]Processed: ##vso[task.issue type=error;]Error: Invalid GitHub service endpoint: e52eaa22-feb4-4f41-bb9f-e15cc972dc98.
##[debug]Processed: ##vso[task.complete result=Failed;]Error: Invalid GitHub service endpoint: e52eaa22-feb4-4f41-bb9f-e15cc972dc98.
davidstaheli commented 5 years ago

Interesting. The error is about missing service connection auth data. Looking at the code, I can't see how the YAML key casing would affect this. @pragmatrix is your pipeline's GitHub service connection based on OAuth or a personal access token? Can you confirm that the service connection still exists under your Azure DevOps 'rust-skia' project settings here?

For our future reference, the error is being thrown by tasklib 2.8 (here).

pragmatrix commented 5 years ago

@davidstaheli All service connections are configured to use OAuth, and yes, I can confirm that the connection still exists.

I assume that some default and/or non-existent connection is picked up when the key is considered missing. I'll change it back to confirm that it works with the case correct key once again and report back.

pragmatrix commented 5 years ago

Diff: https://github.com/rust-skia/rust-skia/commit/dcd3286bbbe96ac449492dda573a2a20b7605f47

and the releases are working again (Build Linux Stable / Release to GitHub rust-skia/skia-binaries):

https://dev.azure.com/pragmatrix-github/rust-skia/_build/results?buildId=1116

Diagnostic Build is queued here:

https://dev.azure.com/pragmatrix-github/rust-skia/_build/results?buildId=1117

davidstaheli commented 5 years ago

@vtbassmatt this probably warrants Talos investigation.

vtbassmatt commented 5 years ago

Sure. Tracking as https://github.com/microsoft/azure-pipelines-task-lib/issues/539, in the meantime, this doc change won't hurt.