@skyhook-io/radar-app 1.22.2 → 1.23.0
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/package.json +8 -8
- package/src/App.tsx +35 -10
- package/src/RadarApp.basename.test.tsx +177 -0
- package/src/RadarApp.settings.test.tsx +33 -0
- package/src/api/agentSandbox.ts +259 -0
- package/src/api/client.autoPromConnect.test.tsx +43 -0
- package/src/api/client.metricsRelayCheck.test.tsx +134 -0
- package/src/api/client.ts +122 -24
- package/src/api/cloudInstallDiscover.test.tsx +76 -0
- package/src/api/diagnose.ts +4 -0
- package/src/api/kagent.test.ts +82 -0
- package/src/api/kagent.ts +230 -0
- package/src/api/prometheusCharts.ts +5 -0
- package/src/api/radarFeatures.test.ts +9 -0
- package/src/api/radarFeatures.ts +13 -0
- package/src/api/substrateWorkspace.test.ts +72 -0
- package/src/api/substrateWorkspace.ts +1394 -0
- package/src/api/vulnerabilities.ts +207 -9
- package/src/api/workloadSource.test.tsx +315 -0
- package/src/api/workloadSource.ts +128 -12
- package/src/components/CloudConnectFlow.tsx +46 -7
- package/src/components/CloudFunnelButton.test.tsx +193 -7
- package/src/components/CloudFunnelButton.tsx +127 -32
- package/src/components/SelfManagedStart.tsx +12 -2
- package/src/components/agentsandbox/AgentSandboxKindLists.tsx +41 -0
- package/src/components/agentsandbox/AgentSandboxLists.test.tsx +410 -0
- package/src/components/agentsandbox/AgentSandboxOverview.test.tsx +333 -0
- package/src/components/agentsandbox/AgentSandboxOverview.tsx +555 -0
- package/src/components/agentsandbox/AgentSandboxSidebar.test.tsx +97 -0
- package/src/components/agentsandbox/AgentSandboxSummary.test.tsx +439 -0
- package/src/components/agentsandbox/AgentSandboxSummary.tsx +956 -0
- package/src/components/agentsandbox/AgentSandboxTables.tsx +966 -0
- package/src/components/agentsandbox/AgentSandboxView.tsx +34 -0
- package/src/components/agentsandbox/agentsandbox.fixtures.ts +135 -0
- package/src/components/agentsandbox/data.ts +135 -0
- package/src/components/agentsandbox/host.test.ts +27 -0
- package/src/components/agentsandbox/host.tsx +85 -0
- package/src/components/agentsandbox/labels.test.ts +42 -0
- package/src/components/agentsandbox/labels.ts +146 -0
- package/src/components/agentsandbox/listFilters.ts +85 -0
- package/src/components/agentsandbox/lists.ts +52 -0
- package/src/components/agentsandbox/routes.ts +23 -0
- package/src/components/agentsandbox/shared.tsx +321 -0
- package/src/components/agentsandbox/useAgentSandboxSidebarWorkspace.ts +69 -0
- package/src/components/agentsandbox/workspace.fixtures.ts +125 -0
- package/src/components/agentsandbox/workspace.tsx +258 -0
- package/src/components/agentsandbox/workspaceRoute.ts +18 -0
- package/src/components/applications/ApplicationsView.openResource.test.tsx +248 -3
- package/src/components/applications/ApplicationsView.tsx +156 -3
- package/src/components/audit/VulnerabilitiesColumns.test.tsx +487 -0
- package/src/components/audit/VulnerabilitiesRisk.test.tsx +318 -0
- package/src/components/audit/VulnerabilitiesView.test.tsx +458 -13
- package/src/components/audit/VulnerabilitiesView.tsx +639 -199
- package/src/components/cloudHints/AgentSetupCloudRow.tsx +28 -0
- package/src/components/cloudHints/CloudHintLink.tsx +29 -0
- package/src/components/cloudHints/SharedInstallAiLine.tsx +36 -0
- package/src/components/cloudHints/cloudHints.test.ts +126 -0
- package/src/components/cloudHints/cloudHints.ts +131 -0
- package/src/components/cloudHints/cloudHintsGate.test.tsx +70 -0
- package/src/components/cloudHints/cloudLinks.test.ts +52 -0
- package/src/components/cloudHints/cloudLinks.ts +31 -0
- package/src/components/cloudHints/hintStorage.ts +28 -0
- package/src/components/cnpg/CNPGView.tsx +4 -7
- package/src/components/diagnose/AgentSetupNotice.tsx +5 -0
- package/src/components/diagnose/DiagnoseContext.tsx +7 -0
- package/src/components/diagnose/DiagnoseSurface.escape.test.tsx +215 -0
- package/src/components/diagnose/DiagnoseSurface.tsx +57 -1
- package/src/components/gitops/RemoteDestinationCloudHint.tsx +6 -14
- package/src/components/home/HomeAgentBlock.tsx +2 -0
- package/src/components/home/HomeView.tsx +3 -3
- package/src/components/home/MCPSetupDialog.test.tsx +9 -0
- package/src/components/home/MCPSetupDialog.tsx +6 -2
- package/src/components/home/McpCloudLine.test.tsx +162 -0
- package/src/components/home/McpCloudLine.tsx +95 -0
- package/src/components/home/ProblemsPanel.investigate.test.tsx +2 -2
- package/src/components/home/mcpToolCatalog.test.ts +10 -0
- package/src/components/home/mcpToolCatalog.ts +4 -4
- package/src/components/issues/ClusterSchedulingBlockerRow.tsx +35 -0
- package/src/components/issues/IssuesPane.render.test.tsx +36 -1
- package/src/components/issues/IssuesPane.tsx +181 -23
- package/src/components/issues/SinceLastVisitRow.render.test.tsx +302 -0
- package/src/components/issues/SinceLastVisitRow.tsx +71 -0
- package/src/components/issues/sinceLastVisit.test.ts +266 -0
- package/src/components/issues/sinceLastVisit.ts +439 -0
- package/src/components/kagent/KagentAgentRenderer.test.ts +32 -0
- package/src/components/kagent/KagentAgentRenderer.tsx +87 -0
- package/src/components/kagent/KagentAgentSessions.test.tsx +166 -0
- package/src/components/kagent/KagentAgentSessions.tsx +124 -0
- package/src/components/kagent/KagentDetailPage.tsx +106 -0
- package/src/components/kagent/KagentLists.tsx +412 -0
- package/src/components/kagent/KagentOverview.tsx +234 -0
- package/src/components/kagent/KagentPages.tsx +690 -0
- package/src/components/kagent/KagentRuntimeTabs.test.tsx +219 -0
- package/src/components/kagent/KagentRuntimeTabs.tsx +283 -0
- package/src/components/kagent/KagentSidebar.test.tsx +112 -0
- package/src/components/kagent/KagentView.tsx +109 -0
- package/src/components/kagent/KagentWorkspace.test.tsx +876 -0
- package/src/components/kagent/host.tsx +144 -0
- package/src/components/kagent/routes.ts +31 -0
- package/src/components/kagent/shared.tsx +336 -0
- package/src/components/kagent/useKagentRuntime.test.tsx +77 -0
- package/src/components/kagent/useKagentSidebarWorkspace.ts +67 -0
- package/src/components/kagent/workspace.fixtures.ts +108 -0
- package/src/components/kagent/workspaceRoute.ts +18 -0
- package/src/components/resource/MetricsNotConnected.test.tsx +28 -0
- package/src/components/resource/MetricsNotConnected.tsx +10 -7
- package/src/components/resource/PrometheusCharts.tsx +10 -1
- package/src/components/resource/PrometheusChartsGrid.render.test.tsx +9 -0
- package/src/components/resource/PrometheusChartsGrid.tsx +3 -3
- package/src/components/resource/SubstrateHealthCharts.test.tsx +13 -1
- package/src/components/resource/SubstrateHealthCharts.tsx +9 -15
- package/src/components/resources/ResourceDetailDrawer.tsx +1 -0
- package/src/components/resources/ResourcesView.tsx +2 -6
- package/src/components/resources/renderers/PodRenderer.tsx +8 -2
- package/src/components/settings/LocalIntegrationStatus.test.tsx +1 -0
- package/src/components/settings/LocalIntegrationStatus.tsx +3 -2
- package/src/components/settings/SettingsDialog.tsx +84 -16
- package/src/components/settings/SubstrateSettings.lifecycle.test.tsx +210 -0
- package/src/components/settings/SubstrateSettings.test.tsx +131 -0
- package/src/components/settings/SubstrateSettings.tsx +544 -0
- package/src/components/settings/settings-state.test.ts +21 -3
- package/src/components/settings/settings-state.ts +13 -3
- package/src/components/share/ShareLinkButton.test.tsx +360 -0
- package/src/components/share/ShareLinkButton.tsx +391 -0
- package/src/components/share/openShareInCloud.test.ts +29 -0
- package/src/components/share/openShareInCloud.ts +10 -0
- package/src/components/share/shareLink.test.ts +129 -0
- package/src/components/share/shareLink.ts +175 -0
- package/src/components/substrate/SubstrateActorDrawer.tsx +87 -0
- package/src/components/substrate/SubstrateActorOverview.tsx +489 -0
- package/src/components/substrate/SubstrateActorPage.tsx +384 -0
- package/src/components/substrate/SubstrateActors.test.tsx +1094 -0
- package/src/components/substrate/SubstrateActors.tsx +612 -0
- package/src/components/substrate/SubstrateAttentionList.tsx +441 -0
- package/src/components/substrate/SubstrateConnect.tsx +88 -0
- package/src/components/substrate/SubstrateOverview.test.tsx +396 -0
- package/src/components/substrate/SubstrateOverview.tsx +575 -0
- package/src/components/substrate/SubstratePages.test.tsx +478 -0
- package/src/components/substrate/SubstratePool.test.tsx +462 -0
- package/src/components/substrate/SubstratePoolPage.tsx +95 -0
- package/src/components/substrate/SubstratePoolSummary.tsx +485 -0
- package/src/components/substrate/SubstrateSidebar.test.tsx +101 -0
- package/src/components/substrate/SubstrateStateBar.tsx +63 -0
- package/src/components/substrate/SubstrateTemplates.tsx +376 -0
- package/src/components/substrate/SubstrateView.tsx +173 -0
- package/src/components/substrate/SubstrateWorkerPodContext.tsx +73 -0
- package/src/components/substrate/SubstrateWorkers.tsx +389 -0
- package/src/components/substrate/attention.ts +81 -0
- package/src/components/substrate/contextPin.tsx +69 -0
- package/src/components/substrate/host.tsx +83 -0
- package/src/components/substrate/kubectlTarget.test.tsx +77 -0
- package/src/components/substrate/readings.test.ts +484 -0
- package/src/components/substrate/readings.ts +997 -0
- package/src/components/substrate/routes.ts +103 -0
- package/src/components/substrate/shared.tsx +426 -0
- package/src/components/substrate/substrate.fixtures.ts +325 -0
- package/src/components/substrate/useSubstrateSidebarWorkspace.ts +87 -0
- package/src/components/substrate/workspaceRoute.ts +23 -0
- package/src/components/traffic/TrafficConnectionsTable.test.tsx +9 -0
- package/src/components/traffic/TrafficConnectionsTable.tsx +4 -2
- package/src/components/traffic/TrafficFilterSidebar.tsx +19 -14
- package/src/components/traffic/TrafficFlowList.test.tsx +63 -0
- package/src/components/traffic/TrafficFlowList.tsx +9 -5
- package/src/components/traffic/TrafficGraph.test.tsx +26 -0
- package/src/components/traffic/TrafficGraph.tsx +17 -14
- package/src/components/traffic/TrafficGraphTooLarge.tsx +2 -0
- package/src/components/traffic/TrafficGraphUnavailable.tsx +3 -1
- package/src/components/traffic/TrafficView.tsx +26 -56
- package/src/components/traffic/trafficFilters.test.ts +61 -1
- package/src/components/traffic/trafficFilters.ts +68 -8
- package/src/components/velero/VeleroOverview.tsx +2 -2
- package/src/components/velero/VeleroView.tsx +3 -6
- package/src/components/vulnerabilities/columns.tsx +132 -0
- package/src/components/vulnerabilities/filters.tsx +317 -0
- package/src/components/vulnerabilities/owner.test.ts +54 -0
- package/src/components/vulnerabilities/owner.tsx +163 -0
- package/src/components/vulnerabilities/parts.test.ts +126 -12
- package/src/components/vulnerabilities/parts.tsx +612 -52
- package/src/components/vulnerabilities/traffic.test.tsx +65 -0
- package/src/components/vulnerabilities/traffic.tsx +40 -0
- package/src/components/workload/WorkloadView.substrateVersion.test.tsx +88 -0
- package/src/components/workload/WorkloadView.tsx +52 -13
- package/src/components/workspace/layout.tsx +13 -7
- package/src/components/workspace/sidebar.test.ts +48 -0
- package/src/components/workspace/sidebar.ts +73 -3
- package/src/components/workspace/table.ts +2 -1
- package/src/contexts/RegistryAccessMode.test.tsx +51 -0
- package/src/contexts/RegistryAccessMode.tsx +25 -0
- package/src/integrations/resourceHost.ts +12 -6
- package/src/integrations/resourceHosts.test.tsx +27 -1
- package/src/integrations/resourceHosts.tsx +15 -7
- package/src/integrations/sidebarWorkspaces.test.tsx +63 -0
- package/src/integrations/sidebarWorkspaces.ts +41 -0
- package/src/integrations/workspaceRoute.ts +1 -1
- package/src/integrations/workspaceRoutes.ts +7 -1
- package/src/integrations/workspaceScreens.tsx +6 -0
|
@@ -3,13 +3,20 @@ import { act, useEffect } from 'react'
|
|
|
3
3
|
import { createRoot } from 'react-dom/client'
|
|
4
4
|
import { MemoryRouter, useLocation, useNavigationType } from 'react-router-dom'
|
|
5
5
|
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
|
|
6
|
-
import { afterEach, beforeEach, expect, it, vi } from 'vitest'
|
|
7
|
-
import { ToastProvider, workloadKey, type AppHistory, type AppRow, type AppWorkload, type SelectedResource } from '@skyhook-io/k8s-ui'
|
|
6
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
|
7
|
+
import { ToastProvider, workloadKey, type AppHistory, type AppRow, type AppWorkload, type FeatureCapabilities, type SelectedResource } from '@skyhook-io/k8s-ui'
|
|
8
|
+
import { radarFeatureSupport, type RadarFeature } from '../../api/radarFeatures'
|
|
8
9
|
import { ApplicationsView } from './ApplicationsView'
|
|
9
10
|
|
|
10
11
|
let apps: AppRow[] = []
|
|
11
12
|
const idle = { data: undefined, isLoading: false, isFetching: false, isPending: false, isSuccess: false, isError: false, error: null }
|
|
12
13
|
let history: Omit<typeof idle, 'data'> & { data?: AppHistory }
|
|
14
|
+
let timelineMode: 'local' | 'retained' = 'local'
|
|
15
|
+
let capabilities: { features?: FeatureCapabilities } | undefined = { features: { workloadSource: true, runningCodeHistory: true } }
|
|
16
|
+
const historyReads: Array<{ kind: string; name: string }> = []
|
|
17
|
+
let workloadHistory: unknown = undefined
|
|
18
|
+
let timelineEvents: unknown[] = []
|
|
19
|
+
let workloadSourceHandler: ((targets: Array<{ kind: string; group?: string; namespace: string; name: string }>) => Map<string, unknown> | null) | null = null
|
|
13
20
|
|
|
14
21
|
vi.mock('../../api/client', () => ({
|
|
15
22
|
useApplications: () => ({ ...idle, data: { applications: apps }, isSuccess: true, dataUpdatedAt: 0, refetch: () => {} }),
|
|
@@ -17,11 +24,24 @@ vi.mock('../../api/client', () => ({
|
|
|
17
24
|
useGitOpsTree: () => idle,
|
|
18
25
|
useHelmRelease: () => idle,
|
|
19
26
|
useIssues: () => idle,
|
|
27
|
+
useRadarFeature: (feature: RadarFeature) => ({ support: radarFeatureSupport(feature, capabilities, undefined) }),
|
|
28
|
+
useWorkloadHistory: (kind: string, _ns: string, name: string, _group?: string, enabled?: boolean) => {
|
|
29
|
+
if (enabled) historyReads.push({ kind, name })
|
|
30
|
+
return { ...idle, data: enabled ? workloadHistory : undefined, isSuccess: Boolean(enabled && workloadHistory !== undefined) }
|
|
31
|
+
},
|
|
20
32
|
useTopology: () => idle,
|
|
21
33
|
}))
|
|
34
|
+
vi.mock('../../api/workloadSource', () => ({
|
|
35
|
+
supportsWorkloadSource: () => true,
|
|
36
|
+
useWorkloadSources: (targets: Array<{ kind: string; group?: string; namespace: string; name: string }>) =>
|
|
37
|
+
workloadSourceHandler ? workloadSourceHandler(targets) : null,
|
|
38
|
+
WORKLOAD_SOURCES_MAX: 24,
|
|
39
|
+
workloadSourceTargetKey: (t: { kind: string; group?: string; namespace: string; name: string }) =>
|
|
40
|
+
`${(t.group ?? '').toLowerCase()}/${t.kind.toLowerCase()}/${t.namespace}/${t.name}`,
|
|
41
|
+
}))
|
|
22
42
|
vi.mock('../../context/ConnectionContext', () => ({ useConnection: () => ({ connection: { state: 'connected', context: 'test' } }) }))
|
|
23
43
|
vi.mock('../../context/TimelineSource', () => ({
|
|
24
|
-
useTimelineSource: () => ({ capabilities: { mode:
|
|
44
|
+
useTimelineSource: () => ({ capabilities: { mode: timelineMode }, useEvents: () => ({ data: timelineEvents, isLoading: false, isError: false }) }),
|
|
25
45
|
}))
|
|
26
46
|
// The workload view's own content is out of scope here: the stub stands in for
|
|
27
47
|
// any resource the user clicks inside it (a config chip or a topology node).
|
|
@@ -61,6 +81,12 @@ function LocationProbe() {
|
|
|
61
81
|
|
|
62
82
|
beforeEach(() => {
|
|
63
83
|
history = idle
|
|
84
|
+
timelineMode = 'local'
|
|
85
|
+
capabilities = { features: { workloadSource: true, runningCodeHistory: true } }
|
|
86
|
+
historyReads.length = 0
|
|
87
|
+
workloadHistory = undefined
|
|
88
|
+
timelineEvents = []
|
|
89
|
+
workloadSourceHandler = null
|
|
64
90
|
vi.stubGlobal('matchMedia', () => ({ matches: false, addEventListener: () => {}, removeEventListener: () => {} }))
|
|
65
91
|
container = document.createElement('div')
|
|
66
92
|
document.body.appendChild(container)
|
|
@@ -242,3 +268,222 @@ it('keeps Deploys and explains a partial source lookup until a complete response
|
|
|
242
268
|
expect(new URLSearchParams(location.split('?')[1]).has('view')).toBe(false)
|
|
243
269
|
expect(container.querySelector('[role="tab"][aria-selected="true"]')?.textContent).toBe('Overview')
|
|
244
270
|
})
|
|
271
|
+
|
|
272
|
+
it('keeps the Environments panel past the code read limit and says why code is not compared', async () => {
|
|
273
|
+
const names = Array.from({ length: 13 }, (_, i) => `svc-${i}`)
|
|
274
|
+
const env = (envName: string): AppRow => ({
|
|
275
|
+
...app(`shop-${envName}/shop`, names),
|
|
276
|
+
name: `shop-${envName}`,
|
|
277
|
+
identity: { key: 'shop', env: envName, confidence: 'high', evidence: 'test' },
|
|
278
|
+
})
|
|
279
|
+
apps = [env('staging'), env('prod')]
|
|
280
|
+
await renderAt('/applications?app=shop-staging%2Fshop')
|
|
281
|
+
const text = container.textContent ?? ''
|
|
282
|
+
expect(text).toContain('13 workloads')
|
|
283
|
+
expect(text).toContain("Code isn't compared for apps with more than 24 workloads across environments.")
|
|
284
|
+
})
|
|
285
|
+
|
|
286
|
+
it('says nothing about the read limit while workload source support is not yet known', async () => {
|
|
287
|
+
capabilities = undefined
|
|
288
|
+
const names = Array.from({ length: 13 }, (_, i) => `svc-${i}`)
|
|
289
|
+
const env = (envName: string): AppRow => ({
|
|
290
|
+
...app(`shop-${envName}/shop`, names),
|
|
291
|
+
name: `shop-${envName}`,
|
|
292
|
+
identity: { key: 'shop', env: envName, confidence: 'high', evidence: 'test' },
|
|
293
|
+
})
|
|
294
|
+
apps = [env('staging'), env('prod')]
|
|
295
|
+
await renderAt('/applications?app=shop-staging%2Fshop')
|
|
296
|
+
expect(container.textContent).not.toContain("Code isn't compared")
|
|
297
|
+
})
|
|
298
|
+
|
|
299
|
+
it('dates the Deploys history start from the oldest Deployment, StatefulSet or DaemonSet, and not on a retained store', async () => {
|
|
300
|
+
const job: AppWorkload = { kind: 'Job', group: 'batch', namespace: 'shop', name: 'migrate', health: 'healthy', ready: 1, desired: 1, restarts: 0 }
|
|
301
|
+
const newer = { ...deployment('worker'), creationTimestamp: '2026-11-23T12:00:00Z' }
|
|
302
|
+
const older = { ...deployment('web'), creationTimestamp: '2026-11-20T12:00:00Z' }
|
|
303
|
+
apps = [{ ...app('shop/app', []), workloads: [job, newer, older] }]
|
|
304
|
+
await renderAt('/applications?app=shop%2Fapp&view=deploys')
|
|
305
|
+
expect(historyReads.length).toBeGreaterThan(0)
|
|
306
|
+
expect(historyReads.every((r) => r.kind === 'deployments' && r.name === 'web')).toBe(true)
|
|
307
|
+
|
|
308
|
+
historyReads.length = 0
|
|
309
|
+
apps = [{ ...app('shop/jobs', []), workloads: [job] }]
|
|
310
|
+
await renderAt('/applications?app=shop%2Fjobs&view=deploys')
|
|
311
|
+
expect(historyReads).toHaveLength(0)
|
|
312
|
+
|
|
313
|
+
timelineMode = 'retained'
|
|
314
|
+
apps = [app('shop/app2', ['web'])]
|
|
315
|
+
await renderAt('/applications?app=shop%2Fapp2&view=deploys')
|
|
316
|
+
expect(historyReads).toHaveLength(0)
|
|
317
|
+
})
|
|
318
|
+
|
|
319
|
+
it('ignores an unparseable creationTimestamp when picking the oldest Deploys boundary workload', async () => {
|
|
320
|
+
const unparseable = { ...deployment('worker'), creationTimestamp: 'not-a-date' }
|
|
321
|
+
const valid = { ...deployment('web'), creationTimestamp: '2026-11-20T12:00:00Z' }
|
|
322
|
+
apps = [{ ...app('shop/app', []), workloads: [unparseable, valid] }]
|
|
323
|
+
await renderAt('/applications?app=shop%2Fapp&view=deploys')
|
|
324
|
+
expect(historyReads.length).toBeGreaterThan(0)
|
|
325
|
+
expect(historyReads.every((r) => r.kind === 'deployments' && r.name === 'web')).toBe(true)
|
|
326
|
+
})
|
|
327
|
+
|
|
328
|
+
it('says the Deploys divider\'s earlier changes come from ReplicaSet history only when rebuilt rows are listed', async () => {
|
|
329
|
+
const now = Date.now()
|
|
330
|
+
const since = new Date(now - 2 * 3600_000).toISOString()
|
|
331
|
+
workloadHistory = { historyCoverage: { incomplete: true, complete_since: since, reasons: ['observation_started_late'] } }
|
|
332
|
+
const code = (id: string, hoursAgo: number, reconstructed: boolean) => ({
|
|
333
|
+
id, timestamp: new Date(now - hoursAgo * 3600_000).toISOString(), source: 'informer', kind: 'Deployment', apiVersion: 'apps/v1',
|
|
334
|
+
namespace: 'shop', name: 'web', eventType: 'update', reason: 'RunningCodeChanged',
|
|
335
|
+
diff: { summary: '', fields: [{ path: 'running.app', oldValue: [{ digest: 'r@sha256:1', image: 'r/web:v1' }], newValue: { digest: 'r@sha256:2', image: 'r/web:v2', ...(reconstructed ? { reconstructed: true } : {}) } }] },
|
|
336
|
+
})
|
|
337
|
+
// Two workloads, so Deploys is the application's view rather than a workload tab.
|
|
338
|
+
const gitopsApp = (): AppRow => ({ ...app('shop/web', ['web', 'worker']), sourceRef: { type: 'gitops', tool: 'argocd', kind: 'Application', namespace: 'argocd', name: 'web' } })
|
|
339
|
+
|
|
340
|
+
apps = [gitopsApp()]
|
|
341
|
+
timelineEvents = [code('new', 1, false), code('old', 3, false)]
|
|
342
|
+
await renderAt('/applications?app=shop%2Fweb&view=deploys')
|
|
343
|
+
const divider = () => container.querySelector('[data-history-boundary]')?.textContent ?? ''
|
|
344
|
+
expect(divider()).toMatch(/^Radar started recording code changes at .+ · earlier code changes may be missing$/)
|
|
345
|
+
|
|
346
|
+
timelineEvents = [code('new', 1, false), code('rebuilt', 3, true)]
|
|
347
|
+
await renderAt('/applications?app=shop%2Fweb&view=deploys')
|
|
348
|
+
expect(divider()).toMatch(/· earlier ones come only from ReplicaSet history$/)
|
|
349
|
+
})
|
|
350
|
+
|
|
351
|
+
describe('Deploys recording boundary and code notes', () => {
|
|
352
|
+
const now = Date.now()
|
|
353
|
+
const hoursAgo = (h: number) => new Date(now - h * 3600_000).toISOString()
|
|
354
|
+
const dated = (h: number) => ({ historyCoverage: { incomplete: true, complete_since: hoursAgo(h), reasons: ['observation_started_late'] } })
|
|
355
|
+
const sync = (h: number, rev: string) => ({ type: 'gitops' as const, title: 'Argo CD sync', revision: rev.repeat(40), timestamp: hoursAgo(h), status: 'Succeeded', id: rev })
|
|
356
|
+
const gitopsApp = (workloads: AppWorkload[]): AppRow => ({
|
|
357
|
+
...app('shop/web', []), workloads,
|
|
358
|
+
sourceRef: { type: 'gitops', tool: 'argocd', kind: 'Application', namespace: 'argocd', name: 'web' },
|
|
359
|
+
})
|
|
360
|
+
const notes = () => [...container.querySelectorAll('[data-code-note]')].map((n) => n.getAttribute('data-code-note'))
|
|
361
|
+
const withDeliveries = () => {
|
|
362
|
+
history = { ...idle, isSuccess: true, data: { appKey: 'shop/web', sourceRef: { type: 'gitops', tool: 'argocd', kind: 'Application', namespace: 'argocd', name: 'web' }, anchors: [sync(2, 'a'), sync(10, 'b')] } as AppHistory }
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
it('never claims running code unchanged, and drives divider and "code not recorded" from the same boundary', async () => {
|
|
366
|
+
withDeliveries()
|
|
367
|
+
workloadHistory = dated(5)
|
|
368
|
+
apps = [gitopsApp([deployment('web'), deployment('worker')])]
|
|
369
|
+
await renderAt('/applications?app=shop%2Fweb&view=deploys')
|
|
370
|
+
expect(notes()).toEqual(['not_recorded'])
|
|
371
|
+
expect(container.textContent).not.toContain('running code unchanged')
|
|
372
|
+
expect(container.querySelector('[data-history-boundary]')).not.toBeNull()
|
|
373
|
+
})
|
|
374
|
+
|
|
375
|
+
it('shows neither divider nor "code not recorded" when no dated boundary is known (including on a retained store)', async () => {
|
|
376
|
+
withDeliveries()
|
|
377
|
+
workloadHistory = {}
|
|
378
|
+
apps = [gitopsApp([deployment('web'), deployment('worker')])]
|
|
379
|
+
await renderAt('/applications?app=shop%2Fweb&view=deploys')
|
|
380
|
+
expect(notes()).toEqual([])
|
|
381
|
+
expect(container.querySelector('[data-history-boundary]')).toBeNull()
|
|
382
|
+
|
|
383
|
+
historyReads.length = 0
|
|
384
|
+
timelineMode = 'retained'
|
|
385
|
+
history = { ...history, data: { ...history.data!, anchors: [sync(2, 'a'), sync(24 * 8, 'b')] } }
|
|
386
|
+
await renderAt('/applications?app=shop%2Fweb&view=deploys')
|
|
387
|
+
expect(historyReads).toHaveLength(0)
|
|
388
|
+
expect(notes()).toEqual([])
|
|
389
|
+
expect(container.querySelector('[data-history-boundary]')).toBeNull()
|
|
390
|
+
})
|
|
391
|
+
|
|
392
|
+
it('suppresses the code-change divider and delivery code labels when runningCodeHistory is absent or false, while still rendering code rows', async () => {
|
|
393
|
+
const argoCode = {
|
|
394
|
+
id: 'code-1',
|
|
395
|
+
timestamp: new Date(now - 2 * 3600_000 + 30_000).toISOString(),
|
|
396
|
+
source: 'informer',
|
|
397
|
+
kind: 'Deployment',
|
|
398
|
+
apiVersion: 'apps/v1',
|
|
399
|
+
namespace: 'shop',
|
|
400
|
+
name: 'web',
|
|
401
|
+
eventType: 'update',
|
|
402
|
+
reason: 'RunningCodeChanged',
|
|
403
|
+
diff: {
|
|
404
|
+
summary: '',
|
|
405
|
+
fields: [{
|
|
406
|
+
path: 'running.app',
|
|
407
|
+
oldValue: [{ digest: 'r@sha256:1', image: 'r/web:v1' }],
|
|
408
|
+
newValue: { digest: 'r@sha256:2', image: 'r/web:v2', setBy: { manager: 'argocd-controller' } },
|
|
409
|
+
}],
|
|
410
|
+
},
|
|
411
|
+
}
|
|
412
|
+
withDeliveries()
|
|
413
|
+
workloadHistory = dated(5)
|
|
414
|
+
timelineEvents = [argoCode]
|
|
415
|
+
apps = [gitopsApp([deployment('web'), deployment('worker')])]
|
|
416
|
+
|
|
417
|
+
// Flag true: divider, "shipped code", and "code not recorded" all render.
|
|
418
|
+
capabilities = { features: { runningCodeHistory: true } }
|
|
419
|
+
await renderAt('/applications?app=shop%2Fweb&view=deploys')
|
|
420
|
+
expect(container.querySelector('[data-history-boundary]')).not.toBeNull()
|
|
421
|
+
expect(notes()).toEqual(['shipped', 'not_recorded'])
|
|
422
|
+
expect(container.querySelector('[data-code-change-badge]')).not.toBeNull()
|
|
423
|
+
|
|
424
|
+
// Flag absent, false, or capabilities still loading: no divider, no delivery
|
|
425
|
+
// code labels, no boundary-only workload history fetch, and any code rows still render.
|
|
426
|
+
for (const caps of [{ features: {} }, { features: { runningCodeHistory: false } }, undefined]) {
|
|
427
|
+
historyReads.length = 0
|
|
428
|
+
capabilities = caps
|
|
429
|
+
await renderAt('/applications?app=shop%2Fweb&view=deploys')
|
|
430
|
+
expect(container.querySelector('[data-history-boundary]')).toBeNull()
|
|
431
|
+
expect(notes()).toEqual([])
|
|
432
|
+
expect(container.textContent).not.toContain('code not recorded')
|
|
433
|
+
expect(container.textContent).not.toContain('shipped code')
|
|
434
|
+
expect(historyReads).toHaveLength(0)
|
|
435
|
+
expect(container.querySelector('[data-code-change-badge]')).not.toBeNull()
|
|
436
|
+
}
|
|
437
|
+
})
|
|
438
|
+
})
|
|
439
|
+
|
|
440
|
+
describe('over-24 targets across environments fallback', () => {
|
|
441
|
+
it('still reads the viewed environment when it has 24 or fewer workloads while keeping the cross-env note', async () => {
|
|
442
|
+
const sha = 'a'.repeat(40)
|
|
443
|
+
const makeEnvApp = (envName: string, count: number): AppRow => ({
|
|
444
|
+
key: `${envName}/shop`,
|
|
445
|
+
name: 'shop',
|
|
446
|
+
namespace: envName,
|
|
447
|
+
health: 'healthy',
|
|
448
|
+
identity: { key: 'shop', env: envName, confidence: 'high', evidence: 'namespace' },
|
|
449
|
+
workloads: Array.from({ length: count }, (_, i) => ({
|
|
450
|
+
kind: 'Deployment', group: 'apps', namespace: envName, name: `svc-${i}`, health: 'healthy', ready: 1, desired: 1, restarts: 0,
|
|
451
|
+
})),
|
|
452
|
+
})
|
|
453
|
+
let seenTargets: Array<{ namespace: string; name: string }> = []
|
|
454
|
+
workloadSourceHandler = (targets) => {
|
|
455
|
+
seenTargets = targets
|
|
456
|
+
if (targets.length === 0 || targets.length > 24) return null
|
|
457
|
+
const out = new Map<string, unknown>()
|
|
458
|
+
for (const t of targets) {
|
|
459
|
+
out.set(`apps/deployment/${t.namespace}/${t.name}`, {
|
|
460
|
+
status: 'ready',
|
|
461
|
+
source: {
|
|
462
|
+
workload: { group: 'apps', kind: 'Deployment', namespace: t.namespace, name: t.name },
|
|
463
|
+
observedAt: '2026-11-29T00:00:00Z',
|
|
464
|
+
images: [{
|
|
465
|
+
container: 'app', kind: 'container', image: 'ghcr.io/acme/shop:1', digest: `sha256:${sha}`, pods: 1, provenance: 'read',
|
|
466
|
+
source: { revision: { value: sha, from: 'oci-label' }, repository: { value: 'https://github.com/acme/shop', from: 'oci-label' } },
|
|
467
|
+
}],
|
|
468
|
+
},
|
|
469
|
+
})
|
|
470
|
+
}
|
|
471
|
+
return out
|
|
472
|
+
}
|
|
473
|
+
apps = [makeEnvApp('staging', 15), makeEnvApp('prod', 15)]
|
|
474
|
+
await renderAt('/applications?app=staging%2Fshop')
|
|
475
|
+
expect(seenTargets).toHaveLength(15)
|
|
476
|
+
expect(seenTargets.every((t) => t.namespace === 'staging')).toBe(true)
|
|
477
|
+
const text = container.textContent ?? ''
|
|
478
|
+
// Header Code fact works for the viewed environment.
|
|
479
|
+
expect(text).toContain('aaaaaaa')
|
|
480
|
+
// Cross-environment comparison note stays.
|
|
481
|
+
expect(text).toContain("Code isn't compared for apps with more than 24 workloads across environments")
|
|
482
|
+
|
|
483
|
+
// When the viewed environment itself exceeds 24 targets, no source targets are read.
|
|
484
|
+
seenTargets = [{ namespace: 'sentinel', name: 'sentinel' }]
|
|
485
|
+
apps = [makeEnvApp('staging', 25), makeEnvApp('prod', 5)]
|
|
486
|
+
await renderAt('/applications?app=staging%2Fshop')
|
|
487
|
+
expect(seenTargets).toHaveLength(0)
|
|
488
|
+
})
|
|
489
|
+
})
|
|
@@ -28,6 +28,11 @@ import {
|
|
|
28
28
|
deploymentInventoryFromGitOps,
|
|
29
29
|
deploymentInventoryFromHelm,
|
|
30
30
|
buildAppMembershipIndex,
|
|
31
|
+
appCodeChangesFromEvents,
|
|
32
|
+
rolloutSummaryForApps,
|
|
33
|
+
servingReadiness,
|
|
34
|
+
summarizeEnv,
|
|
35
|
+
type AppCodeEnv,
|
|
31
36
|
buildApplicationHistoryItems,
|
|
32
37
|
eventsForApplication,
|
|
33
38
|
memberRef,
|
|
@@ -53,12 +58,16 @@ import {
|
|
|
53
58
|
useGitOpsTree,
|
|
54
59
|
useHelmRelease,
|
|
55
60
|
useIssues,
|
|
61
|
+
useRadarFeature,
|
|
56
62
|
useTopology,
|
|
63
|
+
useWorkloadHistory,
|
|
57
64
|
type IssuesResponse,
|
|
58
65
|
} from "../../api/client";
|
|
66
|
+
import { formatBoundaryTime, workloadHistoryBoundary } from "@skyhook-io/k8s-ui/utils/workload-history-notes";
|
|
59
67
|
import { useConnection } from "../../context/ConnectionContext";
|
|
60
68
|
import { useTimelineSource } from "../../context/TimelineSource";
|
|
61
69
|
import { apiVersionToGroup, kindToPluralWithGroup, relatedResourcePath, withCrossViewParams } from "../../utils/navigation";
|
|
70
|
+
import { supportsWorkloadSource, useWorkloadSources, WORKLOAD_SOURCES_MAX, workloadSourceTargetKey, type WorkloadSourcesRead } from "../../api/workloadSource";
|
|
62
71
|
import { WorkloadView } from "../workload/WorkloadView";
|
|
63
72
|
import { ApplicationCostTab } from "../cost/ApplicationCostTab";
|
|
64
73
|
import { ArgoSyncDetails } from "./ArgoSyncDetails";
|
|
@@ -66,6 +75,8 @@ import { WorkloadRevisionsButton } from "../workload/WorkloadRevisionsButton";
|
|
|
66
75
|
import { useTimelineRetentionNote } from "../../context/TimelineCustomization";
|
|
67
76
|
import { isOpenCostWorkloadKind } from "../cost/kinds";
|
|
68
77
|
|
|
78
|
+
const CODE_HISTORY_KINDS = new Set(["Deployment", "StatefulSet", "DaemonSet"]);
|
|
79
|
+
|
|
69
80
|
type ApplicationRouteView = ApplicationView | "cost";
|
|
70
81
|
|
|
71
82
|
const APPLICATION_HISTORY_WINDOW: Record<
|
|
@@ -284,7 +295,7 @@ function AppDetailRoute({
|
|
|
284
295
|
const [searchParams, setSearchParams] = useSearchParams();
|
|
285
296
|
const viewParam = searchParams.get("view");
|
|
286
297
|
const selectedWorkloadParam = searchParams.get("workload");
|
|
287
|
-
const appWorkloads = app.workloads ?? [];
|
|
298
|
+
const appWorkloads = useMemo(() => app.workloads ?? [], [app.workloads]);
|
|
288
299
|
const singleWorkloadKey =
|
|
289
300
|
appWorkloads.length === 1 ? workloadKey(appWorkloads[0]) : null;
|
|
290
301
|
const selectedWorkloadKey = singleWorkloadKey ?? selectedWorkloadParam;
|
|
@@ -335,8 +346,9 @@ function AppDetailRoute({
|
|
|
335
346
|
)
|
|
336
347
|
? retainedHistoryRange
|
|
337
348
|
: historyRangeOptions[0].value;
|
|
349
|
+
// Deploys reads the same events for the running-code changes it interleaves.
|
|
338
350
|
const historyTimelineEnabled =
|
|
339
|
-
!selectedWorkloadKey && selectedView === "history";
|
|
351
|
+
(!selectedWorkloadKey && selectedView === "history") || requestedDeploys;
|
|
340
352
|
const retentionNote = useTimelineRetentionNote();
|
|
341
353
|
const historyTimelineQuery = timelineSource.useEvents({
|
|
342
354
|
namespaces: appHistoryNamespaces,
|
|
@@ -620,6 +632,87 @@ function AppDetailRoute({
|
|
|
620
632
|
}));
|
|
621
633
|
}, [apps, app]);
|
|
622
634
|
|
|
635
|
+
// Which code each environment runs: every workload of every environment
|
|
636
|
+
// instance (or of this app alone), read through the per-workload source route.
|
|
637
|
+
const codeApps = useMemo<AppRow[]>(() => {
|
|
638
|
+
if (!identityInstances) return [app];
|
|
639
|
+
return identityInstances
|
|
640
|
+
.filter((inst) => !inst.aggregate)
|
|
641
|
+
.map((inst) => apps.find((a) => a.key === inst.appKey))
|
|
642
|
+
.filter((a): a is AppRow => !!a);
|
|
643
|
+
}, [app, apps, identityInstances]);
|
|
644
|
+
const sourceWorkloads = useCallback(
|
|
645
|
+
(a: AppRow) => a.workloads.filter((w) => supportsWorkloadSource(kindToPluralWithGroup(w.kind, w.group ?? ""), w.group)),
|
|
646
|
+
[],
|
|
647
|
+
);
|
|
648
|
+
const allCodeTargets = useMemo(
|
|
649
|
+
() => codeApps.flatMap((a) => sourceWorkloads(a).map((w) => ({ kind: w.kind, group: w.group, namespace: w.namespace, name: w.name }))),
|
|
650
|
+
[codeApps, sourceWorkloads],
|
|
651
|
+
);
|
|
652
|
+
const viewedCodeTargets = useMemo(
|
|
653
|
+
() => sourceWorkloads(app).map((w) => ({ kind: w.kind, group: w.group, namespace: w.namespace, name: w.name })),
|
|
654
|
+
[app, sourceWorkloads],
|
|
655
|
+
);
|
|
656
|
+
const overCrossEnvLimit = allCodeTargets.length > WORKLOAD_SOURCES_MAX;
|
|
657
|
+
// Past the read limit across environments we skip cross-environment
|
|
658
|
+
// comparison, but still read the viewed environment's own targets when they
|
|
659
|
+
// fit so its header Code fact and Workloads Code column keep working.
|
|
660
|
+
const codeTargets = useMemo(
|
|
661
|
+
() => (overCrossEnvLimit ? (viewedCodeTargets.length <= WORKLOAD_SOURCES_MAX ? viewedCodeTargets : []) : allCodeTargets),
|
|
662
|
+
[overCrossEnvLimit, viewedCodeTargets, allCodeTargets],
|
|
663
|
+
);
|
|
664
|
+
const sourceReads = useWorkloadSources(codeTargets);
|
|
665
|
+
const { support: sourceSupport } = useRadarFeature("workloadSource");
|
|
666
|
+
const { support: runningCodeHistorySupport } = useRadarFeature("runningCodeHistory");
|
|
667
|
+
const recordsCodeHistory = runningCodeHistorySupport === "supported";
|
|
668
|
+
const tooManyForCode = sourceSupport === "supported" && overCrossEnvLimit;
|
|
669
|
+
const environmentCode = useMemo<AppCodeEnv[] | null>(() => {
|
|
670
|
+
const summarizeWithReads = (a: AppRow, reads: Map<string, WorkloadSourcesRead>) => {
|
|
671
|
+
const supported = sourceWorkloads(a);
|
|
672
|
+
const rollout = rolloutSummaryForApps([a]);
|
|
673
|
+
const { ready, desired } = servingReadiness(a.workloads);
|
|
674
|
+
return summarizeEnv({
|
|
675
|
+
appKey: a.key,
|
|
676
|
+
env: a.identity?.env ?? a.name,
|
|
677
|
+
health: a.health,
|
|
678
|
+
ready,
|
|
679
|
+
desired,
|
|
680
|
+
complete: supported.length === a.workloads.length,
|
|
681
|
+
rolloutNote: a.workloads.some((w) => w.rollout?.phase === "stalled") ? rollout?.label : undefined,
|
|
682
|
+
workloads: supported.map((w) => {
|
|
683
|
+
const workload = { kind: w.kind, group: w.group, namespace: w.namespace, name: w.name };
|
|
684
|
+
const read = reads.get(workloadSourceTargetKey(workload)) ?? { status: "loading" as const };
|
|
685
|
+
return { workload, ...read };
|
|
686
|
+
}),
|
|
687
|
+
stale: supported.some((w) => {
|
|
688
|
+
const read = reads.get(workloadSourceTargetKey(w));
|
|
689
|
+
return read?.status === "ready" && read.stale === true;
|
|
690
|
+
}),
|
|
691
|
+
workloadCount: a.workloads.length,
|
|
692
|
+
});
|
|
693
|
+
};
|
|
694
|
+
if (tooManyForCode) {
|
|
695
|
+
return codeApps.map((a) => {
|
|
696
|
+
if (a.key === app.key && sourceReads) {
|
|
697
|
+
return summarizeWithReads(a, sourceReads);
|
|
698
|
+
}
|
|
699
|
+
const { ready, desired } = servingReadiness(a.workloads);
|
|
700
|
+
return summarizeEnv({
|
|
701
|
+
appKey: a.key,
|
|
702
|
+
env: a.identity?.env ?? a.name,
|
|
703
|
+
health: a.health,
|
|
704
|
+
ready,
|
|
705
|
+
desired,
|
|
706
|
+
complete: false,
|
|
707
|
+
workloads: [],
|
|
708
|
+
workloadCount: a.workloads.length,
|
|
709
|
+
});
|
|
710
|
+
});
|
|
711
|
+
}
|
|
712
|
+
if (!sourceReads) return null;
|
|
713
|
+
return codeApps.map((a) => summarizeWithReads(a, sourceReads));
|
|
714
|
+
}, [app.key, codeApps, sourceReads, sourceWorkloads, tooManyForCode]);
|
|
715
|
+
|
|
623
716
|
// Position-preserving env switch: carry the selected workload + tab into the
|
|
624
717
|
// sibling when a matching workload exists there (exact kind+name, else the
|
|
625
718
|
// env-affix-stripped stem); otherwise land on the instance overview and say
|
|
@@ -685,8 +778,66 @@ function AppDetailRoute({
|
|
|
685
778
|
[apps],
|
|
686
779
|
);
|
|
687
780
|
|
|
781
|
+
const codeChanges = useMemo(
|
|
782
|
+
() => appCodeChangesFromEvents(historyTimelineQuery.data ?? [], app.workloads ?? []),
|
|
783
|
+
[app.workloads, historyTimelineQuery.data],
|
|
784
|
+
);
|
|
785
|
+
// When recording started is process-wide, so one tracked workload's history
|
|
786
|
+
// coverage dates it for Deploys. Pick the oldest tracked workload: one
|
|
787
|
+
// created after Radar started omits historyCoverage because its own history
|
|
788
|
+
// is complete. A retained store keeps code rows across agent restarts, so
|
|
789
|
+
// the agent's start is no boundary there.
|
|
790
|
+
const boundaryWorkload = useMemo(() => {
|
|
791
|
+
if (!requestedDeploys || !recordsCodeHistory || timelineSource.capabilities.mode === "retained") return undefined;
|
|
792
|
+
const tracked = appWorkloads.filter((w) => CODE_HISTORY_KINDS.has(w.kind) && (w.group ?? "apps") === "apps");
|
|
793
|
+
if (tracked.length === 0) return undefined;
|
|
794
|
+
const parseTimestamp = (ts?: string) => {
|
|
795
|
+
if (!ts) return Number.POSITIVE_INFINITY;
|
|
796
|
+
const ms = Date.parse(ts);
|
|
797
|
+
return Number.isFinite(ms) ? ms : Number.POSITIVE_INFINITY;
|
|
798
|
+
};
|
|
799
|
+
let oldest = tracked[0];
|
|
800
|
+
let oldestMs = parseTimestamp(oldest.creationTimestamp);
|
|
801
|
+
for (let i = 1; i < tracked.length; i++) {
|
|
802
|
+
const ms = parseTimestamp(tracked[i].creationTimestamp);
|
|
803
|
+
if (ms < oldestMs) {
|
|
804
|
+
oldest = tracked[i];
|
|
805
|
+
oldestMs = ms;
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
return oldest;
|
|
809
|
+
}, [requestedDeploys, recordsCodeHistory, timelineSource.capabilities.mode, appWorkloads]);
|
|
810
|
+
const boundaryHistory = useWorkloadHistory(
|
|
811
|
+
boundaryWorkload ? kindToPluralWithGroup(boundaryWorkload.kind, boundaryWorkload.group ?? "") : "",
|
|
812
|
+
boundaryWorkload?.namespace ?? "",
|
|
813
|
+
boundaryWorkload?.name ?? "",
|
|
814
|
+
boundaryWorkload?.group,
|
|
815
|
+
Boolean(boundaryWorkload),
|
|
816
|
+
);
|
|
817
|
+
// Name the ReplicaSet rebuild only when rebuilt rows are actually listed.
|
|
818
|
+
const rebuiltListed = codeChanges.some((c) => c.reconstructed);
|
|
819
|
+
const deploysBoundary = useMemo(() => {
|
|
820
|
+
if (!recordsCodeHistory) return null;
|
|
821
|
+
const coverage = boundaryHistory.data?.historyCoverage;
|
|
822
|
+
const boundary = workloadHistoryBoundary(coverage);
|
|
823
|
+
if (!boundary || !coverage?.reasons.includes("observation_started_late")) return boundary;
|
|
824
|
+
const earlier = rebuiltListed ? "earlier ones come only from ReplicaSet history" : "earlier code changes may be missing";
|
|
825
|
+
return { ...boundary, label: `Radar started recording code changes at ${formatBoundaryTime(boundary.atMs)} · ${earlier}` };
|
|
826
|
+
}, [recordsCodeHistory, boundaryHistory.data?.historyCoverage, rebuiltListed]);
|
|
827
|
+
const codeChangesNote = !recordsCodeHistory
|
|
828
|
+
? ""
|
|
829
|
+
: historyTimelineQuery.isError
|
|
830
|
+
? "Recorded code changes could not be loaded."
|
|
831
|
+
: historyTimelineQuery.isLoading
|
|
832
|
+
? ""
|
|
833
|
+
: [
|
|
834
|
+
historyTimelineQuery.truncated ? "Older events are not loaded, so earlier code changes may be missing." : null,
|
|
835
|
+
timelineSource.capabilities.mode === "retained" && (historyTimelineQuery.coverage?.length ?? 0) > 0
|
|
836
|
+
? "Recording coverage is incomplete for part of this range."
|
|
837
|
+
: null,
|
|
838
|
+
].filter(Boolean).join(" ");
|
|
688
839
|
const renderDeploys = deliverySource && (deliveryRecords.length > 0 || requestedDeploys)
|
|
689
|
-
? () => <ApplicationDeploys source={deliverySource} records={deliveryRecords} loading={historyQuery.isLoading} unavailable={historyQuery.isError} partialSources={partialSources} onOpenSource={openSource} />
|
|
840
|
+
? () => <ApplicationDeploys source={deliverySource} records={deliveryRecords} loading={historyQuery.isLoading} unavailable={historyQuery.isError} partialSources={partialSources} onOpenSource={openSource} codeChanges={codeChanges} multiWorkload={appWorkloads.length > 1} codeChangesNote={codeChangesNote} historyBoundary={deploysBoundary} codeHistoryRecorded={recordsCodeHistory} />
|
|
690
841
|
: needsDeploySource && (historyQuery.isError || sourceUnavailable)
|
|
691
842
|
? () => <AlertBanner className="m-4" variant="warning" title={sourceUnavailable ? "Delivery records are unavailable" : "Delivery records could not be refreshed"} items={partialSources} />
|
|
692
843
|
: undefined;
|
|
@@ -705,6 +856,8 @@ function AppDetailRoute({
|
|
|
705
856
|
topologyLoading={topologyLoading}
|
|
706
857
|
deploymentInventory={deploymentInventory}
|
|
707
858
|
identityInstances={identityInstances}
|
|
859
|
+
environmentCode={environmentCode}
|
|
860
|
+
environmentCodeLimit={tooManyForCode ? WORKLOAD_SOURCES_MAX : undefined}
|
|
708
861
|
onSwitchInstance={switchInstance}
|
|
709
862
|
discoveredEnvs={discoveredEnvs}
|
|
710
863
|
onNavigateToResource={onOpenResource}
|