Skip to content

group transfer-project is confusing #1529

@chris-peterson

Description

@chris-peterson

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

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy