@skyhook-io/radar-app 1.17.0 → 1.18.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/README.md +1 -1
- package/package.json +11 -11
- package/src/App.tsx +138 -116
- package/src/api/actions.errorCode.test.ts +40 -0
- package/src/api/actions.test.ts +48 -0
- package/src/api/actions.ts +79 -0
- package/src/api/apiResources.navigation.test.tsx +232 -0
- package/src/api/apiResources.ts +46 -3
- package/src/api/client.gitopsPoll.test.ts +99 -0
- package/src/api/client.helmPreview.test.tsx +48 -0
- package/src/api/client.helmSource.test.ts +39 -0
- package/src/api/client.namespaceSwitch.hook.test.tsx +54 -0
- package/src/api/client.namespaceSwitch.test.ts +107 -0
- package/src/api/client.resourceAvailability.test.ts +24 -0
- package/src/api/client.ts +580 -103
- package/src/api/client.workloadRuns.test.ts +53 -0
- package/src/api/cnpg-ha.live.test.ts +140 -0
- package/src/api/cnpg-ha.test.ts +78 -0
- package/src/api/cnpg-ha.ts +19 -0
- package/src/api/cnpg-history.ts +123 -0
- package/src/api/cnpg-inspect.ts +102 -0
- package/src/api/cnpg-protection.ts +112 -0
- package/src/api/cnpg-recovery.test.tsx +60 -0
- package/src/api/cnpg-recovery.ts +262 -0
- package/src/api/cnpg-sessions.ts +175 -0
- package/src/api/cnpg-storage.ts +138 -0
- package/src/api/cnpg.legacy-reads.test.ts +43 -0
- package/src/api/cnpg.pooler-runtime.test.ts +15 -0
- package/src/api/cnpg.ts +428 -10
- package/src/api/config.test.ts +23 -1
- package/src/api/config.ts +7 -3
- package/src/api/diagnose.ts +4 -1
- package/src/api/drain-plan.test.ts +70 -40
- package/src/api/policy.ts +5 -5
- package/src/api/radarFeatures.render.test.tsx +47 -3
- package/src/api/radarFeatures.ts +5 -1
- package/src/api/reviewedActionMutation.test.tsx +164 -0
- package/src/api/reviewedActionMutation.ts +66 -0
- package/src/api/timelineSource.test.ts +9 -0
- package/src/api/timelineSource.ts +8 -0
- package/src/api/traffic.scope.render.test.tsx +60 -0
- package/src/api/traffic.ts +3 -1
- package/src/components/audit/AuditView.tsx +9 -0
- package/src/components/capacity/CapacityActivity.tsx +3 -31
- package/src/components/capacity/CapacityDemand.tsx +4 -36
- package/src/components/capacity/CapacityOverview.tsx +217 -56
- package/src/components/capacity/CapacityPoolDetail.tsx +6 -55
- package/src/components/capacity/CapacityView.test.tsx +323 -0
- package/src/components/capacity/ClusterSchedulingCard.tsx +2 -10
- package/src/components/capacity/certaintyGlyph.test.tsx +2 -9
- package/src/components/capacity/routes.ts +42 -0
- package/src/components/capacity/shared.tsx +11 -129
- package/src/components/capacity/workspaceRoute.ts +18 -0
- package/src/components/cnpg/CNPGActionHost.compatibility.test.tsx +30 -0
- package/src/components/cnpg/CNPGArchivingRepair.tsx +191 -0
- package/src/components/cnpg/CNPGBlockingSessions.test.tsx +50 -0
- package/src/components/cnpg/CNPGBlockingSessions.tsx +333 -0
- package/src/components/cnpg/CNPGClusterActivity.test.tsx +11 -0
- package/src/components/cnpg/CNPGClusterActivity.tsx +18 -9
- package/src/components/cnpg/CNPGClusterLogs.compatibility.test.tsx +130 -0
- package/src/components/cnpg/CNPGClusterLogs.empty.test.tsx +29 -0
- package/src/components/cnpg/CNPGClusterLogs.test.ts +9 -0
- package/src/components/cnpg/CNPGClusterLogs.tsx +81 -24
- package/src/components/cnpg/CNPGClusterTabs.test.tsx +152 -0
- package/src/components/cnpg/CNPGClusterTabs.tsx +187 -0
- package/src/components/cnpg/CNPGClustersKindView.tsx +46 -0
- package/src/components/cnpg/CNPGConfiguration.test.tsx +223 -0
- package/src/components/cnpg/CNPGConfiguration.tsx +190 -0
- package/src/components/cnpg/CNPGCreateClusterDialog.test.tsx +113 -0
- package/src/components/cnpg/CNPGCreateClusterDialog.tsx +74 -0
- package/src/components/cnpg/CNPGDeclarations.test.ts +107 -0
- package/src/components/cnpg/CNPGDeclarations.tsx +236 -78
- package/src/components/cnpg/CNPGDetailPage.test.tsx +62 -0
- package/src/components/cnpg/CNPGDetailPage.tsx +159 -98
- package/src/components/cnpg/CNPGDrawerTrail.tsx +2 -2
- package/src/components/cnpg/CNPGInvestigationAction.test.tsx +30 -0
- package/src/components/cnpg/CNPGOperator.test.tsx +34 -0
- package/src/components/cnpg/CNPGOperator.tsx +78 -30
- package/src/components/cnpg/CNPGOperatorBanner.tsx +39 -0
- package/src/components/cnpg/CNPGOperatorConditions.test.tsx +45 -0
- package/src/components/cnpg/CNPGOperatorConditions.tsx +16 -0
- package/src/components/cnpg/CNPGOperatorConfig.test.tsx +27 -0
- package/src/components/cnpg/CNPGOperatorDiagnosis.tsx +247 -0
- package/src/components/cnpg/CNPGOverview.test.tsx +171 -0
- package/src/components/cnpg/CNPGOverview.tsx +238 -63
- package/src/components/cnpg/CNPGParametersInEffect.test.tsx +51 -0
- package/src/components/cnpg/CNPGParametersInEffect.tsx +120 -0
- package/src/components/cnpg/CNPGPerformance.prerequisite.test.tsx +48 -0
- package/src/components/cnpg/CNPGPerformance.test.tsx +73 -0
- package/src/components/cnpg/CNPGPerformance.tsx +477 -0
- package/src/components/cnpg/CNPGPooling.test.tsx +89 -0
- package/src/components/cnpg/CNPGPooling.tsx +97 -40
- package/src/components/cnpg/CNPGProtection.test.tsx +145 -0
- package/src/components/cnpg/CNPGProtection.tsx +228 -122
- package/src/components/cnpg/CNPGReplicationTab.test.tsx +87 -0
- package/src/components/cnpg/CNPGReplicationTab.tsx +212 -0
- package/src/components/cnpg/CNPGReplicationView.tsx +264 -0
- package/src/components/cnpg/CNPGStorage.test.tsx +140 -0
- package/src/components/cnpg/CNPGStorage.tsx +619 -0
- package/src/components/cnpg/CNPGSummaryHost.overview.test.tsx +44 -0
- package/src/components/cnpg/CNPGSummaryHost.test.tsx +23 -0
- package/src/components/cnpg/CNPGSummaryHost.tsx +230 -55
- package/src/components/cnpg/CNPGTrends.denied.test.tsx +33 -0
- package/src/components/cnpg/CNPGTrends.missing.test.tsx +69 -0
- package/src/components/cnpg/CNPGTrends.test.ts +38 -0
- package/src/components/cnpg/CNPGTrends.tsx +702 -0
- package/src/components/cnpg/CNPGView.tsx +34 -21
- package/src/components/cnpg/CNPGWorkspace.compatibility.test.tsx +90 -0
- package/src/components/cnpg/actions/CNPGClusterActions.dialog.test.tsx +79 -0
- package/src/components/cnpg/actions/CNPGClusterActions.test.tsx +142 -0
- package/src/components/cnpg/actions/CNPGClusterActions.tsx +853 -0
- package/src/components/cnpg/actions/CNPGConnectButton.read.test.tsx +40 -0
- package/src/components/cnpg/actions/CNPGConnectButton.test.ts +25 -0
- package/src/components/cnpg/actions/CNPGConnectButton.tsx +131 -0
- package/src/components/cnpg/actions/CNPGDestroyInstanceDialog.tsx +185 -0
- package/src/components/cnpg/actions/CNPGInstanceActions.test.tsx +38 -0
- package/src/components/cnpg/actions/CNPGInstanceActions.tsx +74 -0
- package/src/components/cnpg/actions/CNPGMaintenanceBanner.tsx +53 -0
- package/src/components/cnpg/actions/CNPGPoolerActions.test.tsx +35 -0
- package/src/components/cnpg/actions/CNPGPoolerActions.tsx +79 -0
- package/src/components/cnpg/actions/CNPGReportDialog.test.tsx +12 -0
- package/src/components/cnpg/actions/CNPGReportDialog.tsx +91 -0
- package/src/components/cnpg/actions/CNPGScheduleActions.run.test.tsx +58 -0
- package/src/components/cnpg/actions/CNPGScheduleActions.test.tsx +54 -0
- package/src/components/cnpg/actions/CNPGScheduleActions.tsx +208 -0
- package/src/components/cnpg/actions/actionModel.test.ts +111 -0
- package/src/components/cnpg/actions/actionModel.ts +127 -0
- package/src/components/cnpg/actions/renderCNPGHeaderActions.tsx +60 -0
- package/src/components/cnpg/actions/useCNPGWriteGuard.tsx +58 -0
- package/src/components/cnpg/actions/useOpenCNPGPsql.ts +22 -0
- package/src/components/cnpg/archivingRepair.test.ts +104 -0
- package/src/components/cnpg/archivingRepair.ts +145 -0
- package/src/components/cnpg/baseBackup.test.ts +36 -0
- package/src/components/cnpg/baseBackup.ts +36 -0
- package/src/components/cnpg/blocking.test.ts +59 -0
- package/src/components/cnpg/blocking.ts +131 -0
- package/src/components/cnpg/coverageText.test.ts +27 -0
- package/src/components/cnpg/creation/CNPGTargetFields.tsx +110 -0
- package/src/components/cnpg/creation/targetModel.test.ts +137 -0
- package/src/components/cnpg/creation/targetModel.ts +149 -0
- package/src/components/cnpg/fleetStatus.test.ts +46 -0
- package/src/components/cnpg/fleetStatus.ts +43 -0
- package/src/components/cnpg/formFields.ts +2 -0
- package/src/components/cnpg/grantText.test.tsx +11 -0
- package/src/components/cnpg/host.test.tsx +24 -0
- package/src/components/cnpg/host.tsx +101 -0
- package/src/components/cnpg/inspectModel.test.ts +120 -0
- package/src/components/cnpg/inspectModel.ts +140 -0
- package/src/components/cnpg/logicalSlots.test.ts +30 -0
- package/src/components/cnpg/logicalSlots.ts +29 -0
- package/src/components/cnpg/lsn.test.ts +40 -0
- package/src/components/cnpg/lsn.ts +43 -0
- package/src/components/cnpg/operations/CNPGFleetOperation.tsx +30 -0
- package/src/components/cnpg/operations/CNPGOperationTracker.test.tsx +247 -0
- package/src/components/cnpg/operations/CNPGOperationTracker.tsx +255 -0
- package/src/components/cnpg/operations/model.test.ts +510 -0
- package/src/components/cnpg/operations/model.ts +499 -0
- package/src/components/cnpg/operations/presentation.test.ts +80 -0
- package/src/components/cnpg/operations/presentation.ts +84 -0
- package/src/components/cnpg/operations/store.ts +98 -0
- package/src/components/cnpg/operatorStatus.test.ts +134 -0
- package/src/components/cnpg/operatorStatus.ts +194 -0
- package/src/components/cnpg/paths.test.ts +54 -0
- package/src/components/cnpg/paths.ts +47 -4
- package/src/components/cnpg/protection/CNPGAttachArchiveDialog.tsx +185 -0
- package/src/components/cnpg/protection/CNPGCreateScheduleDialog.tsx +196 -0
- package/src/components/cnpg/protection/CNPGProtectionSetup.test.tsx +121 -0
- package/src/components/cnpg/protection/CNPGProtectionSetup.tsx +452 -0
- package/src/components/cnpg/protection/CNPGScheduleInput.tsx +115 -0
- package/src/components/cnpg/protection/CNPGScheduleRepairButton.tsx +120 -0
- package/src/components/cnpg/protection/scheduleModel.test.ts +19 -0
- package/src/components/cnpg/protection/scheduleModel.ts +16 -0
- package/src/components/cnpg/recovery/CNPGRecoveryPoint.tsx +220 -0
- package/src/components/cnpg/recovery/CNPGRestoreButton.test.tsx +29 -0
- package/src/components/cnpg/recovery/CNPGRestoreButton.tsx +26 -0
- package/src/components/cnpg/recovery/CNPGRestoreChecks.test.tsx +23 -0
- package/src/components/cnpg/recovery/CNPGRestoreChecks.tsx +153 -0
- package/src/components/cnpg/recovery/CNPGRestoreDialog.back.test.tsx +149 -0
- package/src/components/cnpg/recovery/CNPGRestoreDialog.test.tsx +46 -0
- package/src/components/cnpg/recovery/CNPGRestoreDialog.tsx +333 -0
- package/src/components/cnpg/recovery/CNPGRestoreProgress.tsx +182 -0
- package/src/components/cnpg/recovery/CNPGRestoreValidation.tsx +216 -0
- package/src/components/cnpg/recovery/restoreModel.test.ts +709 -0
- package/src/components/cnpg/recovery/restoreModel.ts +685 -0
- package/src/components/cnpg/recovery/restoreOperation.ts +56 -0
- package/src/components/cnpg/refresh.test.ts +38 -0
- package/src/components/cnpg/refresh.ts +17 -0
- package/src/components/cnpg/refreshNotice.test.tsx +29 -0
- package/src/components/cnpg/routes.test.ts +34 -3
- package/src/components/cnpg/routes.ts +60 -48
- package/src/components/cnpg/runtimeAssessment.ts +198 -0
- package/src/components/cnpg/runtimeModel.test.ts +175 -0
- package/src/components/cnpg/runtimeModel.ts +196 -0
- package/src/components/cnpg/runtimeParts.test.tsx +17 -0
- package/src/components/cnpg/runtimeParts.tsx +79 -0
- package/src/components/cnpg/shared.test.tsx +59 -0
- package/src/components/cnpg/shared.tsx +100 -182
- package/src/components/cnpg/storageModel.test.ts +107 -0
- package/src/components/cnpg/storageModel.ts +101 -0
- package/src/components/cnpg/trendSamples.test.ts +148 -0
- package/src/components/cnpg/trendSamples.ts +222 -0
- package/src/components/cnpg/useCNPGClusterAssessment.ts +30 -0
- package/src/components/cnpg/useCNPGKubectlContext.test.tsx +45 -0
- package/src/components/cnpg/useCNPGKubectlContext.ts +13 -0
- package/src/components/cnpg/useCNPGNavigate.test.tsx +58 -0
- package/src/components/cnpg/useCNPGNavigate.ts +21 -0
- package/src/components/cnpg/useCNPGPoolerLive.ts +46 -0
- package/src/components/cnpg/useCNPGScreenParams.ts +24 -0
- package/src/components/cnpg/useCNPGSidebarWorkspace.ts +66 -16
- package/src/components/cnpg/workspaceRoute.ts +23 -0
- package/src/components/cost/ApplicationCostTab.test.ts +7 -0
- package/src/components/cost/ApplicationCostTab.tsx +7 -7
- package/src/components/cost/CostView.test.ts +2 -1
- package/src/components/cost/CostView.tsx +0 -2
- package/src/components/cost/WorkloadCostTab.tsx +2 -4
- package/src/components/cost/errors.ts +3 -1
- package/src/components/cost/source.test.ts +10 -0
- package/src/components/cost/source.ts +5 -1
- package/src/components/diagnose/DiagnoseSurface.tsx +3 -3
- package/src/components/diagnose/InvestigationChangesEvidence.test.tsx +352 -0
- package/src/components/diagnose/InvestigationEvidencePane.test.tsx +101 -0
- package/src/components/diagnose/InvestigationView.tsx +2 -1
- package/src/components/diagnose/investigationEvidence/adapters/changes.test.ts +123 -0
- package/src/components/diagnose/investigationEvidence/adapters/changes.ts +192 -3
- package/src/components/diagnose/investigationEvidence/adapters/issues.ts +73 -43
- package/src/components/diagnose/investigationEvidence/adapters/prometheus.ts +64 -2
- package/src/components/diagnose/investigationEvidence/adapters/resource.test.ts +37 -0
- package/src/components/diagnose/investigationEvidence/adapters/testdata/get-changes-created.json +323 -0
- package/src/components/diagnose/investigationEvidence/bodies/streams.tsx +144 -15
- package/src/components/diagnose/investigationEvidence/observations.ts +20 -0
- package/src/components/diagnose/investigationEvidence/parse.ts +57 -1
- package/src/components/diagnose/investigationEvidence/projection.test.ts +123 -0
- package/src/components/diagnose/investigationEvidence/types.ts +11 -0
- package/src/components/diagnose/investigationEvidencePresentation.test.ts +18 -0
- package/src/components/diagnose/investigationState.test.ts +36 -1
- package/src/components/diagnose/investigationState.ts +8 -0
- package/src/components/diagnose/launch.ts +2 -2
- package/src/components/dock/BottomDock.tsx +8 -3
- package/src/components/dock/TerminalTab.test.tsx +17 -0
- package/src/components/dock/TerminalTab.tsx +7 -3
- package/src/components/dock/WorkloadLogsTab.tsx +3 -0
- package/src/components/execution/BatchExecutionView.render.test.tsx +29 -1
- package/src/components/execution/BatchExecutionView.tsx +23 -8
- package/src/components/execution/cluster-template-runs.render.test.tsx +42 -0
- package/src/components/gitops/ArgoResourceDiffLoader.tsx +4 -2
- package/src/components/gitops/GitOpsView.tsx +23 -23
- package/src/components/helm/HelmCompareRoute.test.tsx +59 -0
- package/src/components/helm/HelmCompareRoute.tsx +57 -26
- package/src/components/helm/HelmReleaseDrawer.test.ts +55 -3
- package/src/components/helm/HelmReleaseDrawer.tsx +186 -64
- package/src/components/helm/HelmReleaseNotes.test.tsx +42 -0
- package/src/components/helm/HelmReleaseNotes.tsx +26 -0
- package/src/components/helm/OwnedResources.tsx +2 -2
- package/src/components/helm/TrackChartSourceDialog.render.test.tsx +192 -0
- package/src/components/helm/TrackChartSourceDialog.test.ts +51 -0
- package/src/components/helm/TrackChartSourceDialog.tsx +179 -176
- package/src/components/helm/ValuesDiffPreview.tsx +4 -1
- package/src/components/helm/ValuesViewer.test.tsx +301 -0
- package/src/components/helm/ValuesViewer.tsx +169 -78
- package/src/components/home/ActivitySummary.tsx +2 -1
- package/src/components/home/ClusterHealthCard.tsx +4 -4
- package/src/components/home/CostCard.test.tsx +100 -0
- package/src/components/home/CostCard.tsx +2 -2
- package/src/components/home/HelmSummary.tsx +2 -2
- package/src/components/home/HomeView.tsx +32 -12
- package/src/components/home/MCPSetupDialog.test.tsx +30 -0
- package/src/components/home/MCPSetupDialog.tsx +13 -6
- package/src/components/home/ProblemsPanel.test.tsx +82 -0
- package/src/components/home/TopologyPreview.tsx +2 -2
- package/src/components/home/mcpToolCatalog.ts +18 -2
- package/src/components/issues/IssuesPane.render.test.tsx +143 -0
- package/src/components/issues/IssuesPane.test.ts +65 -1
- package/src/components/issues/IssuesPane.tsx +213 -26
- package/src/components/issues/UncheckedSourceHelp.test.tsx +42 -0
- package/src/components/issues/UncheckedSourceHelp.tsx +24 -0
- package/src/components/issues/uncheckedSources.test.ts +43 -0
- package/src/components/issues/uncheckedSources.ts +74 -0
- package/src/components/logs/ScheduledWorkloadLogsViewer.tsx +4 -2
- package/src/components/resource/PVCUsageBar.render.test.tsx +32 -0
- package/src/components/resource/PVCUsageBar.test.tsx +24 -0
- package/src/components/resource/PVCUsageBar.tsx +15 -6
- package/src/components/resource/WorkloadMetricsHelpDialog.test.tsx +3 -1
- package/src/components/resource/WorkloadMetricsHelpDialog.tsx +1 -1
- package/src/components/resources/CompositeRenderer.tsx +4 -4
- package/src/components/resources/ImageFilesystemModal.test.tsx +68 -0
- package/src/components/resources/ImageFilesystemModal.tsx +11 -4
- package/src/components/resources/PodFilesystemModal.tsx +2 -2
- package/src/components/resources/ResourceDetailDrawer.tsx +2 -2
- package/src/components/resources/ResourcesView.scope.render.test.tsx +58 -0
- package/src/components/resources/ResourcesView.tsx +44 -15
- package/src/components/resources/renderers/FluxHelmReleaseRenderer.test.tsx +111 -0
- package/src/components/resources/renderers/FluxHelmReleaseRenderer.tsx +67 -0
- package/src/components/resources/renderers/KyvernoPolicyCoverage.scope.render.test.tsx +64 -0
- package/src/components/resources/renderers/KyvernoPolicyCoverage.tsx +6 -7
- package/src/components/settings/LocalIntegrationStatus.test.tsx +52 -0
- package/src/components/settings/LocalIntegrationStatus.tsx +3 -4
- package/src/components/settings/SettingsDialog.tsx +49 -30
- package/src/components/timeline/TimelineList.tsx +22 -24
- package/src/components/timeline/TimelineLoadError.test.tsx +62 -0
- package/src/components/timeline/TimelineLoadError.tsx +96 -0
- package/src/components/timeline/TimelineView.tsx +18 -45
- package/src/components/timeline/ViewModeToggle.tsx +20 -0
- package/src/components/timeline/useStickyError.test.tsx +47 -0
- package/src/components/timeline/useStickyError.ts +15 -0
- package/src/components/traffic/TrafficFilterSidebar.test.tsx +77 -0
- package/src/components/traffic/TrafficFilterSidebar.tsx +42 -31
- package/src/components/traffic/TrafficView.tsx +12 -12
- package/src/components/traffic/trafficFilters.test.ts +20 -1
- package/src/components/traffic/trafficFilters.ts +13 -0
- package/src/components/ui/DiagnosticsOverlay.tsx +34 -2
- package/src/components/ui/Markdown.test.tsx +65 -0
- package/src/components/ui/Markdown.tsx +144 -127
- package/src/components/ui/Omnibar.tsx +13 -2
- package/src/components/ui/Toast.tsx +1 -1
- package/src/components/ui/omnibar-match.test.ts +30 -0
- package/src/components/ui/omnibar-match.ts +18 -0
- package/src/components/whats-new/releaseNotes.ts +63 -1
- package/src/components/workload/CronJobSchedulingEvidence.test.tsx +35 -0
- package/src/components/workload/CronJobSchedulingEvidence.tsx +37 -0
- package/src/components/workload/NodeDrainStatus.test.tsx +253 -0
- package/src/components/workload/NodeDrainStatus.tsx +55 -0
- package/src/components/workload/WorkloadView.test.ts +10 -1
- package/src/components/workload/WorkloadView.tsx +63 -243
- package/src/components/workspace/layout.test.tsx +29 -0
- package/src/components/workspace/layout.tsx +259 -0
- package/src/components/workspace/table.ts +7 -0
- package/src/context/ConnectionContext.test.ts +27 -1
- package/src/context/ConnectionContext.tsx +17 -7
- package/src/contexts/CapabilitiesContext.tsx +1 -1
- package/src/integrations/resourceHost.test.tsx +55 -0
- package/src/integrations/resourceHost.ts +99 -0
- package/src/integrations/resourceHosts.test.tsx +142 -0
- package/src/integrations/resourceHosts.tsx +121 -0
- package/src/integrations/workspaceRoute.ts +20 -0
- package/src/integrations/workspaceRoutes.test.ts +40 -0
- package/src/integrations/workspaceRoutes.ts +22 -0
- package/src/integrations/workspaceScreens.tsx +14 -0
- package/src/utils/drawer-trail.ts +35 -0
- package/src/utils/kindFilterStore.test.ts +147 -0
- package/src/utils/kindFilterStore.ts +91 -0
- package/src/utils/navigation.test.ts +13 -1
- package/src/utils/navigation.ts +53 -2
- package/src/utils/page-links.ts +21 -0
- package/src/utils/tabStorage.ts +40 -0
- package/src/utils/viewMemory.test.ts +78 -0
- package/src/utils/viewMemory.ts +54 -0
- package/src/utils/wails-clipboard.ts +4 -2
|
@@ -247,6 +247,61 @@ describe("strict evidence adapters", () => {
|
|
|
247
247
|
}),
|
|
248
248
|
]);
|
|
249
249
|
|
|
250
|
+
const unreadIssueFeed = project([
|
|
251
|
+
tool("issues-down", "issues", {
|
|
252
|
+
issues: [],
|
|
253
|
+
total: 0,
|
|
254
|
+
total_matched: 0,
|
|
255
|
+
recent_changes_error: "timeline history is unavailable",
|
|
256
|
+
}),
|
|
257
|
+
]);
|
|
258
|
+
expect(unreadIssueFeed.limitations).toEqual([
|
|
259
|
+
expect.objectContaining({
|
|
260
|
+
source: "Issue-related changes",
|
|
261
|
+
kind: "error",
|
|
262
|
+
message: "timeline history is unavailable",
|
|
263
|
+
}),
|
|
264
|
+
]);
|
|
265
|
+
|
|
266
|
+
const evictedIssueFeed = project([
|
|
267
|
+
tool("issues-evicted", "issues", {
|
|
268
|
+
issues: [],
|
|
269
|
+
total: 0,
|
|
270
|
+
total_matched: 0,
|
|
271
|
+
recent_changes_history_coverage: {
|
|
272
|
+
incomplete: true,
|
|
273
|
+
reasons: ["events_evicted"],
|
|
274
|
+
},
|
|
275
|
+
}),
|
|
276
|
+
]);
|
|
277
|
+
expect(evictedIssueFeed.limitations).toEqual([
|
|
278
|
+
expect.objectContaining({
|
|
279
|
+
source: "Issue-related changes",
|
|
280
|
+
kind: "unknown",
|
|
281
|
+
message: expect.stringContaining("incomplete for part of the window"),
|
|
282
|
+
}),
|
|
283
|
+
]);
|
|
284
|
+
// Incomplete change history limits the change feed, not the live scan.
|
|
285
|
+
expect(groupsOf(evictedIssueFeed.groups, "receipt")).toHaveLength(1);
|
|
286
|
+
|
|
287
|
+
// So does a saturated change fetch whose rows were all discarded.
|
|
288
|
+
const saturatedIssueFeed = project([
|
|
289
|
+
tool("issues-saturated", "issues", {
|
|
290
|
+
issues: [],
|
|
291
|
+
total: 0,
|
|
292
|
+
total_matched: 0,
|
|
293
|
+
recent_changes_reason: "no_critical_issues",
|
|
294
|
+
recent_changes_truncated: true,
|
|
295
|
+
}),
|
|
296
|
+
]);
|
|
297
|
+
expect(saturatedIssueFeed.limitations).toEqual([
|
|
298
|
+
expect.objectContaining({
|
|
299
|
+
source: "Issue-related changes",
|
|
300
|
+
kind: "truncated",
|
|
301
|
+
}),
|
|
302
|
+
]);
|
|
303
|
+
expect(groupsOf(saturatedIssueFeed.groups, "receipt")).toHaveLength(1);
|
|
304
|
+
|
|
250
305
|
const filtered = project([
|
|
251
306
|
tool("filtered", "get_resource", {
|
|
252
307
|
resource: deployment,
|
|
@@ -1972,6 +2027,74 @@ describe("honest zero and partial-result states", () => {
|
|
|
1972
2027
|
});
|
|
1973
2028
|
});
|
|
1974
2029
|
|
|
2030
|
+
it("shows cluster-scoped admission changes with why each one is listed", () => {
|
|
2031
|
+
const webhook = {
|
|
2032
|
+
kind: "MutatingWebhookConfiguration",
|
|
2033
|
+
apiVersion: "admissionregistration.k8s.io/v1",
|
|
2034
|
+
name: "gatekeeper-mutating-webhook-configuration",
|
|
2035
|
+
changeType: "add",
|
|
2036
|
+
timestamp: "2026-09-02T09:55:00Z",
|
|
2037
|
+
applicability: "applies",
|
|
2038
|
+
applies_because:
|
|
2039
|
+
"webhook mutation.gatekeeper.sh has a namespaceSelector matching namespace shop's labels and its rules cover namespaced resources",
|
|
2040
|
+
};
|
|
2041
|
+
const result = project([
|
|
2042
|
+
tool("changes", "get_changes", {
|
|
2043
|
+
changes: [],
|
|
2044
|
+
clusterScopedChanges: {
|
|
2045
|
+
kinds: ["MutatingWebhookConfiguration"],
|
|
2046
|
+
window_seconds: 3600,
|
|
2047
|
+
changes: [webhook],
|
|
2048
|
+
not_listed: [
|
|
2049
|
+
"ValidatingWebhookConfiguration policy (add at 2026-09-02T09:50:00Z)",
|
|
2050
|
+
],
|
|
2051
|
+
incomplete: "Current webhook configurations are not cached.",
|
|
2052
|
+
},
|
|
2053
|
+
}),
|
|
2054
|
+
tool("issues", "issues", {
|
|
2055
|
+
issues: [],
|
|
2056
|
+
total: 0,
|
|
2057
|
+
total_matched: 0,
|
|
2058
|
+
cluster_scoped_changes: {
|
|
2059
|
+
changes: [{ ...webhook, applies_because: "" }],
|
|
2060
|
+
},
|
|
2061
|
+
}),
|
|
2062
|
+
]);
|
|
2063
|
+
const rows = groupsOf(result.groups, "changes").map(
|
|
2064
|
+
(group) => group.latest.data,
|
|
2065
|
+
);
|
|
2066
|
+
expect(rows).toHaveLength(1);
|
|
2067
|
+
const data = rows[0];
|
|
2068
|
+
expect(data.type).toBe("changes");
|
|
2069
|
+
if (data.type === "changes") {
|
|
2070
|
+
expect(data.changes[0].summary).toBe(
|
|
2071
|
+
"Applies: webhook mutation.gatekeeper.sh has a namespaceSelector matching namespace shop's labels and its rules cover namespaced resources",
|
|
2072
|
+
);
|
|
2073
|
+
}
|
|
2074
|
+
expect(result.limitations).toEqual(
|
|
2075
|
+
expect.arrayContaining([
|
|
2076
|
+
expect.objectContaining({
|
|
2077
|
+
source: "Cluster-scoped admission changes",
|
|
2078
|
+
kind: "truncated",
|
|
2079
|
+
}),
|
|
2080
|
+
expect.objectContaining({
|
|
2081
|
+
source: "Cluster-scoped admission changes",
|
|
2082
|
+
kind: "unknown",
|
|
2083
|
+
}),
|
|
2084
|
+
]),
|
|
2085
|
+
);
|
|
2086
|
+
// A row without its reason is malformed, not silently shown.
|
|
2087
|
+
expect(result.limitations).toEqual(
|
|
2088
|
+
expect.arrayContaining([
|
|
2089
|
+
expect.objectContaining({
|
|
2090
|
+
source: "Cluster-scoped admission changes",
|
|
2091
|
+
message:
|
|
2092
|
+
"Radar couldn't summarize this investigation step. Review it in Activity.",
|
|
2093
|
+
}),
|
|
2094
|
+
]),
|
|
2095
|
+
);
|
|
2096
|
+
});
|
|
2097
|
+
|
|
1975
2098
|
it("creates receipts only for confirmed complete zero-result reads", () => {
|
|
1976
2099
|
const result = project([
|
|
1977
2100
|
tool("diagnose", "diagnose", {
|
|
@@ -111,6 +111,17 @@ export interface InvestigationResourceContext extends DiagnosisResourceContext {
|
|
|
111
111
|
};
|
|
112
112
|
policySummary?: unknown;
|
|
113
113
|
podSummary?: unknown;
|
|
114
|
+
templateDivergence?: {
|
|
115
|
+
summary: string;
|
|
116
|
+
podsCompared: number;
|
|
117
|
+
podsDiffering: number;
|
|
118
|
+
podsCapped?: boolean;
|
|
119
|
+
podsNotCompared?: number;
|
|
120
|
+
examplePod?: string;
|
|
121
|
+
baseline?: string;
|
|
122
|
+
differences: string[];
|
|
123
|
+
sources?: string[];
|
|
124
|
+
};
|
|
114
125
|
}
|
|
115
126
|
export interface InvestigationGitOpsDiagnosis {
|
|
116
127
|
tool: "argocd" | "flux";
|
|
@@ -177,6 +177,24 @@ describe("evidence display significance (not record identity)", () => {
|
|
|
177
177
|
evidenceDisplaySnapshot(different),
|
|
178
178
|
);
|
|
179
179
|
});
|
|
180
|
+
it("keeps a since-creation condition warning stable and distinct from a regression", () => {
|
|
181
|
+
const snapshot = (warning: string) =>
|
|
182
|
+
evidenceDisplaySnapshot(
|
|
183
|
+
observation({ type: "resource", resource, warnings: [warning] }),
|
|
184
|
+
);
|
|
185
|
+
const sinceCreation = (elapsed: string) =>
|
|
186
|
+
snapshot(
|
|
187
|
+
"Condition `Ready=False` for ~" +
|
|
188
|
+
elapsed +
|
|
189
|
+
" — since about when this resource was created (resource age: " +
|
|
190
|
+
elapsed +
|
|
191
|
+
").",
|
|
192
|
+
);
|
|
193
|
+
expect(sinceCreation("20s")).toBe(sinceCreation("1m5s"));
|
|
194
|
+
expect(sinceCreation("20s")).not.toBe(
|
|
195
|
+
snapshot("Condition `Ready=False` for ~20s (resource age: 1h)."),
|
|
196
|
+
);
|
|
197
|
+
});
|
|
180
198
|
it("tolerates unstructured conditions without deleting their contents", () => {
|
|
181
199
|
const value = {
|
|
182
200
|
...resource,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { DiagnoseError } from "../../api/diagnose";
|
|
2
|
+
import { DiagnoseError, type RunSummary } from "../../api/diagnose";
|
|
3
3
|
import {
|
|
4
4
|
canOfferInvestigationApply,
|
|
5
5
|
initialInvestigationPane,
|
|
@@ -28,6 +28,7 @@ import {
|
|
|
28
28
|
investigationHealthSignals,
|
|
29
29
|
investigationSettledAnswerTurnIndexes,
|
|
30
30
|
investigationIsAssessmentTurn,
|
|
31
|
+
readOnlyNotice,
|
|
31
32
|
} from "./investigationState";
|
|
32
33
|
|
|
33
34
|
describe("investigation terminal presentation", () => {
|
|
@@ -1355,3 +1356,37 @@ describe("investigationFailureShown", () => {
|
|
|
1355
1356
|
});
|
|
1356
1357
|
});
|
|
1357
1358
|
});
|
|
1359
|
+
|
|
1360
|
+
describe("readOnlyNotice", () => {
|
|
1361
|
+
const base: RunSummary = {
|
|
1362
|
+
id: "r1",
|
|
1363
|
+
kind: "Deployment",
|
|
1364
|
+
group: "apps",
|
|
1365
|
+
namespace: "prod",
|
|
1366
|
+
name: "payments",
|
|
1367
|
+
context: "prod-cluster",
|
|
1368
|
+
status: "done",
|
|
1369
|
+
createdAt: "2026-01-01T00:00:00Z",
|
|
1370
|
+
updatedAt: "2026-01-01T00:00:00Z",
|
|
1371
|
+
canContinue: false,
|
|
1372
|
+
};
|
|
1373
|
+
|
|
1374
|
+
it("shows the host's reason a run can't take a follow-up", () => {
|
|
1375
|
+
expect(
|
|
1376
|
+
readOnlyNotice({
|
|
1377
|
+
...base,
|
|
1378
|
+
continueBlockedReason:
|
|
1379
|
+
"This conversation can't be continued. Start a new investigation to ask more.",
|
|
1380
|
+
}),
|
|
1381
|
+
).toBe(
|
|
1382
|
+
"This conversation can't be continued. Start a new investigation to ask more.",
|
|
1383
|
+
);
|
|
1384
|
+
});
|
|
1385
|
+
|
|
1386
|
+
it("falls back to the generic notice without one", () => {
|
|
1387
|
+
expect(readOnlyNotice(base)).toBe("This investigation is read-only.");
|
|
1388
|
+
expect(readOnlyNotice({ ...base, continueBlockedReason: " " })).toBe(
|
|
1389
|
+
"This investigation is read-only.",
|
|
1390
|
+
);
|
|
1391
|
+
});
|
|
1392
|
+
});
|
|
@@ -819,6 +819,14 @@ export function canContinueInvestigation(
|
|
|
819
819
|
);
|
|
820
820
|
}
|
|
821
821
|
|
|
822
|
+
// readOnlyNotice is what an interactive run that can't take a follow-up shows
|
|
823
|
+
// where the follow-up box would be: the host's reason when it gave one.
|
|
824
|
+
export function readOnlyNotice(run: RunSummary): string {
|
|
825
|
+
return (
|
|
826
|
+
run.continueBlockedReason?.trim() || "This investigation is read-only."
|
|
827
|
+
);
|
|
828
|
+
}
|
|
829
|
+
|
|
822
830
|
export function canInvestigateFurther(run: RunSummary, gone = false): boolean {
|
|
823
831
|
return (
|
|
824
832
|
!gone &&
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// Builds the shell command that hands an investigation off to the user's own
|
|
2
2
|
// interactive agent CLI, pointed at Radar's MCP. This is the "escape hatch" to the
|
|
3
3
|
// full agent (their config, their other MCPs, interactive approvals) — distinct
|
|
4
|
-
// from the contained in-panel engine. The
|
|
5
|
-
//
|
|
4
|
+
// from the contained in-panel engine. The endpoint follows the server MCP mode.
|
|
5
|
+
// In full mode, the client approval prompts gate changes.
|
|
6
6
|
import { type RunSummary } from "../../api/diagnose";
|
|
7
7
|
|
|
8
8
|
// sq POSIX-single-quotes a string so it's a safe single shell argument regardless
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useCallback } from 'react'
|
|
1
2
|
import { BottomDock as K8sBottomDock, DockTab, useDock, Input } from '@skyhook-io/k8s-ui'
|
|
2
3
|
import { TerminalTab } from './TerminalTab'
|
|
3
4
|
import { LogsTab } from './LogsTab'
|
|
@@ -8,7 +9,7 @@ import { TrafficFlowListTab } from './TrafficFlowListTab'
|
|
|
8
9
|
import { useFlowSearch } from '../traffic/TrafficFlowListContext'
|
|
9
10
|
import { Search } from 'lucide-react'
|
|
10
11
|
|
|
11
|
-
function renderTabContent(tab: DockTab, isActive: boolean) {
|
|
12
|
+
function renderTabContent(tab: DockTab, isActive: boolean, viewNamespaces: string[]) {
|
|
12
13
|
if (tab.type === 'terminal') {
|
|
13
14
|
return (
|
|
14
15
|
<TerminalTab
|
|
@@ -17,6 +18,8 @@ function renderTabContent(tab: DockTab, isActive: boolean) {
|
|
|
17
18
|
containerName={tab.containerName!}
|
|
18
19
|
containers={tab.containers!}
|
|
19
20
|
isActive={isActive}
|
|
21
|
+
shell={tab.shell}
|
|
22
|
+
note={tab.sessionNote}
|
|
20
23
|
/>
|
|
21
24
|
)
|
|
22
25
|
}
|
|
@@ -38,6 +41,7 @@ function renderTabContent(tab: DockTab, isActive: boolean) {
|
|
|
38
41
|
namespace={tab.namespace!}
|
|
39
42
|
workloadKind={tab.workloadKind!}
|
|
40
43
|
workloadName={tab.workloadName!}
|
|
44
|
+
viewNamespaces={viewNamespaces}
|
|
41
45
|
/>
|
|
42
46
|
)
|
|
43
47
|
}
|
|
@@ -88,8 +92,9 @@ function renderTabHeaderExtra(tab: DockTab) {
|
|
|
88
92
|
return null
|
|
89
93
|
}
|
|
90
94
|
|
|
91
|
-
export function BottomDock() {
|
|
95
|
+
export function BottomDock({ viewNamespaces }: { viewNamespaces: string[] }) {
|
|
92
96
|
const { leftOffset, tabs } = useDock()
|
|
93
97
|
const hasTrafficFlows = tabs.some(t => t.type === 'traffic-flows')
|
|
94
|
-
|
|
98
|
+
const renderContent = useCallback((tab: DockTab, isActive: boolean) => renderTabContent(tab, isActive, viewNamespaces), [viewNamespaces])
|
|
99
|
+
return <K8sBottomDock renderTabContent={renderContent} renderTabHeaderExtra={renderTabHeaderExtra} leftOffset={leftOffset} defaultHeight={hasTrafficFlows ? 300 : undefined} />
|
|
95
100
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { renderToString } from 'react-dom/server'
|
|
2
|
+
import { expect, it, vi } from 'vitest'
|
|
3
|
+
import type { TerminalTabProps } from '@skyhook-io/k8s-ui'
|
|
4
|
+
import { TerminalTab } from './TerminalTab'
|
|
5
|
+
const captured = vi.hoisted(() => ({ props: null as TerminalTabProps | null }))
|
|
6
|
+
vi.mock('@skyhook-io/k8s-ui', () => ({ TerminalTab: (props: TerminalTabProps) => { captured.props = props; return null } }))
|
|
7
|
+
vi.mock('../../api/config', () => ({ apiUrl: (path: string) => `/api${path}`, getWsUrl: (path: string) => `ws://localhost/api${path}` }))
|
|
8
|
+
it.each([undefined, '/bin/custom+command'])('forwards the executable and context through the shared terminal (%s)', async shell => {
|
|
9
|
+
renderToString(<TerminalTab namespace="app" podName="worker" containerName="app" containers={['app', 'sidecar']} shell={shell} note="Primary" />)
|
|
10
|
+
const props = captured.props!
|
|
11
|
+
expect(props.command).toBe(shell); expect(props.note).toBe('Primary')
|
|
12
|
+
expect(Boolean(props.createDebugContainer)).toBe(!shell)
|
|
13
|
+
const { wsUrl } = await props.createSession('app')
|
|
14
|
+
const url = new URL(wsUrl)
|
|
15
|
+
expect(url.pathname).toBe('/api/pods/app/worker/exec'); expect(url.searchParams.get('container')).toBe('app')
|
|
16
|
+
expect(url.searchParams.get('shell')).toBe(shell ?? null)
|
|
17
|
+
})
|
|
@@ -8,12 +8,14 @@ interface TerminalTabProps {
|
|
|
8
8
|
containerName: string
|
|
9
9
|
containers: string[]
|
|
10
10
|
isActive?: boolean
|
|
11
|
+
shell?: string
|
|
12
|
+
note?: string
|
|
11
13
|
}
|
|
12
14
|
|
|
13
|
-
export function TerminalTab({ namespace, podName, containerName, containers, isActive }: TerminalTabProps) {
|
|
15
|
+
export function TerminalTab({ namespace, podName, containerName, containers, isActive, shell, note }: TerminalTabProps) {
|
|
14
16
|
const createSession = (container: string) =>
|
|
15
17
|
Promise.resolve({
|
|
16
|
-
wsUrl: getWsUrl(`/pods/${namespace}/${podName}/exec?container=${container}`),
|
|
18
|
+
wsUrl: getWsUrl(`/pods/${namespace}/${podName}/exec?container=${container}${shell ? `&shell=${encodeURIComponent(shell)}` : ''}`),
|
|
17
19
|
})
|
|
18
20
|
|
|
19
21
|
const createDebugContainer = async (targetContainer: string) => {
|
|
@@ -37,7 +39,9 @@ export function TerminalTab({ namespace, podName, containerName, containers, isA
|
|
|
37
39
|
containers={containers}
|
|
38
40
|
isActive={isActive}
|
|
39
41
|
createSession={createSession}
|
|
40
|
-
createDebugContainer={createDebugContainer}
|
|
42
|
+
createDebugContainer={shell ? undefined : createDebugContainer}
|
|
43
|
+
note={note}
|
|
44
|
+
command={shell}
|
|
41
45
|
/>
|
|
42
46
|
)
|
|
43
47
|
}
|
|
@@ -5,12 +5,14 @@ interface WorkloadLogsTabProps {
|
|
|
5
5
|
namespace: string
|
|
6
6
|
workloadKind: string
|
|
7
7
|
workloadName: string
|
|
8
|
+
viewNamespaces?: string[]
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
export function WorkloadLogsTab({
|
|
11
12
|
namespace,
|
|
12
13
|
workloadKind,
|
|
13
14
|
workloadName,
|
|
15
|
+
viewNamespaces,
|
|
14
16
|
}: WorkloadLogsTabProps) {
|
|
15
17
|
const normalizedKind = workloadKind.toLowerCase()
|
|
16
18
|
const isScheduled = normalizedKind === 'cronjob' || normalizedKind === 'cronjobs' ||
|
|
@@ -27,6 +29,7 @@ export function WorkloadLogsTab({
|
|
|
27
29
|
kind={workloadKind}
|
|
28
30
|
namespace={namespace}
|
|
29
31
|
name={workloadName}
|
|
32
|
+
viewNamespaces={viewNamespaces}
|
|
30
33
|
/>
|
|
31
34
|
) : (
|
|
32
35
|
<WorkloadLogsViewer
|
|
@@ -2,13 +2,28 @@ import { renderToStaticMarkup } from 'react-dom/server'
|
|
|
2
2
|
import { describe, expect, it, vi } from 'vitest'
|
|
3
3
|
import { BatchExecutionFullscreen } from './BatchExecutionView'
|
|
4
4
|
|
|
5
|
+
const runQueryState = vi.hoisted(() => {
|
|
6
|
+
const state: { isLoading: boolean; error: Error | undefined } = { isLoading: false, error: undefined }
|
|
7
|
+
return state
|
|
8
|
+
})
|
|
9
|
+
|
|
5
10
|
vi.mock('../../api/client', () => ({
|
|
6
11
|
useResource: () => ({}),
|
|
7
12
|
useWorkloadPods: () => ({}),
|
|
8
13
|
useJobSetResources: () => ({ data: undefined, isLoading: false }),
|
|
9
|
-
useWorkloadRuns: () => ({ data: { collection: 'runs', runs: [], total: 0, truncated: false } }),
|
|
14
|
+
useWorkloadRuns: () => ({ ...runQueryState, data: { collection: 'runs', runs: [], total: 0, truncated: false } }),
|
|
10
15
|
}))
|
|
11
16
|
|
|
17
|
+
it('keeps CronJob configuration distinct from scheduling and completion', () => {
|
|
18
|
+
const html = renderToStaticMarkup(<BatchExecutionFullscreen
|
|
19
|
+
kind="CronJob" apiKind="cronjobs" namespace="default" name="nightly"
|
|
20
|
+
resource={{ spec: { schedule: '0 * * * *', timeZone: 'UTC', startingDeadlineSeconds: 0 }, status: {} }}
|
|
21
|
+
/>)
|
|
22
|
+
expect(html).toContain('Enabled')
|
|
23
|
+
expect(html).toContain('>UTC<')
|
|
24
|
+
expect(html).toContain('>0s<')
|
|
25
|
+
})
|
|
26
|
+
|
|
12
27
|
describe.each(['Job', 'CronJob', 'ScaledJob'])('%s cleanup retention display', (kind) => {
|
|
13
28
|
function render(ttlSecondsAfterFinished?: number) {
|
|
14
29
|
const jobSpec = { ttlSecondsAfterFinished, activeDeadlineSeconds: 60 }
|
|
@@ -34,3 +49,16 @@ describe.each(['Job', 'CronJob', 'ScaledJob'])('%s cleanup retention display', (
|
|
|
34
49
|
expect(render()).not.toContain('TTL after finish')
|
|
35
50
|
})
|
|
36
51
|
})
|
|
52
|
+
|
|
53
|
+
it.each(['loading', 'error'])('keeps scheduling evidence visible while run history is %s', (state) => {
|
|
54
|
+
runQueryState.isLoading = state === 'loading'
|
|
55
|
+
runQueryState.error = state === 'error' ? new Error('history unavailable') : undefined
|
|
56
|
+
try {
|
|
57
|
+
const html = renderToStaticMarkup(<BatchExecutionFullscreen kind="CronJob" apiKind="cronjobs" namespace="default" name="nightly" resource={{ spec: {} }} leadContent={<p>Scheduling error reported</p>} />)
|
|
58
|
+
expect(html).toContain('Scheduling error reported')
|
|
59
|
+
if (state === 'error') expect(html).toContain('Run history unavailable')
|
|
60
|
+
} finally {
|
|
61
|
+
runQueryState.isLoading = false
|
|
62
|
+
runQueryState.error = undefined
|
|
63
|
+
}
|
|
64
|
+
})
|
|
@@ -26,6 +26,7 @@ import type { WorkloadPodInfo } from '../../types'
|
|
|
26
26
|
import { getScaledJobStatus } from '../resources/resource-utils-keda'
|
|
27
27
|
import { Tooltip } from '../ui/Tooltip'
|
|
28
28
|
import { ImageFilesystemModal } from '../resources/ImageFilesystemModal'
|
|
29
|
+
import { useIsAuthEnabled } from '../../contexts/CapabilitiesContext'
|
|
29
30
|
import { executionDefinitionDiffers, executionDefinitionSummary, type ExecutionDefinitionSummary, type ExecutionUnitSummary } from './execution-definition'
|
|
30
31
|
import { batchRunHasContainerOutcome, batchRunNextStep, isFailedRunPhase, type BatchRunNextStep } from './batch-run-actions'
|
|
31
32
|
import { JobSetAdmission } from './JobSetAdmission'
|
|
@@ -105,6 +106,7 @@ function mergeWorkflowArguments(base: any, overlay: any): any {
|
|
|
105
106
|
}
|
|
106
107
|
|
|
107
108
|
interface BatchExecutionProps {
|
|
109
|
+
leadContent?: ReactNode
|
|
108
110
|
kind: string
|
|
109
111
|
apiKind: string
|
|
110
112
|
namespace: string
|
|
@@ -116,9 +118,11 @@ interface BatchExecutionProps {
|
|
|
116
118
|
onSwitchToLogs?: () => void
|
|
117
119
|
onSwitchToTimeline?: () => void
|
|
118
120
|
onNavigateToResource?: (resource: ResourceNavigationTarget) => void
|
|
121
|
+
/** The view's namespace selection; narrows a cluster-scoped template's runs. */
|
|
122
|
+
viewNamespaces?: string[]
|
|
119
123
|
}
|
|
120
124
|
|
|
121
|
-
export function BatchExecutionFullscreen({ kind, apiKind, namespace, name, resource, selectedRunKey = '', canViewLogs = false, onSelectRun, onSwitchToLogs, onSwitchToTimeline, onNavigateToResource }: BatchExecutionProps) {
|
|
125
|
+
export function BatchExecutionFullscreen({ leadContent, kind, apiKind, namespace, name, resource, selectedRunKey = '', canViewLogs = false, onSelectRun, onSwitchToLogs, onSwitchToTimeline, onNavigateToResource, viewNamespaces }: BatchExecutionProps) {
|
|
122
126
|
const scheduled = SCHEDULED_KINDS.has(kind)
|
|
123
127
|
const clusterScoped = kind === 'ClusterWorkflowTemplate'
|
|
124
128
|
const jobSetRoot = isJobSetV1Alpha2(resource)
|
|
@@ -127,7 +131,7 @@ export function BatchExecutionFullscreen({ kind, apiKind, namespace, name, resou
|
|
|
127
131
|
const debouncedSearch = useDebouncedValue(runSearch, 250, value => value === '')
|
|
128
132
|
const [roleFilter, setRoleFilter] = useState('')
|
|
129
133
|
const memberOptions = { role: roleFilter, search: debouncedSearch, state: runFilter, selected: selectedRunKey }
|
|
130
|
-
const runsQuery = useWorkloadRuns(apiKind, namespace, name, true, { refetchActive: true, clusterScoped, ...(jobSetRoot ? memberOptions : {}) })
|
|
134
|
+
const runsQuery = useWorkloadRuns(apiKind, namespace, name, true, { refetchActive: true, clusterScoped, namespaces: viewNamespaces, ownerUID: kind === 'CronJob' ? resource.metadata?.uid : undefined, ...(jobSetRoot ? memberOptions : {}) })
|
|
131
135
|
const resourcesQuery = useJobSetResources(namespace, name, jobSetRoot ? resource.metadata?.uid : undefined, memberOptions)
|
|
132
136
|
const memberCollection = runsQuery.data?.collection === 'members'
|
|
133
137
|
const memberShell = memberCollection || (!runsQuery.data && jobSetRoot)
|
|
@@ -251,12 +255,18 @@ export function BatchExecutionFullscreen({ kind, apiKind, namespace, name, resou
|
|
|
251
255
|
: 'Radar could not load retained runs.'
|
|
252
256
|
|
|
253
257
|
if (runsQuery.isLoading && !jobSetRoot) {
|
|
254
|
-
return
|
|
258
|
+
return (
|
|
259
|
+
<div className="flex h-full min-h-0 flex-col">
|
|
260
|
+
{leadContent && <div className="p-4">{leadContent}</div>}
|
|
261
|
+
<FetchResult loading className="min-h-0 flex-1" />
|
|
262
|
+
</div>
|
|
263
|
+
)
|
|
255
264
|
}
|
|
256
265
|
|
|
257
266
|
if (runsQuery.error && !jobSetRoot) {
|
|
258
267
|
return (
|
|
259
|
-
<div className="p-4">
|
|
268
|
+
<div className="space-y-4 p-4">
|
|
269
|
+
{leadContent && <div className="space-y-4">{leadContent}</div>}
|
|
260
270
|
<EmptyState
|
|
261
271
|
tone="neutral"
|
|
262
272
|
variant="card"
|
|
@@ -339,6 +349,7 @@ export function BatchExecutionFullscreen({ kind, apiKind, namespace, name, resou
|
|
|
339
349
|
|
|
340
350
|
<main className="min-w-0 flex-1 overflow-auto">
|
|
341
351
|
<div className="space-y-4 p-4">
|
|
352
|
+
{leadContent && <div className="space-y-4">{leadContent}</div>}
|
|
342
353
|
{jobSetRoot && (
|
|
343
354
|
<section className="rounded-lg border border-theme-border bg-theme-surface p-4" aria-label="JobSet overview">
|
|
344
355
|
<JobSetRenderer data={resource} mode="overview" shownMemberCounts={shownMemberCounts} onSelectRole={memberCollection ? selectRole : undefined} />
|
|
@@ -560,7 +571,7 @@ function sourceFacts(kind: string, resource: any, runs: WorkloadRun[]) {
|
|
|
560
571
|
const definition = executionDefinitionSummary(kind, resource)
|
|
561
572
|
if (kind === 'CronJob') {
|
|
562
573
|
return {
|
|
563
|
-
state: spec.suspend ? 'Suspended' : (status.active?.length ?? 0) > 0 ? 'Active' : '
|
|
574
|
+
state: spec.suspend ? 'Suspended' : (status.active?.length ?? 0) > 0 ? 'Active' : 'Enabled',
|
|
564
575
|
stateTone: spec.suspend ? 'warning' : 'info',
|
|
565
576
|
schedule: spec.schedule,
|
|
566
577
|
concurrency: spec.concurrencyPolicy || 'Allow',
|
|
@@ -570,7 +581,8 @@ function sourceFacts(kind: string, resource: any, runs: WorkloadRun[]) {
|
|
|
570
581
|
facts: [
|
|
571
582
|
['Last schedule', status.lastScheduleTime ? formatTimeAgo(status.lastScheduleTime) : 'Never'],
|
|
572
583
|
['Last success', status.lastSuccessfulTime ? formatTimeAgo(status.lastSuccessfulTime) : 'Never'],
|
|
573
|
-
['
|
|
584
|
+
['Time zone', spec.timeZone ?? 'Controller local time (zone not reported)'],
|
|
585
|
+
['Starting deadline', spec.startingDeadlineSeconds != null ? `${spec.startingDeadlineSeconds}s` : 'None'],
|
|
574
586
|
],
|
|
575
587
|
definition,
|
|
576
588
|
}
|
|
@@ -720,18 +732,21 @@ function ExecutionDefinitionDetails({ summary, namespace, compact = false }: { s
|
|
|
720
732
|
|
|
721
733
|
function ExecutionUnitDetails({ unit, namespace, pullSecrets, compact }: { unit: ExecutionUnitSummary; namespace: string; pullSecrets: string[]; compact: boolean }) {
|
|
722
734
|
const [browseImage, setBrowseImage] = useState(false)
|
|
735
|
+
const authEnabled = useIsAuthEnabled()
|
|
736
|
+
// With auth on, images are browsed through a Pod; a template has none.
|
|
737
|
+
const canBrowseImage = !authEnabled
|
|
723
738
|
return (
|
|
724
739
|
<>
|
|
725
740
|
<div className={clsx(!compact && 'rounded-md bg-theme-elevated/40 px-3 py-2')}>
|
|
726
741
|
{!compact && <div className="mb-1 flex items-center justify-between gap-3"><span className="truncate text-xs font-medium text-theme-text-primary">{unit.name}</span><span className="text-[10px] uppercase tracking-wide text-theme-text-tertiary">{unit.type}</span></div>}
|
|
727
742
|
<div className="space-y-1">
|
|
728
|
-
{unit.image && <DefinitionFact label="Image" value={unit.image} mono onClick={() => setBrowseImage(true)} tooltip=
|
|
743
|
+
{unit.image && <DefinitionFact label="Image" value={unit.image} mono onClick={canBrowseImage ? () => setBrowseImage(true) : undefined} tooltip={canBrowseImage ? 'Browse image filesystem from registry' : undefined} />}
|
|
729
744
|
{unit.command && <DefinitionFact label="Command" value={unit.command} mono />}
|
|
730
745
|
{!compact && unit.requests && <DefinitionFact label="Requests" value={unit.requests} />}
|
|
731
746
|
{!compact && unit.limits && <DefinitionFact label="Limits" value={unit.limits} />}
|
|
732
747
|
</div>
|
|
733
748
|
</div>
|
|
734
|
-
{unit.image && (
|
|
749
|
+
{unit.image && canBrowseImage && (
|
|
735
750
|
<ImageFilesystemModal
|
|
736
751
|
open={browseImage}
|
|
737
752
|
onClose={() => setBrowseImage(false)}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { renderToStaticMarkup } from 'react-dom/server'
|
|
2
|
+
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
|
3
|
+
import { BatchExecutionFullscreen } from './BatchExecutionView'
|
|
4
|
+
import { ScheduledWorkloadLogsViewer } from '../logs/ScheduledWorkloadLogsViewer'
|
|
5
|
+
import { WorkloadLogsTab } from '../dock/WorkloadLogsTab'
|
|
6
|
+
|
|
7
|
+
const runs = vi.hoisted(() => vi.fn(() => ({ data: { collection: 'runs', runs: [], total: 0, truncated: false } })))
|
|
8
|
+
|
|
9
|
+
vi.mock('../../api/client', () => ({
|
|
10
|
+
useResource: () => ({}),
|
|
11
|
+
useWorkloadPods: () => ({}),
|
|
12
|
+
useJobSetResources: () => ({ data: undefined, isLoading: false }),
|
|
13
|
+
useWorkloadRuns: runs,
|
|
14
|
+
}))
|
|
15
|
+
vi.mock('../logs/WorkloadLogsViewer', () => ({ WorkloadLogsViewer: () => null }))
|
|
16
|
+
|
|
17
|
+
const view = ['team-a', 'team-b']
|
|
18
|
+
|
|
19
|
+
function runsOptions() {
|
|
20
|
+
return (runs.mock.calls.at(-1) as unknown[] | undefined)?.[4]
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
beforeEach(() => runs.mockClear())
|
|
24
|
+
|
|
25
|
+
// A ClusterWorkflowTemplate's runs span namespaces; every surface listing them
|
|
26
|
+
// narrows them to the view's selection.
|
|
27
|
+
describe('cluster-scoped template runs follow the view selection', () => {
|
|
28
|
+
it('in the execution overview', () => {
|
|
29
|
+
renderToStaticMarkup(<BatchExecutionFullscreen kind="ClusterWorkflowTemplate" apiKind="clusterworkflowtemplates" namespace="" name="build" resource={{ spec: {} }} viewNamespaces={view} />)
|
|
30
|
+
expect(runsOptions()).toMatchObject({ clusterScoped: true, namespaces: view })
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
it('in the logs tab', () => {
|
|
34
|
+
renderToStaticMarkup(<ScheduledWorkloadLogsViewer kind="clusterworkflowtemplates" namespace="" name="build" viewNamespaces={view} />)
|
|
35
|
+
expect(runsOptions()).toMatchObject({ clusterScoped: true, namespaces: view })
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
it('in the dock', () => {
|
|
39
|
+
renderToStaticMarkup(<WorkloadLogsTab namespace="" workloadKind="ClusterWorkflowTemplate" workloadName="build" viewNamespaces={view} />)
|
|
40
|
+
expect(runsOptions()).toMatchObject({ clusterScoped: true, namespaces: view })
|
|
41
|
+
})
|
|
42
|
+
})
|
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
import { ArgoResourceDiff } from '@skyhook-io/k8s-ui'
|
|
2
|
-
import type { GitOpsInsightRef } from '@skyhook-io/k8s-ui'
|
|
2
|
+
import type { GitOpsDrift, GitOpsInsightRef } from '@skyhook-io/k8s-ui'
|
|
3
3
|
import { useArgoResourceDiff } from '../../api/client'
|
|
4
4
|
|
|
5
5
|
interface ArgoResourceDiffLoaderProps {
|
|
6
6
|
appNamespace: string
|
|
7
7
|
appName: string
|
|
8
8
|
resourceRef: GitOpsInsightRef
|
|
9
|
+
fallbackDrift?: GitOpsDrift
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
// Host wrapper: fetches the Argo CD resource diff and hands the data to the
|
|
12
13
|
// pure k8s-ui presentation component. Mirrors the data-in-web / render-in-
|
|
13
14
|
// k8s-ui split the resource renderers use for their host-wired data.
|
|
14
|
-
export function ArgoResourceDiffLoader({ appNamespace, appName, resourceRef }: ArgoResourceDiffLoaderProps) {
|
|
15
|
+
export function ArgoResourceDiffLoader({ appNamespace, appName, resourceRef, fallbackDrift }: ArgoResourceDiffLoaderProps) {
|
|
15
16
|
const { data, isLoading, error } = useArgoResourceDiff(appNamespace, appName, resourceRef)
|
|
16
17
|
return (
|
|
17
18
|
<ArgoResourceDiff
|
|
18
19
|
diff={data ?? null}
|
|
19
20
|
loading={isLoading}
|
|
20
21
|
error={(error as Error | null)?.message ?? null}
|
|
22
|
+
fallbackDrift={fallbackDrift}
|
|
21
23
|
/>
|
|
22
24
|
)
|
|
23
25
|
}
|