Version controls
Github, GitLab, Bitbucket, Azure DevOps
Github Integration
How Trag integrates with Github:
Trag
integrates with GitHub as a GitHub App. Customers install the Trag App, granting it the necessary permissions to operate on a selected list of repositories.
These permissions can be reviewed both during the app installation process and within the user’s GitHub account application’s configurations.
The Trag GitHub App includes a built-in, SSL-enabled webhook. The webhook is triggered whenever a pull request is opened or updated within the authorized repositories.
GitLab Integration
How Trag integrates with GitLab:
Trag
uses GitLab Applications as an OAuth
provider for authentication. Upon successful authentication, Trag performs two key actions automatically: it establishes an SSL-verified webhook
for Merge Request (MR) events within the user’s project and invites a private
Trag user with Developer permissions to that project. These actions are performed on behalf of the authenticated user. Therefore, the user must possess the necessary permissions within the GitLab project to create webhooks and invite users. Granting Trag Developer
access is essential for its proper operation.
Bitbucket Integration
How Trag integreates with Bitbucket:
Trag
uses Bitbucket’s OAuth consumer for authentication. Upon successful authentication, Trag establishes an password encrypted webhook for pull request (pr) events within the user’s repository. Bitbucket does not offer a mechanism to directly invite a Trag user into project. Trag cannot automatically grant itself specific permissions. Instead, comments are generated on behalf of the logged-in user and include the hashtag #traggen
.
Due to this limitation, we recommend that customers create a dedicated Bitbucket user specifically for Trag. This dedicated user should then be used to authenticate the OAuth consumer. This approach ensures clearer attribution of Trag’s comments and avoids potential confusion with comments made by other users.
The authenticated user (whether it’s the dedicated Trag user or a regular user) must have the necessary permissions within the Bitbucket repository to create webhooks.
Azure DevOps Integration
Coming soon …
Webhook Handling
Trag’s integration is triggered by pull requests events, specifically when an pr is opened, updated with new commits, or reopened. When such an event occurs, version control sends a webhook payload to Trag. This payload contains metadata about the pr. Upon receiving the payload, Trag retrieves the code diffs for the PR from version control. These diffs are then enriched with additional context, including commit history and the MR description. The enriched code is then processed by Trag’s AI. Any relevant findings are submitted back to version control as pr comments via the official rest api.