Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(autofix): Show banner if gen AI consent is given, even if no feature flag #79362

Merged
merged 1 commit into from
Oct 18, 2024
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
1 change: 1 addition & 0 deletions static/app/components/events/autofix/useAutofixSetup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export function useAutofixSetup(
canStartAutofix: Boolean(
queryData.data?.integration.ok && queryData.data?.genAIConsent.ok
),
genAIConsent: Boolean(queryData.data?.genAIConsent.ok ?? false),
canCreatePullRequests: Boolean(queryData.data?.githubWriteIntegration.ok),
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import styled from '@emotion/styled';

import {AiSuggestedSolution} from 'sentry/components/events/aiSuggestedSolution';
import {Autofix} from 'sentry/components/events/autofix';
import {useAutofixSetup} from 'sentry/components/events/autofix/useAutofixSetup';
import {Resources} from 'sentry/components/events/interfaces/performance/resources';
import {t} from 'sentry/locale';
import ConfigStore from 'sentry/stores/configStore';
Expand Down Expand Up @@ -51,10 +52,14 @@ export function ResourcesAndPossibleSolutions({event, project, group}: Props) {
const config = getConfigForIssueType(group, project);
const isSelfHostedErrorsOnly = ConfigStore.get('isSelfHostedErrorsOnly');
const isSampleError = useIsSampleEvent();
// NOTE: Autofix is for INTERNAL testing only for now.
const {genAIConsent} = useAutofixSetup({
groupId: group.id,
});

const displayAiAutofix =
organization.features.includes('autofix') &&
organization.features.includes('issue-details-autofix-ui') &&
((organization.features.includes('autofix') &&
organization.features.includes('issue-details-autofix-ui')) ||
genAIConsent) &&
!shouldShowCustomErrorResourceConfig(group, project) &&
config.autofix &&
hasStacktraceWithFrames(event) &&
Expand Down
Loading