glab mr checkout <number> results in 404 error if you don't have access to the source repository
Checklist
-
I'm using the latest version of the extension (Run glab --version
)- Extension version: 1.31
-
Operating system and version: Windows 10 and macOS -
Gitlab.com or self-managed instance? gitlab.com -
GitLab version (if self-managed) GitLab version here (Use the version
endpoint, like this: gitlab.my-company.com/api/v4/version) -
I have performed glab auth status
to check for authentication issues
Summary
In a scenario where you have a private repository, and another user with a fork that you don't have permissions on opens an MR, under glab 1.30, you could run glab mr checkout ###
and it would checkout the MR. With glab 1.31, you now receive a 404 error.
Steps to reproduce
- Have a private repository
- Open an MR on that repository from a fork that you don't have access to.
- Run
glab mr checkout ###
What is the current bug behavior?
Currently you receive a 404 for an API call to projects endpoint.
What is the expected correct behavior?
The MR should be able to be checked out without access to the source repository.
Relevant logs and/or screenshots
I don't currently have any logs of screenshots, but hope this is enough information to reproduce.
Possible fixes
I would guess that the source of the issue is in this commit: 9a450081, however I do not know go, not have I dug into the depth of the changes to try and determine the change that caused it.