Skip to content
This repository has been archived by the owner on Nov 22, 2022. It is now read-only.
This repository has been archived by the owner on Nov 22, 2022. It is now read-only.

gitlab_uri setting not respected #686

Open
@VannTen

Description

Description
When using command such as glab repo clone <repo_path on self-hosted> installed, the gitlab_uri setting (host:` in the config file) does not appear to be respected.
It's also possible I misunderstood what that parameter does.

Expected Behavior vs Actual Behavior

Set up a config for a self-hosted gitlab instance : glab auth login --host <self hosted instance>
Configure default gitlab_uri : glab config set -g gitlab_uri <self hosted instance>
Try to clone a repo : glab repo clone <project path>
Result : GET https://gitlab.com/api/v4/user: 401 {message: 401 Unauthorized} -> glab defaults to gitlab.com
GITLAB_HOST=<self hosted instance> glab repo clone <project path> works like it should

From the glab config -h output, I expected the setting gitlab_uri to set a default instance glab would use for command which can not refer to an existing git remote (like repo clone). I have the feeling that's it's not supposed to work that way though, so it might be a documentation bug ?

Additional Notes
The glab config -g set gitlab_uri <host> create a host: entry in ~/.config/glab-cli/config.yaml, why not a gitlab_uri: entry ?

Possible Fix

Either explicit the purpose of gitlab_uri or make glab select the correct host.

Related Issues
#402 This is the one which made me think this was more a documentation issue than an unexpected behavior.

Your Environment

  • Version used : 1.16.0
  • Operating System and version:
    Archlinux
    uname -a: Linux 5.11.15-arch1-2 #1 SMP PREEMPT Sat, 17 Apr 2021 00:22:30 +0000 x86_64 GNU/Linux

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions