Skip to content

Commit 195e9fd

Browse files
committed
Use numerical org ID when assigning github teams
1 parent 9e3c648 commit 195e9fd

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

src/api/functions/github.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ async function resolveTeamIdToSlug({
101101
logger,
102102
}: {
103103
octokit: Octokit;
104-
orgId: string;
104+
orgId: number;
105105
teamId: number;
106106
logger: ValidLoggers;
107107
}): Promise<string> {
@@ -212,12 +212,14 @@ export async function assignIdpGroupsToTeam({
212212
groupsToSync,
213213
logger,
214214
orgId,
215+
orgName,
215216
}: {
216217
githubToken: string;
217218
teamId: number;
218219
groupsToSync: string[];
219220
logger: ValidLoggers;
220-
orgId: string;
221+
orgId: number;
222+
orgName: string;
221223
}) {
222224
try {
223225
const octokit = new Octokit({
@@ -267,7 +269,7 @@ export async function assignIdpGroupsToTeam({
267269
for (const groupId of groupsToSync) {
268270
const idpGroup = await findIdpGroupWithRetry({
269271
octokit,
270-
orgId,
272+
orgId: orgName,
271273
groupId,
272274
logger,
273275
maxRetries: 5,

src/api/routes/organizations.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,8 @@ const organizationsPlugin: FastifyPluginAsync = async (fastify, _options) => {
631631
teamId: githubTeamId,
632632
logger: request.log,
633633
groupsToSync: [entraGroupId].filter((x): x is string => !!x),
634-
orgId: fastify.environmentConfig.GithubOrgName,
634+
orgId: fastify.environmentConfig.GithubOrgId,
635+
orgName: fastify.environmentConfig.GithubOrgName,
635636
});
636637
} else {
637638
request.log.info(

src/common/config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export type ConfigType = {
3333
GithubOrgName: string;
3434
ExecGithubTeam: number;
3535
GithubIdpSyncEnabled: boolean
36+
GithubOrgId: number;
3637
};
3738

3839
export type GenericConfigType = {
@@ -136,6 +137,7 @@ const environmentConfig: EnvironmentConfigType = {
136137
GroupSuffix: "[NonProd]",
137138
GroupEmailSuffix: "nonprod",
138139
GithubOrgName: "acm-uiuc-testing",
140+
GithubOrgId: 235748315,
139141
ExecGithubTeam: 14420860,
140142
GithubIdpSyncEnabled: false
141143
},
@@ -167,6 +169,7 @@ const environmentConfig: EnvironmentConfigType = {
167169
GroupSuffix: "",
168170
GroupEmailSuffix: "",
169171
GithubOrgName: "acm-uiuc",
172+
GithubOrgId: 425738,
170173
ExecGithubTeam: 12025214,
171174
GithubIdpSyncEnabled: true
172175
},

0 commit comments

Comments
 (0)