diff --git a/.changeset/poor-pumpkins-fly.md b/.changeset/poor-pumpkins-fly.md new file mode 100644 index 0000000000..d4462d0010 --- /dev/null +++ b/.changeset/poor-pumpkins-fly.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-azure-devops-backend': patch +--- + +Stop loading all teams when plugin is initialized diff --git a/plugins/azure-devops-backend/src/api/PullRequestsDashboardProvider.ts b/plugins/azure-devops-backend/src/api/PullRequestsDashboardProvider.ts index 0f6dbe5b04..43b4807e7d 100644 --- a/plugins/azure-devops-backend/src/api/PullRequestsDashboardProvider.ts +++ b/plugins/azure-devops-backend/src/api/PullRequestsDashboardProvider.ts @@ -40,11 +40,6 @@ export class PullRequestsDashboardProvider { azureDevOpsApi: AzureDevOpsApi, ): Promise { const provider = new PullRequestsDashboardProvider(logger, azureDevOpsApi); - try { - await provider.readTeams(); - } catch (error) { - logger.warn(`Failed to load azure team information, ${error}`); - } return provider; } @@ -115,6 +110,8 @@ export class PullRequestsDashboardProvider { const dashboardPullRequests = await this.azureDevOpsApi.getDashboardPullRequests(projectName, options); + await this.getAllTeams(); // Make sure team members are loaded + return dashboardPullRequests.map(pr => { if (pr.createdBy?.id) { const teamIds = this.teamMembers.get(pr.createdBy.id)?.memberOf;