Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use '*' to specify version in YAML; works in Release pipeline #72

Open
Erich-McMillan opened this issue Apr 1, 2023 · 2 comments

Comments

@Erich-McMillan
Copy link

What I'd like to do:

I'd like to promote the latest version of a package in the feed from 'local' to 'release'. Want to specify '*' for the version.

What I've tried:

  • Running the task in Release pipeline using GUI -> works fine (last I checked)
  • Copying the yaml from the GUI to a YAML pipeline -> fails (see error below)
  • Copying the yaml from the GUI to a YAML pipeline and changing version: to a specific version 0.1.1 -> works fine

The error:

https://pkgs.dev.azure.com/MYPROJECT/_apis/packaging/feeds/7e237d53-b4c4-44b5-b7fa-49f7f33477eb/UPack/packages/MYPACKAGE/versions/*?api-version=5.0-preview.1
##[debug]PATCH https://pkgs.dev.azure.com/MYPROJECT/_apis/packaging/feeds/7e237d53-b4c4-44b5-b7fa-49f7f33477eb/UPack/packages/MYPACKAGE/versions/*?api-version=5.0-preview.1 with -1-byte payload
##[debug]Caught exception from task script.
##[debug]Error record:
##[debug]Invoke-RestMethod : {"$id":"1","innerException":null,"message":"A potentially dangerous Request.Path value was detected from the client (*).","typeName":"System.Web.HttpException, System.Web","typeKey":"HttpException","errorCode":0,"eventId":0}
##[debug]At D:\a\_tasks\rvo-vsts-promotepackage-task_7ca5869f-a901-4012-a50d-d0f9d436ffec\3.0.9\vsts-promotepackage-task.ps1:162 char:17
##[debug]+ ... $response = Invoke-RestMethod -Uri $releaseViewURL -Headers $requestC ...
##[debug]+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
##[debug]    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebExc    eption
##[debug]    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
##[debug]Script stack trace:
##[debug]at Set-PackageQuality, D:\a\_tasks\rvo-vsts-promotepackage-task_7ca5869f-a901-4012-a50d-d0f9d436ffec\3.0.9\vsts-promotepackage-task.ps1: line 162
##[debug]at Run, D:\a\_tasks\rvo-vsts-promotepackage-task_7ca5869f-a901-4012-a50d-d0f9d436ffec\3.0.9\vsts-promotepackage-task.ps1: line 286
##[debug]at <ScriptBlock>, D:\a\_tasks\rvo-vsts-promotepackage-task_7ca5869f-a901-4012-a50d-d0f9d436ffec\3.0.9\vsts-promotepackage-task.ps1: line 308
##[debug]at <ScriptBlock>, <No file>: line 1
##[debug]at <ScriptBlock>, <No file>: line 22
##[debug]at <ScriptBlock>, <No file>: line 18
##[debug]at <ScriptBlock>, <No file>: line 1
##[debug]Exception:
##[debug]System.Net.WebException: The remote server returned an error: (400) Bad Request.
##[debug]   at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.GetResponse(WebRequest request)
##[debug]   at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.ProcessRecord()
##[error]The remote server returned an error: (400) Bad Request.

Conclusion

Package promotion feels like it should work with '*' version provided. Happy to help implement a fix if you can point me in the right direction :)

@jessehouwing
Copy link
Contributor

Try %2A

@MortenRa
Copy link

I have the same issue anyone solved this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants