GITLAB_URI environment variable not set by default, leads to "unsupported protocol scheme" error
Created by: dnsmichi
Description
I was trying this nice project and started with the minimum effort - short install and only the required settings.
After setting the GITLAB_TOKEN environment variable, I changed into a GitLab repository and ran glab pipeline list
to see the CI/CD status.
There I was greeted with this error:
Expected Behavior
The GITLAB_URI
environment variable is set to https://gitlab.com
as stated in the documentation: https://github.com/profclems/glab#environment-variables
GITLAB_URI: specify the url of the gitlab server if self hosted (eg: https://gitlab.example.com).
Default is https://gitlab.com.
Can be set with `glab config --url=gitlab.example.com`
Actual Behavior
The GitLab URI is not set, and as such, the request URL does not match the expected string. This results in a strange error that the protocol is not supported.
glab pipeline list -s success
Error: Get "/api/v4/projects/dnsmichi%2Fci-monitoring-webcast-2020/pipelines?page=1&per_page=20&sort=desc&status=success": unsupported protocol scheme ""
After setting GITLAB_URI
via command line, this worked.
Possible Fix
If GITLAB_URI
is not set, prefer the default https://gitlab.com
.
Steps to Reproduce
- Install glab via Homebrew
- Change into a GitLab project
- Run
glab pipeline list
Context
Initial project test, trying some of the commands. This is a global problem, glab release list
doesn't work either. I haven't looked into the code yet but have seen that there are major refactorings for configuration going on.
Your Environment
- Version used: 1.10 via Homebrew
- Operating System and version: macOS Catalina 10.15.6
glab --version
glab version 1.10.0 ()
git version 2.28.0
Made with ❤ by Clement Sam <clementsam75@gmail.com> and contributors