Merge pull request #10527 from marleypowell/marley/9709-ado-team-loading-issue

fix: Stop loading all teams when plugin is initialized
This commit is contained in:
Johan Haals
2022-03-31 09:26:51 +02:00
committed by GitHub
2 changed files with 7 additions and 5 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-azure-devops-backend': patch
---
Stop loading all teams when plugin is initialized
@@ -40,11 +40,6 @@ export class PullRequestsDashboardProvider {
azureDevOpsApi: AzureDevOpsApi,
): Promise<PullRequestsDashboardProvider> {
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;