Skip to content

Fix : gl_get_group_id when groupname is duplicated on the gitlab instance #129

@Marsal-a

Description

@Marsal-a

Hello,

When trying to collect a group-id from the groupname with gl_get_group_id, the function fails if the groupname is duplicated on the gitlab instance.

gl_get_group_id(group_name = "outillage-data")
Error in `matching[1, "path_with_namespace"]`:
! Can't subset columns that don't exist.
✖ Column `path_with_namespace` doesn't exist.
Run `rlang::last_trace()` to see where the error occurred.
Message d'avis :
Unknown or uninitialised column: `path_with_namespace`.

The error occurs because the column path_with_namespace is not a column return by gitlab APIs as described here :
https://docs.gitlab.com/api/groups/#list-all-groups

for some reason, the column path_with_namespace is returned for a single group using GET /groups/:id but not returned for GET /groups

Sorry, I did not take the time to provide a reproductible example or make a fix with PR, but I can propose here a simple solution :

Changing the column path_with_namespace with full_path should do the trick on the rows :

matching$path_with_namespace,

paste("Picking", matching[1, "path_with_namespace"], "as default")

thanks for the great work on the package anyway,

Adam

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions