Product
Platform overview Tomosu engine (open source) Tomosu Cloud Reliability rules
Solutions
Prevent outages before merge Reliability Radar Fix safety For developers For SRE and platform teams
Developers
Quickstart Documentation Contribute a rule
Resources
Blog Case studies Learn FAQ News
Company
Pricing About Contact Join the Waitlist
Theme

Connect GitHub, GitLab or Bitbucket

The engine connects to your code host through an app you own. For GitHub it creates your own private GitHub App in one click; for GitLab and Bitbucket you paste your own OAuth application once. Tomosu holds no app or key that can reach your repositories.

  • connect github
  • connect gitlab|bitbucket
  • Console: Connect
  • Updated

What does connecting a code host give me?

  • People sign in to the console with their own account instead of a key.
  • They scan branches of private repositories on Pre-Merge.
  • Accept opens a fix pull or merge request as the person who accepted.

Pull request comments from CI are separate: they use your CI’s own token (CI and pull request comments).

How do I connect GitHub?

The engine creates your own private GitHub App in one click, owned by your organisation or personal account. Its keys go straight from GitHub to your engine’s data folder; they never pass through Tomosu, and Tomosu has no app that could reach your repositories. The app:

  • asks for contents: write, pull requests: write, metadata: read, and nothing else;
  • has no webhook, so GitHub sends the engine nothing on its own;
  • is private, and installed only on the repositories you choose.
  1. Open Connect → GitHub

    As an admin (or with the start-up key), choose An organisation and type its name, or My personal account.

  2. Create the app on GitHub

    GitHub shows a new private app for that account. Press Create GitHub App.

  3. Choose the repositories

    Pick them and press Install & Authorize. You come back signed in.

    The Connect GitHub page after connecting: Code: GitHub shows Connected, a Sign in with GitHub button, and a note that this console uses the GitHub App of the acme organisation, with Disconnect.
    Connect GitHub, connected.

Open the console at the address people use (for example https://tomosu.internal.example), because sign-ins come back to it.

For GitHub Enterprise Server, set integrations.github.api (and integrations.github.web when it does not follow from the API address).

How do I connect GitLab or Bitbucket?

With an OAuth application you register on gitlab.com, a self-managed GitLab, or a Bitbucket Cloud workspace:

  1. Connect → GitLab (or Bitbucket). The page links to the host’s “new application” page and shows the callback address to paste.
  2. GitLab: scopes api and read_user, Confidential ticked. Bitbucket: a private OAuth consumer with Account: Read, Repositories: Write and Pull requests: Write.
  3. Paste the application id (Bitbucket: key) and secret. The secret is kept in the engine’s state database and never shown again.
The Connect GitLab page: Code: GitLab not connected, then Set it up with your GitLab address, the steps to register an application with its redirect URI and scopes, and fields for the application id and secret.
Connect GitLab: the steps, on the page.

From a terminal, an admin connects it once; the secret is read from a file or standard input, never a flag:

tomosu connect gitlab --client-id <application id> --url https://gitlab.example.com --engine http://localhost:7600 < secret.txt
tomosu integrations test gitlab --engine http://localhost:7600

On GitLab, Accept opens a merge request set to merge when the pipeline succeeds; on Bitbucket, a pull request left for review. Disconnect (tomosu disconnect gitlab) deletes the secret and signs everyone out of that host.

Who may do what once it is connected?

ActionWho
Look at anythingAnyone who can open the console
Accept or reject, edit rules, contributePeople with write (push) access to the finding’s repository
Settings, integrations, connect and disconnectAdmins: the logins in run.admins; when it is empty, repository admins
Anything, from scripts and CIThe start-up key or a named access key (Sign-in and access keys)