Skip to content
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

Github username look-up #30

Open
sehaswell opened this issue Feb 3, 2020 · 3 comments
Open

Github username look-up #30

sehaswell opened this issue Feb 3, 2020 · 3 comments
Labels
Finos Feture for Finos

Comments

@sehaswell
Copy link
Contributor

Cross-reference Gitlab users with Github users so that a single user whitelist can be used across both.

This is very dependent on the user info provided by Gitlab for our MRs - can we positively identify users? We can't always assume everyone contributing to an MR is using Gitlab, let alone Github.

@sehaswell sehaswell added the Finos Feture for Finos label Feb 4, 2020
@maoo
Copy link
Contributor

maoo commented Feb 11, 2020

This is very dependent on the user info provided by Gitlab for our MRs - can we positively identify users?

Assuming we know the GitLab ID, we can use the (v4) users api, which returns the GitHub ID associated with the user, see below, identities > externalUid . Note that GitHub IDs are not usernames; for example, my GitHub username is maoo, my ID is 327285

Screenshot 2020-02-11 at 17 45 19

Thanks!

@maoo
Copy link
Contributor

maoo commented Mar 2, 2020

@sehaswell @strangerich - any update on this ? Or shall I try to work on a PR? Thanks!

@maoo
Copy link
Contributor

maoo commented Mar 5, 2020

Did some investigation here.

It appears that the current user validation process:

  1. Fetches user info via the GitLab /users API - https://github.com/ScottLogic/gitlab-cla-bot/blob/master/src/gitlabApi.js#L24
  2. User info is matched against the committers list on https://github.com/ScottLogic/gitlab-cla-bot/blob/master/src/committerFinder.js#L13 , https://github.com/ScottLogic/gitlab-cla-bot/blob/master/src/committerFinder.js#L51 and finally https://github.com/ScottLogic/gitlab-cla-bot/blob/master/src/committerFinder.js#L56

In theory, the user profile payload that is filtered on https://github.com/ScottLogic/gitlab-cla-bot/blob/master/src/committerFinder.js#L57 should include also the GitHub username, on field c.identities.extern_uid

If that is already the case, the only things left would be:

@strangerich @sehaswell - any thoughts, before I embark in this coding adventure? 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Finos Feture for Finos
Projects
None yet
Development

No branches or pull requests

2 participants