renevanosnabrugge / vsts-promotepackage-task

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

Not listing views in the drop down for project scoped feeds #53

Closed bmiller264 closed 4 years ago

bmiller264 commented 4 years ago

When configuring the Task in the build pipeline. The request to get the list of Views is failing when the feeds is a project scoped feed:

API Request URL: https://dev.azure.com/_our_organization_/_uniqueid_/_apis/serviceendpoint/endpointproxy?endpointId=tfs%3A00000036-0000-8888-8000-000000000000

This request succeeds: { "serviceEndpointDetails": null, "dataSourceDetails": { "dataSourceUrl": "{{endpoint.url}}/_apis/Packaging/Feeds/{{{feed}}}/views", "resourceUrl": "", "parameters": {"feed": "BuildFeed"}, "resultSelector": "jsonpath:$.value[*]" }, "resultTransformationDetails": {"resultTemplate": "{ "Value" : "{{{id}}}", "DisplayValue" : "{{{name}}}" }"} }

This request fails: { "serviceEndpointDetails": null, "dataSourceDetails": { "dataSourceUrl": "{{endpoint.url}}/_apis/Packaging/Feeds/{{{feed}}}/views", "resourceUrl": "", "parameters": {"feed": "MyProjectName/MyNugetFeed"}, "resultSelector": "jsonpath:$.value[*]" }, "resultTransformationDetails": {"resultTemplate": "{ "Value" : "{{{id}}}", "DisplayValue" : "{{{name}}}" }"} }

Response from failing request: { "result": [], "statusCode": "notFound", "errorMessage": "Failed to query service connection API: 'https://feeds.dev.azure.com/_our_organization_/_apis/Packaging/Feeds/MyProjectName/MyNugetFeed/views'. Status Code: 'NotFound', Response from server: 'Page not found.'" }

(adding screenshot)

noviews
bmiller264 commented 4 years ago

Using postman - it looks like the request should be:

{ "serviceEndpointDetails": null, "dataSourceDetails": { "dataSourceUrl": "{{endpoint.url}}/MyProjectName/_apis/Packaging/Feeds/{{{feed}}}/views", "resourceUrl": "", "parameters": {"feed": "MyNugetFeed"}, "resultSelector": "jsonpath:$.value[*]" }, "resultTransformationDetails": {"resultTemplate": "{ "Value" : "{{{id}}}", "DisplayValue" : "{{{name}}}" }"} }

bmiller264 commented 4 years ago

duplicate of other issues - after reviewing the release notes, I've found the work-around.