Skip to content

Commit 346c6a2

Browse files
dashedclaude
andcommitted
docs(protos): Reframe as temporary override, not permanent migration
This is a temporary mechanism for faster iteration on proto definitions, not a permanent migration of ownership away from sentry-protos. Changes should eventually be published back to sentry-protos. Remove "migration" language throughout. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 87e04d6 commit 346c6a2

2 files changed

Lines changed: 16 additions & 35 deletions

File tree

proto/README.md

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
# Proto Sources
22

3-
This directory is the **source of truth** for proto definitions used by sentry. Proto files here are compiled on demand during development and pre-compiled during CI/deploy for production.
3+
This directory holds `.proto` files that override the pip-installed `sentry-protos` package. Proto files here are compiled on demand during development and pre-compiled during CI/deploy for production.
44

5-
Currently migrated domains:
6-
7-
- `billing/` — billing service protos (data categories, usage, contracts, etc.)
8-
9-
Other domains (snuba, seer, taskbroker, etc.) remain in the `sentry-protos` pip package until migrated.
5+
This is a temporary mechanism for faster iteration on proto definitions without waiting for a `sentry-protos` release. Changes here should eventually be published back to `sentry-protos`.
106

117
## Directory Structure
128

@@ -18,17 +14,10 @@ proto/
1814
data_category.proto
1915
date.proto
2016
usage_data.proto
21-
common/
22-
v1/
23-
address.proto
24-
...
2517
services/
2618
usage/
2719
v1/
2820
endpoint_usage.proto
29-
contract/
30-
v1/
31-
...
3221
```
3322

3423
## Usage
@@ -46,16 +35,12 @@ Edit `.proto` files in this directory directly. On next import, the `proto_loade
4635
## How Overrides Work
4736

4837
1. **This directory** (`proto/`) -- highest priority
49-
2. **pip-installed `sentry-protos`** -- fallback for non-migrated domains
38+
2. **pip-installed `sentry-protos`** -- fallback
5039

5140
See `src/sentry/utils/PROTO_OVERRIDE.md` for full documentation.
5241

53-
## Initial Migration
54-
55-
To migrate a new domain from `sentry-protos` into this repo:
42+
## Copying Protos from sentry-protos
5643

5744
```bash
58-
bin/sync-protos /path/to/sentry-protos <domain>
45+
bin/sync-protos /path/to/sentry-protos billing
5946
```
60-
61-
After the initial copy, maintain the protos here -- do not re-sync.

src/sentry/utils/PROTO_OVERRIDE.md

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
# Proto Override System
22

3-
Compile and serve proto definitions directly from the sentry repo, replacing the pip-installed `sentry-protos` package for migrated domains.
3+
Temporarily override pip-installed `sentry-protos` modules with local `.proto` definitions for faster iteration, without waiting for a `sentry-protos` release.
44

55
## Why This Exists
66

7-
Proto definitions used to live exclusively in the `sentry-protos` repo, with a separate pip release cycle. Iterating on protos required publishing a new `sentry-protos` version before sentry could use the changes. This system moves proto source files into the sentry repo itself (`proto/`), compiling them at import time during development and pre-compiling them during CI/deploy for production.
8-
9-
Domains are migrated incrementally. Non-migrated domains (snuba, seer, etc.) continue to be served from the `sentry-protos` pip package as a transparent fallback.
7+
Proto definitions live in the `sentry-protos` repo with a separate pip release cycle. Iterating on protos requires publishing a new `sentry-protos` version before sentry can use the changes. This system lets you place `.proto` files in `proto/` to override specific modules during development, CI, and production. Changes should eventually be published back to `sentry-protos`.
108

119
## Architecture
1210

@@ -72,28 +70,26 @@ This works regardless of whether the module comes from `proto/` (override) or th
7270
### Priority Order
7371

7472
```
75-
1. proto/ (in-repo, committed to git) ← source of truth
76-
2. pip sentry-protos (installed package) ← fallback for non-migrated domains
73+
1. proto/ (in-repo overrides) ← highest priority
74+
2. pip sentry-protos (installed package) ← fallback
7775
```
7876

79-
Migrated domains (e.g., billing) are maintained in `proto/`. Non-migrated domains (snuba, seer, etc.) are served from the pip-installed `sentry-protos` package until they are migrated.
77+
Protos in `proto/` take precedence. Anything not overridden falls through to the pip package.
8078

8179
### getsentry
8280

8381
No setup required. Both repos share one venv with sentry editable-installed, so `REPO_ROOT` in `proto_loader.py` resolves to sentry's repo root where `proto/` lives. The `install()` calls in sentry's initializer and pytest plugin cover getsentry automatically — both at runtime and in tests.
8482

8583
Proto overrides placed in sentry's `proto/sentry_protos/` are picked up by getsentry with no getsentry-side changes.
8684

87-
### Migrating a New Domain
85+
### Copying Protos from sentry-protos
8886

89-
To migrate a domain from `sentry-protos` into this repo (one-time):
87+
To copy a domain's protos from a local sentry-protos checkout:
9088

9189
```bash
9290
bin/sync-protos /path/to/sentry-protos <domain>
9391
```
9492

95-
After the initial copy, maintain the protos in `proto/` — do not re-sync.
96-
9793
## Configuration
9894

9995
Most setups need no environment variables — `proto/` and `.proto_cache/` work by convention.
@@ -145,16 +141,16 @@ proto/ ← .proto sources (in git)
145141

146142
## Helper Script: `bin/sync-protos`
147143

148-
A one-time migration tool for copying proto files from a `sentry-protos` checkout into `proto/`. After the initial migration, protos are maintained directly in the sentry repo.
144+
Copies proto files from a `sentry-protos` checkout into `proto/`.
149145

150146
```bash
151-
# One-time migration: copy billing protos from sentry-protos
147+
# Copy billing protos from sentry-protos
152148
bin/sync-protos /path/to/sentry-protos billing
153149

154-
# Migrate multiple domains at once
150+
# Copy multiple domains
155151
bin/sync-protos /path/to/sentry-protos billing snuba
156152

157-
# Migrate all domains
153+
# Copy all domains
158154
bin/sync-protos --all
159155

160156
# Show current override status

0 commit comments

Comments
 (0)