-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
GitLab: issues matching git authors and Gitlab users #50
Comments
Greetings 👋 |
Hi @ojacques, I tried different project access tokens as mentioned above, one of them had EDIT: Just tried again with |
In GitLab, it must at least be a developer role, as guest does not give access to the repository. You mention earlier that you used:
Where for GitLab, it should be:
With the GitLab project ID, not a repo slug, like on GitHub. Could this be the isue ? |
I just realized that it is also mentioned in the README.md (https://github.com/ojacques/mkdocs-git-committers-plugin-2#setup)... sorry for not realizing that. While it now fetches the contributors it somehow resolves it incorrectly. The person happens to have the same name than I have but obviously a different login. Another thing came to my mind: |
Glad you passed 401! 🥳
Interesting. Do you have an example repository, or maybe share the 2 GitLab user names? I expect the API call to be deterministic and avoid such confusion.
To exactly avoid the problem you are experiencing now: not being deterministic if only based on Git commits authors which are free form. Using local git commit info was the initial implementation, but turned out to not be reliable, no matter which key was used (name, email). This is why I'm interested in your case, as I expect that the API calls are supposed to fetch reliably the GitHub/GitLab author. |
My gitlab login is If this does not help you, I can create an example repository to share with you. |
A private repo would be great indeed. Thank you. |
Ok I now created the repository. What is your gitlab login such that I can give you access to the repo. |
I just gave you developer access to the test repo.
… On 26 Jan 2024, at 14:35, Olivier Jacques ***@***.***> wrote:
@skwde : https://gitlab.com/ojacques2
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
@skwde, I reproduced the issue of user mismatch (I updated the title of this issue). It is caused by the method used to find the Gitlab user. https://github.com/ojacques/mkdocs-git-committers-plugin-2/blob/master/mkdocs_git_committers_plugin_2/plugin.py#L125 Unfortunately, Gitlab API does not give us a reliable way to match commit and users (unlike GitHub). See https://gitlab.com/gitlab-org/gitlab/-/issues/20924 I tried a different way by first fetching all Gitlab project members, then look through those. But the member details ( Don't correspond to the details I can get from a commit ( (I pixelated the actual names, but as you will see if you try / they do not match, and I could not find an ID to reliably match). Not sure how I can take it from there... |
@ojacques, you are right. The problem is that the profile is necessarily empty (like mine), consequently there is currently no reliable way to match a user to a commit until the gitlab issue (https://gitlab.com/gitlab-org/gitlab/-/issues/20924) you already linked above is resolved via adding additional info to the commits api. A way around, until this is resolved from gitlab side, would be to make a note that in the gitlab profile |
Hello @ojacques , Thanks! It should be on readme IMHO. |
I added a note in the README that matching may not be reliable on GitLab (less of an issue on self-hosted GitLab where users are identified with SSO). |
Thanks you! |
In your README.md you write that a token does not need any scope.
In GitLab, when not selecting any scope, it seems to get all scopes but lets be as restrictive as possible.
I tried several scopes with role
guest
, but none worked.I always get
The scopes I tried (independently) are
api
read_api
read_repository
Of course I always did a
I am using
mkdocs-material
and setSo what scope is actually required to get it working?
The text was updated successfully, but these errors were encountered: