Skip to content

Commit b9fc637

Browse files
ref(overwatch): include organization slug and name in response data (#101246)
Updated the PreventPrReviewSentryOrgEndpoint to return additional organization details (slug and name) in the response. Corresponding test cases have been adjusted to reflect these changes.
1 parent 51cf765 commit b9fc637

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

src/sentry/overwatch/endpoints/overwatch_rpc.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,12 @@ def get(self, request: Request) -> Response:
161161
return Response(
162162
data={
163163
"organizations": [
164-
{"org_id": org.id, "has_consent": _can_use_prevent_ai_features(org)}
164+
{
165+
"org_id": org.id,
166+
"org_slug": org.slug,
167+
"org_name": org.name,
168+
"has_consent": _can_use_prevent_ai_features(org),
169+
}
165170
for org in organizations
166171
]
167172
}

tests/sentry/overwatch/endpoints/test_overwatch_rpc.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,18 @@ def test_returns_org_ids_with_consent(self):
126126
assert resp.status_code == 200
127127
# Should return both orgs with their consent status
128128
expected_orgs = [
129-
{"org_id": org_with_consent.id, "has_consent": True},
130-
{"org_id": org_without_consent.id, "has_consent": False},
129+
{
130+
"org_id": org_with_consent.id,
131+
"org_slug": org_with_consent.slug,
132+
"org_name": org_with_consent.name,
133+
"has_consent": True,
134+
},
135+
{
136+
"org_id": org_without_consent.id,
137+
"org_slug": org_without_consent.slug,
138+
"org_name": org_without_consent.name,
139+
"has_consent": False,
140+
},
131141
]
132142
# Sort both lists by org_id to ensure consistent comparison
133143
expected_orgs = sorted(expected_orgs, key=lambda x: x["org_id"])

0 commit comments

Comments
 (0)