@skyhook-io/radar-app 1.21.6 → 1.21.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +7 -7
- package/src/App.tsx +19 -1
- package/src/RadarApp.tsx +8 -2
- package/src/api/client.discoverMetrics.test.tsx +69 -0
- package/src/api/client.issueCorrelation.test.tsx +244 -0
- package/src/api/client.issueRowChanges.test.tsx +129 -0
- package/src/api/client.pendingOwnership.test.tsx +197 -0
- package/src/api/client.prometheusStatus.test.ts +4 -0
- package/src/api/client.restartError.test.ts +36 -1
- package/src/api/client.stopWorkflow.test.tsx +133 -0
- package/src/api/client.submitWorkflowTemplate.test.tsx +127 -0
- package/src/api/client.ts +572 -111
- package/src/api/connectionBinding.test.tsx +3 -1
- package/src/api/connectionBinding.ts +14 -2
- package/src/api/gitOpsPermissions.render.test.tsx +155 -0
- package/src/api/gitOpsPermissions.test.ts +90 -0
- package/src/api/gitOpsPermissions.ts +51 -0
- package/src/api/httpErrors.test.ts +30 -1
- package/src/api/httpErrors.ts +17 -0
- package/src/api/openobserveSetup.ts +85 -0
- package/src/api/podDebug.test.tsx +137 -0
- package/src/api/podDebug.ts +82 -0
- package/src/api/prometheusCharts.test.ts +23 -0
- package/src/api/prometheusCharts.ts +25 -0
- package/src/api/radarFeatures.render.test.tsx +43 -2
- package/src/api/radarFeatures.test.ts +18 -1
- package/src/api/radarFeatures.ts +17 -4
- package/src/api/reviewedActionMutation.ts +9 -2
- package/src/api/workloadMetrics.ts +2 -0
- package/src/components/applications/ApplicationsView.openResource.test.tsx +137 -11
- package/src/components/applications/ApplicationsView.tsx +56 -31
- package/src/components/cnpg/host.test.tsx +1 -1
- package/src/components/cnpg/host.tsx +0 -2
- package/src/components/dock/BottomDock.tsx +7 -3
- package/src/components/dock/MissingShellDebug.test.tsx +193 -0
- package/src/components/dock/MissingShellDebug.tsx +114 -0
- package/src/components/dock/PodDebugSession.test.tsx +60 -0
- package/src/components/dock/PodDebugSession.tsx +96 -0
- package/src/components/dock/TerminalTab.test.tsx +48 -4
- package/src/components/dock/TerminalTab.tsx +47 -25
- package/src/components/dock/WorkloadLogsTab.test.tsx +24 -1
- package/src/components/dock/WorkloadLogsTab.tsx +16 -0
- package/src/components/execution/BatchExecutionView.command.test.tsx +69 -0
- package/src/components/execution/BatchExecutionView.tsx +88 -5
- package/src/components/execution/BatchExecutionView.workflow-stop.test.tsx +69 -0
- package/src/components/execution/WorkflowRunStopAction.tsx +8 -0
- package/src/components/gitops/GitOpsPermissionRowActions.test.tsx +100 -0
- package/src/components/gitops/GitOpsPermissionRowActions.tsx +27 -0
- package/src/components/gitops/GitOpsView.identity.test.tsx +1 -0
- package/src/components/gitops/GitOpsView.permissions.test.tsx +102 -0
- package/src/components/gitops/GitOpsView.syncRequest.test.tsx +95 -7
- package/src/components/gitops/GitOpsView.tsx +93 -32
- package/src/components/helm/OwnedResources.tsx +1 -0
- package/src/components/home/mcpToolCatalog.ts +1 -0
- package/src/components/issues/IssuesPane.render.test.tsx +1 -1
- package/src/components/issues/IssuesPane.tsx +11 -0
- package/src/components/issues/useIssueExpansion.ts +91 -0
- package/src/components/resource/MetricsNotConnected.test.tsx +50 -0
- package/src/components/resource/MetricsNotConnected.tsx +114 -0
- package/src/components/resource/PVCUsageBar.tsx +2 -1
- package/src/components/resource/PrometheusCharts.render.test.tsx +47 -0
- package/src/components/resource/PrometheusCharts.tsx +14 -2
- package/src/components/resource/PrometheusChartsGrid.render.test.tsx +91 -1
- package/src/components/resource/PrometheusChartsGrid.tsx +28 -52
- package/src/components/resource/RestartChart.tsx +4 -3
- package/src/components/resource/RightsizingPanel.source.test.tsx +34 -0
- package/src/components/resource/RightsizingStrip.tsx +5 -3
- package/src/components/resource/WorkloadMetricsSection.render.test.tsx +6 -0
- package/src/components/resource/WorkloadMetricsSection.tsx +14 -11
- package/src/components/resource/nameMatchedScope.ts +9 -3
- package/src/components/resources/EmptyNamespaceHint.tsx +42 -0
- package/src/components/resources/PodDebugAction.test.tsx +157 -0
- package/src/components/resources/PodDebugAction.tsx +207 -0
- package/src/components/resources/PodDebugPermission.tsx +21 -0
- package/src/components/resources/ResourcesView.empty-hint.test.tsx +132 -0
- package/src/components/resources/ResourcesView.tsx +39 -5
- package/src/components/resources/namespaceHint.test.ts +34 -0
- package/src/components/resources/namespaceHint.ts +19 -0
- package/src/components/resources/renderers/AdmissionPolicyRenderers.tsx +135 -0
- package/src/components/resources/renderers/NodeRenderer.tsx +2 -1
- package/src/components/resources/renderers/PodRenderer.tsx +12 -5
- package/src/components/resources/renderers/ValidatingAdmissionPolicyRenderer.test.tsx +24 -1
- package/src/components/settings/LocalIntegrationStatus.tsx +14 -3
- package/src/components/settings/MetricsBackendSwitch.tsx +167 -0
- package/src/components/settings/OpenObserveSetup.test.tsx +343 -0
- package/src/components/settings/OpenObserveSetup.tsx +358 -0
- package/src/components/settings/SettingsDialog.tsx +21 -7
- package/src/components/settings/openobserveStatus.test.ts +34 -0
- package/src/components/settings/openobserveStatus.ts +55 -0
- package/src/components/timeline/TimelineList.selection.test.tsx +40 -0
- package/src/components/timeline/TimelineList.test.ts +18 -0
- package/src/components/timeline/TimelineList.tsx +19 -5
- package/src/components/timeline/TimelineView.tsx +2 -0
- package/src/components/workload/WorkloadView.pendingOwnership.test.tsx +34 -0
- package/src/components/workload/WorkloadView.tabUrl.test.tsx +44 -0
- package/src/components/workload/WorkloadView.tsx +95 -10
- package/src/context/TimelineNavigation.test.ts +59 -0
- package/src/context/TimelineNavigation.tsx +86 -0
- package/src/contexts/CapabilitiesContext.tsx +3 -1
- package/src/hooks/useResourceCounts.ts +2 -1
- package/src/hooks/useWorkflowStopAction.ts +31 -0
- package/src/index.css +1 -0
- package/src/integrations/resourceHosts.test.tsx +2 -2
- package/src/integrations/resourceHosts.tsx +4 -2
- package/src/k8s-ui-exports.test.ts +10 -0
- package/src/components/resources/renderers/ValidatingAdmissionPolicyRenderer.tsx +0 -128
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { useEffect, useMemo } from 'react'
|
|
2
|
+
import { useQuery, useQueryClient } from '@tanstack/react-query'
|
|
3
|
+
import { getApiBase } from './config'
|
|
4
|
+
import { fetchJSON, useRadarFeature } from './client'
|
|
5
|
+
import { connectionHeaders, connectionHeaderValue, useCurrentConnectionId } from './connectionBinding'
|
|
6
|
+
|
|
7
|
+
export function createPodDebugContainer(namespace: string, podName: string, connection: string | undefined, request: {
|
|
8
|
+
targetContainer: string
|
|
9
|
+
uid: string
|
|
10
|
+
image?: string
|
|
11
|
+
}) {
|
|
12
|
+
return fetchJSON<{ containerName: string; image: string; status: 'running' | 'pending' }>(
|
|
13
|
+
`/pods/${namespace}/${podName}/debug`, {
|
|
14
|
+
method: 'POST',
|
|
15
|
+
headers: { 'Content-Type': 'application/json', ...connectionHeaders(connection) },
|
|
16
|
+
body: JSON.stringify({ ...request, returnImmediately: true }),
|
|
17
|
+
},
|
|
18
|
+
)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
interface RefusedAttempt { message: string; rechecked: boolean }
|
|
22
|
+
type PodDebugAccess = { exec?: boolean; refusedAttempt?: RefusedAttempt } & ({ state: 'allowed'; image: string } | { state: 'unknown'; image?: string } | { state: 'denied' | 'unavailable' | 'check_failed' })
|
|
23
|
+
|
|
24
|
+
function needsNamedRecheck(state?: { data?: PodDebugAccess; error: unknown }) {
|
|
25
|
+
const answer = state?.data?.state
|
|
26
|
+
return !!state?.error || answer === 'denied' || answer === 'unavailable' || answer === 'check_failed'
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function podDebugAccessKey(namespace: string, name: string, uid: string, base = getApiBase(), connection = connectionHeaderValue()) {
|
|
30
|
+
return ['pod-debug-access', base, connection, namespace, name, uid]
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function usePodDebugAccess(namespace: string, name: string, uid: string, enabled: boolean, execOnly = false, namespaceGrant?: string) {
|
|
34
|
+
const { support } = useRadarFeature('podDebugAccess')
|
|
35
|
+
const client = useQueryClient()
|
|
36
|
+
const base = getApiBase()
|
|
37
|
+
const connection = useCurrentConnectionId()
|
|
38
|
+
const key = useMemo(() => [...podDebugAccessKey(namespace, name, uid, base, connection), execOnly], [namespace, name, uid, base, connection, execOnly])
|
|
39
|
+
const query = useQuery<PodDebugAccess>({
|
|
40
|
+
queryKey: key,
|
|
41
|
+
queryFn: async () => {
|
|
42
|
+
const answer = await fetchJSON<PodDebugAccess>(`/pods/${namespace}/${name}/debug-access${execOnly ? '?execOnly=true' : ''}`, {
|
|
43
|
+
headers: connectionHeaders(connection),
|
|
44
|
+
})
|
|
45
|
+
const refusal = client.getQueryData<PodDebugAccess>(key)?.refusedAttempt
|
|
46
|
+
return answer.state !== 'allowed' && refusal ? { ...answer, refusedAttempt: refusal } : answer
|
|
47
|
+
},
|
|
48
|
+
enabled: q => support === 'supported' && (enabled || (!!namespaceGrant && needsNamedRecheck(q.state))),
|
|
49
|
+
staleTime: 15_000,
|
|
50
|
+
retry: false,
|
|
51
|
+
refetchOnWindowFocus: true,
|
|
52
|
+
})
|
|
53
|
+
const recheck = query.refetch
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
// A newly visible namespace grant can disagree with a previous named denial.
|
|
56
|
+
// Ask about this Pod again rather than letting either cached answer outvote the other.
|
|
57
|
+
const previous = client.getQueryState<PodDebugAccess>(key)
|
|
58
|
+
if (namespaceGrant && support === 'supported' && needsNamedRecheck(previous)) void recheck({ cancelRefetch: false })
|
|
59
|
+
}, [namespaceGrant, support, client, key, recheck])
|
|
60
|
+
const access = query.data
|
|
61
|
+
const unverifiedImage = support === 'supported' && !execOnly && !query.error && access?.state === 'unknown' && access.exec ? access.image : undefined
|
|
62
|
+
async function recheckAccess() {
|
|
63
|
+
const previous = client.getQueryData<PodDebugAccess>(key)?.refusedAttempt
|
|
64
|
+
const result = await recheck()
|
|
65
|
+
if (previous && !result.error && result.data?.state === 'unknown') {
|
|
66
|
+
client.setQueryData<PodDebugAccess>(key, answer => answer?.refusedAttempt === previous
|
|
67
|
+
? { ...answer, refusedAttempt: { ...previous, rechecked: true } } : answer)
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
function rememberRefusal(message: string) {
|
|
71
|
+
client.setQueryData<PodDebugAccess>(key, answer => answer?.state === 'unknown'
|
|
72
|
+
? { ...answer, refusedAttempt: { message, rechecked: false } } : answer)
|
|
73
|
+
void recheck({ cancelRefetch: false })
|
|
74
|
+
}
|
|
75
|
+
function clearRefusal() {
|
|
76
|
+
if (!access?.refusedAttempt) return
|
|
77
|
+
client.setQueryData<PodDebugAccess>(key, current => current && current.refusedAttempt === access.refusedAttempt
|
|
78
|
+
? { ...current, refusedAttempt: undefined } : current)
|
|
79
|
+
}
|
|
80
|
+
const unverifiedReview = unverifiedImage ? { refused: access?.refusedAttempt, rememberRefusal, recheckAccess, clearRefusal } : undefined
|
|
81
|
+
return { unverifiedImage, unverifiedReview, recheckAccess, query, support, recheckSupport: () => client.invalidateQueries({queryKey: ['capabilities'], exact: true}) }
|
|
82
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest'
|
|
2
|
+
import type { PrometheusStatus } from './client'
|
|
3
|
+
import { hasPrometheusCharts, metricsConnectionLabel, metricsSourceUnavailable } from './prometheusCharts'
|
|
4
|
+
|
|
5
|
+
const down = { kind: 'openobserve', via: 'local', unavailable: true, error: 'OpenObserve unavailable: timeout' } as PrometheusStatus['source']
|
|
6
|
+
|
|
7
|
+
describe('metrics connection state', () => {
|
|
8
|
+
// Older Radar reports a down OpenObserve relay as connected; newer as not.
|
|
9
|
+
it.each([true, false])('never says Connected while OpenObserve is down (connected=%s)', (connected) => {
|
|
10
|
+
const status = { connected, available: connected, address: 'OpenObserve https://oo.example', source: down } as PrometheusStatus
|
|
11
|
+
expect(metricsSourceUnavailable(status)).toBe(true)
|
|
12
|
+
expect(hasPrometheusCharts(status)).toBe(false)
|
|
13
|
+
expect(metricsConnectionLabel(status)).toBe('OpenObserve unavailable')
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
it('keeps the usual labels otherwise', () => {
|
|
17
|
+
expect(metricsConnectionLabel(undefined)).toBe('Checking…')
|
|
18
|
+
expect(metricsConnectionLabel({ connected: true } as PrometheusStatus)).toBe('Connected')
|
|
19
|
+
expect(metricsConnectionLabel({ connected: false, discovering: true } as PrometheusStatus)).toBe('Discovering…')
|
|
20
|
+
expect(metricsConnectionLabel({ connected: false } as PrometheusStatus)).toBe('Not connected')
|
|
21
|
+
expect(hasPrometheusCharts({ connected: true, source: { ...down, unavailable: false } } as PrometheusStatus)).toBe(true)
|
|
22
|
+
})
|
|
23
|
+
})
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { PrometheusStatus } from './client'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Whether the metrics source in use is an OpenObserve connection that can't
|
|
5
|
+
* answer right now. Older Radar reports such a relay as connected, so the
|
|
6
|
+
* source, not `connected`, is what says so.
|
|
7
|
+
*/
|
|
8
|
+
export function metricsSourceUnavailable(status: PrometheusStatus | null | undefined): boolean {
|
|
9
|
+
return status?.source?.kind === 'openobserve' && status.source.unavailable === true
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function hasPrometheusCharts(status: PrometheusStatus | null | undefined): boolean {
|
|
13
|
+
if (metricsSourceUnavailable(status)) return false
|
|
14
|
+
return status?.connected === true || status?.gkeSystemMetrics === true
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** The one-word state Settings shows for the metrics connection. */
|
|
18
|
+
export function metricsConnectionLabel(status: PrometheusStatus | null | undefined): string {
|
|
19
|
+
if (!status) return 'Checking…'
|
|
20
|
+
if (metricsSourceUnavailable(status)) return 'OpenObserve unavailable'
|
|
21
|
+
if (status.connected) return 'Connected'
|
|
22
|
+
if (status.gkeSystemMetrics) return 'GKE system metrics'
|
|
23
|
+
if (status.discovering) return 'Discovering…'
|
|
24
|
+
return 'Not connected'
|
|
25
|
+
}
|
|
@@ -3,8 +3,8 @@ import { act, useEffect } from 'react'
|
|
|
3
3
|
import { createRoot } from 'react-dom/client'
|
|
4
4
|
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
|
|
5
5
|
import { afterEach, beforeEach, expect, it, vi } from 'vitest'
|
|
6
|
-
import { getRadarUpgradeRequirement } from '@skyhook-io/k8s-ui'
|
|
7
|
-
import { ApiError, isNotFoundError, useApplications, useCapacityPoolDetail, useDrainPlan, useNodeRemovalPlan, usePodEnvironment, useRadarFeature, useSubjectIssues, useWorkloadHistory } from './client'
|
|
6
|
+
import { getRadarUpgradeRequirement, ResourceActionsBar } from '@skyhook-io/k8s-ui'
|
|
7
|
+
import { ApiError, isNotFoundError, useApplications, useCapacityPoolDetail, useDrainPlan, useNodeRemovalPlan, usePodEnvironment, useRadarFeature, useRestartWorkload, useSubjectIssues, useWorkloadHistory } from './client'
|
|
8
8
|
import { getApiBase } from './config'
|
|
9
9
|
import { usePolicyResource } from './policy'
|
|
10
10
|
import { isRadarFeatureUnsupported } from './radarFeatures'
|
|
@@ -62,6 +62,47 @@ async function settle() {
|
|
|
62
62
|
|
|
63
63
|
const asked = (suffix: string) => requested.some((url) => url.includes(suffix))
|
|
64
64
|
|
|
65
|
+
function WorkloadRestart({ uid }: { uid?: string }) {
|
|
66
|
+
const restart = useRestartWorkload()
|
|
67
|
+
const target = { kind: 'statefulsets', namespace: 'shop', name: 'orders' }
|
|
68
|
+
return <>
|
|
69
|
+
<ResourceActionsBar
|
|
70
|
+
resource={target}
|
|
71
|
+
data={{ apiVersion: 'apps/v1', metadata: { uid, resourceVersion: '42' } }}
|
|
72
|
+
onRestart={params => restart.mutate(params)}
|
|
73
|
+
/>
|
|
74
|
+
{restart.error?.message}
|
|
75
|
+
</>
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
it.each([
|
|
79
|
+
{ features: { workloadRestartPreconditions: true }, body: '{"uid":"reviewed-uid"}' },
|
|
80
|
+
{ features: { workloadRestartPreconditions: false }, body: undefined },
|
|
81
|
+
{ features: {}, body: undefined },
|
|
82
|
+
])('sends the single Restart body for $features', async ({ features, body }) => {
|
|
83
|
+
client.setQueryData(['capabilities'], { features })
|
|
84
|
+
client.setQueryData(['version-check', getApiBase()], {})
|
|
85
|
+
vi.mocked(fetch).mockResolvedValue(Response.json({}))
|
|
86
|
+
await render(<WorkloadRestart uid="reviewed-uid" />)
|
|
87
|
+
await act(async () => { element.querySelector('button')!.click() })
|
|
88
|
+
expect(fetch).toHaveBeenCalledTimes(1)
|
|
89
|
+
const [url, init] = vi.mocked(fetch).mock.calls[0]
|
|
90
|
+
expect(url).toBe(`${getApiBase()}/workloads/statefulsets/shop/orders/restart`)
|
|
91
|
+
expect(init?.method).toBe('POST')
|
|
92
|
+
expect(init?.body).toBe(body)
|
|
93
|
+
})
|
|
94
|
+
|
|
95
|
+
it.each([
|
|
96
|
+
{ capabilities: undefined, uid: 'reviewed-uid', reason: 'has not been confirmed' },
|
|
97
|
+
{ capabilities: { features: { workloadRestartPreconditions: true } }, uid: undefined, reason: 'UID is unavailable' },
|
|
98
|
+
])('refuses an unverified single Restart when $reason', async ({ capabilities, uid, reason }) => {
|
|
99
|
+
client.setQueryData(['capabilities'], capabilities)
|
|
100
|
+
await render(<WorkloadRestart uid={uid} />)
|
|
101
|
+
await act(async () => { element.querySelector('button')!.click() })
|
|
102
|
+
await vi.waitFor(() => expect(element.textContent).toContain(reason))
|
|
103
|
+
expect(asked('/restart')).toBe(false)
|
|
104
|
+
})
|
|
105
|
+
|
|
65
106
|
function Environment() {
|
|
66
107
|
const { data, error } = usePodEnvironment('shop', 'web')
|
|
67
108
|
return <span>{data ? 'data' : getRadarUpgradeRequirement(error) ? 'upgrade' : 'pending'}</span>
|
|
@@ -20,6 +20,13 @@ describe('radarFeatureSupport', () => {
|
|
|
20
20
|
expect(radarFeatureSupport('searchEventContent', { features: { searchEventContent: true } }, 'v1.0.0')).toBe('supported')
|
|
21
21
|
expect(radarFeatureSupport('searchEventContent', undefined, 'dev')).toBe('unknown')
|
|
22
22
|
})
|
|
23
|
+
it('requires affirmative capability support for restart preconditions', () => {
|
|
24
|
+
const feature = 'workloadRestartPreconditions'
|
|
25
|
+
expect(radarFeatureSupport(feature, { features: { workloadRestartPreconditions: true } }, undefined)).toBe('supported')
|
|
26
|
+
expect(radarFeatureSupport(feature, { features: {} }, 'v99.0.0')).toBe('unsupported')
|
|
27
|
+
expect(radarFeatureSupport(feature, undefined, 'v99.0.0')).toBe('unknown')
|
|
28
|
+
})
|
|
29
|
+
|
|
23
30
|
it('trusts the advertised flag over the version', () => {
|
|
24
31
|
expect(radarFeatureSupport('policyResource', { features: { policyResource: true } }, 'v1.7.2')).toBe('supported')
|
|
25
32
|
expect(radarFeatureSupport('policyResource', { features: { policyResource: true } }, undefined)).toBe('supported')
|
|
@@ -111,6 +118,16 @@ describe('radarSpecSupport for a feature whose flag shipped with its endpoint',
|
|
|
111
118
|
describe('guardRadarFeature', () => {
|
|
112
119
|
const versions = { currentVersion: 'v1.7.2', latestVersion: 'v1.15.0' }
|
|
113
120
|
|
|
121
|
+
it.each(['workloadRestartPreconditions', 'argoRollback', 'argoAutoSyncEnable', 'datadogRightsizing', 'replicaSetLogs', 'substrateHealthMetrics'] as const)(
|
|
122
|
+
'sends a request for %s only after support is confirmed', async feature => {
|
|
123
|
+
const request = vi.fn(async () => 'ok')
|
|
124
|
+
await expect(guardRadarFeature(feature, 'unknown', versions, request)).rejects.toThrow(/not been confirmed/)
|
|
125
|
+
expect(request).not.toHaveBeenCalled()
|
|
126
|
+
await expect(guardRadarFeature(feature, 'supported', versions, request)).resolves.toBe('ok')
|
|
127
|
+
expect(request).toHaveBeenCalledTimes(1)
|
|
128
|
+
},
|
|
129
|
+
)
|
|
130
|
+
|
|
114
131
|
it('never asks a Radar known to be too old', async () => {
|
|
115
132
|
const request = vi.fn(() => Promise.resolve('data'))
|
|
116
133
|
await expect(guardRadarFeature('policyResource', 'unsupported', versions, request))
|
|
@@ -171,7 +188,7 @@ describe('shouldRetryRadarQuery', () => {
|
|
|
171
188
|
})
|
|
172
189
|
|
|
173
190
|
describe('affirmative mutation support', () => {
|
|
174
|
-
it.each(['argoRollback', 'argoAutoSyncEnable'] as const)('%s distinguishes checking, failed and known answers', feature => {
|
|
191
|
+
it.each(['argoRollback', 'argoAutoSyncEnable', 'workloadRestartPreconditions'] as const)('%s distinguishes checking, failed and known answers', feature => {
|
|
175
192
|
expect(radarControlBlockedReason(feature, 'unknown', false)).toBe("Checking this cluster's Radar…")
|
|
176
193
|
expect(radarControlBlockedReason(feature, 'unknown', true)).toBe("Couldn't check this cluster's Radar support. Refresh to try again.")
|
|
177
194
|
expect(radarControlBlockedReason(feature, 'supported', false)).toBeUndefined()
|
package/src/api/radarFeatures.ts
CHANGED
|
@@ -32,17 +32,24 @@ export interface RadarFeatureSpec {
|
|
|
32
32
|
export const RADAR_FEATURES = {
|
|
33
33
|
datadogRightsizing: { label: 'Datadog-backed rightsizing', flag: 'datadogRightsizing', flagShippedWithEndpoint: true, requireAffirmativeSupport: true },
|
|
34
34
|
datadogAgentPresence: { label: 'Datadog Agent setup hints', flag: 'datadogAgentPresence', flagShippedWithEndpoint: true },
|
|
35
|
+
gitopsActionCapabilities: { label: 'GitOps action permission checks', flag: 'gitopsActionCapabilities', flagShippedWithEndpoint: true },
|
|
36
|
+
openobserveCollectorPresence: { label: 'OpenObserve collector setup hints', flag: 'openobserveCollectorPresence', flagShippedWithEndpoint: true },
|
|
37
|
+
openobserveLocalSetup: { label: 'OpenObserve connections in Settings', flag: 'openobserveLocalSetup', flagShippedWithEndpoint: true },
|
|
35
38
|
resourceReadCoverage: { label: 'Resource read coverage', flag: 'resourceReadCoverage', flagShippedWithEndpoint: true },
|
|
36
39
|
searchCoverage: { label: 'Search coverage and object filters', flag: 'searchCoverage', flagShippedWithEndpoint: true },
|
|
37
40
|
applicationEvidence: { label: 'Application evidence collection', flag: 'applicationEvidence', flagShippedWithEndpoint: true },
|
|
38
41
|
searchEventContent: { label: 'Event reason and message searches', flag: 'searchEventContent', flagShippedWithEndpoint: true },
|
|
39
42
|
resourceIssues: { label: 'Operational issues', minimumVersion: 'v1.8.0', flag: 'resourceIssues' },
|
|
40
43
|
resourceIssueCoverage: { label: 'Resource-specific issue views', flag: 'resourceIssueCoverage', flagShippedWithEndpoint: true },
|
|
44
|
+
// An older Radar serves the route and ignores ?correlate=.
|
|
45
|
+
issueCorrelation: { label: 'Recent changes on an issue', flag: 'issueCorrelation', flagShippedWithEndpoint: true },
|
|
46
|
+
podDebugAccess: { label: 'Pod debug access', flag: 'podDebugAccess', flagShippedWithEndpoint: true, requireAffirmativeSupport: true },
|
|
41
47
|
podEnvironment: { label: 'Values from ConfigMaps and Secrets', minimumVersion: 'v1.9.0', flag: 'podEnvironment' },
|
|
42
48
|
policyResource: { label: 'Policy results', minimumVersion: 'v1.10.0', flag: 'policyResource' },
|
|
43
49
|
capacity: { label: 'Capacity views', minimumVersion: 'v1.9.0' },
|
|
44
50
|
// Radars from v1.15.0 serve the route without advertising the flag.
|
|
45
51
|
rayClusterPods: { label: 'RayCluster runtime Pods', minimumVersion: 'v1.15.0', flag: 'rayClusterPods' },
|
|
52
|
+
replicaSetLogs: { label: 'Combined ReplicaSet logs', flag: 'replicaSetLogs', flagShippedWithEndpoint: true, requireAffirmativeSupport: true },
|
|
46
53
|
upgradeReadiness: { label: 'Upgrade impact reports', minimumVersion: 'v1.9.0' },
|
|
47
54
|
drainPlan: { label: 'Drain plans', minimumVersion: 'v1.14.0' },
|
|
48
55
|
applications: { label: 'Applications', minimumVersion: 'v1.7.7' },
|
|
@@ -52,6 +59,8 @@ export const RADAR_FEATURES = {
|
|
|
52
59
|
cnpgWorkspace: { label: 'CloudNativePG views', flag: 'cnpgWorkspace', flagShippedWithEndpoint: true },
|
|
53
60
|
sealedSecretsController: { label: 'Sealed Secrets controller status', flag: 'sealedSecretsController', flagShippedWithEndpoint: true },
|
|
54
61
|
sealedSecretsCert: { label: 'Sealed Secrets sealing certificate', flag: 'sealedSecretsCert', flagShippedWithEndpoint: true },
|
|
62
|
+
workflowStop: { label: 'Argo Workflow stop actions', flag: 'workflowStop', flagShippedWithEndpoint: true },
|
|
63
|
+
workflowTemplateSubmit: { label: 'Argo WorkflowTemplate submissions', flag: 'workflowTemplateSubmit', flagShippedWithEndpoint: true },
|
|
55
64
|
cnpgProtectionSetup: { label: 'CloudNativePG backup setup', flag: 'cnpgProtectionSetup', flagShippedWithEndpoint: true },
|
|
56
65
|
veleroWorkspace: { label: 'Velero views', flag: 'veleroWorkspace', flagShippedWithEndpoint: true },
|
|
57
66
|
veleroBackupNow: { label: 'Back up now', flag: 'veleroBackupNow', flagShippedWithEndpoint: true },
|
|
@@ -60,6 +69,7 @@ export const RADAR_FEATURES = {
|
|
|
60
69
|
veleroRunArtifacts: { label: 'Velero run contents and log', flag: 'veleroRunArtifacts', flagShippedWithEndpoint: true },
|
|
61
70
|
veleroRuns: { label: 'Velero backup and restore lists', flag: 'veleroRuns', flagShippedWithEndpoint: true },
|
|
62
71
|
veleroDeleteBackup: { label: 'Delete a Velero backup', flag: 'veleroDeleteBackup', flagShippedWithEndpoint: true },
|
|
72
|
+
workloadRestartPreconditions: { label: 'Reviewed workload restarts', flag: 'workloadRestartPreconditions', flagShippedWithEndpoint: true, requireAffirmativeSupport: true },
|
|
63
73
|
resourceDeletePreconditions: { label: 'Delete only the object you reviewed', flag: 'resourceDeletePreconditions', flagShippedWithEndpoint: true },
|
|
64
74
|
gitopsWriteEvidence: { label: 'GitOps revert warnings', flag: 'gitopsWriteEvidence', flagShippedWithEndpoint: true },
|
|
65
75
|
serviceEndpointSlices: { label: 'Service EndpointSlice inventories', flag: 'serviceEndpointSlices', flagShippedWithEndpoint: true },
|
|
@@ -185,10 +195,9 @@ export function isRadarFeatureUnsupported(error: unknown, feature?: RadarFeature
|
|
|
185
195
|
}
|
|
186
196
|
|
|
187
197
|
/**
|
|
188
|
-
*
|
|
189
|
-
*
|
|
190
|
-
*
|
|
191
|
-
* is a routing failure and stays an error.
|
|
198
|
+
* A request requiring affirmative support can run once support is confirmed.
|
|
199
|
+
* For features that allow probing, chi's unknown-route 404 on a probe means
|
|
200
|
+
* the feature is unsupported. With confirmed support it signals a routing error.
|
|
192
201
|
*/
|
|
193
202
|
export async function guardRadarFeature<T>(
|
|
194
203
|
feature: RadarFeature,
|
|
@@ -197,6 +206,10 @@ export async function guardRadarFeature<T>(
|
|
|
197
206
|
request: () => Promise<T>,
|
|
198
207
|
): Promise<T> {
|
|
199
208
|
if (support === 'unsupported') throw new RadarFeatureUnsupportedError(feature, versions)
|
|
209
|
+
const spec: RadarFeatureSpec = RADAR_FEATURES[feature]
|
|
210
|
+
if (support === 'unknown' && spec.requireAffirmativeSupport) {
|
|
211
|
+
throw new Error(`Radar support for ${spec.label} has not been confirmed`)
|
|
212
|
+
}
|
|
200
213
|
try {
|
|
201
214
|
return await request()
|
|
202
215
|
} catch (error) {
|
|
@@ -15,6 +15,7 @@ export function useReviewedActionMutation<Data, Variables extends { request: { r
|
|
|
15
15
|
target: string,
|
|
16
16
|
reviewedContext: string | undefined,
|
|
17
17
|
options: Omit<UseMutationOptions<Data, Error, Variables>, 'mutationFn' | 'mutationKey'> & { mutationFn: MutationFunction<Data, Variables> },
|
|
18
|
+
recoveryInstruction = 'Inspect the current state, then reload this page and review the action again.',
|
|
18
19
|
) {
|
|
19
20
|
const client = useQueryClient()
|
|
20
21
|
let store = stores.get(client)
|
|
@@ -53,7 +54,7 @@ export function useReviewedActionMutation<Data, Variables extends { request: { r
|
|
|
53
54
|
} catch (error) {
|
|
54
55
|
if (actionOutcomeLocked(error)) {
|
|
55
56
|
const failure = error as Error
|
|
56
|
-
const message =
|
|
57
|
+
const message = [failure.message, recoveryInstruction].filter(Boolean).join(' ')
|
|
57
58
|
retainedError = failure instanceof ApiError ? new ApiError(message, failure.status, failure.data) : new Error(message)
|
|
58
59
|
}
|
|
59
60
|
throw error
|
|
@@ -62,5 +63,11 @@ export function useReviewedActionMutation<Data, Variables extends { request: { r
|
|
|
62
63
|
}
|
|
63
64
|
},
|
|
64
65
|
})
|
|
65
|
-
|
|
66
|
+
const acknowledgeOutcome = () => {
|
|
67
|
+
if (outcomes.entries.get(key)?.error) {
|
|
68
|
+
publish(key, EMPTY)
|
|
69
|
+
mutation.reset()
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return { ...mutation, isPending: mutation.isPending || retained.pending, outcomeError: retained.error, acknowledgeOutcome }
|
|
66
73
|
}
|
|
@@ -8,6 +8,7 @@ export type WorkloadMetricState =
|
|
|
8
8
|
export type WorkloadRequestSource = "beyla" | "istio";
|
|
9
9
|
|
|
10
10
|
export interface WorkloadMetricPanel {
|
|
11
|
+
source?: "gke";
|
|
11
12
|
state: WorkloadMetricState;
|
|
12
13
|
reason?: string;
|
|
13
14
|
unit: string;
|
|
@@ -15,6 +16,7 @@ export interface WorkloadMetricPanel {
|
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
export interface WorkloadMetrics {
|
|
19
|
+
resourceSource?: "gke";
|
|
18
20
|
history: Partial<Record<"cpu" | "memory" | "throttling" | "requests", { mode: "workload-history" | "current-pods" | "unavailable"; reason?: string }>>;
|
|
19
21
|
comparison: Partial<Record<"cpu" | "memory" | "throttling", WorkloadMetricPanel>>;
|
|
20
22
|
scopeNotice?: string;
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
// @vitest-environment jsdom
|
|
2
2
|
import { act, useEffect } from 'react'
|
|
3
3
|
import { createRoot } from 'react-dom/client'
|
|
4
|
-
import { MemoryRouter, useLocation } from 'react-router-dom'
|
|
4
|
+
import { MemoryRouter, useLocation, useNavigationType } from 'react-router-dom'
|
|
5
5
|
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
|
|
6
6
|
import { afterEach, beforeEach, expect, it, vi } from 'vitest'
|
|
7
|
-
import { ToastProvider, type AppRow, type AppWorkload, type SelectedResource } from '@skyhook-io/k8s-ui'
|
|
7
|
+
import { ToastProvider, workloadKey, type AppHistory, type AppRow, type AppWorkload, type SelectedResource } from '@skyhook-io/k8s-ui'
|
|
8
8
|
import { ApplicationsView } from './ApplicationsView'
|
|
9
9
|
|
|
10
10
|
let apps: AppRow[] = []
|
|
11
|
-
const idle = { data: undefined, isLoading: false, isError: false, error: null }
|
|
11
|
+
const idle = { data: undefined, isLoading: false, isFetching: false, isPending: false, isSuccess: false, isError: false, error: null }
|
|
12
|
+
let history: Omit<typeof idle, 'data'> & { data?: AppHistory }
|
|
12
13
|
|
|
13
14
|
vi.mock('../../api/client', () => ({
|
|
14
15
|
useApplications: () => ({ ...idle, data: { applications: apps }, isSuccess: true, dataUpdatedAt: 0, refetch: () => {} }),
|
|
15
|
-
useApplicationHistory: () =>
|
|
16
|
+
useApplicationHistory: () => history,
|
|
16
17
|
useGitOpsTree: () => idle,
|
|
17
18
|
useHelmRelease: () => idle,
|
|
18
19
|
useIssues: () => idle,
|
|
@@ -46,18 +47,20 @@ let root: ReturnType<typeof createRoot>
|
|
|
46
47
|
let container: HTMLDivElement
|
|
47
48
|
let client: QueryClient
|
|
48
49
|
let location = ''
|
|
50
|
+
let navigationType: ReturnType<typeof useNavigationType>
|
|
49
51
|
|
|
50
|
-
function
|
|
51
|
-
location = next
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
function LocationProbe({ onChange }: { onChange: (location: string) => void }) {
|
|
52
|
+
function LocationProbe() {
|
|
55
53
|
const loc = useLocation()
|
|
56
|
-
|
|
54
|
+
const action = useNavigationType()
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
location = `${loc.pathname}${loc.search}`
|
|
57
|
+
navigationType = action
|
|
58
|
+
}, [loc, action])
|
|
57
59
|
return null
|
|
58
60
|
}
|
|
59
61
|
|
|
60
62
|
beforeEach(() => {
|
|
63
|
+
history = idle
|
|
61
64
|
vi.stubGlobal('matchMedia', () => ({ matches: false, addEventListener: () => {}, removeEventListener: () => {} }))
|
|
62
65
|
container = document.createElement('div')
|
|
63
66
|
document.body.appendChild(container)
|
|
@@ -80,7 +83,7 @@ async function renderAt(url: string, onOpenResource = vi.fn()) {
|
|
|
80
83
|
<ToastProvider>
|
|
81
84
|
<MemoryRouter initialEntries={[url]}>
|
|
82
85
|
<ApplicationsView namespaces={[]} onOpenResource={onOpenResource} />
|
|
83
|
-
<LocationProbe
|
|
86
|
+
<LocationProbe />
|
|
84
87
|
</MemoryRouter>
|
|
85
88
|
</ToastProvider>
|
|
86
89
|
</QueryClientProvider>,
|
|
@@ -116,3 +119,126 @@ it('keeps the API group, namespace filter and open investigation when opening an
|
|
|
116
119
|
expect(url.searchParams.get('namespaces')).toBe('shop')
|
|
117
120
|
expect(url.searchParams.get('ai-run')).toBe('run-1')
|
|
118
121
|
})
|
|
122
|
+
|
|
123
|
+
it.each(['initial fetch', 'background refresh'])('keeps a single-workload Deploys link during %s', async (phase) => {
|
|
124
|
+
apps = [app('shop/Deployment/web', ['web'])]
|
|
125
|
+
const initial = phase === 'initial fetch'
|
|
126
|
+
history = { ...idle, isFetching: true, isLoading: initial, isPending: initial, isSuccess: !initial, data: initial ? undefined : { appKey: apps[0].key } }
|
|
127
|
+
const url = '/applications?app=shop%2FDeployment%2Fweb&view=deploys&namespaces=shop'
|
|
128
|
+
await renderAt(url)
|
|
129
|
+
expect(new URLSearchParams(location.split('?')[1]).get('view')).toBe('deploys')
|
|
130
|
+
expect(container.querySelector('[data-testid="workload-view"]')).toBeNull()
|
|
131
|
+
|
|
132
|
+
history = { ...idle, isSuccess: true, data: { appKey: apps[0].key, sourceRef: { type: 'helm', kind: 'HelmRelease', namespace: 'shop', name: 'web' } } }
|
|
133
|
+
await renderAt(url)
|
|
134
|
+
const params = new URLSearchParams(location.split('?')[1])
|
|
135
|
+
expect(params.get('view')).toBeNull()
|
|
136
|
+
expect(params.get('tab')).toBe('deploys')
|
|
137
|
+
expect(params.get('workload')).toBe(workloadKey(deployment('web')))
|
|
138
|
+
expect(params.get('namespaces')).toBe('shop')
|
|
139
|
+
expect(container.querySelector('[data-testid="workload-view"]')).not.toBeNull()
|
|
140
|
+
})
|
|
141
|
+
|
|
142
|
+
it('keeps app Deploys after clearing a stale workload, and drops Deploys from a valid child workload', async () => {
|
|
143
|
+
apps = [{ ...app('shop/web', ['web', 'worker']), sourceRef: { type: 'helm', kind: 'HelmRelease', namespace: 'shop', name: 'web' } }]
|
|
144
|
+
await renderAt('/applications?app=shop%2Fweb&view=&tab=deploys&workload=stale')
|
|
145
|
+
let params = new URLSearchParams(location.split('?')[1])
|
|
146
|
+
expect(params.get('workload')).toBeNull()
|
|
147
|
+
expect(params.get('tab')).toBeNull()
|
|
148
|
+
expect(params.get('view')).toBe('deploys')
|
|
149
|
+
expect(container.textContent).toContain('Recorded deliveries')
|
|
150
|
+
|
|
151
|
+
await act(async () => root.unmount())
|
|
152
|
+
root = createRoot(container)
|
|
153
|
+
const child = workloadKey(deployment('worker'))
|
|
154
|
+
await renderAt(`/applications?app=shop%2Fweb&view=deploys&workload=${encodeURIComponent(child)}`)
|
|
155
|
+
params = new URLSearchParams(location.split('?')[1])
|
|
156
|
+
expect(params.get('workload')).toBe(child)
|
|
157
|
+
expect(params.get('view')).toBeNull()
|
|
158
|
+
expect(container.textContent).not.toContain('Recorded deliveries')
|
|
159
|
+
})
|
|
160
|
+
|
|
161
|
+
it('replaces a tab-only Deploys link with the app view once the source is known', async () => {
|
|
162
|
+
apps = [app('shop/web', ['web', 'worker'])]
|
|
163
|
+
const url = '/applications?app=shop%2Fweb&tab=deploys&namespaces=shop'
|
|
164
|
+
history = { ...idle, isFetching: true, isPending: true, isLoading: true }
|
|
165
|
+
await renderAt(url)
|
|
166
|
+
expect(location).toBe(url)
|
|
167
|
+
expect(container.querySelector('[role="tab"][aria-selected="true"]')).toBeNull()
|
|
168
|
+
|
|
169
|
+
history = { ...idle, isSuccess: true, data: {
|
|
170
|
+
appKey: apps[0].key,
|
|
171
|
+
sourceRef: { type: 'helm', kind: 'HelmRelease', namespace: 'shop', name: 'web' },
|
|
172
|
+
} }
|
|
173
|
+
await renderAt(url)
|
|
174
|
+
const params = new URLSearchParams(location.split('?')[1])
|
|
175
|
+
expect(params.get('view')).toBe('deploys')
|
|
176
|
+
expect(params.has('tab')).toBe(false)
|
|
177
|
+
expect(params.get('namespaces')).toBe('shop')
|
|
178
|
+
expect(navigationType).toBe('REPLACE')
|
|
179
|
+
expect(container.querySelector('[role="tab"][aria-selected="true"]')?.textContent).toBe('Deploys')
|
|
180
|
+
expect(container.textContent).toContain('Recorded deliveries')
|
|
181
|
+
})
|
|
182
|
+
|
|
183
|
+
it.each([false, true])('resolves a group-less Deploys workload link (ambiguous: %s)', async (ambiguous) => {
|
|
184
|
+
const rollout = { ...deployment('api'), kind: 'Rollout', group: 'argoproj.io' }
|
|
185
|
+
apps = [{
|
|
186
|
+
...app('shop/web', []),
|
|
187
|
+
workloads: [rollout, ambiguous ? { ...rollout, group: 'example.io' } : deployment('worker')],
|
|
188
|
+
sourceRef: { type: 'helm', kind: 'HelmRelease', namespace: 'shop', name: 'web' },
|
|
189
|
+
}]
|
|
190
|
+
const child = 'Rollout/shop/api'
|
|
191
|
+
await renderAt(`/applications?app=shop%2Fweb&tab=deploys&workload=${encodeURIComponent(child)}`)
|
|
192
|
+
const params = new URLSearchParams(location.split('?')[1])
|
|
193
|
+
expect(params.has('tab')).toBe(false)
|
|
194
|
+
expect(params.get('workload')).toBe(ambiguous ? null : child)
|
|
195
|
+
expect(params.get('view')).toBe(ambiguous ? 'deploys' : null)
|
|
196
|
+
expect(container.querySelector('[data-testid="workload-view"]')?.getAttribute('data-name')).toBe(ambiguous ? undefined : 'api')
|
|
197
|
+
})
|
|
198
|
+
|
|
199
|
+
it('keeps Deploys on a failed history refresh until a successful response rules out a source', async () => {
|
|
200
|
+
apps = [app('shop/web', ['web', 'worker'])]
|
|
201
|
+
const data: AppHistory = {
|
|
202
|
+
appKey: 'shop/web',
|
|
203
|
+
sourceRef: { type: 'helm', kind: 'HelmRelease', namespace: 'shop', name: 'web' },
|
|
204
|
+
anchors: [{ type: 'helm', title: 'Release promoted', revision: '3', timestamp: '2026-11-23T12:00:00Z' }],
|
|
205
|
+
}
|
|
206
|
+
const url = '/applications?app=shop%2Fweb&view=deploys'
|
|
207
|
+
history = { ...idle, isSuccess: true, data }
|
|
208
|
+
await renderAt(url)
|
|
209
|
+
expect(container.textContent).toContain('Release promoted')
|
|
210
|
+
|
|
211
|
+
history = { ...idle, isError: true, data }
|
|
212
|
+
await renderAt(url)
|
|
213
|
+
expect(new URLSearchParams(location.split('?')[1]).get('view')).toBe('deploys')
|
|
214
|
+
expect(container.querySelector('[role="tab"][aria-selected="true"]')?.textContent).toBe('Deploys')
|
|
215
|
+
expect(container.textContent).toContain('Delivery records could not be refreshed')
|
|
216
|
+
expect(container.textContent).not.toContain('Release promoted')
|
|
217
|
+
|
|
218
|
+
history = { ...idle, isSuccess: true, data: { appKey: data.appKey } }
|
|
219
|
+
await renderAt(url)
|
|
220
|
+
expect(new URLSearchParams(location.split('?')[1]).has('view')).toBe(false)
|
|
221
|
+
expect(container.querySelector('[role="tab"][aria-selected="true"]')?.textContent).toBe('Overview')
|
|
222
|
+
})
|
|
223
|
+
|
|
224
|
+
it('keeps Deploys and explains a partial source lookup until a complete response rules out a source', async () => {
|
|
225
|
+
apps = [app('shop/web', ['web', 'worker'])]
|
|
226
|
+
const appKey = apps[0].key
|
|
227
|
+
const url = '/applications?app=shop%2Fweb&view=deploys'
|
|
228
|
+
const reason = "Deployment-source history is unavailable because you don't have access to this app's deployment source."
|
|
229
|
+
history = { ...idle, isSuccess: true, data: {
|
|
230
|
+
appKey,
|
|
231
|
+
partialSources: [reason],
|
|
232
|
+
anchors: [{ type: 'helm', title: 'Release promoted', revision: '3', timestamp: '2026-11-23T12:00:00Z' }],
|
|
233
|
+
} }
|
|
234
|
+
await renderAt(url)
|
|
235
|
+
expect(location).toBe(url)
|
|
236
|
+
expect(container.querySelector('[role="tab"][aria-selected="true"]')?.textContent).toBe('Deploys')
|
|
237
|
+
expect(container.textContent).toContain(reason)
|
|
238
|
+
expect(container.textContent).not.toContain('Release promoted')
|
|
239
|
+
|
|
240
|
+
history = { ...idle, isSuccess: true, data: { appKey } }
|
|
241
|
+
await renderAt(url)
|
|
242
|
+
expect(new URLSearchParams(location.split('?')[1]).has('view')).toBe(false)
|
|
243
|
+
expect(container.querySelector('[role="tab"][aria-selected="true"]')?.textContent).toBe('Overview')
|
|
244
|
+
})
|