Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Group import fails when parent_id is passed as int #2506

Closed
Labels
@vlizanae

Description

@vlizanae

Description of the problem, including code/CLI snippet

Testing group export/import between different Gitlab instances. Used to the path of the group working as the group id, I tried the following:

gl.groups.import_group(buffer,path='group_slug',name='Group name',parent_id='path/to/parent')

which yields

gitlab.exceptions.GitlabImportError: 400: parent_id is invalid

Not very descriptive but reading gitlab's api docs I find out:

parent_id, integer: ID of a parent group to import the group into. Defaults to the current user’s namespace if not provided.

So I try the numerical id of the group:

gl.groups.import_group(buffer,path='group_slug',name='Group name',parent_id=42)

even worse:

AttributeError: 'int' object has no attribute 'encode'

Expected Behavior

Because the path works as an id in several calls (e.g.groups.get) I think the first versionshould work. The second version should definitely work.

Actual Behavior

In the end, after digging a bit on the code, what works is:

gl.groups.import_group(buffer,path='group_slug',name='Group name',parent_id='42')

Specifications

  • python-gitlab version: 3.13.0
  • API version you are using (v3/v4): v4
  • Gitlab server version (or gitlab.com): 15.8.1-ee

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp