Skip to content

Commit 1c5b63a

Browse files
untraclaude
andcommitted
git provider doc refinement, rust lints
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 5bad57b commit 1c5b63a

6 files changed

Lines changed: 182 additions & 93 deletions

File tree

docs/getting-started/git/github.md

Lines changed: 28 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
title: "GitHub"
33
description: "Configure GitHub integration with Operator."
44
layout: doc
5+
published: true
56
---
67

78
# GitHub
@@ -19,7 +20,7 @@ Connect Operator to GitHub for repository management and pull requests.
1920

2021
## Install GitHub CLI
2122

22-
The `gh` CLI handles authentication and API operations.
23+
The `gh` CLI handles authentication and API operations. Operator uses `gh` directly rather than raw API calls.
2324

2425
### macOS
2526

@@ -35,6 +36,9 @@ curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo
3536
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
3637
sudo apt update
3738
sudo apt install gh
39+
40+
# Fedora/RHEL
41+
sudo dnf install gh
3842
```
3943

4044
### Windows
@@ -43,20 +47,19 @@ sudo apt install gh
4347
winget install --id GitHub.cli
4448
```
4549

46-
### Authenticate
50+
## Authenticate
51+
52+
The `gh` CLI manages authentication, including OAuth flows and credential storage:
4753

4854
```bash
4955
gh auth login
5056
```
5157

52-
Follow the prompts to authenticate via browser or token.
53-
54-
## Create Personal Access Token
58+
Follow the prompts to authenticate via browser or token. Verify with:
5559

56-
1. Go to GitHub Settings > Developer settings > Personal access tokens
57-
2. Click "Generate new token (classic)"
58-
3. Select scopes: `repo`, `workflow`
59-
4. Copy the token
60+
```bash
61+
gh auth status
62+
```
6063

6164
## Configuration
6265

@@ -67,38 +70,32 @@ Add GitHub to your Operator configuration:
6770

6871
[git.github]
6972
enabled = true
70-
token_env = "GITHUB_TOKEN"
71-
owner = "your-username" # or organization
72-
repo = "your-repo"
73+
token_env = "GITHUB_TOKEN" # env var for token (used as fallback if gh CLI auth is unavailable)
7374
```
7475

75-
Set your token:
76+
If `token_env` is set, export the token:
7677

7778
```bash
7879
export GITHUB_TOKEN="ghp_xxxxx"
7980
```
8081

81-
## Pull Request Settings
82+
### Provider Auto-Detection
8283

83-
Configure PR behavior:
84+
Operator auto-detects GitHub from your git remote URL. You can also set it explicitly:
8485

8586
```toml
86-
[git.github.pr]
87-
base_branch = "main"
88-
draft = false
89-
auto_merge = false
90-
reviewers = ["teammate1", "teammate2"]
91-
labels = ["automated", "ai-generated"]
87+
[git]
88+
provider = "github"
9289
```
9390

94-
## Branch Naming
91+
### Shared Git Settings
9592

96-
Configure branch name format:
93+
Branch naming and worktree settings live under the shared `[git]` section (see [Supported Git Repositories](/getting-started/git/) for details):
9794

9895
```toml
99-
[git.github]
100-
branch_format = "{type}/{ticket_id}-{slug}"
101-
# Example: feat/PROJ-123-add-login
96+
[git]
97+
branch_format = "{type}/{ticket_id}"
98+
use_worktrees = false
10299
```
103100

104101
## Commit Messages
@@ -117,22 +114,20 @@ Ticket: PROJ-123
117114

118115
### Authentication errors
119116

120-
Test your token:
117+
Check your auth status:
121118

122119
```bash
123-
curl -H "Authorization: token $GITHUB_TOKEN" \
124-
https://api.github.com/user
120+
gh auth status
125121
```
126122

127123
### Permission denied
128124

129-
Ensure your token has `repo` scope and you have push access.
125+
Ensure you have push access to the repository and your `gh` session is authenticated.
130126

131127
### Rate limiting
132128

133-
GitHub has API rate limits. Check remaining quota:
129+
Check remaining API quota:
134130

135131
```bash
136-
curl -H "Authorization: token $GITHUB_TOKEN" \
137-
https://api.github.com/rate_limit
132+
gh api rate_limit
138133
```

docs/getting-started/git/gitlab.md

Lines changed: 96 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,131 @@
11
---
22
title: "GitLab"
3-
description: "Configure GitLab integration with Operator (Coming Soon)."
3+
description: "Configure GitLab integration with Operator."
44
layout: doc
55
published: true
66
---
77

88
# GitLab
99

10-
GitLab integration is planned for a future release.
10+
Connect Operator to GitLab for repository management and merge requests.
1111

12-
## Planned Features
12+
## Prerequisites
1313

14-
When available, GitLab support will include:
14+
| Requirement | Purpose | Verification |
15+
|------------|---------|--------------|
16+
| `git` | Version control | `git --version` |
17+
| `glab` | GitLab CLI | `glab --version` |
18+
| GitLab account | Repository access | - |
19+
| Push access | Create branches/MRs | - |
1520

16-
- Merge request creation and monitoring
17-
- Review status tracking
18-
- CI/CD pipeline status integration
19-
- Branch management
21+
## Install GitLab CLI
2022

21-
## Expected Prerequisites
23+
The `glab` CLI handles authentication and API operations. Operator uses `glab` directly rather than raw API calls.
2224

23-
GitLab integration will require:
25+
### macOS
2426

25-
| Requirement | Purpose |
26-
|------------|---------|
27-
| GitLab account | Repository access |
28-
| Personal Access Token or Project Token | API authentication |
29-
| `glab` CLI (optional) | Alternative to direct API |
27+
```bash
28+
brew install glab
29+
```
3030

31-
### Token Scopes (Planned)
31+
### Linux
3232

33-
- `api` - Full API access
34-
- `read_repository` - Read repository contents
35-
- `write_repository` - Push changes
33+
```bash
34+
# Debian/Ubuntu
35+
curl -fsSL https://gitlab.com/gitlab-org/cli/-/releases/permalink/latest/downloads/glab_amd64.deb -o glab.deb
36+
sudo dpkg -i glab.deb
3637

37-
## Planned Configuration
38+
# Fedora/RHEL
39+
sudo dnf install glab
40+
```
41+
42+
### Windows
43+
44+
```powershell
45+
winget install --id GLab.GLab
46+
```
47+
48+
## Authenticate
49+
50+
The `glab` CLI manages authentication, including OAuth flows and credential storage:
51+
52+
```bash
53+
glab auth login
54+
```
55+
56+
Follow the prompts to authenticate via browser or token. Verify with:
57+
58+
```bash
59+
glab auth status
60+
```
61+
62+
## Configuration
63+
64+
Add GitLab to your Operator configuration:
3865

3966
```toml
4067
# ~/.config/operator/config.toml
4168

42-
[git]
43-
provider = "gitlab"
44-
4569
[git.gitlab]
4670
enabled = true
47-
token_env = "GITLAB_TOKEN"
48-
host = "gitlab.com" # Or self-hosted instance
49-
project_id = "namespace/project"
71+
token_env = "GITLAB_TOKEN" # env var for token (used as fallback if glab CLI auth is unavailable)
72+
host = "gitlab.com" # or your self-hosted instance (e.g., "gitlab.example.com")
5073
```
5174

52-
### Merge Request Settings (Planned)
75+
If `token_env` is set, export the token:
5376

54-
```toml
55-
[git.gitlab.mr]
56-
target_branch = "main"
57-
draft = false
58-
remove_source_branch = true
59-
squash = false
60-
reviewers = ["username1", "username2"]
61-
labels = ["automated", "ai-generated"]
77+
```bash
78+
export GITLAB_TOKEN="glpat-xxxxx"
6279
```
6380

