Browse Source

chore(gen-ai): Rename Sentry AI to Seer (#86216)

Renaming.

<img width="322" alt="Screenshot 2025-03-03 at 10 43 50 AM"
src="https://github.com/user-attachments/assets/b0dabf24-5933-4104-929a-b15dcf644c06"
/>
Rohan Agarwal 1 week ago
parent
commit
7e2f866eec

+ 101 - 36
static/app/components/events/autofix/autofixRootCause.spec.tsx

@@ -1,6 +1,6 @@
 import {AutofixRootCauseData} from 'sentry-fixture/autofixRootCauseData';
 
-import {render, screen, userEvent} from 'sentry-test/reactTestingLibrary';
+import {render, screen, userEvent, waitFor} from 'sentry-test/reactTestingLibrary';
 
 import {AutofixRootCause} from 'sentry/components/events/autofix/autofixRootCause';
 
@@ -11,11 +11,13 @@ describe('AutofixRootCause', function () {
     mockApi = MockApiClient.addMockResponse({
       url: '/issues/1/autofix/update/',
       method: 'POST',
+      body: {success: true},
     });
   });
 
   afterEach(function () {
     MockApiClient.clearMockResponses();
+    jest.clearAllTimers();
   });
 
   const defaultProps = {
@@ -29,20 +31,39 @@ describe('AutofixRootCause', function () {
   it('can view a relevant code snippet', async function () {
     render(<AutofixRootCause {...defaultProps} />);
 
-    expect(screen.getByText('Root Cause')).toBeInTheDocument();
-    expect(
-      screen.getByText(defaultProps.causes[0]!.root_cause_reproduction![0]!.title)
-    ).toBeInTheDocument();
+    // Wait for initial render and animations
+    await waitFor(
+      () => {
+        expect(screen.getByText('Root Cause')).toBeInTheDocument();
+      },
+      {timeout: 2000}
+    );
+
+    await waitFor(
+      () => {
+        expect(
+          screen.getByText(defaultProps.causes[0]!.root_cause_reproduction![0]!.title)
+        ).toBeInTheDocument();
+      },
+      {timeout: 2000}
+    );
 
     await userEvent.click(screen.getByTestId('autofix-root-cause-timeline-item-0'));
-    expect(
-      screen.getByText(
-        defaultProps.causes[0]!.root_cause_reproduction![0]!.code_snippet_and_analysis
-      )
-    ).toBeInTheDocument();
+
+    // Wait for code snippet to appear with increased timeout for animation
+    await waitFor(
+      () => {
+        expect(
+          screen.getByText(
+            defaultProps.causes[0]!.root_cause_reproduction![0]!.code_snippet_and_analysis
+          )
+        ).toBeInTheDocument();
+      },
+      {timeout: 2000}
+    );
   });
 
-  it('shows graceful error state when there are no causes', function () {
+  it('shows graceful error state when there are no causes', async function () {
     render(
       <AutofixRootCause
         {...{
@@ -53,14 +74,30 @@ describe('AutofixRootCause', function () {
       />
     );
 
-    expect(
-      screen.getByText('No root cause found. The error comes from outside the codebase.')
-    ).toBeInTheDocument();
+    // Wait for error state to render
+    await waitFor(
+      () => {
+        expect(
+          screen.getByText(
+            'No root cause found. The error comes from outside the codebase.'
+          )
+        ).toBeInTheDocument();
+      },
+      {timeout: 2000}
+    );
   });
 
   it('can edit and submit custom root cause', async function () {
     render(<AutofixRootCause {...defaultProps} />);
 
+    // Wait for initial render
+    await waitFor(
+      () => {
+        expect(screen.getByText('Root Cause')).toBeInTheDocument();
+      },
+      {timeout: 2000}
+    );
+
     // Click edit button
     await userEvent.click(screen.getByTestId('autofix-root-cause-edit-button'));
 
@@ -74,23 +111,28 @@ describe('AutofixRootCause', function () {
     // Click Save button
     await userEvent.click(screen.getByTestId('autofix-root-cause-save-edit-button'));
 
-    // Verify API was called with correct payload
-    expect(mockApi).toHaveBeenCalledWith(
-      '/issues/1/autofix/update/',
-      expect.objectContaining({
-        method: 'POST',
-        data: {
-          run_id: '101',
-          payload: {
-            type: 'select_root_cause',
-            custom_root_cause: 'This is a custom root cause',
-          },
-        },
-      })
+    // Wait for API call to complete
+    await waitFor(
+      () => {
+        expect(mockApi).toHaveBeenCalledWith(
+          '/issues/1/autofix/update/',
+          expect.objectContaining({
+            method: 'POST',
+            data: {
+              run_id: '101',
+              payload: {
+                type: 'select_root_cause',
+                custom_root_cause: 'This is a custom root cause',
+              },
+            },
+          })
+        );
+      },
+      {timeout: 2000}
     );
   });
 
-  it('shows selected root cause when rootCauseSelection is provided', function () {
+  it('shows selected root cause when rootCauseSelection is provided', async function () {
     const selectedCause = AutofixRootCauseData();
     render(
       <AutofixRootCause
@@ -103,14 +145,25 @@ describe('AutofixRootCause', function () {
       />
     );
 
-    // Verify selected root cause is displayed
-    expect(screen.getByText('Root Cause')).toBeInTheDocument();
-    expect(
-      screen.getByText(selectedCause.root_cause_reproduction![0]!.title)
-    ).toBeInTheDocument();
+    // Wait for selected root cause to render
+    await waitFor(
+      () => {
+        expect(screen.getByText('Root Cause')).toBeInTheDocument();
+      },
+      {timeout: 2000}
+    );
+
+    await waitFor(
+      () => {
+        expect(
+          screen.getByText(selectedCause.root_cause_reproduction![0]!.title)
+        ).toBeInTheDocument();
+      },
+      {timeout: 2000}
+    );
   });
 
-  it('shows custom root cause when rootCauseSelection has custom_root_cause', function () {
+  it('shows custom root cause when rootCauseSelection has custom_root_cause', async function () {
     render(
       <AutofixRootCause
         {...{
@@ -122,7 +175,19 @@ describe('AutofixRootCause', function () {
       />
     );
 
-    expect(screen.getByText('Custom Root Cause')).toBeInTheDocument();
-    expect(screen.getByText('This is a custom root cause')).toBeInTheDocument();
+    // Wait for custom root cause to render
+    await waitFor(
+      () => {
+        expect(screen.getByText('Custom Root Cause')).toBeInTheDocument();
+      },
+      {timeout: 2000}
+    );
+
+    await waitFor(
+      () => {
+        expect(screen.getByText('This is a custom root cause')).toBeInTheDocument();
+      },
+      {timeout: 2000}
+    );
   });
 });

+ 3 - 3
static/app/views/issueDetails/streamline/sidebar/solutionsHubDrawer.spec.tsx

@@ -134,7 +134,7 @@ describe('SolutionsHubDrawer', () => {
     expect(screen.getByText(mockEvent.id)).toBeInTheDocument();
 
     // The heading is "Sentry AI" with a beta badge next to it
-    expect(screen.getByText('Sentry AI')).toBeInTheDocument();
+    expect(screen.getByText('Seer')).toBeInTheDocument();
 
     expect(screen.getByTestId('ai-setup-data-consent')).toBeInTheDocument();
   });
@@ -156,7 +156,7 @@ describe('SolutionsHubDrawer', () => {
       screen.queryByTestId('ai-setup-loading-indicator')
     );
 
-    expect(screen.getByText('Sentry AI')).toBeInTheDocument();
+    expect(screen.getByText('Seer')).toBeInTheDocument();
 
     // Verify the Start Autofix button is available
     const startButton = screen.getByRole('button', {name: 'Start Autofix'});
@@ -435,7 +435,7 @@ describe('SolutionsHubDrawer', () => {
       screen.queryByTestId('ai-setup-loading-indicator')
     );
 
-    expect(screen.getByText('Sentry AI')).toBeInTheDocument();
+    expect(screen.getByText('Seer')).toBeInTheDocument();
 
     // Since "Install the GitHub Integration" text isn't found, let's check for
     // the "Set Up the GitHub Integration" text which is what the component is actually showing

+ 1 - 1
static/app/views/issueDetails/streamline/sidebar/solutionsHubDrawer.tsx

@@ -187,7 +187,7 @@ export function SolutionsHubDrawer({group, project, event}: SolutionsHubDrawerPr
       <SolutionsDrawerNavigator>
         <Header>
           <SeerIcon size="lg" />
-          {t('Sentry AI')}
+          {t('Seer')}
           <StyledFeatureBadge
             type="beta"
             tooltipProps={{

+ 4 - 6
static/app/views/issueDetails/streamline/sidebar/solutionsSection.spec.tsx

@@ -199,7 +199,7 @@ describe('SolutionsSection', () => {
   });
 
   describe('Solutions Hub button text', () => {
-    it('shows "Set Up Sentry AI" when AI needs setup', async () => {
+    it('shows "Set Up Seer" when AI needs setup', async () => {
       const customOrganization = OrganizationFixture({
         genAIConsent: false,
         hideAiFeatures: false,
@@ -227,10 +227,10 @@ describe('SolutionsSection', () => {
       });
 
       expect(
-        screen.getByText('Explore potential root causes and solutions with Sentry AI.')
+        screen.getByText('Explore potential root causes and solutions with Seer.')
       ).toBeInTheDocument();
 
-      expect(screen.getByRole('button', {name: 'Set Up Sentry AI'})).toBeInTheDocument();
+      expect(screen.getByRole('button', {name: 'Set Up Seer'})).toBeInTheDocument();
     });
 
     it('shows "Find Root Cause" even when autofix needs setup', async () => {
@@ -376,9 +376,7 @@ describe('SolutionsSection', () => {
       );
 
       expect(screen.queryByTestId('loading-placeholder')).not.toBeInTheDocument();
-      expect(
-        screen.queryByRole('button', {name: 'Set Up Sentry AI'})
-      ).not.toBeInTheDocument();
+      expect(screen.queryByRole('button', {name: 'Set Up Seer'})).not.toBeInTheDocument();
       expect(
         screen.queryByRole('button', {name: 'Set Up Autofix'})
       ).not.toBeInTheDocument();

+ 1 - 3
static/app/views/issueDetails/streamline/sidebar/solutionsSection.tsx

@@ -66,9 +66,7 @@ export default function SolutionsSection({
   const renderContent = () => {
     if (aiConfig.needsGenAIConsent) {
       return (
-        <Summary>
-          {t('Explore potential root causes and solutions with Sentry AI.')}
-        </Summary>
+        <Summary>{t('Explore potential root causes and solutions with Seer.')}</Summary>
       );
     }
 

+ 1 - 1
static/app/views/issueDetails/streamline/sidebar/solutionsSectionCtaButton.tsx

@@ -83,7 +83,7 @@ export function SolutionsSectionCtaButton({
 
   const getButtonText = () => {
     if (aiConfig.needsGenAIConsent) {
-      return t('Set Up Sentry AI');
+      return t('Set Up Seer');
     }
 
     if (!aiConfig.hasAutofix) {