Skip to content
Open
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
6 changes: 0 additions & 6 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import { ThemeContextProvider } from 'shared/ThemeContext'
import AccountSettings from './pages/AccountSettings'
import AdminSettings from './pages/AdminSettings'
const AnalyticsPage = lazy(() => import('./pages/AnalyticsPage'))
const CodecovAIPage = lazy(() => import('./pages/CodecovAIPage'))
const CommitDetailPage = lazy(() => import('./pages/CommitDetailPage'))
const EnterpriseLandingPage = lazy(() => import('pages/EnterpriseLandingPage'))
const LoginPage = lazy(() => import('./pages/LoginPage'))
Expand Down Expand Up @@ -118,11 +117,6 @@ const MainAppRoutes = () => (
<AnalyticsPage />
</BaseLayout>
</SentryRoute>
<SentryRoute path="/codecovai/:provider/:owner" exact>
<BaseLayout>
<CodecovAIPage />
</BaseLayout>
</SentryRoute>
<SentryRoute path="/:provider" exact>
<BaseLayout>
<HomePageRedirect />
Expand Down
Binary file not shown.
Binary file not shown.
Binary file removed src/assets/codecovAI/test-gen-example-dark-mode.png
Binary file not shown.
Binary file removed src/assets/codecovAI/test-gen-example-light-mode.png
Binary file not shown.
1 change: 0 additions & 1 deletion src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const defaultConfig = {
SENTRY_SESSION_SAMPLE_RATE: 0.1,
SENTRY_ERROR_SAMPLE_RATE: 1.0,
GH_APP: DEFAULT_GH_APP,
GH_APP_AI: 'codecov-ai',
SUNBURST_ENABLED: true,
DISPLAY_SELF_HOSTED_EXPIRATION_BANNER: true,
}
Expand Down
32 changes: 0 additions & 32 deletions src/pages/AccountSettings/shared/Header/Header.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,8 @@ import config from 'config'

import Header from './Header'

const mocks = vi.hoisted(() => ({
useFlags: vi.fn(),
}))

vi.mock('config')
vi.mock('layouts/MyContextSwitcher', () => () => 'MyContextSwitcher')
vi.mock('shared/featureFlags', () => ({
useFlags: mocks.useFlags,
}))

const queryClient = new QueryClient()

Expand All @@ -36,7 +29,6 @@ beforeEach(() => {
describe('Header', () => {
function setup(isSelfHosted: boolean = false) {
config.IS_SELF_HOSTED = isSelfHosted
mocks.useFlags.mockReturnValue({ codecovAiFeaturesTab: true })
}

describe('when users is part of the org', () => {
Expand Down Expand Up @@ -119,28 +111,4 @@ describe('Header', () => {
).not.toBeInTheDocument()
})
})

describe('ai features tab', () => {
it('does not render tab when flag is off', () => {
mocks.useFlags.mockReturnValue({ codecovAiFeaturesTab: false })
render(<Header />, { wrapper })

expect(
screen.queryByRole('link', {
name: /Codecov AI beta/i,
})
).not.toBeInTheDocument()
})

it('renders tab when flag is on', () => {
setup()
render(<Header />, { wrapper })

expect(
screen.getByRole('link', {
name: /Codecov AI beta/i,
})
).toBeInTheDocument()
})
})
})
18 changes: 0 additions & 18 deletions src/pages/AccountSettings/shared/Header/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,31 +1,13 @@
import config from 'config'

import { useFlags } from 'shared/featureFlags'
import Badge from 'ui/Badge'
import TabNavigation from 'ui/TabNavigation'

function Header() {
const { codecovAiFeaturesTab } = useFlags({
codecovAiFeaturesTab: false,
})

return (
<TabNavigation
tabs={[
{ pageName: 'owner', children: 'Repos' },
{ pageName: 'analytics', children: 'Analytics' },
...(codecovAiFeaturesTab
? [
{
pageName: 'codecovAI',
children: (
<>
Codecov AI <Badge>beta</Badge>{' '}
</>
),
},
]
: []),
...(config.IS_SELF_HOSTED
? []
: [{ pageName: 'membersTab' }, { pageName: 'planTab' }]),
Expand Down
31 changes: 0 additions & 31 deletions src/pages/AnalyticsPage/Tabs/Tabs.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,8 @@ import config from 'config'

import Tabs from './Tabs'

const mocks = vi.hoisted(() => ({
useFlags: vi.fn(),
}))

vi.mock('config')

vi.mock('shared/featureFlags', async () => {
const actual = await vi.importActual('shared/featureFlags')
return {
...actual,
useFlags: mocks.useFlags,
}
})

const queryClient = new QueryClient()

const wrapper: React.FC<{ children: React.ReactNode }> = ({ children }) => (
Expand All @@ -37,7 +25,6 @@ beforeEach(() => {
describe('Tabs', () => {
function setup(isSelfHosted: boolean = false) {
config.IS_SELF_HOSTED = isSelfHosted
mocks.useFlags.mockReturnValue({ codecovAiFeaturesTab: true })
}

describe('when user is part of the org', () => {
Expand Down Expand Up @@ -102,22 +89,4 @@ describe('Tabs', () => {
expect(link).not.toBeInTheDocument()
})
})

describe('ai features tab', () => {
it('does not render tab when flag is off', () => {
mocks.useFlags.mockReturnValue({ codecovAiFeaturesTab: false })
render(<Tabs />, { wrapper })

const link = screen.queryByRole('link', { name: /Codecov AI beta/i })
expect(link).not.toBeInTheDocument()
})

it('renders tab when flag is on', () => {
setup()
render(<Tabs />, { wrapper })

const link = screen.getByRole('link', { name: /Codecov AI beta/i })
expect(link).toBeInTheDocument()
})
})
})
18 changes: 0 additions & 18 deletions src/pages/AnalyticsPage/Tabs/Tabs.tsx
Original file line number Diff line number Diff line change
@@ -1,31 +1,13 @@
import config from 'config'

import { useFlags } from 'shared/featureFlags'
import Badge from 'ui/Badge'
import TabNavigation from 'ui/TabNavigation'

function Tabs() {
const { codecovAiFeaturesTab } = useFlags({
codecovAiFeaturesTab: false,
})

return (
<TabNavigation
tabs={[
{ pageName: 'owner', children: 'Repos' },
{ pageName: 'analytics', children: 'Analytics' },
...(codecovAiFeaturesTab
? [
{
pageName: 'codecovAI',
children: (
<>
Codecov AI <Badge>beta</Badge>{' '}
</>
),
},
]
: []),
...(config.IS_SELF_HOSTED
? []
: [{ pageName: 'membersTab' }, { pageName: 'planTab' }]),
Expand Down
74 changes: 0 additions & 74 deletions src/pages/CodecovAIPage/CodecovAICommands/CodecovAICommands.tsx

This file was deleted.

Loading
Loading