64-
## CLI Alternative
81+
Merge request operations (create, monitor, review tracking) are not yet implemented. Provider detection, configuration, and `glab` CLI authentication work today.
6582

66-
GitLab's official CLI (`glab`) may be used as an alternative:
83+
### Provider Auto-Detection
84+
85+
Operator auto-detects GitLab from your git remote URL, including self-hosted instances (any URL containing `gitlab.`):
6786

6887
```bash
69-
# Install glab
70-
brew install glab
88+
# All of these are auto-detected as GitLab:
89+
git@gitlab.com:owner/repo.git
90+
https://gitlab.com/owner/repo
91+
https://gitlab.example.com/owner/repo
92+
```
7193

72-
# Authenticate
73-
glab auth login
94+
You can also set the provider explicitly:
95+
96+
```toml
97+
[git]
98+
provider = "gitlab"
7499
```
75100

76-
## Contributing
101+
### Shared Git Settings
102+
103+
Branch naming and worktree settings live under the shared `[git]` section (see [Supported Git Repositories](/getting-started/git/) for details):
104+
105+
```toml
106+
[git]
107+
branch_format = "{type}/{ticket_id}"
108+
use_worktrees = false
109+
```
77110

78-
Interested in helping implement GitLab support? See the [Provider Support](/getting-started/git/provider-support/) guide for architecture details.
111+
## Troubleshooting
112+
113+
### Authentication errors
114+
115+
Check your auth status:
116+
117+
```bash
118+
glab auth status
119+
```
120+
121+
### Permission denied
122+
123+
Ensure you have push access to the repository and your `glab` session is authenticated.
124+
125+
### Self-hosted connectivity
126+
127+
If using a self-hosted GitLab instance, verify the `host` value in your config matches the instance hostname and that the instance is reachable:
128+
129+
```bash
130+
glab auth status --hostname gitlab.example.com
131+
```

docs/getting-started/git/index.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ layout: doc
66

77
# Supported Git Repositories
88

9-
Operator integrates with Git hosting platforms to manage branches and pull requests.
9+
Operator integrates with Git hosting platforms to manage branches and pull/merge requests.
1010

1111
## Prerequisites
1212

@@ -21,6 +21,30 @@ All providers require:
2121
| Platform | Status | CLI Tool | Notes |
2222
|----------|--------|----------|-------|
2323
| [GitHub](/getting-started/git/github/) | Supported | `gh` | Full PR integration |
24+
| [GitLab](/getting-started/git/gitlab/) | Partial | `glab` | Detection and config ready; MR operations planned |
25+
26+
## Provider Auto-Detection
27+
28+
Operator detects your Git provider from the remote URL automatically. You can override this in config:
29+
30+
```toml
31+
[git]
32+
provider = "github" # or "gitlab"
33+
```
34+
35+
## Shared Git Configuration
36+
37+
These settings apply regardless of provider:
38+
39+
```toml
40+
[git]
41+
branch_format = "{type}/{ticket_id}" # Branch naming pattern
42+
use_worktrees = false # Per-ticket worktree isolation
43+
```
44+
45+
**Branch format variables:** `{type}` is the ticket type prefix (e.g., `feature`, `fix`, `spike`, `investigation`), `{ticket_id}` is the ticket identifier.
46+
47+
**Worktrees:** When enabled, Operator creates isolated git worktrees per ticket, allowing parallel development without branch switching.
2448

2549
## How It Works
2650

@@ -29,7 +53,7 @@ When an agent completes work on a ticket:
2953
1. **Branch**: Creates a feature branch from main
3054
2. **Commit**: Commits changes with ticket reference
3155
3. **Push**: Pushes branch to remote
32-
4. **PR**: Opens a pull request for review
56+
4. **PR/MR**: Opens a pull request or merge request for review
3357

3458
## Local Git
3559

0 commit comments

Comments
 (0)