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
58 changes: 13 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@

## Installation 🔨

### Preresequisits
### Prerequisites

- install python3 (make sure to include pip in install)
- Install Python 3 (make sure to include pip during installation)
- 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 a GitLab access token; SSH is recommended)
- Install dependencies with `pip install -r requirements.txt`

### Setup

Expand All @@ -25,8 +24,8 @@
- 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)
- You can adjust templates now, or play with them later (however, you have to remove comments from json before running the command).
- In `configs/config.ini`, paste your GitLab group ID into `group_id`. This is used for fetching milestones and epics.
- You can adjust templates now, or play with them later. Remove comments from `templates.json` before running the command because JSON does not support comments.

#### Alias

Expand All @@ -42,7 +41,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 apply, the program will prompt you for `project_id`

#### Issue creation for multiple projects at once

Expand Down Expand Up @@ -82,7 +81,7 @@ If you don't want to include some settings you use following flags:
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 the same functionality by adding the `onlyIssue` key to the `templates.json` file.

```
...
Expand Down Expand Up @@ -124,13 +123,13 @@ To submit merge request into review run command:
gh review
```

To also enable **auto-merge when the pipeline succeeds**, add `--auto_merge` or `-am` flag:
To also enable **auto-merge when the pipeline succeeds**, add the `--auto_merge` or `-am` flag:

```
gh review –-auto_merge

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

### Manually selecting reviewers

To manually select reviewers for your merge request, use the `--select` flag with the review command:
Expand Down Expand Up @@ -176,46 +175,15 @@ 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 a 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.
If you get `glab: 401 Unauthorized (HTTP 401)` when using GitHappens, run `glab auth login` again and then reopen your terminal.

## Contributing 🫂🫶

Expand Down