Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/sentry/prevent/endpoints/pr_review_github_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def get(

response_data: dict[str, Any] = deepcopy(PREVENT_AI_CONFIG_DEFAULT)
if config:
response_data["organization"][git_organization_name] = config.data
response_data["organization"] = config.data

return Response(response_data, status=200)

Expand Down Expand Up @@ -103,6 +103,6 @@ def put(
)

response_data: dict[str, Any] = deepcopy(PREVENT_AI_CONFIG_DEFAULT)
response_data["organization"][git_organization_name] = request.data
response_data["organization"] = request.data

return Response(response_data, status=200)
8 changes: 3 additions & 5 deletions tests/sentry/prevent/endpoints/test_pr_review_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def test_get_returns_config_when_exists(self):

resp = self.client.get(self.url)
assert resp.status_code == 200
assert resp.data["organization"][self.git_org] == VALID_ORG_CONFIG
assert resp.data["organization"] == VALID_ORG_CONFIG

def test_get_returns_404_when_integration_not_found(self):
"""Test GET endpoint returns 404 when GitHub integration doesn't exist."""
Expand All @@ -88,7 +88,7 @@ def test_put_with_valid_config_creates_entry(self):
"""Test PUT endpoint creates a new configuration entry."""
resp = self.client.put(self.url, data=VALID_ORG_CONFIG, format="json")
assert resp.status_code == 200
assert resp.data["organization"][self.git_org] == VALID_ORG_CONFIG
assert resp.data["organization"] == VALID_ORG_CONFIG

config = PreventAIConfiguration.objects.get(
organization_id=self.org.id, integration_id=self.integration.id
Expand Down Expand Up @@ -191,8 +191,6 @@ def test_config_with_repo_overrides(self):
resp = self.client.get(self.url)
assert resp.status_code == 200
assert (
resp.data["organization"][self.git_org]["repo_overrides"]["my-repo"]["bug_prediction"][
"sensitivity"
]
resp.data["organization"]["repo_overrides"]["my-repo"]["bug_prediction"]["sensitivity"]
== "high"
)
Loading