Skip to main content
Devin’s API is a powerful tool, please read the following article before continuing with this guide.

1. Process Overview

  1. Pull Request is opened: A pull request (PR) is submitted to the repository with changes that may contain issues identified by a code scanning tool.
  2. GitLab Action is triggered: The opening of the PR automatically triggers a GitHub Action workflow.
  3. GitLab Action calls Devin API: The GitHub Action sends a request to the Devin API, passing the identified issues for automated resolution.
  4. Devin session is initialized: A Devin session spins up, receiving the context of the issue and attempting to resolve it based on the provided data.
  5. Devin proposes PR for human review: Once the issue is resolved, Devin generates a PR with the proposed changes and submits it for human review.

2. Steps to Accomplish This

  1. Configure GitLab environment to hold the required secrets:
    • Set up the GitLab environment to securely store the necessary secrets, such as authentication tokens and configuration keys, to interact with Devin’s API and other integrated tools.
Once these steps are complete, your pipeline will be ready to automatically resolve issues using Devin’s API, speeding up the process and reducing the need for manual intervention.
  1. Test the Integration
Once your setup is complete, you can test the integration by manually triggering a GitLab Action. This will allow you to verify that the action correctly calls the Devin API and resolves the identified issues.
  1. View Devin Sessions Page
After the GitLab Build is triggered and Devin processes the issues, you can view the status and results on the Devin sessions page. This page provides detailed insights into the resolved issues and the proposed changes. As mentioned before the required Values from SonarQube are: To configure the integration, you will need to obtain the following three values from your SonarQube instance: You will need three_values from SonarQube: {SONAR_TOKEN, SONAR_ORG, SONAR_PROJECT_KEY} Once you have all the required values, you’re ready to configure the GitLab Action.
This assumes you have a local SonarCloud properties file sonar-project.properties that specifies:
The GitLab Action has the following source code
As a reminder devin_remediation.py is the following:
To ensure the GitLab Action sets the correct environment variables, add them to GitLab CI/CD Secrets. Navigating to the correct settings can be tricky. Go to Settings and edit Secrets. Add SONAR_TOKEN and DEVINS_API under Repository Secrets.
SonarQube
If you use self-hosted GitLab, then the only difference would be: Once configured, you can monitor your GitLab Action in progress. If it runs successfully, it will appear as follows:
SonarQube
You can view Devin sessions in the Session Manager.
SonarQube
Once completed, Devin will automatically open pull requests. For GitLab users, refer to the linked guide.