Connecting Your Repos
Introduction¶
To get the most out of Sourcery, we highly recommend adding Sourcery to your GitHub or GitLab repositories.
Linking your repos allows you to:
- Get code reviews on any pull request
- Scan the repo for security risks/issues
- Investigate Sentry issues associated with the repo
- Get in depth analytics on velocity and SDLC metrics for your repo
Linking Sourcery to GitHub Repos¶
Sign up for a Sourcery account using your GitHub log in and you will be prompted to add Sourcery to your GitHub account/Organization*.
If you already have a Sourcery account, you can go to the GitHub App section of your Sourcery dashboard and add the Sourcery integration to your GitHub account/organization.
Then choose whether you want to add Sourcery to all of your repos or to select repositories. Sourcery is only able to review and analyze any repositories that it has access to.
To change which repos Sourcery has access to you can go to the GitHub App section of your dashboard at any time and click into "Configure Repositories" to add or remove Sourcery's access to repos.
*Note: In order to add Sourcery into a GitHub organization you will need to be an admin of that GitHub organization. If you want to use Sourcery in your team/company but are not the admin, please ask your GitHub admin to install Sourcery.
Linking Sourcery to GitLab Projects¶
Sign up for a Sourcery account with your GitLab log in and you will be prompted to add Sourcery to your GitLab account.
Then select the GitLab namespace(s) you want to add Sourcery to and the Projects you want to add Sourcery to.
You can add or modify which Projects Sourcery has access to at any point by going to the Repositories section of your dashboard.
Sourcery for GitHub Enterprise Server¶
To use Sourcery with a self hosted GitHub Enterprise Server or GitLab Self-Hosted click on the Self-hosted section at the top of the account creation section.
Once you choose GitHub Enterprise Server you'll be asked to input your GitHub Enterprise Server URL.
You'll then need to set up a
GitHub personal access
token with read:org permissions. Add that into Sourcery and you will then be
asked to select which Organizations you want to add Sourcery to.
Finally you will be asked to choose whether you want to add Sourcery to all of your repos or to select repositories. Sourcery is only able to review and analyze any repositories that it has access to.
Sourcery for Self Hosted GitLab Projects¶
After choosing GitLab Self-Hosted from the account creation screen you will be prompted to enter your GitLab Instance URL.
Then you will need to create a
GitLab access token
with api scope and add that into Sourcery.
Then select the GitLab namespace(s) you want to add Sourcery to and the Projects you want to add Sourcery to.
Firewall allowlist for self-hosted instances:¶
If your instance is behind a firewall you will need to grant access to the following IP addresses to allow Sourcery to work:
- 34.142.124.129
- 34.147.223.148
