Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 11 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@

## Installation 🔨

### Preresequisits
### Prerequisites

- install python3 (make sure to include pip in install)
- Install [glab](https://gitlab.com/gitlab-org/cli)
- Authorize via glab `glab auth login` (you will need Gitlab access token, SSH recomended)
- `pip install inquirer` or `pip3 install inquirer`
- `pip install requests` or `pip3 install requests`
- Authorize via glab `glab auth login` (you will need Gitlab access token, SSH recommended)
- `pip install -r requirements.txt` or install individually:
- `pip install inquirer` or `pip3 install inquirer`
- `pip install requests` or `pip3 install requests`

### Setup

Expand All @@ -25,7 +26,7 @@
- In configs folder copy example files like so:
`cp configs/templates.json.example configs/templates.json`
`cp configs/config.ini.example configs/config.ini`
- In `configs.ini` you have to paste id of your group in Gitlab to `group_id` (This is for fetching milestones and epics)
- In `config.ini` you have to paste id of your group in Gitlab to `group_id` (This is for fetching milestones and epics)
- You can adjust templates now, or play with them later (however, you have to remove comments from json before running the command).

#### Alias
Expand All @@ -42,7 +43,7 @@ Run `source ~/.zshrc` or restart terminal.

- Project selection is made automatically if you run script in same path as your project is located.
- You can specify project id or URL-encoded path as script argument e.g.: `--project_id=123456`
- If no of steps above happen, program will prompt you with question about project_id
- If none of the steps above happen, program will prompt you with question about project_id

#### Issue creation for multiple projects at once

Expand Down Expand Up @@ -76,13 +77,14 @@ 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 prompted
- `--no_iteration` - no iteration will be selected or prompted

### Only issue

If 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.
You can achieve same functionality with adding onlyIssue key to `templates.json` file.

```
...
Expand Down Expand Up @@ -127,7 +129,7 @@ gh review
To also enable **auto-merge when the pipeline succeeds**, add `--auto_merge` or `-am` flag:

```
gh review -auto_merge
gh review --auto_merge

gh review -am
```
Expand Down Expand Up @@ -175,44 +177,13 @@ To configure production deployment detection, add project-specific mappings to y

**Note:** The command only considers deployments with "success" status to ensure accurate last deployment information.


You can check when the last successful production deployment occurred:

```
gh last deploy
```

This command shows information about the most recent successful production deployment including timing, pipeline details, and how long ago it happened.

#### Configuration

To configure production deployment detection, add project-specific mappings to your `templates.json`:

```json
{
"templates": [...],
"reviewers": [...],
"productionMappings": {
"your_project_id": {
"stage": "production:deploy",
"job": "deploy-to-production"
},
"another_project_id": {
"stage": "deploy",
"job": "production:deploy"
}
}
}
```

**Note:** The command only considers deployments with "success" status to ensure accurate last deployment information.
### Flag help

If you run just `gh` (or whatever alias you set) or `gh --help` you will see all available flags and a short explanation.

## Troubleshooting 🪲🔫

### Recieving 401 Unauthorized error
### Receiving 401 Unauthorized error

If you get `glab: 401 Unauthorized (HTTP 401)` when using GitHappens, you must repeat `glab auth login`
and then reopen your terminal.
Expand All @@ -225,4 +196,3 @@ I suggest checking Gitlab's official API documentation: https://docs.gitlab.com/
## Donating 💜

Make sure to check this project on [OpenPledge](https://app.openpledge.io/repositories/zigcBenx/gitHappens).