sourcebot/docs/docs/connections/gerrit.mdx
2025-06-01 18:51:12 -07:00

77 lines
No EOL
2 KiB
Text

---
title: Linking code from Gerrit
sidebarTitle: Gerrit
icon: crow
---
import GerritSchema from '/snippets/schemas/v3/gerrit.schema.mdx'
<Note>Authenticating with Gerrit is currently not supported. If you need this capability, please raise a [feature request](https://github.com/sourcebot-dev/sourcebot/discussions/categories/ideas).</Note>
Sourcebot can sync code from self-hosted gerrit instances.
## Connecting to a Gerrit instance
To connect to a gerrit instance, provide the `url` property to your config:
```json
{
"type": "gerrit",
"url": "https://gerrit.example.com"
// .. rest of config ..
}
```
## Examples
<AccordionGroup>
<Accordion title="Sync projects by glob pattern">
```json
{
"type": "gerrit",
"url": "https://gerrit.example.com",
// Sync all repos under project1 and project2/sub-project
"projects": [
"project1/**",
"project2/sub-project/**"
]
}
```
</Accordion>
<Accordion title="Exclude repos from syncing">
```json
{
"type": "gerrit",
"url": "https://gerrit.example.com",
// Sync all repos under project1 and project2/sub-project...
"projects": [
"project1/**",
"project2/sub-project/**"
],
// ...except:
"exclude": {
// any project that matches these glob patterns
"projects": [
"project1/foo-project",
"project2/sub-project/some-sub-folder/**"
],
// projects that have state READ_ONLY
"readOnly": true,
// projects that have state HIDDEN
"hidden": true
}
}
```
</Accordion>
</AccordionGroup>
## Schema reference
<Accordion title="Reference">
[schemas/v3/gerrit.json](https://github.com/sourcebot-dev/sourcebot/blob/main/schemas/v3/gerrit.json)
<GerritSchema />
</Accordion>