Skip to content
This repository was archived by the owner on Mar 21, 2025. It is now read-only.

Commit 9cabe4b

Browse files
committed
add gitlab connection docs
1 parent ec17045 commit 9cabe4b

File tree

4 files changed

+182
-3
lines changed

4 files changed

+182
-3
lines changed

docs.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
"group": "Connections",
2929
"pages": [
3030
"docs/connections/overview",
31-
"docs/connections/github"
31+
"docs/connections/github",
32+
"docs/connections/gitlab"
3233
]
3334
},
3435
{

docs/connections/github.mdx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ For a detailed description of the schema, check out the schema file (TODO: link)
3737
```json
3838
{
3939
"type": "github",
40-
"orgs": [
40+
"users": [
4141
"msukkari",
4242
"brendan-kellem",
4343
"torvalds"
@@ -79,6 +79,7 @@ For a detailed description of the schema, check out the schema file (TODO: link)
7979
"token": {
8080
"secret": "MY_SECRET"
8181
}
82+
// .. additional configs ..
8283
}
8384
```
8485
</Tab>
@@ -171,7 +172,9 @@ This connection type supports additional options for filtering which repos are i
171172
"min": 1000
172173
"max": 1000000000
173174
}
175+
// .. additional excludes ..
174176
}
177+
// .. additional configs ..
175178
}
176179
```
177180
</Tab>

docs/connections/gitlab.mdx

Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
---
2+
title: GitLab Connection
3+
sidebarTitle: GitLab
4+
icon: gitlab
5+
---
6+
7+
To search projects on GitLab, you'll create a GitLab Connection. Using this connection, you can:
8+
- Index individual GitLab projects
9+
- Index all of the projects in a GitLab group/sub-group
10+
- Index all of the projects from a GitLab user
11+
12+
<Note>If you want to index a private project/group, make sure you provide an [access token](/docs/access-tokens/overview)</Note>
13+
14+
![GitLab Connection](/images/github_connection.png)
15+
16+
# Config Schema
17+
18+
For a detailed description of the schema, check out the schema file (TODO: link)
19+
20+
<Tabs>
21+
<Tab title="All Visible">
22+
<Note>This flag only works if your GitLab instance url is set and not equal to https://gitlab.com. Make sure you provide a [secret](/docs/access-tokens/secrets) containing the necessary access token to fetch your projects.</Note>
23+
If you'd like to index all projects visible to your GitLab instance, you can use the `all` flag.
24+
```json
25+
{
26+
"type": "gitlab",
27+
"all": "true",
28+
"url": "https://gitlab.aperaturelabs.com" // This is required, and cannot be https://gitlab.com
29+
"token": {
30+
"secret": "MY_SECRET_KEY_NAME" // the name of the secret you created in Sourcebot
31+
}
32+
}
33+
```
34+
</Tab>
35+
<Tab title="Groups">
36+
You can provide a list of groups (and recursive sub-groups) to index. Sourcebot will fetch all of the visible projects in these groups. Subgroups can be specified by providing the path to the subgroup (e.g. `my-group/sub-group-a`)
37+
```json
38+
{
39+
"type": "gitlab",
40+
"groups": [
41+
"gitlab-org/api",
42+
"veloren"
43+
]
44+
// .. additional configs ..
45+
}
46+
```
47+
</Tab>
48+
<Tab title="Users">
49+
You can provide a list of users to index. Sourcebot will fetch all of the visible projects for these users.
50+
```json
51+
{
52+
"type": "gitlab",
53+
"users": [
54+
"gnachman"
55+
]
56+
// .. additional configs ..
57+
}
58+
```
59+
</Tab>
60+
<Tab title="Projects">
61+
You can provide a list of projects to index. These must be provided in the `<owner>/<project_name>` syntax.
62+
```json
63+
{
64+
"type": "gitlab",
65+
"projects": [
66+
"inkscape/inkscape",
67+
"wireshark/wireshark"
68+
]
69+
// .. additional configs ..
70+
}
71+
```
72+
</Tab>
73+
<Tab title="Custom URL">
74+
If you're self-hosting you're own GitLab instance, you can provide a link to it:
75+
```json
76+
{
77+
"type": "gitlab",
78+
"url": {
79+
"https://gitlab.aperaturelabs.com"
80+
}
81+
// .. additional configs ..
82+
}
83+
```
84+
</Tab>
85+
<Tab title="Token">
86+
If you'd like to index private projects, make sure you provide a token. You can do so by referencing the [secret](/docs/access-tokens/secrets) that contains your token.
87+
```json
88+
{
89+
"type": "gitlab",
90+
"token": {
91+
"secret": "MY_SECRET_KEY_NAME"
92+
}
93+
// .. additional configs ..
94+
}
95+
```
96+
</Tab>
97+
</Tabs>
98+
99+
### Filter Options
100+
101+
This connection type supports additional options for filtering which projects are indexed.
102+
103+
<Tabs>
104+
<Tab title="Topics">
105+
You can provide a list of repository topics to include while fetching the projects. Only projects that match at least one of these topics will be fetched.
106+
```json
107+
{
108+
"type": "gitlab",
109+
"topics": [
110+
"docs",
111+
"core"
112+
]
113+
// .. additional configs ..
114+
}
115+
```
116+
</Tab>
117+
<Tab title="Exclude Forks">
118+
If enabled, forked projects will be ignored.
119+
```json
120+
{
121+
"type": "gitlab",
122+
"exclude": {
123+
"forks": true
124+
// .. additional excludes ..
125+
}
126+
// .. additional configs ..
127+
}
128+
```
129+
</Tab>
130+
<Tab title="Exclude Archived">
131+
If enabled, archived projects will be ignored.
132+
```json
133+
{
134+
"type": "gitlab",
135+
"exclude": {
136+
"archived": true
137+
// .. additional excludes ..
138+
}
139+
// .. additional configs ..
140+
}
141+
```
142+
</Tab>
143+
<Tab title="Exclude Projects">
144+
You can provide a list of projects to exclude. These must be provided in the `<owner>/<repo_name>` syntax.
145+
```json
146+
{
147+
"type": "gitlab",
148+
"exclude": {
149+
"projects": [
150+
"sourcebot-dev/zoekt",
151+
"torvalds/linux"
152+
]
153+
// .. additional excludes ..
154+
}
155+
// .. additional configs ..
156+
}
157+
```
158+
</Tab>
159+
<Tab title="Exclude Topics">
160+
You can provide a list of topics to ignore. Projects that contain any of these topics will be ignored
161+
```json
162+
{
163+
"type": "gitlab",
164+
"exclude": {
165+
"topics": [
166+
"ci",
167+
"experimental"
168+
]
169+
// .. additional excludes ..
170+
}
171+
// .. additional configs ..
172+
}
173+
```
174+
</Tab>
175+
</Tabs>

snippets/connection-cards.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<CardGroup cols={2}>
22
<Card title="GitHub" icon="github" href="/docs/connections/github"></Card>
3-
<Card title="GitLab" icon="gitlab"></Card>
3+
<Card title="GitLab" icon="gitlab" href="/docs/connections/gitlab"></Card>
44
<Card title="Gitea" icon="gitea"></Card>
55
<Card title="Gerrit" icon="gerrit"></Card>
66
<Card title="Local" icon="folders">Self-host only</Card>

0 commit comments

Comments
 (0)