glab icon indicating copy to clipboard operation
glab copied to clipboard

`repo search` documentation is wrong

Open gdzien opened this issue 3 years ago • 4 comments

Description

glab config set gitlab_uri https://example.com failed to set "gitlab_uri" to "https://example.com": failed to write config: not a git repository alias glab alias glab='GITLAB_HOST=https://example.com glab'

$ glab repo search required flag(s) "search" not set

$ glab repo search docker accepts 0 arg(s), received 1

Expected Behavior vs Actual Behavior Commands actually work and tool is useful.

Possible Fix

Steps to Reproduce All should be obvious via description section.

Logs

Your Environment

  • Version used (Run glab --version): glab version 1.22.0 (2022-01-10)
  • Operating System and version: Mac OS (12.0.1) on M1 tool installed via homebrew.

gdzien avatar Mar 23 '22 16:03 gdzien

So few things here.

  1. glab config set gitlab_uri https://example.com/ needs to be run inside a git repository to make, sense. This sets the URI for the GitLab API for that directory.
  2. glab repo search error message is clear enough, although the help message is not great. You need to provide the --search flag instead of using an argument. e.g. glab repo search --search docker

zemzale avatar Mar 23 '22 20:03 zemzale

  1. makes no sense to be directory sepecific when otherwise my calls to "search repo" says 401 unauthorised to gitlab.com
  2. Documentation and messages need to be updated, also adding "--search" to "repo search" is illogical.

gdzien avatar Mar 24 '22 12:03 gdzien

makes no sense to be directory specific when otherwise my calls to "search repo" says 401 unauthorized to gitlab.com

The API host is found by

  • GITLAB_HOST
  • Check if the host in the current git directory is authenticated
  • If neither of the above is true, fall back to gitlab.com

So you either have to set GITLAB_HOST and authenticate against the host using the glab auth login command

Documentation and messages need to be updated, also adding "--search" to "repo search" is illogical.

I agree with this. Since the tool is being adopted by GitLab( https://github.com/profclems/glab/issues/983) feel free to open an issue there.

zemzale avatar Mar 24 '22 13:03 zemzale

This issue has been automatically marked as stale because it has not had recent activity. We haven't had the time to address it yet, but we want to keep it open. This message is just a reminder for us to help triage issues.

clemsbot avatar Apr 24 '22 02:04 clemsbot