I was growing a bit sick of plodding through GitLab's UI to find MRs that are ready for review, so made this quick dirty TUI to access non-draft (ready to review) MRs quickly.
![image](https://private-user-images.githubusercontent.com/8438991/374205991-9110f527-72e3-413d-ab2e-5c3e9cfee30f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk5MTgyNDYsIm5iZiI6MTczOTkxNzk0NiwicGF0aCI6Ii84NDM4OTkxLzM3NDIwNTk5MS05MTEwZjUyNy03MmUzLTQxM2QtYWIyZS01YzNlOWNmZWUzMGYucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMThUMjIzMjI2WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NDVlNTVlOTE5N2EyNjEwYjUxNWQ5MDFlNWI5ZjRhZDY2NzliNDYzZjBlYzFjNzgwMWYwNDY5ZjRjNDI2OTU2OCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.A-uv_wEiEE_8qH9lCd3UW3kxoYBG2XSb3E9JZvM4G6M)
- Attractive TUI Interface
- Quickly drill down and find a MR from the comfort of your command line
- Toggle draft PRs by pressing d.
- Slap enter on a MR in the tool, and it opens in your browser!
go mod tidy
go build
A statically linked binary called mr-reviewer
will appear in the repo. You
can copy it to /usr/local/bin
to instantly use it!
You will need a tiny bit of configuration to add your bearer token.
- CD into
~/.config
- Create a folder called
mr-reviewer
- Create a
config.json
inside this new folder - Open the file and add the boilerplate below
- Fill in the gitlab base path, your gitlab token, and the list of repositories you want to track
{
"gitlab_base_path": "<Your GitLab instances base url, eg. 'https://gitlab.com'>",
"gitlab_token": "<Your gitlab access token>",
"repositories": [
{
"name": "<repo name>",
"description": "<repo description>",
"route": "<route/to/project>"
}
]
}
- Open GitLab
- Click your profile icon
- Navigate to "Preferences"
- Click "Access Tokens" on the left sidebar
- Generate a new token with any name, and the scope
read_api
- Your token will appear at the top of the page, below the search bar
- Copy it into the json file described abov
- The code is pretty messy ;-;
- Absolutely no tests
- Missing help messages at the bottom for
d
andbackspace
. Shouldn't be too challenging to add. - A UI for creating the configuration for repositories would be nice.