Skip to main content

Introduction

The SCM (Source Code Management) platform is a vendor-agnostic abstraction layer for interacting with source code management service-providers such as GitHub, GitLab, and Bitbucket. It decouples Sentry's product features from service-provider-specific APIs by presenting a single, declarative interface for both reading and writing SCM resources and for reacting to SCM webhook events.

Goals

  1. Service-provider independence. Product code should never import a service-provider's client or parse a service-provider's response format directly. All interactions should flow through a common interface. Adding new service-providers should not require changes to existing implementations.
  2. Declarative usage. Callers should describe what they want (e.g. "create a pull request") not how to accomplish it. Initialization, authentication, rate limiting, and response mapping are handled internally.
  3. Centrally enforced access controls. Access controls must be strictly and consistently enforced across all SCM service-providers to prevent unprivileged access to sensitive customer data. The security model should be implemented once and applied universally.
  4. Observable. Every outbound action and every inbound webhook listener automatically records success/failure metrics, emits traces, and reports errors and logs to Sentry. The health of the SCM platform should always be knowable.
  5. Extensible. The SCM platform should be maximally and trivially extensible. As core infrastructure it should mutate as business needs change and not ossify a particular implementation.

Features

The platform exposes three subsystems:

  • Actions — outbound SCM operations initiated by Sentry code. The SourceCodeManager class provides 70+ methods covering comments, reactions, pull requests, branches, git objects, reviews, and check runs. With more actions planned to be added as we port more use cases.
  • Actions RPC - outbound SCM commands exposed over the network. The SourceCodeManager is fully available over the network. This enables usage of the SCM for services outside the monolith.
  • Event Stream — inbound webhook processing. SCM service-providers push events which are deserialized into typed, provider-neutral dataclasses (CheckRunEvent, CommentEvent, PullRequestEvent) which are then dispatched to registered listener functions.

Why

Ad-hoc usage of a SCM service-provider's API client tightly couples your application code to that provider. Ad-hoc management of access controls increases Sentry's security vulnerability surface area (specifically IDOR vulnerabilities). And ad hoc use of API clients can lead to resource exhaustion, starving critical product features of quota without consideration.

You should not need to care about any of these things. These problems should be solved once and managed for you. It should be impossible for you to perform an action which violates a security boundary. It should be impossible for your usage of the SCM to break another feature's SLO. The less you have to think about, the more you can focus on solving the business case.

The SCM solves all the problems you don't want to care about.

Getting Started

We have extensive documentation both inline in the Sentry codebase and on the Sentry developer documentation portal. If you're interested in expanding your SCM usage or in enabling new service-providers for a limited amount of effort take a took at the SCM platform.

Releasing a New Version

  1. On the getsentry/scm-platform repository page click the Actions tab.
  2. On the left-hand side click the release workflow.
  3. Click Run workflow, choose a bump type (patch, minor, or major), and run it. The next version is calculated automatically from the current version in pyproject.toml.
  4. The workflow will create a release branch and PR via getsentry/action-prepare-release. After completion it will return a URL to an issue on getsentry/publish.
  5. On the getsentry/publish issue immediately set the accepted label.
  6. A pull request will be opened on getsentry/pypi.
  7. Edit the file in GitHub and place python>=3.13 on the line immediately following the changed line.
  8. The PR will merge automatically. When it's merged your new version is available for use.

Release files for sentry-scm 1.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sentry-scm 1.6.0
File Size Uploaded
sentry_scm-1.6.0.tar.gz 84.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sentry-scm 1.6.0
File Interpreter ABI Platform
sentry_scm-1.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 177.3 kB

Release files / sentry_scm-1.6.0.tar.gz

Download URL sentry_scm-1.6.0.tar.gz
Size 84.7 kB
Tags Source
SHA-256 checksum
How to use checksums
97608d828ab1bd9423ecc1682d74fcf314fb7e6b8ad37641c8549ed6f56e56a5
BLAKE2b-256 checksum
How to use checksums
53eb3ed8b6c74778d4acb246f6f731dccd4a802bf2c936cb76dfb81d7e94605e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.2

Release files / sentry_scm-1.6.0-py3-none-any.whl

Download URL sentry_scm-1.6.0-py3-none-any.whl
Size 92.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5d2b8eb301c4669c4c7899d420746cbc6f614fa408c0399f768d4e7d41c4bf37
BLAKE2b-256 checksum
How to use checksums
466b70b5ff524fb16bd277835ec645342794f83c7fca17f82da6b1bf73901822
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.2

Release history Release notifications | RSS feed

This release

1.6.0 This release

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.32.1

2 release files

0.30.0

2 release files

0.21.1

2 release files

0.21.0

2 release files

0.20.0

2 release files

0.19.0

2 release files

0.18.0

2 release files

0.17.0

2 release files

0.16.0

2 release files

0.15.1

2 release files

0.15.0

2 release files

0.14.1

2 release files

0.14.0

2 release files

0.10.1

2 release files

0.10.0

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.7

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page