From 639145b5be7d6ddc5e9de5ddffc243fae98cc899 Mon Sep 17 00:00:00 2001 From: Calvin Yau Date: Thu, 26 Feb 2026 13:21:22 -0800 Subject: [PATCH] feat(codecov): Hide TA feature --- knip.config.ts | 3 + static/app/router/routes.tsx | 37 --------- static/app/views/nav/primary/index.tsx | 7 +- .../nav/secondary/secondaryNavContent.tsx | 3 +- .../prevent/preventSecondaryNav.spec.tsx | 78 ------------------- 5 files changed, 7 insertions(+), 121 deletions(-) delete mode 100644 static/app/views/nav/secondary/sections/prevent/preventSecondaryNav.spec.tsx diff --git a/knip.config.ts b/knip.config.ts index 88ddc927ec72f9..674bb5e2afaefb 100644 --- a/knip.config.ts +++ b/knip.config.ts @@ -23,6 +23,9 @@ const productionEntryPoints = [ 'static/app/components/core/quote/*.tsx', // Prevent exception until we build out coverage 'static/app/components/prevent/virtualRenderers/**/*.{js,ts,tsx}', + // Temporary Prevent TA exceptions until the code is removed + 'static/app/views/nav/secondary/sections/prevent/**/*.{js,ts,tsx}', + 'static/app/views/prevent/**/*.{js,ts,tsx}', // todo we currently keep all icons 'static/app/icons/**/*.{js,mjs,ts,tsx}', // todo find out how chartcuterie works diff --git a/static/app/router/routes.tsx b/static/app/router/routes.tsx index ccce9678201273..543211b8510f29 100644 --- a/static/app/router/routes.tsx +++ b/static/app/router/routes.tsx @@ -2358,42 +2358,6 @@ function buildRoutes(): RouteObject[] { children: exploreChildren, }; - const preventRoutes: SentryRouteObject = { - path: '/prevent/', - withOrgPath: true, - component: make(() => import('sentry/views/prevent/index')), - children: [ - { - index: true, - redirectTo: 'tests/', - }, - { - path: 'tests/', - component: make(() => import('sentry/views/prevent/tests/testsWrapper')), - children: [ - { - index: true, - component: make(() => import('sentry/views/prevent/tests/tests')), - }, - { - path: 'new/', - component: make(() => import('sentry/views/prevent/tests/onboarding')), - }, - ], - }, - { - path: 'tokens/', - component: make(() => import('sentry/views/prevent/tokens/tokensWrapper')), - children: [ - { - index: true, - component: make(() => import('sentry/views/prevent/tokens/tokens')), - }, - ], - }, - ], - }; - const preprodChildren: SentryRouteObject[] = [ { index: true, @@ -2828,7 +2792,6 @@ function buildRoutes(): RouteObject[] { issueRoutes, alertRoutes, monitorRoutes, - preventRoutes, preprodRoutes, pullRequestRoutes, replayRoutes, diff --git a/static/app/views/nav/primary/index.tsx b/static/app/views/nav/primary/index.tsx index efb29015f77470..604aa6a82c098c 100644 --- a/static/app/views/nav/primary/index.tsx +++ b/static/app/views/nav/primary/index.tsx @@ -17,7 +17,6 @@ import { IconSettings, IconSiren, } from 'sentry/icons'; -import type {Organization} from 'sentry/types/organization'; import useOrganization from 'sentry/utils/useOrganization'; import {getDefaultExploreRoute} from 'sentry/views/explore/utils'; import {useNavContext} from 'sentry/views/nav/context'; @@ -69,11 +68,11 @@ function SidebarFooter({children}: {children: React.ReactNode}) { ); } -function showPreventNav(organization: Organization) { +function showPreventNav() { // only people with test analytics can see the prevent nav // Legacy Seer and New Seer orgs are getting a Seer Config Reminder icon, which // means that the only Prevent sub-nav item remaining is the Tests item. - return organization.features.includes('prevent-test-analytics'); + return false; } export function PrimaryNavigationItems() { @@ -161,7 +160,7 @@ export function PrimaryNavigationItems() { - {showPreventNav(organization) ? ( + {showPreventNav() ? ( ; case PrimaryNavGroup.PREVENT: - return ; + return null; case PrimaryNavGroup.SETTINGS: return ; case PrimaryNavGroup.ADMIN: diff --git a/static/app/views/nav/secondary/sections/prevent/preventSecondaryNav.spec.tsx b/static/app/views/nav/secondary/sections/prevent/preventSecondaryNav.spec.tsx deleted file mode 100644 index 279db254309270..00000000000000 --- a/static/app/views/nav/secondary/sections/prevent/preventSecondaryNav.spec.tsx +++ /dev/null @@ -1,78 +0,0 @@ -import {OrganizationFixture} from 'sentry-fixture/organization'; - -import {render, screen} from 'sentry-test/reactTestingLibrary'; - -import Nav from 'sentry/views/nav'; -import {NavContextProvider} from 'sentry/views/nav/context'; - -jest.mock('sentry/utils/analytics', () => ({ - trackAnalytics: jest.fn(), -})); - -describe('PreventSecondaryNav', () => { - beforeEach(() => { - localStorage.clear(); - MockApiClient.clearMockResponses(); - - MockApiClient.addMockResponse({ - url: '/organizations/org-slug/group-search-views/starred/', - body: [], - }); - MockApiClient.addMockResponse({ - url: '/organizations/org-slug/dashboards/', - body: [], - }); - - MockApiClient.addMockResponse({ - url: `/organizations/org-slug/broadcasts/`, - body: [], - }); - - MockApiClient.addMockResponse({ - url: `/assistant/`, - body: [], - }); - }); - - it('renders the correct tests link', () => { - render( - -