`glab repo view reponame` uses user of current directory's host and host of default instance

Summary

Running glab project view repo_name from a non-default host repo, will use the user of the non-default host against the default host's instance.

e.g.

glab project view repo_name # where current repo is hosted on mycompany-gitlab.com and my default repo is gitlab.com
x Failed to retrieve project information error=GET https://gitlab.com/api/v4/projects/username_for_non_default_instance/repo_name: 404 {message: 404 Project Not Found}

Steps to reproduce

Given two configured gitlab hosts:

  • default: gitlab.com
  • non-default: mycompany-gitlab.com

Within a git repo hosted on mycompany-gitlab.com

glab project view repo_name

What is the current bug behavior?

x Failed to retrieve project information error=GET https://gitlab.com/api/v4/projects/username_for_non_default_instance/repo_name: 404 {message: 404 Project Not Found}

What is the expected correct behavior?

Use the default instance and the associated user: view project:

  • https://gitlab.com/api/v4/projects/username_for_default_instance/repo_name
Edited Jun 28, 2023 by Jay McCure
Assignee Loading
Time tracking Loading