From b4e9f3ff7e6eb49d632a5feda192a61da8542e5e Mon Sep 17 00:00:00 2001 From: Hubert Deng Date: Tue, 2 Jul 2024 16:51:12 -0700 Subject: [PATCH] feat(self-hosted): Disable ai features for self-hosted errors only (#73529) The ai features should not be available for self-hosted errors only. --- .../views/issueDetails/resourcesAndPossibleSolutions.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/static/app/views/issueDetails/resourcesAndPossibleSolutions.tsx b/static/app/views/issueDetails/resourcesAndPossibleSolutions.tsx index 2860720c6d97bb..b1c0f33342b887 100644 --- a/static/app/views/issueDetails/resourcesAndPossibleSolutions.tsx +++ b/static/app/views/issueDetails/resourcesAndPossibleSolutions.tsx @@ -6,6 +6,7 @@ import {Autofix} from 'sentry/components/events/autofix'; import {EventDataSection} from 'sentry/components/events/eventDataSection'; import {Resources} from 'sentry/components/events/interfaces/performance/resources'; import {t} from 'sentry/locale'; +import ConfigStore from 'sentry/stores/configStore'; import {space} from 'sentry/styles/space'; import {EntryType, type Event, type Group, type Project} from 'sentry/types'; import { @@ -44,6 +45,7 @@ function hasStacktraceWithFrames(event: Event) { export function ResourcesAndPossibleSolutions({event, project, group}: Props) { const organization = useOrganization(); const config = getConfigForIssueType(group, project); + const isSelfHostedErrorsOnly = ConfigStore.get('isSelfHostedErrorsOnly'); // NOTE: Autofix is for INTERNAL testing only for now. const displayAiAutofix = @@ -59,7 +61,10 @@ export function ResourcesAndPossibleSolutions({event, project, group}: Props) { !shouldShowCustomErrorResourceConfig(group, project) && !displayAiAutofix; - if (!config.resources && !(displayAiSuggestedSolution || displayAiAutofix)) { + if ( + isSelfHostedErrorsOnly || + (!config.resources && !(displayAiSuggestedSolution || displayAiAutofix)) + ) { return null; }