-
-
Notifications
You must be signed in to change notification settings - Fork 3
feat: github users table #208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| * @param { import("knex").Knex } knex | ||
| * @returns { Promise<void> } | ||
| */ | ||
| exports.up = async (knex) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This table is being created with the response from https://docs.github.com/en/rest/orgs/members?apiVersion=2022-11-28#list-organization-members, I think it makes the most sense. I don't think we need all the user information.
0903448 to
78b45de
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was brought from the schema provided by GitHub
| for await (const org of organizations) { | ||
| debug(`Fetching members for org (${org.login})`) | ||
| logger.info(`Fetching members for org (${org.login})`) | ||
| const members = await github.fetchOrgMembersByLogin(org.login) | ||
| debug(`Got ${members.length} members for org: ${org.login}`) | ||
| debug('Validating data') | ||
| validateGithubListOrgMembers(members) | ||
|
|
||
| // Upsert each member in parallel | ||
| for await (const member of members) { | ||
| debug(`Upserting member (${member.login})`) | ||
| const mappedData = github.mappers.user(member) | ||
| await upsertGithubMembers(mappedData) | ||
| } | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
I think the best option would be to split this PR into two: one for GitHub users and another for roles. @UlisesGascon What do you think? The roles topic has quite a bit of logic since there are roles by teams and by repository, at least that's what I understood from the GitHub API. |
|
Is there anything I can do to move this forward? |

Related #148