renevanosnabrugge / vsts-promotepackage-task

Promote a package in VSTS to a Release View
MIT License
21 stars 25 forks source link

Error during Promote Universal Package (TASK Version 3.x) #43

Open megel opened 4 years ago

megel commented 4 years ago

The Log: image

2020-01-12T10:22:30.6508555Z ==============================================================================
2020-01-12T10:22:30.6508603Z Task         : Promote package to Release View
2020-01-12T10:22:30.6508639Z Description  : Promotes a package to a Release View in VSTS Package Management
2020-01-12T10:22:30.6508685Z Version      : 3.0.1
2020-01-12T10:22:30.6508716Z Author       : Rene van Osnabrugge
2020-01-12T10:22:30.6508763Z Help         : Version: 3.0.1. [More Information](https://github.com/renevanosnabrugge/vsts-promotepackage-task/wiki)
2020-01-12T10:22:30.6508794Z ==============================================================================
2020-01-12T10:22:32.0494937Z Promoting 1 package(s) named 'contract' with version '1.0.5'
2020-01-12T10:22:32.0592766Z Promoting version 1.0.5 of package contract from feed xxxx-xxxx-xxxx-xxxx-xxxx to view DEV
2020-01-12T10:22:32.4398750Z ##[error]Unhandled exception while reading feed xxxx-xxxx-xxxx-xxxx-xxxx
System.Net.WebException: The remote server returned an error: (404) Not Found.
   at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.GetResponse(WebRequest request)
   at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.ProcessRecord()at Get-FeedId, D:\a\_tasks\rvo-vsts-promotepackage-task_7ca5869f-a901-4012-a50d-d0f9d436ffec\3.0.1\vsts-promotepackage-task.ps1: line 48
at Set-PackageQuality, D:\a\_tasks\rvo-vsts-promotepackage-task_7ca5869f-a901-4012-a50d-d0f9d436ffec\3.0.1\vsts-promotepackage-task.ps1: line 137
at Run, D:\a\_tasks\rvo-vsts-promotepackage-task_7ca5869f-a901-4012-a50d-d0f9d436ffec\3.0.1\vsts-promotepackage-task.ps1: line 267
at <ScriptBlock>, D:\a\_tasks\rvo-vsts-promotepackage-task_7ca5869f-a901-4012-a50d-d0f9d436ffec\3.0.1\vsts-promotepackage-task.ps1: line 289
at <ScriptBlock>, <No file>: line 1
at <ScriptBlock>, <No file>: line 22
at <ScriptBlock>, <No file>: line 18
at <ScriptBlock>, <No file>: line 1

The Task Configuration: (Variables are OK) image

Lookup Package from Feed FAILS: image

The Package (Universal) in Asset Store (Project Scope) image

Release Pipeline can access the package: image

I guess, Microsoft has changed something at the Asset Store. Package Feeds are now Organization vs. Project Scoped.

Version 1.x works, but I can't select this version from a new created project :/

megel commented 4 years ago

My current Work-Around is a PowerShell Tasks with:

$headers  = @{ "Authorization" = "Bearer $(System.AccessToken)"; "Content-Type" = "application/json"; }
$uri      = "https://pkgs.dev.azure.com/$([string]::Join("/", ([uri]$env:SYSTEM_TEAMFOUNDATIONSERVERURI).Segments[1].TrimEnd('/'), $env:SYSTEM_TEAMPROJECT).Trim('/'))/_apis/packaging/feeds/$(ArtifactFeed)/upack/packages/$(PackageName)/versions/$(PackageVersion)?api-version=5.1-preview.1"
$body     = @{ views = @{ op = "add"; path = "/views/-"; value = "$(ReleaseView)" } } | ConvertTo-Json -Compress
Write-Host "Get packages from '$uri' $($headers | ConvertTo-Json -Compress)" -f Gray
(Invoke-WebRequest -Method Patch -Body $body -uri $uri -Headers $headers -UseBasicParsing)
renevanosnabrugge commented 4 years ago

The Org vs. Project scope has been fixed. Is this issue resolved now?

jessehouwing commented 4 years ago

The UI for project vs org has been fixed too now. The precious fix only worked in YAML.

jessehouwing commented 4 years ago

Likely fixed now: https://github.com/renevanosnabrugge/vsts-promotepackage-task/pull/54