Skip to content

Commit 95b0026

Browse files
authored
Merge branch 'master' into lynnagara/ref/remove-dead-no-org-invite-route
2 parents cf29df0 + 3445a4a commit 95b0026

File tree

2,006 files changed

+43987
-23209
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,006 files changed

+43987
-23209
lines changed

.agents/skills/hybrid-cloud-outboxes/SKILL.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ description: >-
1818

1919
Sentry uses a **transactional outbox pattern** for eventually consistent operations. When a model changes, an outbox row is written inside the same database transaction. After the transaction commits, the outbox is drained — firing a signal that triggers side effects such as RPC calls, tombstone propagation, or audit logging.
2020

21-
The most common use case is **cross-silo data replication**: a model saved in the Region silo produces a `RegionOutbox` that, when processed, replicates data to the Control silo (or vice versa via `ControlOutbox`). But the pattern is general — outboxes work for any operation that should happen reliably after a transaction commits, even within a single silo.
21+
The most common use case is **cross-silo data replication**: a model saved in the Cell silo produces a `CellOutbox` that, when processed, replicates data to the Control silo (or vice versa via `ControlOutbox`). But the pattern is general — outboxes work for any operation that should happen reliably after a transaction commits, even within a single silo.
2222

2323
There are two outbox types corresponding to the two directions of flow:
2424

25-
- **`RegionOutbox`** — written in a Cell silo, processed in the Cell silo to push data toward Control (via RPC calls in signal receivers).
25+
- **`CellOutbox`** — written in a Cell silo, processed in the Cell silo to push data toward Control (via RPC calls in signal receivers).
2626
- **`ControlOutbox`** — written in the Control silo, processed in the Control silo to push data toward one or more Cell silos. Each `ControlOutbox` row targets a specific `cell_name`.
2727

2828
## Critical Constraints
@@ -66,7 +66,7 @@ There are two outbox types corresponding to the two directions of flow:
6666

6767
| Data lives in... | Replicates toward... | Mixin | Outbox type |
6868
| ---------------- | -------------------- | ------------------------ | --------------- |
69-
| Cell silo | Control silo | `ReplicatedCellModel` | `RegionOutbox` |
69+
| Cell silo | Control silo | `ReplicatedCellModel` | `CellOutbox` |
7070
| Control silo | Cell silo(s) | `ReplicatedControlModel` | `ControlOutbox` |
7171

7272
### 2.2 `ReplicatedCellModel` Template
@@ -148,7 +148,7 @@ class MyModel(ReplicatedCellModel):
148148

149149
### 2.3 `ReplicatedControlModel` Template
150150

151-
Use this when a Control model needs to replicate data to Region silo(s). The key difference: Control outboxes fan out to one or more cells, so the model must declare which cells to target.
151+
Use this when a Control model needs to replicate data to Cell silo(s). The key difference: Control outboxes fan out to one or more cells, so the model must declare which cells to target.
152152

153153
```python
154154
from sentry.db.models import control_silo_model
@@ -360,7 +360,7 @@ def test_idempotent_replication(self):
360360

361361
### 7.3 Silo Test Decorators
362362

363-
- Use **`@cell_silo_test`** for tests focused on `RegionOutbox` creation
363+
- Use **`@cell_silo_test`** for tests focused on `CellOutbox` creation
364364
- Use **`@control_silo_test`** for tests focused on `ControlOutbox` creation
365365
- Use **`@all_silo_test`** for end-to-end replication tests that exercise both silos
366366
- Only use **`TransactionTestCase`** for threading/concurrency tests (e.g., `threading.Barrier`), not for standard outbox drain tests

.agents/skills/hybrid-cloud-outboxes/references/backfill.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ Each batch (via `process_outbox_backfill_batch`):
110110

111111
1. Calls `_chunk_processing_batch` to determine the ID range `(low, up)` for this batch
112112
2. For each instance in `model.objects.filter(id__gte=low, id__lte=up)`:
113-
- Region models: `inst.outbox_for_update().save()` inside `outbox_context(flush=False)`
113+
- Cell models: `inst.outbox_for_update().save()` inside `outbox_context(flush=False)`
114114
- Control models: saves all `inst.outboxes_for_update()` inside `outbox_context(flush=False)`
115115
3. If no more rows: sets cursor to `(0, replication_version + 1)` (marks complete)
116116
4. Otherwise: advances cursor to `(up + 1, version)`
@@ -141,7 +141,7 @@ options.get("outbox_replication.sentry_mymodel.replication_version")
141141
### Check Outbox Queue Depth
142142

143143
```sql
144-
-- Region outboxes for a specific category
144+
-- Cell outboxes for a specific category
145145
SELECT count(*) FROM sentry_regionoutbox
146146
WHERE category = <category_value>;
147147

.agents/skills/hybrid-cloud-outboxes/references/debugging.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ When debugging stuck outboxes, you'll often need to generate SQL for a developer
4545

4646
| Direction | Model class | Table name |
4747
| ------------------ | --------------- | ---------------------- |
48-
| Cell -> Control | `RegionOutbox` | `sentry_regionoutbox` |
48+
| Cell -> Control | `CellOutbox` | `sentry_regionoutbox` |
4949
| Control -> Cell(s) | `ControlOutbox` | `sentry_controloutbox` |
5050

5151
**How to determine direction**: Look at the model that changed.

.agents/skills/hybrid-cloud-rpc/references/service-template.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ from .model import * # noqa
77
from .service import * # noqa
88
```
99

10-
## `model.py` (REGION silo example)
10+
## `model.py` (CELL silo example)
1111

1212
```python
1313
# Please do not use
@@ -125,7 +125,7 @@ def serialize_my_thing(obj: MyThing) -> RpcMyThing:
125125
)
126126
```
127127

128-
## `service.py` (REGION silo)
128+
## `service.py` (CELL silo)
129129

130130
```python
131131
# Please do not use
@@ -223,7 +223,7 @@ class MyMappingService(RpcService):
223223
my_mapping_service = MyMappingService.create_delegation()
224224
```
225225

226-
## `impl.py` (REGION silo example)
226+
## `impl.py` (CELL silo example)
227227

228228
```python
229229
from __future__ import annotations

.agents/skills/hybrid-cloud-test-gen/references/outbox-tests.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import pytest
1212

1313
from sentry.hybridcloud.models.outbox import (
1414
ControlOutbox,
15-
RegionOutbox,
15+
CellOutbox,
1616
outbox_context,
1717
)
1818
from sentry.hybridcloud.outbox.category import OutboxCategory, OutboxScope
@@ -181,7 +181,7 @@ class Test{Feature}OutboxProcessing(TestCase):
181181
- **`assume_test_silo_mode_of(Model)`** is preferred for checking a specific model's state cross-silo. Auto-detects the model's silo.
182182
- **`assume_test_silo_mode(SiloMode.X)`** for blocks accessing multiple models or non-model resources.
183183
- **Factory calls** (`self.create_organization()`, etc.) must NEVER be wrapped in `assume_test_silo_mode`. Factories handle silo mode internally.
184-
- **`@control_silo_test`** for tests focused on `ControlOutbox` records. **`@cell_silo_test`** for `RegionOutbox`.
184+
- **`@control_silo_test`** for tests focused on `ControlOutbox` records. **`@cell_silo_test`** for `CellOutbox`.
185185
- Only use **`TransactionTestCase`** for threading/concurrency tests (e.g., `threading.Barrier`), not for standard outbox drain tests.
186186
- Outbox drain fixtures can clear state between tests:
187187
```python

.agents/skills/sentry-backend-bugs/references/missing-records.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The most common sources of stale IDs:
1717
1. **Snuba/ClickHouse query results** -- Snuba stores issue IDs, project IDs, and group IDs that may be deleted from Postgres before Snuba data expires
1818
2. **Workflow engine references** -- Detectors, subscriptions, and alert rules reference objects deleted asynchronously
1919
3. **Integration state** -- SentryAppInstallation, ServiceHook, or ExternalActor deleted while alert rules still reference them
20-
4. **Cross-silo references** -- Region silo holds IDs that reference control silo objects (or vice versa) that may be deleted asynchronously
20+
4. **Cross-silo references** -- Cell silo holds IDs that reference control silo objects (or vice versa) that may be deleted asynchronously
2121
5. **Cached foreign keys** -- A ProjectKey cached in Redis still references a `project_id` for a deleted project
2222
6. **Monitor/cron references** -- Environment objects referenced by monitors that may be deleted
2323

@@ -120,7 +120,7 @@ except Subscription.DoesNotExist:
120120
| Environment deleted while monitors reference it | High | `Environment.objects.get(id=monitor.env_id)` |
121121
| Integration uninstalled while rules active | High | Alert rules referencing deleted SentryApp |
122122
| Cached FK target deleted | Medium | `get_from_cache(id=fk_id)` after parent deleted |
123-
| Cross-silo object deleted asynchronously | Medium | Region silo references control silo object |
123+
| Cross-silo object deleted asynchronously | Medium | Cell silo references control silo object |
124124

125125
## Fix Patterns
126126

.agents/skills/sentry-security/references/endpoint-patterns.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ projects = self.get_projects(
174174
| -------------- | ---------------------- | ------------------------------------ | ------------------------------------------- |
175175
| Org-scoped | `OrganizationEndpoint` | `organization` in kwargs | `OrganizationPermission` (org:read for GET) |
176176
| Project-scoped | `ProjectEndpoint` | `organization` + `project` in kwargs | `ProjectPermission` |
177-
| Region silo | `RegionSiloEndpoint` | Nothing — must implement own auth | None |
177+
| Cell silo | `CellSiloEndpoint` | Nothing — must implement own auth | None |
178178
| Control silo | `ControlSiloEndpoint` | Nothing — must implement own auth | None |
179179

180-
If an endpoint inherits `RegionSiloEndpoint` or `Endpoint` directly instead of `OrganizationEndpoint`/`ProjectEndpoint`, verify it has its own authorization logic.
180+
If an endpoint inherits `CellSiloEndpoint` or `Endpoint` directly instead of `OrganizationEndpoint`/`ProjectEndpoint`, verify it has its own authorization logic.

0 commit comments

Comments
 (0)