glab auth login
(you will need Gitlab access token)pip install inquirer
pip install requests
cp configs/templates.json.example configs/templates.json
cp configs/config.ini.example configs/config.ini
configs.ini
you have to paste id of your group in Gitlab to group_id
(This is for fetching milestones and epics)To run gitHappens script anywhere in filesystem, make sure to create an alias.
Add following line to your .bashrc
or .zshrc
file
alias gh='python3 ~/<path-to-githappens-project>/gitHappens.py'
Run source ~/.zshrc
or restart terminal.
--project_id=123456
This feature is useful if you have to create issue on both backend and frontend project for same thing.
templates.json
file.
...
{
"name": "Feature issue for API and frontend",
...
"projectIds": [123, 456]
}
...
Milestone is set to current by default. If you want to pick it manually, pass -m
or --milestone
flag to the script.
Issue templates are located in configs/templates.json
.
Make sure that names of templates are unique
If you don't want to include some settings you use following flags:
--no_epic
- no epic will be selected or prompted--no_milestone
- no milestone will be selected or promptedIf you are in a hurry and want to create issue for later without merge request and branch this flag is for you.
--only_issue
- no merge request nor branch will be created.
You can achive same functionality with adding onlyIssue key to templates.json
file.
...
{
"name": "Feature issue for later",
...
"onlyIssue": true
}
...
You can open merge request for current checked out branch in browser with command:
gh open
You can set default reviewers in templates.json file.
...
{
"templates": [
...
],
...
"reviewers": [234, 456, 678]
}
...
To submit merge request into review run command:
gh review
If you run just gh
(or whatever alias you set) or gh --help
you will see all available flags and a short explanation.
Every contributor is welcome. I suggest checking Gitlab's official API documentation: https://docs.gitlab.com/ee/api/merge_requests.html
Make sure to check this project on OpenPledge.