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
14 changes: 8 additions & 6 deletions src/sentry/seer/endpoints/seer_rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@
from sentry.api.authentication import AuthenticationSiloLimit, StandardAuthentication
from sentry.api.base import Endpoint, region_silo_endpoint
from sentry.api.endpoints.organization_trace_item_attributes import as_attribute_key
from sentry.constants import ENABLE_PR_REVIEW_TEST_GENERATION_DEFAULT, ObjectStatus
from sentry.constants import (
ENABLE_PR_REVIEW_TEST_GENERATION_DEFAULT,
HIDE_AI_FEATURES_DEFAULT,
ObjectStatus,
)
from sentry.exceptions import InvalidSearchQuery
from sentry.hybridcloud.rpc.service import RpcAuthenticationSetupException, RpcResolutionException
from sentry.hybridcloud.rpc.sig import SerializableFunctionValueException
Expand Down Expand Up @@ -229,18 +233,16 @@ def get_organization_seer_consent_by_org_name(
for org_integration in org_integrations:
try:
org = Organization.objects.get(id=org_integration.organization_id)
seer_org_acknowledgement = get_seer_org_acknowledgement(org_id=org.id)
github_extension_enabled = org.id in options.get("github-extension.enabled-orgs")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

github_extension_enabled = org.id in options.get("github-extension.enabled-orgs")

Do you know what does github-extension.enabled-org mean ? Does that mean the user in the Sentry UI somewhere consented to use of the sentry.io github app or something? If so, do we need to preserve this check?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is copilot related, so we can ignore that.


hide_ai_features = org.get_option("sentry:hide_ai_features", HIDE_AI_FEATURES_DEFAULT)
pr_review_test_generation_enabled = bool(
org.get_option(
"sentry:enable_pr_review_test_generation",
ENABLE_PR_REVIEW_TEST_GENERATION_DEFAULT,
)
)

if (
seer_org_acknowledgement or github_extension_enabled
) and pr_review_test_generation_enabled:
if not hide_ai_features and pr_review_test_generation_enabled:
return {"consent": True}
except Organization.DoesNotExist:
continue
Expand Down
Loading
Loading