Skip to content
Snippets Groups Projects

Iss #237 - Add better async handling in GH team creation call

Merged Iss #237 - Add better async handling in GH team creation call
All threads resolved!
Merged Martin Lowe requested to merge malowe/eclipsefdn-github-sync:malowe/master/237 into master
All threads resolved!
1 file
+ 7
6
Compare changes
  • Side-by-side
  • Inline
+ 7
6
@@ -295,15 +295,16 @@ async function processProjectsOrg(org, project) {
logger.debug(`Sync:processProjectsOrg(org = ${org}, project = ${project.project_id})`);
}
// prefetch teams to reduce redundant calls
await wrap.prefetchTeams(org);
await wrap.prefetchRepos(org);
const prefetch = await Promise.allSettled([wrap.prefetchTeams(org), wrap.prefetchRepos(org)]);
// create the teams for the current org + update perms
if (!argv.d) {
await wrap.updateOrgPermissions(org, DEFAULT_ORG_PERMISSIONS);
await updateProjectTeam(org, project, 'contributors');
await updateProjectTeam(org, project, 'committers');
await updateProjectTeam(org, project, 'project_leads');
const done = await Promise.allSettled([
wrap.updateOrgPermissions(org, DEFAULT_ORG_PERMISSIONS),
updateProjectTeam(org, project, 'contributors'),
updateProjectTeam(org, project, 'committers'),
updateProjectTeam(org, project, 'project_leads')]);
logger.debug(`Finished creating teams for ${project} in org '${org}' with ${done.filter(status => status.status !== 'fulfilled').length} errors.`);
} else {
logger.debug('Dry run set, not adding teams for org: ' + org);
}
Loading