Skip to content

GITLAB_REPO not being parsed by some `ci` subcommand

Checklist

  • I'm using the latest version of the extension (Run glab --version)
    • Extension version: 1.49.0
  • Operating system and version: Arch Linux x86_64 | 6.6.63-1-lts
  • Gitlab.com or self-managed instance? self-managed instance
  • GitLab version (if self-managed) 17.3 (Use the version endpoint, like this: gitlab.my-company.com/api/v4/version)
  • I have performed glab auth status to check for authentication issues
  • Run the command in debug mode (like DEBUG=true glab mr list) and attach any useful output

Summary

Various ci verbs will not work if used outside of a repo folder. Passing the GITLAB_REPO variable also will have no effect. The only subcommand that worked is glab ci run.

Environment

  • OS: Linux 6.6.63-1-lts x86_64
  • SHELL: /bin/fish
  • TERM: xterm-kitty
  • GLAB: Current glab version: 1.49.0

Other:

Steps to reproduce

Place yourself outside of a git directory and run GITLAB_REPO="https://gitlab.your-domain.com/" glab ci view. Other subcommands like trigger and get are also acceptable.

What is the current bug behavior?

DEBUG=true GITLAB_REPO="https://gitlab.REDACTED.com/REDACTED" glab ci view
[git remote -v]
[git symbolic-ref --quiet --short HEAD]
fatal: not a git repository (or any of the parent directories): .git
git: exit status 128

What is the expected correct behavior?

The command should exec even outside a git repo, since other commands like glab ci run work by passing the GITLAB_REPO variable.

Relevant logs and/or screenshots

Possible fixes

When used outside the context of a repository we should use the default branch of the project specified.

Edited by Kai Armstrong
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information