Prerequisites
- GitLab Premium or Ultimate. Service accounts are available on every tier, but Gitar registers a group webhook during setup and GitLab does not offer group webhooks on Free.
- The Owner role on the group where you create the service account. On GitLab Self-Managed and Dedicated, group Owners must also be allowed to create service accounts, otherwise an administrator has to create the account for you.
Setup Instructions
1
Create a service account
- Go to your group in GitLab
- On the left sidebar, select Settings → Service accounts
- Select Add service account
- Enter a name and username, then select Create
gitar-service-<org-name> (e.g., gitar-service-acme).A service account can only be invited to the group or project that created it, and to anything beneath it. Creating the account in your top-level group keeps every subgroup and project available to you, including any you decide to connect later.In GitLab 18.11 and later, subgroups and projects can create their own service accounts, but those accounts are confined to that subgroup or project. On earlier versions, only top-level groups and instance administrators can create them.On GitLab Self-Managed and Dedicated, an administrator can instead create an instance service account from the Admin area, which can be invited to any group on the instance.
2
Generate a service account token
- Select the vertical ellipsis (⋮) next to your new service account, then select Manage access tokens
- Select Add new token
- Enter a token name and set an expiration date — note this date so you can rotate the token before it expires
- Select the scopes listed below, then select Generate token
- Copy the token immediately — GitLab will not show it again
A service account token is generated from the service account’s Manage access tokens page, not from a user’s profile settings. Gitar rejects personal access tokens and group or project access tokens during validation, so make sure you generate the token from the service account itself.
read_user- Required for user authentication and integration with Gitarread_repository- Allows Gitar to read repository contents, branches, and metadataread_api- Enables reading GitLab API data for project information and settingswrite_repository- Required for creating pull requests and pushing code changesapi- Enables automatic webhook setup and project discovery
3
Invite the service account to your group
Creating the service account does not give it access to anything. Invite it to the group you want Gitar to work in:
- Go to that group in GitLab
- On the left sidebar, select Manage → Members
- Select Invite members
- Search for your service account, assign the Owner role, then select Invite
admin_web_hook) permission in GitLab 17.0 and later, which you can add to a lower base role such as Maintainer.Invite the service account to the group whose path you enter in the next step. Membership inherits downwards, so inviting it to a parent group also covers every subgroup and project beneath it — but inviting it to a subgroup gives it no access to the parent.
4
Connect in Gitar
Use the generated token to configure the connection with the following fields:
- GitLab Host: The hostname of your GitLab instance (e.g., gitlab.com, gitlab.example.com)
- Group/Namespace Path: The full path of the group, including any parent groups (e.g.,
acmefor gitlab.com/acme, oracme/platformfor a subgroup) - Project ID (Optional): Find your project ID in GitLab project settings
- Service Account Token: The token you generated above, with all the scopes listed
You can update the group, token, or other connection settings after onboarding by going to Settings → Configuration in your Gitar dashboard.
Configure Repository Access
After connecting GitLab, you can configure which repositories should receive Gitar webhook notifications.Select the Configure button for GitLab, then choose individual projects or whole groups to connect. You can search by project name or paste a full project path for a direct lookup.
Self-Hosted GitLab: Git Hooks Configuration
If your self-hosted GitLab instance uses server-side git hooks to validate committer emails (push rules or custom hooks), you must allow Gitar’s committer email address.Adding the Gitar Committer Email
Depending on your GitLab configuration, addnoreply@gitar.ai to your allowed committer list:
Option 1: GitLab Push Rules (Recommended)
- Go to Admin Area → Push Rules (for instance-wide rules) or Project Settings → Repository → Push Rules (for project-specific rules)
- In the “Commit author’s email” field, add a regex pattern that includes Gitar’s email:
- Save the push rules
pre-receive or update hooks that validate committer emails, add noreply@gitar.ai to your allowed email list in the hook script.
Option 3: Service Account Email Configuration
Alternatively, ensure the Gitar service account in GitLab has noreply@gitar.ai configured as one of its verified emails.
Firewall / IP Allowlisting
If your GitLab instance enforces an IP allowlist, add Gitar’s public IP addresses to it. See Network Access for the addresses and details.Troubleshooting
“The group or namespace was not found” Gitar could not read the group with the token you supplied. GitLab returns the same response whether the group does not exist or the token cannot see it, so check both:- The path is the group’s full path, including any parent groups. A subgroup is
parent-group/subgroup, notsubgroup. - The service account is a member of that group or of one of its parent groups. Creating the account inside a group grants it no access on its own — only an invitation does.