« Back to Search  |  Reader Mode  |  Switch to Full Retro Site View Links: Stay in Reader  |  Retro Mode: ON  |  Original »
GitHub · Extracted in 1004 ms

`group transfer-project` is confusing · Issue #1529 · python-gitlab/python-gitlab

Source: https://github.com/python-gitlab/python-gitlab/issues/1529

Repository navigation

group transfer-project is confusing  #1529


New issue

New issue

Closed
#1599
Closed
group transfer-project is confusing #1529 #1599 Labels
cli
Milestone v3.0.0

Description

@chris-peterson's profile chris-peterson opened on Jun 22, 2021

Description of the problem, including code/CLI snippet

I've wrapped the python gitlab CLI in some powershell tooling

Relevant snippet:

function Move-GitLabProject {
    [CmdletBinding()]
    param (
        [Parameter(Position=0, Mandatory=$true)]
        [string]
        $ProjectId,

        [Parameter(Position=1, Mandatory=$true)]
        [string]
        $DestinationGroup,

        [switch]
        [Parameter(Mandatory=$false)]
        $WhatIf = $false
    )

    $SourceProject = Get-GitLabProject -ProjectId $ProjectId
    $Group = Get-GitLabGroup -GroupId $DestinationGroup

    if ($WhatIf) {
        Write-Host "WhatIf: Moving '$($SourceProject.Name)' (project id: $($SourceProject.Id)) to '$($Group.FullPath)' (group id: $($Group.Id))"
    } else {
        gitlab group transfer-project --id $Group.Id --to-project-id $SourceProject.Id
    }
}

Expected Behavior

Recommend that the parameters be renamed:

--id -> --to-group-id

--to-project-id -> --project-id

traditionally, to denotes a destination, not a source.

Actual Behavior

Trial and error and code inspection before realizing I had the parameters backwards.

Specifications

  • python-gitlab version: 2.8.0
  • API version you are using (v3/v4): v4
  • Gitlab server version (or gitlab.com): 13.10.3 (Enterprise Edition)

Metadata

Metadata

Assignees

No one assigned

    Labels


    cli

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions