Skip to content
This repository has been archived by the owner on May 29, 2023. It is now read-only.

Commit

Permalink
fix: clean up sloth repos (#313)
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBeckwith authored Aug 22, 2019
1 parent 9a1f83d commit f694f40
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion repos.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

{ "language": "elixir", "repo": "googleapis/elixir-google-api"},

{ "language": "go", "repo": "google/go-genproto"},
{ "language": "go", "repo": "googleapis/go-genproto"},
{ "language": "go", "repo": "googleapis/gax-go"},
{ "language": "go", "repo": "googleapis/google-api-go-client"},
{ "language": "go", "repo": "googleapis/google-cloud-go-testing"},
Expand Down
14 changes: 6 additions & 8 deletions src/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,17 @@ export async function reconcileTeams() {
}

export async function reconcileRepos() {
const promises = new Array<Promise<Octokit.AnyResponse | void>>();
const teams = await reconcileTeams();

users.membership.forEach(m => {
m.repos.forEach(async r => {
console.log(teams.map(x => x.name));
for (const m of users.membership) {
for (const r of m.repos) {
const [o, repo] = r.split('/');
const team = getTeam(m.team, o, teams);
const yoshiAdmins = getTeam('yoshi-admins', o, teams);
const yoshiTeam = getTeam('yoshi', o, teams);

if (!team) {
throw new Error(`Unable to find team '${m.team}`);
throw new Error(`Unable to find team '${m.team}'`);
}

// Add the language specific team
Expand Down Expand Up @@ -110,9 +109,8 @@ export async function reconcileRepos() {
.catch(e => {
console.error(`Error adding ${r} to 'yoshi'.`);
});
});
});
// await Promise.all(promises);
}
}
}

function getTeam(team: string, org: string, teams: Team[]) {
Expand Down
2 changes: 1 addition & 1 deletion users.json
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@
"davidcavazos"
],
"repos": [
"google/go-genproto",
"googleapis/go-genproto",
"googleapis/gax-go",
"googleapis/google-api-go-client",
"googleapis/google-cloud-go-testing",
Expand Down

0 comments on commit f694f40

Please sign in to comment.