rfennell / AzurePipelines

A single Repo to contain the source for ALL my Azure DevOps Build/Release Extensions. The packages can be found in the Azure DevOps Marketplace
https://marketplace.visualstudio.com/search?term=fenn&target=VSTS&sortBy=Relevance
MIT License
334 stars 430 forks source link

Could not get list of PRs. #1367

Open alexmfreitas opened 1 year ago

alexmfreitas commented 1 year ago

Azure DevOps Extensions

Generate Release Notes (Node Cross Platform)

Platform

Azure DevOps Services

Azure DevOps Server (TFS) Version

No response

Extension Version

3.89.3

Describe the bug

Hi,

I'm having an intermittent problem when generating the release notes, specifically in the PR's step. We have a "large" number of PRs (~1400) but I'm not sure if this is the problem.

Sometimes I'm receiving the following error: Could not get details of any PR an error was seen: TypeError: Cannot read property 'length' of null

Could you help me?

Repo Steps

  1. Create a Release Note Task
  2. Execute the release note task ...

Expected Behavior

Some kind of retry? Fail the task?

Logging Information

2022-10-24T15:12:27.9001717Z ##[section]Starting: Generate Release Notes 2022-10-24T15:12:27.9845960Z ============================================================================== 2022-10-24T15:12:27.9846595Z Task : Generate Release Notes (Crossplatform) 2022-10-24T15:12:27.9847144Z Description : Generates a release notes file in a format of your choice from the build or release history 2022-10-24T15:12:27.9847616Z Version : 3.89.3 2022-10-24T15:12:27.9847902Z Author : Black Marble 2022-10-24T15:12:27.9848627Z Help : Version: 3.89.3. More Information 2022-10-24T15:12:27.9849409Z ============================================================================== 2022-10-24T15:12:29.5888430Z Creating Azure DevOps API connections for https://dev.azure.com/xxxx/ with 'allowRetries' set to 'true' and 'maxRetries' count to '20' 2022-10-24T15:12:29.5950928Z Creating the credential handler from the OAUTH token 2022-10-24T15:12:30.0149673Z Getting the current release details 2022-10-24T15:12:30.3315109Z Show associated items for primary artifact only is set to false 2022-10-24T15:12:30.3322062Z Getting the Environment Id 2022-10-24T15:12:30.3322712Z Identified [dev] as having id [1] 2022-10-24T15:12:30.3345413Z Finding successful deployments 2022-10-24T15:12:31.3886105Z Found 50 releases to consider 2022-10-24T15:12:31.3977339Z Finding the last successful release 2022.10.20.38-1 2022-10-24T15:12:31.3979132Z Getting all artifacts in the current release... 2022-10-24T15:12:31.3980207Z Found 1 artifacts for current release 2022-10-24T15:12:31.5720668Z Getting all artifacts in the most recent successful release [2022.10.20.38-1]... 2022-10-24T15:12:31.5726442Z Found 1 artifacts for most recent successful release 2022-10-24T15:12:31.5730565Z Looking at artifact [_OrderManagement] 2022-10-24T15:12:31.5731547Z Artifact type [Build] 2022-10-24T15:12:31.5733098Z Build Definition ID [122] 2022-10-24T15:12:31.5733976Z Build Number: [2022.10.24.2] 2022-10-24T15:12:31.5735433Z Is Primary: [true] 2022-10-24T15:12:31.5736540Z Looking for the [_OrderManagement] in the most recent successful release [2022.10.20.38-1] 2022-10-24T15:12:31.5738583Z Found artifact [_OrderManagement] with build number [2022.10.20.38] in release [2022.10.20.38-1] 2022-10-24T15:12:31.5739895Z Checking what commits and workitems have changed from [2022.10.20.38][ID 20109] => [2022.10.24.2] [ID 20135] 2022-10-24T15:12:31.5743314Z Defaulting on the workaround for build API limitation (see issue #349 set 'ReleaseNotes.Fix349=false' to disable) 2022-10-24T15:12:31.5744711Z Using workaround for build API limitation (see issue #349) 2022-10-24T15:12:31.9851925Z Processing commits found 2022-10-24T15:12:31.9853809Z Enriched change 04fc5d6eaa4594bfde79fc1597e33e393dfdc1db of type TfsGit 2022-10-24T15:12:32.3239132Z Enriched with details of 8 files 2022-10-24T15:12:32.3244750Z Enriched change b1a7e2597bc94be9b6f1ea5e9cb45152ab1dac8c of type TfsGit 2022-10-24T15:12:32.4196004Z Enriched with details of 8 files 2022-10-24T15:12:32.4197710Z Getting test associated with the latest build [20135] 2022-10-24T15:12:36.3672573Z Adding the build [20135] and its associations to the unified results object 2022-10-24T15:12:36.3688436Z Detected 2 commits/changesets between the current build and the last successful one 2022-10-24T15:12:36.3690119Z Detected 0 workitems between the current build and the last successful one 2022-10-24T15:12:36.3691655Z Found 1687 tests associated with the build [20135] adding any not already in the global test list to the list 2022-10-24T15:12:36.6820065Z Found 0 manual tests associated with the build [20135] adding any not already in the global test list to the list 2022-10-24T15:12:36.6821072Z 2022-10-24T15:12:37.4561957Z Removing duplicate Commits from master list 2022-10-24T15:12:37.4565672Z Expanding the truncated commit messages... 2022-10-24T15:12:37.4568746Z Expanded truncated commit messages 0 2022-10-24T15:12:37.4626202Z Leaving CS in default order as returned by API 2022-10-24T15:12:37.4627668Z Find any WorkItems linked from GitHub using the AB#123 format 2022-10-24T15:12:37.4628714Z Adding 0 found using AB#123 links in GitHub comments 2022-10-24T15:12:37.4629982Z Removing duplicate WorkItems from master list 2022-10-24T15:12:37.4631114Z Getting tests linked to WorkItems 2022-10-24T15:12:37.4632080Z Leaving WI in default order as returned by API 2022-10-24T15:12:37.5459406Z The default artifact for the build/release was triggered by the PR 3106, getting details 2022-10-24T15:12:37.6297037Z Getting all completed Azure DevOps Git Repo PRs in the Team Project OrderManagement 2022-10-24T15:12:37.6298397Z Getting associated PRs 2022-10-24T15:12:54.1905777Z Could not get details of any PR an error was seen: TypeError: Cannot read property 'length' of null 2022-10-24T15:12:54.1907747Z Enriching known Pull Requests 2022-10-24T15:12:55.1165134Z Total Builds: [1] 2022-10-24T15:12:55.1165930Z Total Commits: [2] 2022-10-24T15:12:55.1166615Z Total Workitems: [0] 2022-10-24T15:12:55.1167388Z Total Related Workitems (Parent/Children): [0] 2022-10-24T15:12:55.1168155Z Total Release Tests: [0] 2022-10-24T15:12:55.1168968Z Total Tests: [1687] 2022-10-24T15:12:55.1169618Z Total Manual Test Runs: [0] 2022-10-24T15:12:55.1170377Z Total Manual Test Configurations: [0] 2022-10-24T15:12:55.1171113Z Total Pull Requests: [1] 2022-10-24T15:12:55.1171813Z Total Indirect Pull Requests: [0] 2022-10-24T15:12:55.1172554Z Total Associated Test WI: [0] 2022-10-24T15:12:55.1173258Z Total Consumed Artifacts: [0] 2022-10-24T15:12:55.1173962Z Total WIQL Workitems: [0] 2022-10-24T15:12:55.2994616Z Generating the release notes, the are 1 template(s) to process 2022-10-24T15:12:55.2999170Z Using in-line template 2022-10-24T15:12:55.5046289Z Loading handlebars-helpers extension 2022-10-24T15:12:56.0734529Z Writing output file C:\DevOpsAgent_work_tasks\XplatGenerateReleaseNotes_7b0a5887-75c4-4ade-a915-f92a93c934cb\3.89.3\customHandlebarsExtension.js 2022-10-24T15:12:56.0825876Z Finished writing output file C:\DevOpsAgent_work_tasks\XplatGenerateReleaseNotes_7b0a5887-75c4-4ade-a915-f92a93c934cb\3.89.3\customHandlebarsExtension.js 2022-10-24T15:12:56.0882446Z Loaded handlebars extension file 2022-10-24T15:12:56.1819065Z Completed processing template 2022-10-24T15:12:56.1822444Z Writing output file C:\DevOpsAgent_work\r1\a/releasenotes.md 2022-10-24T15:12:56.1880160Z Finished writing output file C:\DevOpsAgent_work\r1\a/releasenotes.md 2022-10-24T15:12:56.1883413Z Output variable 'undefined' set to value of first generated release notes 2022-10-24T15:12:56.3031157Z ##[section]Finishing: Generate Release Notes

rfennell commented 1 year ago

This problem is a long standing one, see #648, there is a problem with these timeouts when many SDK API calls are made in a short period.

At this point I have no obvious next step

alexmfreitas commented 1 year ago

Thanks for the answer!