Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
ea2b378
feat(nav): Add icon-only Feedback button to top navigation bar (#111647)
JonasBa Mar 30, 2026
0900dc6
fix(repos): Make it clearer when repos are disabled or connected prop…
ryan953 Mar 30, 2026
cb7dd72
feat(dashboards): Add tableWidths to backend overview transactions ta…
DominikB2014 Mar 30, 2026
bece1ff
feat(tracemetrics): Display metric name in aggregates table when no g…
nsdeschenes Mar 30, 2026
1a4b4cc
fix(preprod): Prefer display_name for snapshot sidebar labels (#111779)
runningcode Mar 30, 2026
a154d99
ref(metrics): Tidy up metrics UI for refresh layout (#111532)
nsdeschenes Mar 30, 2026
dd2f2ec
chore(dashboards): Add consistent settings files to all prebuilt dash…
DominikB2014 Mar 30, 2026
c2a682c
feat(dashboards): Adds `dashboards-ai-generate` flag to Seer Explorer…
edwardgou-sentry Mar 30, 2026
bfa1b15
feat(metric-issues): Use placeholder loaders for attribute comparison…
malwilley Mar 30, 2026
eb411f8
perf(preprod): Parallelize and deduplicate snapshot image fetches (#1…
NicoHinderling Mar 30, 2026
01f9626
chore(eco): Adds a new organization create CLI command (#111765)
GabeVillalobos Mar 30, 2026
486e7c6
fix(tracemetrics): Allow delete for big number when more than 1 field…
narsaynorath Mar 30, 2026
dfe9a86
fix(oauth): Preserve session payload across cycle_key() in authorize …
sentry[bot] Mar 30, 2026
3d82914
feat(codeowners): Optimize DB query construction for building CODEOWN…
shashjar Mar 30, 2026
2f1ce81
ci(backend): enable xdist on PRs with 2 workers (#111557)
mchen-sentry Mar 30, 2026
3a2ad5b
fix(aci): Show empty state in Alerts list projects column when no det…
malwilley Mar 30, 2026
a6213c8
feat(workflows) Add WorkflowFireHistory to the bulk cleanup task (#11…
kcons Mar 30, 2026
65969cb
feat(aci): Move monitor project/environment fields from the header to…
malwilley Mar 30, 2026
4ab83b7
feat(autofix): Update seer explorer autofix last triggered on complet…
Zylphrex Mar 30, 2026
5294cdb
feat(explore): Validate trace item search keys asynchronously (#111189)
nsdeschenes Mar 30, 2026
54d7c86
feat(preprod): Use sequential (n-1) comparisons for size analysis dif…
mtopo27 Mar 30, 2026
e65ba42
feat(monitors): Add info hint for diff-based issue detection (#111698)
mtopo27 Mar 30, 2026
56ba6d1
feat(snapshots): Add status check settings frontend and flag saving (…
NicoHinderling Mar 30, 2026
391682b
ref(tracemetrics): Remove unsortable telemetry columns behind feature…
nsdeschenes Mar 30, 2026
8fff35d
perf(workflows): Query batching in WorkflowEngineDataConditionSeriali…
kcons Mar 30, 2026
b97719e
ref(cells): Start dispatching clear_cell_cache (#111750)
lynnagara Mar 30, 2026
aed48e0
feat(cells): Support multi-cell jira integration (#111696)
lynnagara Mar 30, 2026
a28359e
ref(cells): Rename regions to cells in users models (#111741)
lynnagara Mar 30, 2026
236c9e5
ref(cells): Update hybrid cloud debugging skill with cells terminolog…
lynnagara Mar 30, 2026
fd00557
ref(explore): Remove sticky last column from aggregates tab (#111525)
nsdeschenes Mar 30, 2026
7c7ba45
ref(spans): Cleanup merge payloads code and distributed payloads migr…
lvthanh03 Mar 30, 2026
2c28de8
ref(dashboards): Update generate dashboard endpoint permission check …
edwardgou-sentry Mar 30, 2026
9a6d298
feat(autofix): Support optional repo name when creating PRs (#111804)
Zylphrex Mar 30, 2026
48c6d3d
ref(stacktrace): Clean up filename in new stack trace (#111726)
scttcper Mar 30, 2026
ebfe30a
feat(issues): Simplify shared issue event rendering (#111769)
scttcper Mar 30, 2026
331e2b0
fix(pipeline): Typing in oauth2 (#111754)
evanpurkhiser Mar 30, 2026
8da8854
chore(eco): Adds new CLI command for creating projects (#111766)
GabeVillalobos Mar 30, 2026
475561c
fix(typing): Codemod `-> None` to a bunch of tests (#111812)
thetruecpaul Mar 30, 2026
63d9dcc
ref(ci): Fix codeowners yet again (#111813)
rbro112 Mar 30, 2026
5bddca5
fix(dashboards): Preserve saved global filters when URL has other fil…
DominikB2014 Mar 30, 2026
7218e1e
feat(errors): add sidebar item and routes for new Errors ui (#111786)
nikkikapadia Mar 30, 2026
ca493f2
feat(snapshots): Wire up status check setting fields into snapshot st…
NicoHinderling Mar 30, 2026
605d033
feat(issues): Prefetch supergroup data and add stats columns to rows …
scttcper Mar 30, 2026
b8803c3
ref(cells): Remove clear_region_cache, all callers have been removed …
lynnagara Mar 30, 2026
35e5a2c
feat(onboarding): SCM platform features step UI polish and analytics …
jaydgoss Mar 30, 2026
6cda965
feat(autofix): Pass PR description suffix for explorer autofix (#111814)
Zylphrex Mar 30, 2026
5556766
ref(cells): Remove temp backward compat for RpcOrganizationSlugReserv…
lynnagara Mar 30, 2026
790319e
feat(issues): Refactor SuspectCommits layout, clean up types (#111818)
scttcper Mar 30, 2026
fe7b09d
fix(onboarding): Handle repo selection race with background link_all_…
jaydgoss Mar 30, 2026
d9eb84b
fix(errors): add alpha badge to navigation bar (#111825)
nikkikapadia Mar 30, 2026
64580f1
fix(np): Updates IssueNotificationData, render logic to correctly ext…
GabeVillalobos Mar 30, 2026
a63cd84
fix(seer-explorer): Display correct label for metrics queries (#111810)
isaacwang-sentry Mar 30, 2026
f1f7579
feat(dashboards): track seer session errors on generating dashboards …
edwardgou-sentry Mar 30, 2026
8989390
fix(assisted-query): Add Metrics to search strategy help text (#111796)
isaacwang-sentry Mar 30, 2026
abd3470
ref(cells): clean up temporary aliases needed for getsentry (#111599)
lynnagara Mar 30, 2026
1f2d929
perf(workflows): Add MetricAlertRegistryHandler.get_targets; use it i…
kcons Mar 30, 2026
3fc3baa
chore(ACI): Add/update detectors to a workflow in the WorkflowValidat…
ceorourke Mar 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
20 changes: 10 additions & 10 deletions .agents/skills/hybrid-cloud-outboxes/references/debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Understanding the pipeline helps locate where things break:

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

`sentry_controloutbox` has one additional column:

| Column | Type | Description |
| ------------- | ------- | ----------------------------- |
| `region_name` | varchar | Target region for this outbox |
| Column | Type | Description |
| ------------- | ------- | --------------------------- |
| `region_name` | varchar | Target cell for this outbox |

### Resolving Enum Values

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

#### Find stuck shards (region)
#### Find stuck shards (cell)

```sql
-- Find region outbox shards stuck in backoff
-- Find cell outbox shards stuck in backoff
-- shard_scope: 0 = ORGANIZATION_SCOPE, 1 = USER_SCOPE, etc.
-- category: see OutboxCategory enum in category.py
SELECT
Expand Down Expand Up @@ -199,7 +199,7 @@ LIMIT 10;

When a developer asks you to debug stuck outboxes:

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.
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.
2. **Resolve enum values**: Read `src/sentry/hybridcloud/outbox/category.py` to get the integer values for the relevant `OutboxCategory` and `OutboxScope`.
3. **Construct the query**: Use the templates above, substituting resolved values. Always add comments with the human-readable enum names.
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.
Expand All @@ -212,10 +212,10 @@ When a developer asks you to debug stuck outboxes:
The `should_skip_shard()` method checks these options:

```python
# Skip specific organization shards (region outboxes)
# Skip specific organization shards (cell outboxes)
"hybrid_cloud.authentication.disabled_organization_shards": [org_id_1, org_id_2]

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

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

# Top 10 deepest region shards
# Top 10 deepest cell shards
for shard in CellOutbox.get_shard_depths_descending(limit=10):
print(f"Scope={shard['shard_scope']} ID={shard['shard_identifier']} Depth={shard['depth']}")
```
Expand Down
7 changes: 7 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,11 @@ tests/sentry/api/endpoints/test_organization_attribute_mappings.py @get
*sentryapp*.py @getsentry/product-owners-settings-integrations @getsentry/ecosystem
*doc_integration*.py @getsentry/ecosystem

/src/sentry/runner/commands/createproject.py @getsentry/ecosystem
/src/sentry/runner/commands/createorg.py @getsentry/ecosystem
/tests/sentry/runner/commands/test_createproject.py @getsentry/ecosystem
/tests/sentry/runner/commands/test_createorg.py @getsentry/ecosystem

## End of Integrations


Expand Down Expand Up @@ -673,12 +678,14 @@ tests/sentry/api/endpoints/test_organization_attribute_mappings.py @get
/static/app/components/events/highlights/ @getsentry/issue-workflow
/static/app/components/issues/ @getsentry/issue-workflow
/static/app/components/stackTrace/ @getsentry/issue-workflow
/static/app/components/stream/supergroupRow.tsx @getsentry/issue-detection-frontend
/static/app/views/issueList/ @getsentry/issue-workflow
/static/app/views/issueList/issueListSeerComboBox.tsx @getsentry/issue-workflow @getsentry/machine-learning-ai
/static/app/views/issueList/pages/supergroups.tsx @getsentry/issue-detection-frontend
/static/app/views/issueList/supergroups/ @getsentry/issue-detection-frontend
/static/app/views/issueDetails/ @getsentry/issue-workflow
/static/app/views/nav/secondary/sections/issues/ @getsentry/issue-workflow
/static/app/views/sharedGroupDetails/ @getsentry/issue-workflow
/static/app/components/events/interfaces/performance/spanEvidenceKeyValueList.tsx @getsentry/issue-detection-frontend
/static/app/components/events/interfaces/crashContent/exception/actionableItems.tsx @getsentry/issue-workflow
/tests/sentry/deletions/test_group.py @getsentry/issue-detection-backend
Expand Down
26 changes: 2 additions & 24 deletions .github/codeowners-coverage-baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ src/sentry/runner/commands/cleanup.py
src/sentry/runner/commands/config.py
src/sentry/runner/commands/configoptions.py
src/sentry/runner/commands/createflag.py
src/sentry/runner/commands/createorg.py
src/sentry/runner/commands/createuser.py
src/sentry/runner/commands/devserver.py
src/sentry/runner/commands/devservices.py
Expand Down Expand Up @@ -225,9 +226,6 @@ src/sentry/scripts/quotas/is_rate_limited.lua
src/sentry/scripts/ratelimits/api_limiter.lua
src/sentry/scripts/ratelimits/leaky_bucket.lua
src/sentry/scripts/similarity/index.lua
src/sentry/scripts/spans/add-buffer.lua
src/sentry/scripts/spans/done-flush-segment-data.lua
src/sentry/scripts/spans/done-flush-segment.lua
src/sentry/scripts/tsdb/cmsketch.lua
src/sentry/scripts/utils/locking/delete_lock.lua
src/sentry/scripts/utils/sadd_capped.lua
Expand Down Expand Up @@ -552,7 +550,6 @@ static/app/components/discover/transactionsList.spec.tsx
static/app/components/discover/transactionsList.tsx
static/app/components/discover/transactionsTable.tsx
static/app/components/discoverButton.tsx
static/app/components/dnd/dragReorderButton.tsx
static/app/components/dropdownButton.tsx
static/app/components/dropdownMenu/footer.tsx
static/app/components/dropdownMenu/index.spec.tsx
Expand Down Expand Up @@ -605,14 +602,9 @@ static/app/components/events/eventAttachmentActions.tsx
static/app/components/events/eventAttachments.spec.tsx
static/app/components/events/eventAttachments.tsx
static/app/components/events/eventAttachmentsCrashReportsNotice.tsx
static/app/components/events/eventBreadcrumbsSection.spec.tsx
static/app/components/events/eventBreadcrumbsSection.tsx
static/app/components/events/eventCustomPerformanceMetrics.tsx
static/app/components/events/eventDataSection.tsx
static/app/components/events/eventDrawer.tsx
static/app/components/events/eventEntries.spec.tsx
static/app/components/events/eventEntries.tsx
static/app/components/events/eventEntry.tsx
static/app/components/events/eventEvidence.spec.tsx
static/app/components/events/eventEvidence.tsx
static/app/components/events/eventExtraData/getEventExtraDataKnownDataDetails.tsx
Expand Down Expand Up @@ -1023,18 +1015,6 @@ static/app/components/replaysOnboarding/replayConfigToggle.tsx
static/app/components/replaysOnboarding/replayOnboardingLayout.tsx
static/app/components/replaysOnboarding/sidebar.tsx
static/app/components/replaysOnboarding/utils.tsx
static/app/components/repositories/getRepoStatusLabel.tsx
static/app/components/repositories/repoProviderIcon.tsx
static/app/components/repositories/scmIntegrationTree/providerConfigLink.tsx
static/app/components/repositories/scmIntegrationTree/scmIntegrationTree.tsx
static/app/components/repositories/scmIntegrationTree/scmIntegrationTreeNodes.ts
static/app/components/repositories/scmIntegrationTree/scmIntegrationTreeRow.tsx
static/app/components/repositories/scmIntegrationTree/scmTreeFilters.tsx
static/app/components/repositories/scmIntegrationTree/types.ts
static/app/components/repositories/scmIntegrationTree/useScmIntegrationTreeData.spec.tsx
static/app/components/repositories/scmIntegrationTree/useScmIntegrationTreeData.ts
static/app/components/repositories/scmIntegrationTree/useScmTreeFilters.tsx
static/app/components/repositories/scmRepoTreeModal.tsx
static/app/components/repositoryRow.spec.tsx
static/app/components/repositoryRow.tsx
static/app/components/resolutionBox.spec.tsx
Expand Down Expand Up @@ -1489,9 +1469,6 @@ static/app/views/setupWizard/utils/useOrganizationsWithRegion.tsx
static/app/views/setupWizard/utils/useUpdateWizardCache.tsx
static/app/views/setupWizard/waitingForWizardToConnect.tsx
static/app/views/setupWizard/wizardProjectSelection.tsx
static/app/views/sharedGroupDetails/index.spec.tsx
static/app/views/sharedGroupDetails/index.tsx
static/app/views/sharedGroupDetails/sharedGroupHeader.tsx
static/app/views/unsubscribe/issue.spec.tsx
static/app/views/unsubscribe/issue.tsx
static/app/views/unsubscribe/project.spec.tsx
Expand Down Expand Up @@ -2318,6 +2295,7 @@ tests/sentry/runner/commands/test_cleanup.py
tests/sentry/runner/commands/test_config.py
tests/sentry/runner/commands/test_configoptions.py
tests/sentry/runner/commands/test_createflag.py
tests/sentry/runner/commands/test_createorg.py
tests/sentry/runner/commands/test_createuser.py
tests/sentry/runner/commands/test_init.py
tests/sentry/runner/commands/test_migrations.py
Expand Down
61 changes: 61 additions & 0 deletions .github/workflows/backend-selective.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@ jobs:
env:
MATRIX_INSTANCE_TOTAL: ${{ needs.calculate-shards.outputs.shard-count }}
TEST_GROUP_STRATEGY: roundrobin
PYTHONHASHSEED: '0'
XDIST_PER_WORKER_SNUBA: '1'
XDIST_WORKERS: '2'
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

Expand All @@ -195,6 +198,58 @@ jobs:
sudo install -m 755 odiff-linux-x64 /usr/local/bin/odiff
rm odiff-linux-x64

- name: Bootstrap per-worker Snuba instances
run: |
set -eo pipefail
SNUBA_IMAGE=$(docker inspect snuba-snuba-1 --format '{{.Config.Image}}')
SNUBA_NETWORK=$(docker inspect snuba-snuba-1 --format '{{range $k, $v := .NetworkSettings.Networks}}{{$k}}{{end}}')
if [ -z "$SNUBA_IMAGE" ] || [ -z "$SNUBA_NETWORK" ]; then
echo "ERROR: Could not inspect snuba-snuba-1 container. Is devservices running?"
exit 1
fi

docker stop snuba-snuba-1 || true

PIDS=()
for i in $(seq 0 $(( ${XDIST_WORKERS} - 1 ))); do
(
WORKER_DB="default_gw${i}"
WORKER_PORT=$((1230 + i))
curl -sf 'http://localhost:8123/' --data-binary "CREATE DATABASE IF NOT EXISTS ${WORKER_DB}"
docker run --rm --network "$SNUBA_NETWORK" \
-e "CLICKHOUSE_DATABASE=${WORKER_DB}" -e "CLICKHOUSE_HOST=clickhouse" \
-e "CLICKHOUSE_PORT=9000" -e "CLICKHOUSE_HTTP_PORT=8123" \
-e "DEFAULT_BROKERS=kafka:9093" -e "REDIS_HOST=redis" \
-e "REDIS_PORT=6379" -e "REDIS_DB=1" -e "SNUBA_SETTINGS=docker" \
"$SNUBA_IMAGE" bootstrap --force 2>&1 | tail -3
docker run -d --name "snuba-gw${i}" --network "$SNUBA_NETWORK" \
-p "${WORKER_PORT}:1218" \
-e "CLICKHOUSE_DATABASE=${WORKER_DB}" -e "CLICKHOUSE_HOST=clickhouse" \
-e "CLICKHOUSE_PORT=9000" -e "CLICKHOUSE_HTTP_PORT=8123" \
-e "DEFAULT_BROKERS=kafka:9093" -e "REDIS_HOST=redis" \
-e "REDIS_PORT=6379" -e "REDIS_DB=1" -e "SNUBA_SETTINGS=docker" \
-e "DEBUG=1" "$SNUBA_IMAGE" api

for attempt in $(seq 1 30); do
if curl -sf "http://127.0.0.1:${WORKER_PORT}/health" > /dev/null 2>&1; then
echo "snuba-gw${i} healthy on port ${WORKER_PORT}"
break
fi
if [ "$attempt" -eq 30 ]; then
echo "ERROR: snuba-gw${i} failed health check after 30 attempts"
docker logs "snuba-gw${i}" 2>&1 | tail -20 || true
exit 1
fi
sleep 2
done
) &
PIDS+=($!)
done

for pid in "${PIDS[@]}"; do
wait "$pid" || { echo "ERROR: Snuba bootstrap subshell (PID $pid) failed"; exit 1; }
done

- name: Download selected tests artifact
if: needs.select-tests.outputs.has-selected-tests == 'true'
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
Expand All @@ -206,6 +261,7 @@ jobs:
env:
SELECTED_TESTS_FILE: ${{ needs.select-tests.outputs.has-selected-tests == 'true' && '.artifacts/selected-tests.txt' || '' }}
run: |
export PYTEST_ADDOPTS="$PYTEST_ADDOPTS -n ${XDIST_WORKERS} --dist=loadfile"
make test-python-ci

- name: Inspect failure
Expand All @@ -214,3 +270,8 @@ jobs:
if command -v devservices; then
devservices logs
fi

for i in $(seq 0 $(( ${XDIST_WORKERS} - 1 ))); do
echo "--- snuba-gw${i} logs ---"
docker logs "snuba-gw${i}" 2>&1 | tail -30 || true
done
7 changes: 3 additions & 4 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,9 @@ jobs:
# Dynamic total from calculate-shards
MATRIX_INSTANCE_TOTAL: ${{ needs.calculate-shards.outputs.shard-count }}
TEST_GROUP_STRATEGY: roundrobin
# xdist: enabled on master pushes and workflow_dispatch, disabled on PRs
PYTHONHASHSEED: ${{ github.event_name != 'pull_request' && '0' || 'random' }}
XDIST_PER_WORKER_SNUBA: ${{ github.event_name != 'pull_request' && '1' || '' }}
XDIST_WORKERS: ${{ github.event_name != 'pull_request' && '3' || '' }}
PYTHONHASHSEED: '0'
XDIST_PER_WORKER_SNUBA: '1'
XDIST_WORKERS: ${{ github.event_name == 'pull_request' && '2' || '3' }}

steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
Expand Down
27 changes: 6 additions & 21 deletions src/sentry/api/endpoints/project_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from typing import Any, Literal, NotRequired, TypedDict, cast

from django.conf import settings
from django.db import router, transaction
from django.db.models.signals import pre_save
from django.dispatch import receiver
from drf_spectacular.utils import extend_schema
Expand Down Expand Up @@ -53,9 +52,6 @@
WorkflowInput,
WorkflowValidator,
)
from sentry.workflow_engine.endpoints.validators.detector_workflow import (
BulkWorkflowDetectorsValidator,
)
from sentry.workflow_engine.migration_helpers.issue_alert_conditions import (
translate_to_data_condition_data,
)
Expand Down Expand Up @@ -819,6 +815,11 @@ def format_request_data(
}
workflow_payload["actionFilters"] = [action_filters]

issue_stream_detector = Detector.get_issue_stream_detector_for_project(project.id)
if issue_stream_detector is None:
raise serializers.ValidationError("Could not find issue stream detector for project")
workflow_payload["detectorIds"] = [issue_stream_detector.id]

return workflow_payload


Expand Down Expand Up @@ -922,23 +923,7 @@ def post(self, request: Request, project) -> Response:
context={"organization": project.organization, "request": request},
)
validator.is_valid(raise_exception=True)

with transaction.atomic(router.db_for_write(Workflow)):
workflow = validator.create(validator.validated_data)
issue_stream_detector = Detector.get_issue_stream_detector_for_project(project.id)
if issue_stream_detector is None:
raise serializers.ValidationError(
"Could not find issue stream detector for project"
)
bulk_validator = BulkWorkflowDetectorsValidator(
data={
"workflow_id": workflow.id,
"detector_ids": [issue_stream_detector.id],
},
context={"organization": project.organization, "request": request},
)
bulk_validator.is_valid(raise_exception=True)
bulk_validator.save()
workflow = validator.create(validator.validated_data)

return Response(
serialize(workflow, request.user, WorkflowEngineRuleSerializer()),
Expand Down
2 changes: 2 additions & 0 deletions src/sentry/api/endpoints/user_organizations.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
from sentry.users.services.user import RpcUser


# TODO(cells): Non-routable by Synapse (no org slug in URL). Fix by moving to
# @control_silo_endpoint and querying OrganizationMemberMapping + OrganizationMapping.
@cell_silo_endpoint
class UserOrganizationsEndpoint(RegionSiloUserEndpoint):
publish_status = {
Expand Down
9 changes: 9 additions & 0 deletions src/sentry/api/serializers/models/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -1174,6 +1174,15 @@ def format_options(self, attrs: Mapping[str, Any]) -> dict[str, Any]:
"sentry:preprod_size_status_checks_rules": options.get(
"sentry:preprod_size_status_checks_rules"
),
"sentry:preprod_snapshot_status_checks_enabled": options.get(
"sentry:preprod_snapshot_status_checks_enabled", True
),
"sentry:preprod_snapshot_status_checks_fail_on_added": options.get(
"sentry:preprod_snapshot_status_checks_fail_on_added", False
),
"sentry:preprod_snapshot_status_checks_fail_on_removed": options.get(
"sentry:preprod_snapshot_status_checks_fail_on_removed", True
),
"quotas:spike-protection-disabled": options.get("quotas:spike-protection-disabled"),
"sentry:preprod_size_enabled_query": options.get("sentry:preprod_size_enabled_query"),
"sentry:preprod_distribution_enabled_query": options.get(
Expand Down
Loading
Loading