- Notifications
You must be signed in to change notification settings - Fork673
feat: add create from template args to ProjectManager#1053
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
This commit adds the v4 Create project attributes necessary to create aproject from a project, instance, or group level template as documentedinhttps://docs.gitlab.com/ee/api/projects.html#create-project
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.
Thanks for the PR! It looks like there are a lot of missing optional attributes, since they can be supplied in**kwargs
.
Just a minor comment, but I'll let@max-wittig decide if it's really needed. It might make sense to add these in here as well for consistency:
python-gitlab/gitlab/v4/objects.py
Lines 247 to 267 inf493b73
classUserProjectManager(ListMixin,CreateMixin,RESTManager): | |
_path="/projects/user/%(user_id)s" | |
_obj_cls=UserProject | |
_from_parent_attrs= {"user_id":"id"} | |
_create_attrs= ( | |
("name",), | |
( | |
"default_branch", | |
"issues_enabled", | |
"wall_enabled", | |
"merge_requests_enabled", | |
"wiki_enabled", | |
"snippets_enabled", | |
"public", | |
"visibility", | |
"description", | |
"builds_enabled", | |
"public_builds", | |
"import_url", | |
"only_allow_merge_if_build_succeeds", | |
), |
(although the GitLab docs are a bit inconsistent there, I think the same 4 attributes apply, but some of these are EE features, so hard to test)
I'm currently using the cli for chatops ci jobs, as it's much less maintenance than a purpose-built script that uses the library. I know you guys have talked about removing the cli completely, so I understand if you don't want to accept the PR for those reasons. If you accept this PR, I'm certainly open to contributing more api updates. |
nejch commentedMar 23, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Ah I might have worded that strangely, it was a general comment that we have some catching up to do across the entire library to match the current GitLab API attributes ;) Sorry if that came out wrong! That's a good point about CLI usage as well, thanks. We should probably review all the missing attributes and add more as a follow-up to this PR. |
This commit adds the v4 Create project attributes necessary to create a
project from a project, instance, or group level template as documented
inhttps://docs.gitlab.com/ee/api/projects.html#create-project