Home Agentic Code Reviews GitLab Integration Setup

GitLab Integration Setup

Last updated on Oct 08, 2025

Enable Optibot to analyze your GitLab repositories, automate code reviews, and generate contextual summaries.

Setup time: ~12–15 minutes
Required permissions: Maintainer or Admin on the GitLab group or repository.


Sign Up and Access the Integration Page

  1. Go to the Optimal AI signup page.

  2. Select “Sign Up with GitLab.”

  3. Complete your account details and verify your email address.

  4. After verification, you’ll be redirected to the GitLab Integration Setup page.


Create a GitLab Access Token

Optibot requires a GitLab Access Token from a bot or service account with specific permissions to interact with your repositories.

Steps:

  1. In GitLab, navigate to your group or repository’s Settings → Access Tokens.
    (Group tokens are recommended for multi-repository installations.)

  2. Click “Add new token.”

  3. Enter a Token name, e.g., Optibot-code-review or Optibot Reviewer.

  4. Add a short description, and set the expiration date to the maximum allowed.

  5. Assign the role as Maintainer.

  6. Under Scopes, select all of the following:

    • api — Full API access

    • read_repository — Clone and read repositories

    • write_repository — Create merge request comments

    • read_user — Access user information


Retrieve the Bot/User ID

Optibot also needs the Bot or User ID associated with your GitLab token.

  1. Navigate to your Admin Area → Users.

  2. Search for the service or bot account (e.g., Optibot-code-review-2).

  3. Open the user profile and note the ID listed under the account section.
    Example: ID: 16


Connect GitLab to Optimal AI

Once you have your token and user ID:

  1. Return to the GitLab Setup Page.

  2. If using GitLab self-hosted, replace the default URL gitlab.com with your custom domain.

  3. Enter:

    • GitLab Token — your access token from Step 2

    • GitLab Bot/User ID — the numeric ID from Step 3

  4. Click “Connect GitLab.”


Select Repositories for Installation

After connecting, you’ll see a list of available repositories.

  • Select the repositories where you want Optibot to be active.

  • Optibot will automatically:

    • Install itself in each selected repo

    • Create necessary webhooks for real-time event monitoring

You can manage or update these repositories anytime via the GitLab Integration Dashboard.


Verify Installation

Once setup completes:

  • Optibot will begin analyzing merge requests automatically.

  • You can confirm installation by checking your GitLab Repository → Settings → Webhooks.
    There should be an entry for agents.getoptimal.ai.


Optibot Features on GitLab

Once integrated, Optibot enables:

  • 🧠 Automated Code Reviews
    Reviews each new merge request and provides detailed feedback directly in GitLab comments.

  • 🧾 AI-Generated Summaries
    Generates structured summaries and line-by-line breakdowns of code changes for every MR.

  • ⚙️ Contextual Recommendations
    Highlights potential issues, security concerns, or missing documentation based on code patterns.

  • 🔗 Cross-Tool Integration
    Works seamlessly with Jira, Bitbucket, and other tools for compliance and reporting.

For additional configuration options, visit the Advanced Configuration page.


Your Optibot GitLab integration is now complete.
From here, you can monitor and manage your integrations anytime at:
🔗 https://agents.getoptimal.ai/dashboard/gitlab-integration