-
Notifications
You must be signed in to change notification settings - Fork 668
cli syntax issue #1732
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
Comments
How does it not work? Any messages? Silently fails? |
The error message is Impossible to create object (400: allowed_to_merge is invalid) Probably because of a wrong synxtax, i do not know how to set the --allowed-to-merge parameter. |
The upstream docs ( https://docs.gitlab.com/ee/api/protected_branches.html#protect-repository-branches ) say that So I would think on the command line it would be: |
Sorry, the upstream docs say:
So maybe: I'm not quite sure what they mean by "described by a hash" |
Thank you for your help :D I tried gitlab project-protected-branch create --project-id yyy --name master --code-owner-approval-required=true --allowed-to-merge=xxx but it failed with the same error Impossible to create object (400: allowed_to_merge is invalid) It should be a complex structure as it can be a list of user_id or a list of group_id. |
That doesn't seem to be what the docs say 😟 |
If you can figure out how to make it work with a |
But it seems like it might be what the code says. Confusing 😟 |
Looking more closely at the docs I found: https://docs.gitlab.com/ee/api/protected_branches.html#example-with-user--group-level-access Which says:
An example curl command:
Which putting part of it into Python:
So we for sure don't support that data type yet 😟 Right now I have a PR up to better support the We will need to add support for the |
OK, thus i have i will have to change my code. Thank you for your investigation. |
I see that 1735 got merged, but i'm still getting I thought the array Am I wrong? The debug mode of the above cli command shows:
|
Description of the problem, including code/CLI snippet
Hello,
First of all thank you for the work done in this project, it is helpful.
I am trying to manage some gitlab configuration with python-gitlab CLI, however I do not find the right syntax to protect a branch. I am struggling with the parameters :
--allowed-to-push
--allowed-to-merge
Can someone help me ?
**The syntax below does not work
gitlab project-protected-branch create --project-id xxx\ --name master \ --allowed-to-merge='user_id: xxx' \ --code-owner-approval-required=true \ --push-access-level=0 \ --merge-access-level=0
The text was updated successfully, but these errors were encountered: