Skip to content

Unable to initialize repo with readme when creating project on behalf of user #2869

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

Closed
connelldave opened this issue May 16, 2024 · 1 comment

Comments

@connelldave
Copy link

Description of the problem, including code/CLI snippet

When creating a project on behalf of user u as an admin, initialize_with_readme is ignored

In [32]: init_with_readme = True

In [33]: 
    ...:         project_data = {
    ...:             "name": project_name,
    ...:             "namespace_id": group_id,
    ...:             "initialize_with_readme": init_with_readme,
    ...:             "visibility": "internal",
    ...:         }

In [34]: r = u.projects.create(project_data)

In [35]: r.visibility
Out[35]: 'internal'

I think this might be because the attr is not declared in users.py like it is in projects.py?

Looks like an extension of #765 in a different object?

Expected Behavior

Repo is initialized with a default readme

Actual Behavior

Repo is not initialized

Specifications

  • python-gitlab version: tested on 3.12.0
  • API version you are using (v3/v4): v4
  • Gitlab server version (or gitlab.com): v16.10.4-ee
@connelldave
Copy link
Author

I think this was actually just my falling foul of a user being a developer in a group with fully protected default branches - the defined attrs don't seem to restrict what's passed? I produced expected behaviour in a users own namespace, so can close this

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

No branches or pull requests

2 participants