@skyhook-io/radar-app 1.19.0 → 1.20.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 +5 -5
- package/src/App.tsx +31 -5
- package/src/api/application-evidence.ts +63 -0
- package/src/api/argoSync.test.ts +22 -0
- package/src/api/client.audit-gating.test.tsx +48 -0
- package/src/api/client.kueuePosition.test.ts +32 -0
- package/src/api/client.kueueQueueWorkloads.test.tsx +71 -0
- package/src/api/client.resource-identity.test.ts +3 -0
- package/src/api/client.resourceIssues.test.tsx +239 -0
- package/src/api/client.resourcePath.test.ts +3 -0
- package/src/api/client.ts +285 -55
- package/src/api/config.ts +21 -0
- package/src/api/diagnose.ts +4 -0
- package/src/api/radarFeatures.render.test.tsx +33 -1
- package/src/api/radarFeatures.test.ts +47 -0
- package/src/api/radarFeatures.ts +40 -1
- package/src/api/rbac.settled.test.tsx +42 -0
- package/src/api/rbac.test.ts +18 -0
- package/src/api/rbac.ts +37 -7
- package/src/api/traffic.ts +9 -4
- package/src/api/usage-data.fixtures.ts +3 -1
- package/src/api/usage-data.test.tsx +134 -0
- package/src/api/usage-data.ts +35 -7
- package/src/api/workloadPodsPolling.test.ts +26 -0
- package/src/components/CloudConnectFlow.test.tsx +86 -0
- package/src/components/CloudConnectFlow.tsx +65 -27
- package/src/components/CloudFunnelButton.test.tsx +140 -5
- package/src/components/CloudFunnelButton.tsx +50 -9
- package/src/components/ConnectionErrorView.test.tsx +34 -0
- package/src/components/ConnectionErrorView.tsx +35 -11
- package/src/components/ContextSwitcher.tsx +5 -2
- package/src/components/SwitchAwareConnectionError.test.tsx +43 -0
- package/src/components/SwitchAwareConnectionError.tsx +85 -0
- package/src/components/application-evidence/ApplicationEvidenceAction.flow.test.tsx +234 -0
- package/src/components/application-evidence/ApplicationEvidenceAction.test.tsx +144 -0
- package/src/components/application-evidence/ApplicationEvidenceAction.tsx +218 -0
- package/src/components/capacity/CapacityDemand.tsx +3 -2
- package/src/components/capacity/demandSummary.test.ts +38 -0
- package/src/components/capacity/shared.tsx +12 -1
- package/src/components/cost/ApplicationCostTab.tsx +4 -0
- package/src/components/cost/CostTrendChart.tsx +2 -0
- package/src/components/cost/WorkloadCostTab.tsx +4 -0
- package/src/components/cost/source.test.ts +5 -0
- package/src/components/cost/source.ts +11 -0
- package/src/components/diagnose/AIMarkdown.tsx +3 -0
- package/src/components/diagnose/AgentSetupNotice.test.tsx +17 -0
- package/src/components/diagnose/AgentSetupNotice.tsx +21 -3
- package/src/components/diagnose/ContinueInAgentButton.mounted.test.tsx +182 -0
- package/src/components/diagnose/ContinueInAgentButton.test.tsx +128 -0
- package/src/components/diagnose/ContinueInAgentButton.tsx +303 -0
- package/src/components/diagnose/DiagnoseContext.question.test.tsx +1 -1
- package/src/components/diagnose/DiagnoseContext.tsx +68 -2
- package/src/components/diagnose/DiagnoseSurface.tsx +58 -113
- package/src/components/diagnose/ExampleInvestigationLink.tsx +20 -0
- package/src/components/diagnose/Home.test.tsx +26 -0
- package/src/components/diagnose/Home.tsx +20 -1
- package/src/components/diagnose/InvestigationEvidenceSections.tsx +45 -22
- package/src/components/diagnose/InvestigationView.tsx +94 -26
- package/src/components/diagnose/LocalDiagnoseAction.history.test.tsx +450 -0
- package/src/components/diagnose/LocalDiagnoseAction.tsx +354 -35
- package/src/components/diagnose/NextStepJump.test.tsx +92 -0
- package/src/components/diagnose/NextStepJump.tsx +75 -0
- package/src/components/diagnose/QuestionComposer.tsx +8 -0
- package/src/components/diagnose/exampleInvestigation.events.json +191 -0
- package/src/components/diagnose/exampleInvestigation.loadFailure.test.tsx +94 -0
- package/src/components/diagnose/exampleInvestigation.test.tsx +248 -0
- package/src/components/diagnose/exampleInvestigation.ts +121 -0
- package/src/components/diagnose/investigationCase.test.tsx +9 -1
- package/src/components/diagnose/investigationEvidence/adapters/applicationFindings.test.ts +739 -0
- package/src/components/diagnose/investigationEvidence/adapters/diagnose.ts +50 -2
- package/src/components/diagnose/investigationEvidence/adapters/issues.ts +9 -0
- package/src/components/diagnose/investigationEvidence/builder.ts +30 -0
- package/src/components/diagnose/investigationEvidence/observations.ts +121 -2
- package/src/components/diagnose/investigationEvidence/projection.test.ts +85 -3
- package/src/components/diagnose/investigationEvidence/types.ts +5 -0
- package/src/components/diagnose/investigationState.ts +28 -0
- package/src/components/diagnose/lastInvestigation.test.ts +95 -0
- package/src/components/diagnose/lastInvestigation.ts +58 -0
- package/src/components/diagnose/launch.test.ts +125 -1
- package/src/components/diagnose/launch.ts +57 -10
- package/src/components/diagnose/toolCallLabel.test.ts +10 -4
- package/src/components/execution/BatchExecutionView.tsx +24 -11
- package/src/components/execution/JobSetAdmission.test.tsx +42 -0
- package/src/components/execution/JobSetAdmission.tsx +18 -3
- package/src/components/execution/JobSetMemberComparison.tsx +2 -1
- package/src/components/execution/runState.test.ts +14 -0
- package/src/components/execution/runState.ts +8 -0
- package/src/components/gitops/GitOpsView.rollbackGate.test.tsx +202 -0
- package/src/components/gitops/GitOpsView.syncRequest.test.tsx +369 -0
- package/src/components/gitops/GitOpsView.tsx +86 -17
- package/src/components/gitops/RemoteDestinationCloudHint.tsx +2 -3
- package/src/components/gitops/destination-toast.test.ts +1 -1
- package/src/components/gitops/destination-toast.ts +2 -2
- package/src/components/home/ClusterHealthCard.tsx +1 -1
- package/src/components/home/HomeAgentBlock.test.tsx +31 -3
- package/src/components/home/HomeAgentBlock.tsx +13 -4
- package/src/components/home/HomeDiagramCard.tsx +47 -0
- package/src/components/home/HomeView.tsx +81 -41
- package/src/components/home/MCPSetupDialog.test.tsx +95 -5
- package/src/components/home/MCPSetupDialog.tsx +30 -5
- package/src/components/home/ProblemsPanel.investigate.test.tsx +171 -0
- package/src/components/home/ProblemsPanel.test.tsx +3 -1
- package/src/components/home/TopologyPreview.test.tsx +73 -0
- package/src/components/home/TopologyPreview.tsx +120 -233
- package/src/components/home/TrafficSummary.test.tsx +63 -0
- package/src/components/home/TrafficSummary.tsx +135 -138
- package/src/components/home/mcpToolCatalog.ts +23 -10
- package/src/components/issues/IssuesPane.test.ts +11 -0
- package/src/components/issues/IssuesPane.tsx +15 -5
- package/src/components/issues/uncheckedSources.test.ts +20 -1
- package/src/components/issues/uncheckedSources.ts +18 -0
- package/src/components/kueue/KueuePendingPosition.tsx +35 -0
- package/src/components/kueue/useRelatedObjects.test.tsx +219 -0
- package/src/components/kueue/useRelatedReads.test.ts +56 -0
- package/src/components/kueue/useRelatedReads.ts +205 -0
- package/src/components/logs/MultiPodLogsTab.test.tsx +93 -0
- package/src/components/logs/MultiPodLogsTab.tsx +120 -0
- package/src/components/logs/PodLogsUnavailable.test.tsx +18 -0
- package/src/components/logs/PodLogsUnavailable.tsx +21 -0
- package/src/components/logs/RayClusterLogsTab.reselect.test.tsx +67 -0
- package/src/components/logs/RayClusterLogsTab.test.tsx +167 -0
- package/src/components/logs/RayClusterLogsTab.tsx +109 -0
- package/src/components/logs/ScheduledWorkloadLogsViewer.tsx +3 -2
- package/src/components/logs/rayClusterPods.ts +32 -0
- package/src/components/outageSince.test.ts +21 -0
- package/src/components/outageSince.ts +10 -0
- package/src/components/resource/PrometheusCharts.overlays.test.ts +12 -0
- package/src/components/resource/PrometheusCharts.tsx +3 -40
- package/src/components/resources/crd/CRDSchemaTab.test.tsx +28 -0
- package/src/components/resources/crd/CRDSchemaTab.tsx +13 -0
- package/src/components/resources/crd/host.tsx +14 -0
- package/src/components/resources/renderers/CustomResourceDefinitionRenderer.test.tsx +27 -0
- package/src/components/resources/renderers/CustomResourceDefinitionRenderer.tsx +12 -0
- package/src/components/resources/renderers/JobAdmissionRenderers.test.tsx +4 -1
- package/src/components/resources/renderers/JobAdmissionRenderers.tsx +4 -3
- package/src/components/resources/renderers/KueueHostRenderers.test.tsx +117 -0
- package/src/components/resources/renderers/KueueQueueRenderers.test.tsx +97 -0
- package/src/components/resources/renderers/KueueQueueRenderers.tsx +139 -0
- package/src/components/resources/renderers/KueueWorkloadRenderer.test.tsx +7 -1
- package/src/components/resources/renderers/KueueWorkloadRenderer.tsx +47 -7
- package/src/components/resources/renderers/OpenTelemetryCollectorRenderer.test.tsx +67 -0
- package/src/components/resources/renderers/OpenTelemetryCollectorRenderer.tsx +31 -0
- package/src/components/resources/renderers/RayClusterRenderer.test.tsx +81 -3
- package/src/components/resources/renderers/RayClusterRenderer.tsx +19 -4
- package/src/components/traffic/TrafficView.tsx +3 -3
- package/src/components/ui/command-items-crd.test.tsx +23 -0
- package/src/components/ui/command-items.ts +2 -1
- package/src/components/useContextSwitchFlow.test.tsx +61 -0
- package/src/components/useContextSwitchFlow.tsx +21 -4
- package/src/components/whats-new/WhatsNew.test.ts +10 -3
- package/src/components/whats-new/WhatsNew.tsx +5 -1
- package/src/components/whats-new/WhatsNewDialog.test.tsx +17 -3
- package/src/components/whats-new/releaseNotes.ts +77 -4
- package/src/components/workload/RelatedFindingsSection.test.tsx +126 -0
- package/src/components/workload/RelatedFindingsSection.tsx +80 -0
- package/src/components/workload/WorkloadView.test.ts +10 -1
- package/src/components/workload/WorkloadView.tsx +85 -98
- package/src/components/workload/issueResourceOpener.test.ts +20 -0
- package/src/components/workload/issueResourceOpener.ts +17 -0
- package/src/context/ConnectionContext.tsx +133 -60
- package/src/context/ConnectionProvider.retry.test.tsx +176 -0
- package/src/context/ContextSwitchContext.tsx +14 -1
- package/src/context/DiagnoseCustomization.tsx +3 -0
- package/src/context/clusterConnected.ts +10 -0
- package/src/contexts/CapabilitiesContext.tsx +6 -4
- package/src/hooks/useElementSize.ts +30 -0
- package/src/integrations/resourceHost.test.tsx +1 -0
- package/src/integrations/resourceHost.ts +5 -1
- package/src/integrations/resourceHosts.test.tsx +21 -4
- package/src/integrations/resourceHosts.tsx +12 -0
- package/src/main.tsx +5 -0
- package/src/utils/related-findings.ts +46 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
// A finished investigation bundled with Radar, so someone who has never run one
|
|
2
|
+
// can see what it produces before installing an agent or consenting to
|
|
3
|
+
// anything. It is a real run from a test cluster with its identifying values
|
|
4
|
+
// replaced; it replays through the same view as a saved run, from this bundle
|
|
5
|
+
// rather than the server, so it works against any Radar a host embeds.
|
|
6
|
+
import { createContext, useContext } from "react";
|
|
7
|
+
import type {
|
|
8
|
+
DiagnoseStreamEvent,
|
|
9
|
+
RunSummary,
|
|
10
|
+
SubscribeHandlers,
|
|
11
|
+
} from "../../api/diagnose";
|
|
12
|
+
|
|
13
|
+
// Never issued by a server: Radar's run ids are `run-<hex>`.
|
|
14
|
+
export const EXAMPLE_INVESTIGATION_ID = "example";
|
|
15
|
+
|
|
16
|
+
export function isExampleInvestigation(id: string | null | undefined): boolean {
|
|
17
|
+
return id === EXAMPLE_INVESTIGATION_ID;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Offered only until the user has investigations of their own: automatic runs
|
|
21
|
+
// and runs others shared with them don't count, as in the history list's
|
|
22
|
+
// grouping. On the setup step no history is fetched, and with no agent there is
|
|
23
|
+
// none of theirs to show. Not while a start waits for consent: that start owns
|
|
24
|
+
// the pane.
|
|
25
|
+
export function exampleInvestigationOffered(input: {
|
|
26
|
+
runs: readonly RunSummary[];
|
|
27
|
+
runsLoaded: boolean;
|
|
28
|
+
setupPending: boolean;
|
|
29
|
+
needsConsent: boolean;
|
|
30
|
+
}): boolean {
|
|
31
|
+
const own = input.runs.filter(
|
|
32
|
+
(run) => run.trigger !== "background" && run.ownedByMe !== false,
|
|
33
|
+
);
|
|
34
|
+
return (
|
|
35
|
+
!input.needsConsent &&
|
|
36
|
+
own.length === 0 &&
|
|
37
|
+
(input.runsLoaded || input.setupPending)
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export const EXAMPLE_INVESTIGATION_RUN: RunSummary = {
|
|
42
|
+
id: EXAMPLE_INVESTIGATION_ID,
|
|
43
|
+
kind: "Deployment",
|
|
44
|
+
group: "apps",
|
|
45
|
+
namespace: "guestbook",
|
|
46
|
+
name: "guestbook-ui",
|
|
47
|
+
context: "sample-cluster",
|
|
48
|
+
agent: "claude",
|
|
49
|
+
profile: "safeguarded",
|
|
50
|
+
managedBy: "Argo CD",
|
|
51
|
+
health: {
|
|
52
|
+
health: "healthy",
|
|
53
|
+
issueCount: 1,
|
|
54
|
+
highestSeverity: "critical",
|
|
55
|
+
topReason: "ErrImagePull",
|
|
56
|
+
issues: [
|
|
57
|
+
{
|
|
58
|
+
severity: "critical",
|
|
59
|
+
reason: "ErrImagePull",
|
|
60
|
+
message:
|
|
61
|
+
'rpc error: code = NotFound desc = failed to pull and unpack image "gcr.io/google-samples/gb-frontend:v99-missing": failed to resolve reference "gcr.io/google-samples/gb-frontend:v99-missing": gcr.io/google-samples/gb-fr…',
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
auditCount: 11,
|
|
65
|
+
auditSeverity: "high",
|
|
66
|
+
topFinding: "privilegeEscalation",
|
|
67
|
+
auditFindings: [
|
|
68
|
+
{
|
|
69
|
+
severity: "high",
|
|
70
|
+
reason: "privilegeEscalation",
|
|
71
|
+
message: 'Container "guestbook-ui" allows privilege escalation',
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
severity: "medium",
|
|
75
|
+
reason: "automountServiceAccountToken",
|
|
76
|
+
message: "Service account token is auto-mounted",
|
|
77
|
+
},
|
|
78
|
+
],
|
|
79
|
+
},
|
|
80
|
+
status: "done",
|
|
81
|
+
preview:
|
|
82
|
+
"A direct edit set guestbook-ui to a nonexistent image tag; the new pod can't start and the rollout is stuck on the old pod.",
|
|
83
|
+
createdAt: "2026-10-08T10:45:35Z",
|
|
84
|
+
updatedAt: "2026-10-08T10:46:41Z",
|
|
85
|
+
canContinue: false,
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
// Replays the bundled transcript with the same handler contract as
|
|
89
|
+
// subscribeRun: replay start, every event with its sequence, then the replay
|
|
90
|
+
// boundary. Loaded on demand so the transcript stays out of the main bundle.
|
|
91
|
+
export function replayExampleInvestigation(
|
|
92
|
+
handlers: SubscribeHandlers,
|
|
93
|
+
): () => void {
|
|
94
|
+
let cancelled = false;
|
|
95
|
+
void import("./exampleInvestigation.events.json").then(
|
|
96
|
+
({ default: events }) => {
|
|
97
|
+
if (cancelled) return;
|
|
98
|
+
handlers.onReplayStart?.();
|
|
99
|
+
(events as unknown as DiagnoseStreamEvent[]).forEach((event, index) => {
|
|
100
|
+
if (!cancelled) handlers.onEvent(event, index + 1);
|
|
101
|
+
});
|
|
102
|
+
if (!cancelled) handlers.onEvent({ type: "replay_complete" });
|
|
103
|
+
},
|
|
104
|
+
() => {
|
|
105
|
+
if (!cancelled) handlers.onClosed?.("unavailable");
|
|
106
|
+
},
|
|
107
|
+
);
|
|
108
|
+
return () => {
|
|
109
|
+
cancelled = true;
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const ExampleInvestigationContext = createContext(false);
|
|
114
|
+
export const ExampleInvestigationProvider =
|
|
115
|
+
ExampleInvestigationContext.Provider;
|
|
116
|
+
|
|
117
|
+
// Copy buttons read this: the example is for looking at, and a copied
|
|
118
|
+
// command or verdict would carry sample values somewhere they could be acted on.
|
|
119
|
+
export function useInExampleInvestigation(): boolean {
|
|
120
|
+
return useContext(ExampleInvestigationContext);
|
|
121
|
+
}
|
|
@@ -2223,7 +2223,15 @@ describe("agent case robustness", () => {
|
|
|
2223
2223
|
expect(html).toContain('data-testid="investigation-ruled-out"');
|
|
2224
2224
|
expect(html).toContain("Kept");
|
|
2225
2225
|
expect(html).not.toContain("Points at a source-placed item");
|
|
2226
|
-
expect(html).toContain("See CrashLoopBackOff");
|
|
2226
|
+
expect(html).toContain("See CrashLoopBackOff issue on api");
|
|
2227
|
+
// A ruled-out hypothesis is labelled as such and carries the claim of the
|
|
2228
|
+
// evidence that contradicts it, so it never reads as a finding.
|
|
2229
|
+
const ruledOutStart = html.indexOf('data-testid="investigation-ruled-out"');
|
|
2230
|
+
const ruledOut = html.slice(ruledOutStart, html.indexOf("</section>", ruledOutStart));
|
|
2231
|
+
expect(ruledOut).toMatch(/>Ruled out<span[^>]*>Agent<\/span><\/h3>/);
|
|
2232
|
+
expect(ruledOut).toContain("Ruled out: </span>Kept");
|
|
2233
|
+
expect(ruledOut).toContain("Valid, on the issue.");
|
|
2234
|
+
expect(html).not.toContain("Also checked");
|
|
2227
2235
|
});
|
|
2228
2236
|
|
|
2229
2237
|
it("shows a source-placed claim in Assessment details with its role", () => {
|