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: 4 additions & 0 deletions src/sentry/core/endpoints/organization_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,10 @@ def save(self, **kwargs):
for key, option, type_, default_value in ORG_OPTIONS:
if key not in data:
continue
if key == "enableSeerCoding" and features.has(
"organizations:seer-disable-coding-setting", org
):
continue
try:
option_inst = OrganizationOption.objects.get(organization=org, key=option)
update_tracked_data(option_inst)
Expand Down
2 changes: 2 additions & 0 deletions src/sentry/features/temporary.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,8 @@ def register_temporary_features(manager: FeatureManager) -> None:
manager.add("organizations:seer-agent-pr-consolidation", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True)
# Enables Seer Autopilot
manager.add("organizations:seer-autopilot", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True)
# Disables the enableSeerCoding setting, preventing orgs from changing code generation behavior
manager.add("organizations:seer-disable-coding-setting", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True)
# Disable select orgs from ingesting mobile replay events.
manager.add("organizations:session-replay-video-disabled", OrganizationFeature, FeatureHandlerStrategy.INTERNAL, api_expose=False)
# Enable data scrubbing of replay recording payloads in Relay.
Expand Down
8 changes: 8 additions & 0 deletions static/gsApp/views/seerAutomation/settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,14 @@ export function SeerAutomationSettings() {
),
type: 'boolean',
defaultValue: true, // See ENABLE_SEER_CODING_DEFAULT in sentry/src/sentry/constants.py
disabled:
!canWrite ||
organization.features.includes('seer-disable-coding-setting'),
disabledReason: organization.features.includes(
'seer-disable-coding-setting'
)
? t('Code generation is managed by your organization.')
: undefined,
},
],
},
Expand Down
16 changes: 16 additions & 0 deletions tests/sentry/core/endpoints/test_organization_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -1494,6 +1494,22 @@ def test_enable_seer_coding_can_be_enabled(self) -> None:

assert self.organization.get_option("sentry:enable_seer_coding") is True

@with_feature("organizations:seer-disable-coding-setting")
def test_enable_seer_coding_cannot_be_disabled_when_flag_enabled(self) -> None:
data = {"enableSeerCoding": False}
self.get_success_response(self.organization.slug, **data)

assert self.organization.get_option("sentry:enable_seer_coding") is not False

@with_feature("organizations:seer-disable-coding-setting")
def test_enable_seer_coding_cannot_be_enabled_when_flag_enabled(self) -> None:
self.organization.update_option("sentry:enable_seer_coding", False)

data = {"enableSeerCoding": True}
self.get_success_response(self.organization.slug, **data)

assert self.organization.get_option("sentry:enable_seer_coding") is False

def test_granular_replay_permissions_flag_set(self) -> None:
with assume_test_silo_mode_of(AuditLogEntry):
AuditLogEntry.objects.filter(organization_id=self.organization.id).delete()
Expand Down
Loading