Awesome task!
I'm using the testconsole to test my configuration & handlebars template. If I issue myself a PAT with full access, everything works fine. However, if I attempt to restrict the permissions in the PAT to those I would expect it to need, it only goes so far before encountering a 401 Unauthorised when attempting to retrieve details of automated test runs (there are none in my project, by the way), which then seemingly causes it to lose all the work items it had previously successfully retrieved, and consequently the markdown file produced is largely empty.
I tracked the issue down to
|
export async function getTestsForBuild( |
, specifically
|
let buildTestResults = await (testAPI.getTestResultsByBuild(teamProject, buildId)); |
which uses
testAPI.getTestResultsByBuild and hates me & the PAT I rode in on.
The doco is fairly limited on what access this extension method & the APIs it calls needs, so running a bit blind, but my work-around for now has been to comment out the majority of this function (because I don't have any automated tests anyway), and then everything works just fine. Ideally though I wouldn't need to do that, & instead it'd be good to:
- Know exactly what permissions the PAT I use with the
testconsole needs so I don't need to create a PAT with full access (indeed some Azure DevOps organisations I work with don't even allow the creation of full access PATs)
- More gracefully handle this case of the 401, so that although it might result in no tests being retrieved, at least it wouldn't result in the whole object structure being empty, particularly the work items, not sure why this should impact them
Thanks for your help, let me know if you need any more information!
Awesome task!
I'm using the
testconsoleto test my configuration & handlebars template. If I issue myself a PAT with full access, everything works fine. However, if I attempt to restrict the permissions in the PAT to those I would expect it to need, it only goes so far before encountering a 401 Unauthorised when attempting to retrieve details of automated test runs (there are none in my project, by the way), which then seemingly causes it to lose all the work items it had previously successfully retrieved, and consequently the markdown file produced is largely empty.I tracked the issue down to
AzurePipelines/Extensions/XplatGenerateReleaseNotes/V3/ReleaseNotesFunctions.ts
Line 542 in 1ca0b2c
AzurePipelines/Extensions/XplatGenerateReleaseNotes/V3/ReleaseNotesFunctions.ts
Line 550 in 1ca0b2c
testAPI.getTestResultsByBuildand hates me & the PAT I rode in on.The doco is fairly limited on what access this extension method & the APIs it calls needs, so running a bit blind, but my work-around for now has been to comment out the majority of this function (because I don't have any automated tests anyway), and then everything works just fine. Ideally though I wouldn't need to do that, & instead it'd be good to:
testconsoleneeds so I don't need to create a PAT with full access (indeed some Azure DevOps organisations I work with don't even allow the creation of full access PATs)Thanks for your help, let me know if you need any more information!