-
Notifications
You must be signed in to change notification settings - Fork 78
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
Can't use TOKEN with a project with group permissions #165
Comments
@hlas Thanks for this! I was able to reproduce this as well in a test group/project. My gut feeling is that this is a bug on GitLab's side - I expected this permission information to be available in some way through the Project API. I've opened https://gitlab.com/gitlab-org/gitlab/-/issues/290880 to investigate/discuss. I'm not sure about the details of your setup, but perhaps using a project access token might be a workaround for you? In lieu of solving https://gitlab.com/gitlab-org/gitlab/-/issues/290880, perhaps this module could test for permissions by attempting to push to the repository with the |
Hey, I'm having this issue. Following the issues lead me to https://gitlab.com/gitlab-org/gitlab/-/issues/223832 which was closed for inactivity but not fixed. |
Yes sure, thanks! I'm not sure though how |
As far as I can tell, it contains the info needed:
From Line 71 in 26d7f9f
access_level . Maybe I'm missing something since I only quickly glanced at the code.We'd probably need to fetch more about the PAT identity to see if it's a group access token/is in the group the project is shared with. Or the other way around: if the PAT user if a member of one of the groups the project is shared with. |
Yes
|
That makes sense, sending more requests will end up quite convoluted, harder to maintain and may even make things worse. I've read the main repo's code and the code flow and maybe there is an even easier solution. Could we simply skip over this step and not check for push permission? Semantic release already does a https://github.com/semantic-release/semantic-release/blob/master/lib/git.js#L205
Which is called in the main: https://github.com/semantic-release/semantic-release/blob/4012f75386cced3c8806b7094f552cccc357b6f5/index.js#L85 Here are logs from a failing CI I have (first check from semantic-release/semantic-release, second from semantic-release/gitlab):
|
Sorry for the late response.
Generally this sounds feasible, but we might at some point want to get rid of that to enable use cases like #156 where the authenticated user cannot push, but can create tags via API. What if we just verify by calling maintainer/developer-only API endpoints and see if they succeed, like in the description of https://gitlab.com/gitlab-org/gitlab/-/issues/223832? |
Hi, is there no workaround for this issue? |
Get this error:
This is what I get with a direct call to the gitlab API:
So, this code doesn't verify correctly the permissions:
gitlab/lib/verify.js
Line 51 in cfa2f17
The text was updated successfully, but these errors were encountered: