Skip to content

Commit 2d46283

Browse files
authored
Merge branch 'master' into cleanup-getsentry-aliases
2 parents 686abe4 + fe7b09d commit 2d46283

File tree

298 files changed

+4630
-4289
lines changed

Some content is hidden

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

298 files changed

+4630
-4289
lines changed

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Understanding the pipeline helps locate where things break:
66

77
1. **Model save/delete** writes outbox row inside `outbox_context(transaction.atomic(...))`
88
2. **On commit**: if `flush=True`, `drain_shard()` runs synchronously for that shard
9-
3. **Periodic task**: `enqueue_outbox_jobs` (region) / `enqueue_outbox_jobs_control` (control) runs on a cron schedule
9+
3. **Periodic task**: `enqueue_outbox_jobs` (cell) / `enqueue_outbox_jobs_control` (control) runs on a cron schedule
1010
4. **`schedule_batch`** partitions the ID range into `CONCURRENCY=5` chunks and spawns `drain_outbox_shards` tasks
1111
5. **`drain_outbox_shards`** calls `process_outbox_batch` which:
1212
- Calls `find_scheduled_shards(lo, hi)` to find shards with `scheduled_for <= now`
@@ -71,9 +71,9 @@ Both tables share these columns:
7171

7272
`sentry_controloutbox` has one additional column:
7373

74-
| Column | Type | Description |
75-
| ------------- | ------- | ----------------------------- |
76-
| `region_name` | varchar | Target region for this outbox |
74+
| Column | Type | Description |
75+
| ------------- | ------- | --------------------------- |
76+
| `region_name` | varchar | Target cell for this outbox |
7777

7878
### Resolving Enum Values
7979

@@ -92,10 +92,10 @@ When generating SQL for a developer, **print the query to the terminal** so they
9292
2. Comments mapping integer values to their enum names
9393
3. Reasonable `LIMIT` clauses to avoid overwhelming output
9494

95-
#### Find stuck shards (region)
95+
#### Find stuck shards (cell)
9696

9797
```sql
98-
-- Find region outbox shards stuck in backoff
98+
-- Find cell outbox shards stuck in backoff
9999
-- shard_scope: 0 = ORGANIZATION_SCOPE, 1 = USER_SCOPE, etc.
100100
-- category: see OutboxCategory enum in category.py
101101
SELECT
@@ -199,7 +199,7 @@ LIMIT 10;
199199

200200
When a developer asks you to debug stuck outboxes:
201201

202-
1. **Determine the table**: Ask which model or direction is involved, or infer from context. Use `sentry_regionoutbox` for region models, `sentry_controloutbox` for control models.
202+
1. **Determine the table**: Ask which model or direction is involved, or infer from context. Use `sentry_regionoutbox` for cell models, `sentry_controloutbox` for control models.
203203
2. **Resolve enum values**: Read `src/sentry/hybridcloud/outbox/category.py` to get the integer values for the relevant `OutboxCategory` and `OutboxScope`.
204204
3. **Construct the query**: Use the templates above, substituting resolved values. Always add comments with the human-readable enum names.
205205
4. **Print to terminal**: Output the final SQL so the developer can copy it. Do NOT attempt to run it — you don't have production database access.
@@ -212,10 +212,10 @@ When a developer asks you to debug stuck outboxes:
212212
The `should_skip_shard()` method checks these options:
213213

214214
```python
215-
# Skip specific organization shards (region outboxes)
215+
# Skip specific organization shards (cell outboxes)
216216
"hybrid_cloud.authentication.disabled_organization_shards": [org_id_1, org_id_2]
217217

218-
# Skip specific user shards (region/control outboxes)
218+
# Skip specific user shards (cell/control outboxes)
219219
"hybrid_cloud.authentication.disabled_user_shards": [user_id_1, user_id_2]
220220
```
221221

@@ -252,7 +252,7 @@ For local debugging or in a Django shell:
252252
```python
253253
from sentry.hybridcloud.models.outbox import CellOutbox, ControlOutbox
254254

255-
# Top 10 deepest region shards
255+
# Top 10 deepest cell shards
256256
for shard in CellOutbox.get_shard_depths_descending(limit=10):
257257
print(f"Scope={shard['shard_scope']} ID={shard['shard_identifier']} Depth={shard['depth']}")
258258
```

.github/CODEOWNERS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,11 @@ tests/sentry/api/endpoints/test_organization_attribute_mappings.py @get
489489
*sentryapp*.py @getsentry/product-owners-settings-integrations @getsentry/ecosystem
490490
*doc_integration*.py @getsentry/ecosystem
491491

492+
/src/sentry/runner/commands/createproject.py @getsentry/ecosystem
493+
/src/sentry/runner/commands/createorg.py @getsentry/ecosystem
494+
/tests/sentry/runner/commands/test_createproject.py @getsentry/ecosystem
495+
/tests/sentry/runner/commands/test_createorg.py @getsentry/ecosystem
496+
492497
## End of Integrations
493498

494499

@@ -673,12 +678,14 @@ tests/sentry/api/endpoints/test_organization_attribute_mappings.py @get
673678
/static/app/components/events/highlights/ @getsentry/issue-workflow
674679
/static/app/components/issues/ @getsentry/issue-workflow
675680
/static/app/components/stackTrace/ @getsentry/issue-workflow
681+
/static/app/components/stream/supergroupRow.tsx @getsentry/issue-detection-frontend
676682
/static/app/views/issueList/ @getsentry/issue-workflow
677683
/static/app/views/issueList/issueListSeerComboBox.tsx @getsentry/issue-workflow @getsentry/machine-learning-ai
678684
/static/app/views/issueList/pages/supergroups.tsx @getsentry/issue-detection-frontend
679685
/static/app/views/issueList/supergroups/ @getsentry/issue-detection-frontend
680686
/static/app/views/issueDetails/ @getsentry/issue-workflow
681687
/static/app/views/nav/secondary/sections/issues/ @getsentry/issue-workflow
688+
/static/app/views/sharedGroupDetails/ @getsentry/issue-workflow
682689
/static/app/components/events/interfaces/performance/spanEvidenceKeyValueList.tsx @getsentry/issue-detection-frontend
683690
/static/app/components/events/interfaces/crashContent/exception/actionableItems.tsx @getsentry/issue-workflow
684691
/tests/sentry/deletions/test_group.py @getsentry/issue-detection-backend

.github/codeowners-coverage-baseline.txt

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ src/sentry/runner/commands/cleanup.py
184184
src/sentry/runner/commands/config.py
185185
src/sentry/runner/commands/configoptions.py
186186
src/sentry/runner/commands/createflag.py
187+
src/sentry/runner/commands/createorg.py
187188
src/sentry/runner/commands/createuser.py
188189
src/sentry/runner/commands/devserver.py
189190
src/sentry/runner/commands/devservices.py
@@ -225,9 +226,6 @@ src/sentry/scripts/quotas/is_rate_limited.lua
225226
src/sentry/scripts/ratelimits/api_limiter.lua
226227
src/sentry/scripts/ratelimits/leaky_bucket.lua
227228
src/sentry/scripts/similarity/index.lua
228-
src/sentry/scripts/spans/add-buffer.lua
229-
src/sentry/scripts/spans/done-flush-segment-data.lua
230-
src/sentry/scripts/spans/done-flush-segment.lua
231229
src/sentry/scripts/tsdb/cmsketch.lua
232230
src/sentry/scripts/utils/locking/delete_lock.lua
233231
src/sentry/scripts/utils/sadd_capped.lua
@@ -552,7 +550,6 @@ static/app/components/discover/transactionsList.spec.tsx
552550
static/app/components/discover/transactionsList.tsx
553551
static/app/components/discover/transactionsTable.tsx
554552
static/app/components/discoverButton.tsx
555-
static/app/components/dnd/dragReorderButton.tsx
556553
static/app/components/dropdownButton.tsx
557554
static/app/components/dropdownMenu/footer.tsx
558555
static/app/components/dropdownMenu/index.spec.tsx
@@ -605,14 +602,9 @@ static/app/components/events/eventAttachmentActions.tsx
605602
static/app/components/events/eventAttachments.spec.tsx
606603
static/app/components/events/eventAttachments.tsx
607604
static/app/components/events/eventAttachmentsCrashReportsNotice.tsx
608-
static/app/components/events/eventBreadcrumbsSection.spec.tsx
609-
static/app/components/events/eventBreadcrumbsSection.tsx
610605
static/app/components/events/eventCustomPerformanceMetrics.tsx
611606
static/app/components/events/eventDataSection.tsx
612607
static/app/components/events/eventDrawer.tsx
613-
static/app/components/events/eventEntries.spec.tsx
614-
static/app/components/events/eventEntries.tsx
615-
static/app/components/events/eventEntry.tsx
616608
static/app/components/events/eventEvidence.spec.tsx
617609
static/app/components/events/eventEvidence.tsx
618610
static/app/components/events/eventExtraData/getEventExtraDataKnownDataDetails.tsx
@@ -1023,18 +1015,6 @@ static/app/components/replaysOnboarding/replayConfigToggle.tsx
10231015
static/app/components/replaysOnboarding/replayOnboardingLayout.tsx
10241016
static/app/components/replaysOnboarding/sidebar.tsx
10251017
static/app/components/replaysOnboarding/utils.tsx
1026-
static/app/components/repositories/getRepoStatusLabel.tsx
1027-
static/app/components/repositories/repoProviderIcon.tsx
1028-
static/app/components/repositories/scmIntegrationTree/providerConfigLink.tsx
1029-
static/app/components/repositories/scmIntegrationTree/scmIntegrationTree.tsx
1030-
static/app/components/repositories/scmIntegrationTree/scmIntegrationTreeNodes.ts
1031-
static/app/components/repositories/scmIntegrationTree/scmIntegrationTreeRow.tsx
1032-
static/app/components/repositories/scmIntegrationTree/scmTreeFilters.tsx
1033-
static/app/components/repositories/scmIntegrationTree/types.ts
1034-
static/app/components/repositories/scmIntegrationTree/useScmIntegrationTreeData.spec.tsx
1035-
static/app/components/repositories/scmIntegrationTree/useScmIntegrationTreeData.ts
1036-
static/app/components/repositories/scmIntegrationTree/useScmTreeFilters.tsx
1037-
static/app/components/repositories/scmRepoTreeModal.tsx
10381018
static/app/components/repositoryRow.spec.tsx
10391019
static/app/components/repositoryRow.tsx
10401020
static/app/components/resolutionBox.spec.tsx
@@ -1489,9 +1469,6 @@ static/app/views/setupWizard/utils/useOrganizationsWithRegion.tsx
14891469
static/app/views/setupWizard/utils/useUpdateWizardCache.tsx
14901470
static/app/views/setupWizard/waitingForWizardToConnect.tsx
14911471
static/app/views/setupWizard/wizardProjectSelection.tsx
1492-
static/app/views/sharedGroupDetails/index.spec.tsx
1493-
static/app/views/sharedGroupDetails/index.tsx
1494-
static/app/views/sharedGroupDetails/sharedGroupHeader.tsx
14951472
static/app/views/unsubscribe/issue.spec.tsx
14961473
static/app/views/unsubscribe/issue.tsx
14971474
static/app/views/unsubscribe/project.spec.tsx
@@ -2318,6 +2295,7 @@ tests/sentry/runner/commands/test_cleanup.py
23182295
tests/sentry/runner/commands/test_config.py
23192296
tests/sentry/runner/commands/test_configoptions.py
23202297
tests/sentry/runner/commands/test_createflag.py
2298+
tests/sentry/runner/commands/test_createorg.py
23212299
tests/sentry/runner/commands/test_createuser.py
23222300
tests/sentry/runner/commands/test_init.py
23232301
tests/sentry/runner/commands/test_migrations.py

src/sentry/api/endpoints/user_organizations.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
from sentry.users.services.user import RpcUser
1414

1515

16+
# TODO(cells): Non-routable by Synapse (no org slug in URL). Fix by moving to
17+
# @control_silo_endpoint and querying OrganizationMemberMapping + OrganizationMapping.
1618
@cell_silo_endpoint
1719
class UserOrganizationsEndpoint(RegionSiloUserEndpoint):
1820
publish_status = {

src/sentry/api/serializers/models/project.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1181,7 +1181,7 @@ def format_options(self, attrs: Mapping[str, Any]) -> dict[str, Any]:
11811181
"sentry:preprod_snapshot_status_checks_fail_on_added", False
11821182
),
11831183
"sentry:preprod_snapshot_status_checks_fail_on_removed": options.get(
1184-
"sentry:preprod_snapshot_status_checks_fail_on_removed", False
1184+
"sentry:preprod_snapshot_status_checks_fail_on_removed", True
11851185
),
11861186
"quotas:spike-protection-disabled": options.get("quotas:spike-protection-disabled"),
11871187
"sentry:preprod_size_enabled_query": options.get("sentry:preprod_size_enabled_query"),

src/sentry/dashboards/endpoints/organization_dashboard_generate.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
from sentry.models.organization import Organization
1919
from sentry.ratelimits.config import RateLimitConfig
2020
from sentry.seer.explorer.client import SeerExplorerClient
21-
from sentry.seer.explorer.client_utils import has_seer_explorer_access_with_detail
2221
from sentry.seer.models import SeerApiError, SeerPermissionError
22+
from sentry.seer.seer_setup import has_seer_access_with_detail
2323
from sentry.types.ratelimit import RateLimit, RateLimitCategory
2424

2525
logger = logging.getLogger(__name__)
@@ -63,7 +63,7 @@ def post(self, request: Request, organization: Organization) -> Response:
6363
):
6464
return Response({"detail": "Feature not enabled"}, status=403)
6565

66-
has_access, error = has_seer_explorer_access_with_detail(organization, request.user)
66+
has_access, error = has_seer_access_with_detail(organization, request.user)
6767
if not has_access:
6868
raise PermissionDenied(error)
6969

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
from typing import Any
2-
3-
from pydantic import root_validator
4-
51
from sentry.hybridcloud.rpc import RpcModel
62

73

@@ -12,14 +8,3 @@ class RpcOrganizationSlugReservation(RpcModel):
128
slug: str
139
cell_name: str
1410
reservation_type: int
15-
16-
@root_validator(pre=True)
17-
@classmethod
18-
def _accept_region_name(cls, values: dict[str, Any]) -> dict[str, Any]:
19-
if "region_name" in values and "cell_name" not in values:
20-
values["cell_name"] = values.pop("region_name")
21-
return values
22-
23-
@property
24-
def region_name(self) -> str:
25-
return self.cell_name

src/sentry/hybridcloud/services/replica/impl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ def upsert_replicated_org_slug_reservation(
296296
slug=slug_reservation.slug,
297297
organization_id=slug_reservation.organization_id,
298298
user_id=slug_reservation.user_id,
299-
cell_name=slug_reservation.region_name,
299+
cell_name=slug_reservation.cell_name,
300300
reservation_type=slug_reservation.reservation_type,
301301
organization_slug_reservation_id=slug_reservation.id,
302302
)

src/sentry/identity/oauth2.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
IntegrationPipelineViewEvent,
3333
IntegrationPipelineViewType,
3434
)
35+
from sentry.pipeline.base import Pipeline
3536
from sentry.pipeline.types import PipelineStepResult
3637
from sentry.pipeline.views.base import PipelineView
3738
from sentry.shared_integrations.exceptions import ApiError, ApiInvalidRequestError, ApiUnauthorized
@@ -282,7 +283,7 @@ def __init__(
282283
self.bind_key = bind_key
283284
self.extra_authorize_params = extra_authorize_params or {}
284285

285-
def get_step_data(self, pipeline: Any, request: HttpRequest) -> dict[str, str]:
286+
def get_step_data(self, pipeline: Pipeline[Any, Any], request: HttpRequest) -> dict[str, str]:
286287
params = urlencode(
287288
{
288289
"client_id": self.client_id,
@@ -301,7 +302,7 @@ def get_serializer_cls(self) -> type:
301302
def handle_post(
302303
self,
303304
validated_data: dict[str, str],
304-
pipeline: Any,
305+
pipeline: Pipeline[Any, Any],
305306
request: HttpRequest,
306307
) -> PipelineStepResult:
307308
code = validated_data["code"]

src/sentry/integrations/base.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -240,11 +240,15 @@ class is just a descriptor for how that object functions, and what behavior
240240
the installer's identity to the organization integration
241241
"""
242242

243-
is_cell_restricted: bool = False
244-
"""
245-
Returns True if each integration installation can only be connected on one cell of Sentry at a
246-
time. It will raise an error if any organization from another cell attempts to install it.
247-
"""
243+
# TODO(cells): Remove once jira integration is updated and works for multi-cell.
244+
# No integrations should be cell restricted.
245+
@property
246+
def is_cell_restricted(self) -> bool:
247+
"""
248+
Returns True if each integration installation can only be connected on one cell of Sentry at a
249+
time. It will raise an error if any organization from another cell attempts to install it.
250+
"""
251+
return False
248252

249253
features: frozenset[IntegrationFeatures] = frozenset()
250254
"""can be any number of IntegrationFeatures"""

0 commit comments

Comments
 (0)