Skip to content

Commit

Permalink
feat(self-hosted): Disable ai features for self-hosted errors only (#…
Browse files Browse the repository at this point in the history
…73529)

The ai features should not be available for self-hosted errors only.
  • Loading branch information
hubertdeng123 authored Jul 2, 2024
1 parent cdc03d3 commit b4e9f3f
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 =
Expand All @@ -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;
}

Expand Down

0 comments on commit b4e9f3f

Please sign in to comment.