@skyhook-io/radar-app 1.18.2 → 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 +7 -7
- package/src/App.tsx +31 -6
- 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.test.ts +33 -2
- package/src/api/diagnose.ts +97 -3
- package/src/api/radarFeatures.render.test.tsx +33 -1
- package/src/api/radarFeatures.test.ts +47 -0
- package/src/api/radarFeatures.ts +41 -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 +4 -1
- package/src/components/diagnose/ActivityTurn.tsx +34 -14
- package/src/components/diagnose/AgentControls.tsx +53 -6
- package/src/components/diagnose/AgentSetupNotice.test.tsx +17 -0
- package/src/components/diagnose/AgentSetupNotice.tsx +22 -4
- package/src/components/diagnose/AgentSigninNotice.test.tsx +98 -0
- package/src/components/diagnose/AgentSigninNotice.tsx +61 -0
- package/src/components/diagnose/AnalysisStory.test.tsx +22 -0
- package/src/components/diagnose/AnalysisStory.tsx +17 -4
- package/src/components/diagnose/AssessmentCard.tsx +39 -8
- 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.capacity.test.tsx +113 -0
- package/src/components/diagnose/DiagnoseContext.question.test.tsx +245 -0
- package/src/components/diagnose/DiagnoseContext.tsx +272 -10
- package/src/components/diagnose/DiagnoseSurface.test.tsx +54 -0
- package/src/components/diagnose/DiagnoseSurface.tsx +151 -134
- package/src/components/diagnose/EvidenceCard.tsx +67 -14
- package/src/components/diagnose/ExampleInvestigationLink.tsx +20 -0
- package/src/components/diagnose/Home.test.tsx +208 -5
- package/src/components/diagnose/Home.tsx +187 -36
- package/src/components/diagnose/InvestigationCapacityNotice.test.tsx +246 -0
- package/src/components/diagnose/InvestigationCapacityNotice.tsx +241 -0
- package/src/components/diagnose/InvestigationEvidencePane.story.test.tsx +97 -6
- package/src/components/diagnose/InvestigationEvidencePane.test.tsx +57 -0
- package/src/components/diagnose/InvestigationEvidencePane.tsx +59 -11
- package/src/components/diagnose/InvestigationEvidenceSections.tsx +50 -23
- package/src/components/diagnose/InvestigationView.tsx +249 -54
- package/src/components/diagnose/LocalDiagnoseAction.history.test.tsx +450 -0
- package/src/components/diagnose/LocalDiagnoseAction.tsx +365 -39
- package/src/components/diagnose/NextStepJump.test.tsx +92 -0
- package/src/components/diagnose/NextStepJump.tsx +75 -0
- package/src/components/diagnose/QuestionComposer.test.tsx +553 -0
- package/src/components/diagnose/QuestionComposer.tsx +495 -0
- package/src/components/diagnose/QuestionFocus.test.tsx +38 -0
- package/src/components/diagnose/QuestionFocus.tsx +123 -0
- package/src/components/diagnose/ResourcePicker.tsx +206 -0
- package/src/components/diagnose/StoryExcerpt.tsx +12 -3
- package/src/components/diagnose/assessmentCopy.ts +5 -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.runs.test.tsx +328 -0
- package/src/components/diagnose/investigationCase.test.tsx +9 -1
- package/src/components/diagnose/investigationCase.ts +33 -1
- package/src/components/diagnose/investigationEvidence/adapters/applicationFindings.test.ts +739 -0
- package/src/components/diagnose/investigationEvidence/adapters/coverage.test.tsx +46 -0
- package/src/components/diagnose/investigationEvidence/adapters/diagnose.ts +58 -2
- package/src/components/diagnose/investigationEvidence/adapters/issues.ts +9 -0
- package/src/components/diagnose/investigationEvidence/adapters/posture.ts +29 -1
- package/src/components/diagnose/investigationEvidence/adapters/prometheus.test.ts +40 -0
- package/src/components/diagnose/investigationEvidence/adapters/prometheus.ts +27 -1
- package/src/components/diagnose/investigationEvidence/bodies/metrics.test.tsx +111 -0
- package/src/components/diagnose/investigationEvidence/bodies/metrics.tsx +67 -16
- package/src/components/diagnose/investigationEvidence/builder.ts +30 -0
- package/src/components/diagnose/investigationEvidence/excerpt.test.ts +18 -5
- package/src/components/diagnose/investigationEvidence/excerpt.ts +22 -11
- package/src/components/diagnose/investigationEvidence/index.ts +1 -1
- package/src/components/diagnose/investigationEvidence/navigation.tsx +2 -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 +7 -0
- package/src/components/diagnose/investigationEvidencePartition.ts +6 -1
- package/src/components/diagnose/investigationFocus.test.ts +271 -0
- package/src/components/diagnose/investigationFocus.ts +132 -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/parts.test.tsx +20 -0
- package/src/components/diagnose/questionSuggestions.test.ts +111 -0
- package/src/components/diagnose/questionSuggestions.ts +150 -0
- package/src/components/diagnose/storyParts.test.tsx +13 -0
- package/src/components/diagnose/target.test.ts +143 -2
- package/src/components/diagnose/target.ts +109 -7
- package/src/components/diagnose/testdata/story-runs.json +474 -0
- package/src/components/diagnose/toolCallLabel.test.ts +10 -4
- package/src/components/diagnose/verdictText.test.tsx +87 -0
- package/src/components/diagnose/verdictText.ts +68 -0
- 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 +13 -39
- package/src/components/home/HomeAgentBlock.test.tsx +141 -0
- package/src/components/home/HomeAgentBlock.tsx +103 -0
- package/src/components/home/HomeDiagramCard.tsx +47 -0
- package/src/components/home/HomeView.tsx +86 -47
- 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/RadarVersionLine.test.tsx +0 -14
- package/src/components/home/RadarVersionLine.tsx +3 -28
- 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/Omnibar.investigate.test.tsx +105 -0
- package/src/components/ui/Omnibar.tsx +47 -3
- package/src/components/ui/RadarOmnibar.test.tsx +1 -0
- package/src/components/ui/RadarOmnibar.tsx +11 -0
- 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 +18 -4
- package/src/components/whats-new/releaseNotes.ts +136 -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/useAgentSignin.test.tsx +190 -0
- package/src/hooks/useAgentSignin.ts +160 -0
- package/src/hooks/useApproveAfterSignin.test.tsx +108 -0
- 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,206 @@
|
|
|
1
|
+
// Search for the one resource a question is about, the way the Omnibar
|
|
2
|
+
// searches: workloads before the objects they own.
|
|
3
|
+
import { useEffect, useId, useMemo, useState } from "react";
|
|
4
|
+
import { useDebouncedValue } from "@skyhook-io/k8s-ui";
|
|
5
|
+
|
|
6
|
+
import { type SearchResult, useSearch } from "../../api/client";
|
|
7
|
+
import {
|
|
8
|
+
PENDING_RETRY_BUDGET_MS,
|
|
9
|
+
PENDING_RETRY_MS,
|
|
10
|
+
searchCoverageNote,
|
|
11
|
+
} from "../ui/searchCoverageNote";
|
|
12
|
+
import type { QuestionPin } from "./questionSuggestions";
|
|
13
|
+
import { formatInvestigationKind } from "./target";
|
|
14
|
+
|
|
15
|
+
function stillSyncing(data: SearchResult | undefined): boolean {
|
|
16
|
+
return !!data?.coverage?.gaps.some((gap) => gap.code === "kind_sync_pending");
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Kinds that are usually children of what an engineer means: a question is
|
|
20
|
+
// about the Deployment or Service, not one of its ReplicaSets or Pods. They
|
|
21
|
+
// stay pickable, after everything else.
|
|
22
|
+
const OWNED_KINDS = new Set([
|
|
23
|
+
"Pod",
|
|
24
|
+
"ReplicaSet",
|
|
25
|
+
"ControllerRevision",
|
|
26
|
+
"EndpointSlice",
|
|
27
|
+
"Event",
|
|
28
|
+
]);
|
|
29
|
+
|
|
30
|
+
function rankForPinning<T extends { kind: string }>(hits: T[]): T[] {
|
|
31
|
+
return [...hits].sort(
|
|
32
|
+
(a, b) => Number(OWNED_KINDS.has(a.kind)) - Number(OWNED_KINDS.has(b.kind)),
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function ResourcePicker({
|
|
37
|
+
inputRef,
|
|
38
|
+
onPick,
|
|
39
|
+
onCancel,
|
|
40
|
+
}: {
|
|
41
|
+
inputRef: React.RefObject<HTMLInputElement | null>;
|
|
42
|
+
onPick: (pin: QuestionPin) => void;
|
|
43
|
+
onCancel: () => void;
|
|
44
|
+
}) {
|
|
45
|
+
const [query, setQuery] = useState("");
|
|
46
|
+
const [active, setActive] = useState(0);
|
|
47
|
+
const listId = useId();
|
|
48
|
+
// Search the way the Omnibar does: once typing pauses, not per keystroke.
|
|
49
|
+
const searched = useDebouncedValue(query, 150, (value) => !value.trim());
|
|
50
|
+
// Kinds still syncing answer "not yet", not "no": keep asking, as the
|
|
51
|
+
// Omnibar does, for a bounded while.
|
|
52
|
+
const [exhausted, setExhausted] = useState<string | null>(null);
|
|
53
|
+
const { data, isFetching, isPlaceholderData, isError, refetch } = useSearch(
|
|
54
|
+
searched,
|
|
55
|
+
{
|
|
56
|
+
context: "none",
|
|
57
|
+
limit: 8,
|
|
58
|
+
globalNs: true,
|
|
59
|
+
refetchInterval: (latest) =>
|
|
60
|
+
stillSyncing(latest) && exhausted !== searched
|
|
61
|
+
? PENDING_RETRY_MS
|
|
62
|
+
: false,
|
|
63
|
+
},
|
|
64
|
+
);
|
|
65
|
+
const syncing = !isPlaceholderData && stillSyncing(data);
|
|
66
|
+
useEffect(() => {
|
|
67
|
+
if (!syncing) return;
|
|
68
|
+
const timer = setTimeout(
|
|
69
|
+
() => setExhausted(searched),
|
|
70
|
+
PENDING_RETRY_BUDGET_MS,
|
|
71
|
+
);
|
|
72
|
+
return () => clearTimeout(timer);
|
|
73
|
+
}, [syncing, searched]);
|
|
74
|
+
// Results belong to what is in the box only once it has been searched.
|
|
75
|
+
const current =
|
|
76
|
+
searched === query && query.trim().length >= 2 && !isPlaceholderData;
|
|
77
|
+
// Results kept from the previous query while the next one loads must not
|
|
78
|
+
// be pinnable: Enter would pin what the engineer just typed away from.
|
|
79
|
+
const hits = useMemo(
|
|
80
|
+
() => (current && !isError ? rankForPinning(data?.hits ?? []) : []),
|
|
81
|
+
[current, isError, data],
|
|
82
|
+
);
|
|
83
|
+
const note = current
|
|
84
|
+
? searchCoverageNote(data?.coverage, {
|
|
85
|
+
hits: data?.hits,
|
|
86
|
+
query,
|
|
87
|
+
pendingExhausted: exhausted === searched,
|
|
88
|
+
})
|
|
89
|
+
: undefined;
|
|
90
|
+
const noteText = note?.parts
|
|
91
|
+
? note.parts.map((part) => part.text).join(" ")
|
|
92
|
+
: note?.text;
|
|
93
|
+
const activeIndex = Math.min(active, Math.max(hits.length - 1, 0));
|
|
94
|
+
const pick = (hit: (typeof hits)[number]) =>
|
|
95
|
+
onPick({
|
|
96
|
+
kind: hit.kind,
|
|
97
|
+
group: hit.group ?? "",
|
|
98
|
+
namespace: hit.namespace ?? "",
|
|
99
|
+
name: hit.name,
|
|
100
|
+
});
|
|
101
|
+
return (
|
|
102
|
+
<div className="border-t border-theme-border-subtle px-3 py-2">
|
|
103
|
+
<input
|
|
104
|
+
ref={inputRef}
|
|
105
|
+
value={query}
|
|
106
|
+
onChange={(event) => {
|
|
107
|
+
setQuery(event.target.value);
|
|
108
|
+
setActive(0);
|
|
109
|
+
}}
|
|
110
|
+
onKeyDown={(event) => {
|
|
111
|
+
if (event.key === "Escape") {
|
|
112
|
+
event.preventDefault();
|
|
113
|
+
event.stopPropagation();
|
|
114
|
+
onCancel();
|
|
115
|
+
} else if (event.key === "ArrowDown" || event.key === "ArrowUp") {
|
|
116
|
+
event.preventDefault();
|
|
117
|
+
if (hits.length === 0) return;
|
|
118
|
+
const step = event.key === "ArrowDown" ? 1 : -1;
|
|
119
|
+
setActive((activeIndex + step + hits.length) % hits.length);
|
|
120
|
+
} else if (event.key === "Enter") {
|
|
121
|
+
event.preventDefault();
|
|
122
|
+
const hit = hits[activeIndex];
|
|
123
|
+
if (hit) pick(hit);
|
|
124
|
+
}
|
|
125
|
+
}}
|
|
126
|
+
role="combobox"
|
|
127
|
+
aria-expanded={hits.length > 0}
|
|
128
|
+
aria-label="Search for a resource to pin"
|
|
129
|
+
aria-controls={listId}
|
|
130
|
+
aria-activedescendant={
|
|
131
|
+
hits.length > 0 ? `${listId}-${activeIndex}` : undefined
|
|
132
|
+
}
|
|
133
|
+
placeholder="Search resources by name, kind:Deployment, ns:shop…"
|
|
134
|
+
className="w-full rounded-md border border-theme-border bg-theme-elevated px-2 py-1 text-sm text-theme-text-primary placeholder:text-theme-text-tertiary focus:border-accent focus:outline-none"
|
|
135
|
+
/>
|
|
136
|
+
<ul id={listId} role="listbox" className="mt-1 max-h-48 overflow-y-auto">
|
|
137
|
+
{hits.map((hit, index) => (
|
|
138
|
+
<li
|
|
139
|
+
key={`${hit.group ?? ""}/${hit.kind}/${hit.namespace ?? ""}/${hit.name}`}
|
|
140
|
+
id={`${listId}-${index}`}
|
|
141
|
+
role="option"
|
|
142
|
+
aria-selected={index === activeIndex}
|
|
143
|
+
>
|
|
144
|
+
<button
|
|
145
|
+
type="button"
|
|
146
|
+
tabIndex={-1}
|
|
147
|
+
onClick={() => pick(hit)}
|
|
148
|
+
onMouseEnter={() => setActive(index)}
|
|
149
|
+
className={`flex w-full items-baseline gap-2 rounded px-2 py-1 text-left text-sm ${
|
|
150
|
+
index === activeIndex ? "bg-theme-hover" : ""
|
|
151
|
+
}`}
|
|
152
|
+
>
|
|
153
|
+
<span className="truncate text-theme-text-primary">
|
|
154
|
+
{hit.name}
|
|
155
|
+
</span>
|
|
156
|
+
<span className="shrink-0 text-xs text-theme-text-tertiary">
|
|
157
|
+
{formatInvestigationKind(hit.kind, hit.group ?? "")}
|
|
158
|
+
{hit.namespace ? ` · ${hit.namespace}` : ""}
|
|
159
|
+
</span>
|
|
160
|
+
</button>
|
|
161
|
+
</li>
|
|
162
|
+
))}
|
|
163
|
+
{current && isError && !isFetching && (
|
|
164
|
+
<li className="flex items-center gap-2 px-2 py-1 text-xs text-theme-text-secondary">
|
|
165
|
+
Couldn’t search resources.
|
|
166
|
+
<button
|
|
167
|
+
type="button"
|
|
168
|
+
onClick={() => void refetch()}
|
|
169
|
+
className="font-medium text-theme-text-primary hover:underline"
|
|
170
|
+
>
|
|
171
|
+
Try again
|
|
172
|
+
</button>
|
|
173
|
+
</li>
|
|
174
|
+
)}
|
|
175
|
+
{current && !isError && !isFetching && hits.length === 0 && (
|
|
176
|
+
<li className="px-2 py-1 text-xs text-theme-text-tertiary">
|
|
177
|
+
{noteText
|
|
178
|
+
? "No matches in what Radar searched."
|
|
179
|
+
: "No matching resources."}
|
|
180
|
+
</li>
|
|
181
|
+
)}
|
|
182
|
+
{current && !isError && noteText && (
|
|
183
|
+
<li className="px-2 py-1 text-[11px] text-theme-text-tertiary">
|
|
184
|
+
{noteText}
|
|
185
|
+
{syncing && exhausted === searched && (
|
|
186
|
+
<button
|
|
187
|
+
type="button"
|
|
188
|
+
onClick={() => {
|
|
189
|
+
setExhausted(null);
|
|
190
|
+
void refetch();
|
|
191
|
+
}}
|
|
192
|
+
className="ml-1 font-medium text-theme-text-primary hover:underline"
|
|
193
|
+
>
|
|
194
|
+
Try again
|
|
195
|
+
</button>
|
|
196
|
+
)}
|
|
197
|
+
</li>
|
|
198
|
+
)}
|
|
199
|
+
</ul>
|
|
200
|
+
<p className="mt-1 text-[11px] text-theme-text-tertiary">
|
|
201
|
+
Pinning starts the investigation at that resource, and lets you apply a
|
|
202
|
+
fix from it.
|
|
203
|
+
</p>
|
|
204
|
+
</div>
|
|
205
|
+
);
|
|
206
|
+
}
|
|
@@ -30,6 +30,7 @@ export function StoryExcerpt({
|
|
|
30
30
|
open,
|
|
31
31
|
canExpand,
|
|
32
32
|
changeCoverage,
|
|
33
|
+
chartId,
|
|
33
34
|
}: {
|
|
34
35
|
excerpt: Excerpt;
|
|
35
36
|
data: InvestigationEvidenceData;
|
|
@@ -37,6 +38,8 @@ export function StoryExcerpt({
|
|
|
37
38
|
open: boolean;
|
|
38
39
|
canExpand: boolean;
|
|
39
40
|
changeCoverage?: MetricsChangeCoverage;
|
|
41
|
+
/** Panel id for the card header's aria-controls when the chart folds. */
|
|
42
|
+
chartId?: string;
|
|
40
43
|
}) {
|
|
41
44
|
const padding = prominence === "primary" ? "px-3 pb-2.5" : "px-2.5 pb-2";
|
|
42
45
|
switch (excerpt.kind) {
|
|
@@ -129,9 +132,15 @@ export function StoryExcerpt({
|
|
|
129
132
|
);
|
|
130
133
|
case "chart":
|
|
131
134
|
return data.type === "metrics" ? (
|
|
132
|
-
<
|
|
133
|
-
<
|
|
134
|
-
|
|
135
|
+
<Collapse open={open} mountLazily id={chartId}>
|
|
136
|
+
<div data-story-metrics className={padding}>
|
|
137
|
+
<MetricsBody
|
|
138
|
+
data={data}
|
|
139
|
+
changeCoverage={changeCoverage}
|
|
140
|
+
size={excerpt.size}
|
|
141
|
+
/>
|
|
142
|
+
</div>
|
|
143
|
+
</Collapse>
|
|
135
144
|
) : null;
|
|
136
145
|
}
|
|
137
146
|
}
|
|
@@ -19,6 +19,9 @@ export interface AssessmentCopyRadar {
|
|
|
19
19
|
/** Where and when: the header line a reader in a channel needs first. */
|
|
20
20
|
context?: {
|
|
21
21
|
target: string;
|
|
22
|
+
/** The engineer's question on a run that names a resource; a run opened
|
|
23
|
+
* by the question alone already has it as its target. */
|
|
24
|
+
asked?: string;
|
|
22
25
|
cluster?: string;
|
|
23
26
|
startedAt?: string;
|
|
24
27
|
agent?: string;
|
|
@@ -60,6 +63,8 @@ export function assessmentCopyText(
|
|
|
60
63
|
.filter(Boolean)
|
|
61
64
|
.join(" · "),
|
|
62
65
|
);
|
|
66
|
+
const asked = radar.context.asked?.replace(/\s+/g, " ").trim();
|
|
67
|
+
if (asked) parts.push(`Asked: “${asked}”`);
|
|
63
68
|
}
|
|
64
69
|
if (diagnosis.summary) {
|
|
65
70
|
const certainty = diagnosis.healthy
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"type": "turn"
|
|
4
|
+
},
|
|
5
|
+
{
|
|
6
|
+
"type": "phase",
|
|
7
|
+
"phase": "investigating"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"type": "phase",
|
|
11
|
+
"phase": "connected"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"type": "phase",
|
|
15
|
+
"phase": "ready",
|
|
16
|
+
"model": "claude-opus-5-5",
|
|
17
|
+
"toolCount": 25,
|
|
18
|
+
"mcpServers": [
|
|
19
|
+
{
|
|
20
|
+
"name": "radar",
|
|
21
|
+
"status": "connected"
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"type": "thinking",
|
|
27
|
+
"token": "I'll start with Radar's diagnose bundle for the Deployment."
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"type": "step",
|
|
31
|
+
"step": {
|
|
32
|
+
"id": "toolu_sample_diagnose_deployment",
|
|
33
|
+
"tool": "diagnose",
|
|
34
|
+
"status": "running",
|
|
35
|
+
"summary": "{\"kind\":\"deployment\",\"namespace\":\"guestbook\",\"name\":\"guestbook-ui\",\"group\":\"apps\"}"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"type": "step",
|
|
40
|
+
"step": {
|
|
41
|
+
"id": "toolu_sample_diagnose_deployment",
|
|
42
|
+
"tool": "",
|
|
43
|
+
"status": "done",
|
|
44
|
+
"ms": 3062,
|
|
45
|
+
"result": "{\"resource\":{\"apiVersion\":\"apps/v1\",\"kind\":\"Deployment\",\"metadata\":{\"annotations\":{\"argocd.argoproj.io/tracking-id\":\"guestbook:apps/Deployment:guestbook/guestbook-ui\",\"deployment.kubernetes.io/revision\":\"4\"},\"creationTimestamp\":\"2026-10-08T10:06:19Z\",\"generation\":4,\"name\":\"guestbook-ui\",\"namespace\":\"guestbook\"},\"spec\":{\"progressDeadlineSeconds\":600,\"replicas\":1,\"revisionHistoryLimit\":3,\"selector\":{\"matchLabels\":{\"app\":\"guestbook-ui\"}},\"strategy\":{\"rollingUpdate\":{\"maxSurge\":\"25%\",\"maxUnavailable\":\"25%\"},\"type\":\"RollingUpdate\"},\"template\":{\"metadata\":{\"labels\":{\"app\":\"guestbook-ui\"}},\"spec\":{\"containers\":[{\"image\":\"gcr.io/google-samples/gb-frontend:v99-missing\",\"name\":\"guestbook-ui\",\"ports\":[{\"containerPort\":80,\"protocol\":\"TCP\"}],\"resources\":{}}],\"restartPolicy\":\"Always\",\"securityContext\":{},\"terminationGracePeriodSeconds\":30}}},\"status\":{\"availableReplicas\":1,\"conditions\":[{\"lastTransitionTime\":\"2026-10-08T10:06:34Z\",\"lastUpdateTime\":\"2026-10-08T10:06:34Z\",\"message\":\"Deployment has minimum availability.\",\"reason\":\"MinimumReplicasAvailable\",\"status\":\"True\",\"type\":\"Available\"},{\"lastTransitionTime\":\"2026-10-08T10:06:20Z\",\"lastUpdateTime\":\"2026-10-08T10:44:55Z\",\"message\":\"ReplicaSet \\\"guestbook-ui-5c4d9dcb47\\\" is progressing.\",\"reason\":\"ReplicaSetUpdated\",\"status\":\"True\",\"type\":\"Progressing\"}],\"readyReplicas\":1,\"replicas\":2,\"unavailableReplicas\":1,\"updatedReplicas\":1}},\"resourceContext\":{\"tier\":\"diagnostic\",\"managedBy\":[{\"kind\":\"Application\",\"group\":\"argoproj.io\",\"name\":\"guestbook\"}],\"exposes\":[{\"kind\":\"Service\",\"namespace\":\"guestbook\",\"name\":\"guestbook-ui\"}],\"statusSummary\":{\"conditions\":[{\"type\":\"Available\",\"status\":\"True\",\"reason\":\"MinimumReplicasAvailable\",\"message\":\"Deployment has minimum availability.\",\"lastTransitionTime\":\"2026-10-08T10:06:34Z\"},{\"type\":\"Progressing\",\"status\":\"True\",\"reason\":\"ReplicaSetUpdated\",\"message\":\"ReplicaSet \\\"guestbook-ui-5c4d9dcb47\\\" is progressing.\",\"lastTransitionTime\":\"2026-10-08T10:06:20Z\"}]},\"workloadSummary\":{\"replicas\":{\"desired\":1,\"ready\":1,\"available\":1,\"updated\":1,\"unavailable\":1}},\"issueSummary\":{\"count\":1,\"highestSeverity\":\"critical\",\"topReason\":\"ImagePullBackOff\",\"bySource\":{\"problem\":1}},\"auditSummary\":{\"count\":11,\"highestSeverity\":\"high\",\"topFinding\":\"privilegeEscalation\"}},\"logsCurrent\":[{\"pod\":\"guestbook-ui-5c4d9dcb47-nqnfz\",\"container\":\"guestbook-ui\",\"logs\":{\"lines\":null,\"totalLines\":0,\"matchedLines\":0,\"fallback\":false},\"error\":\"failed to get logs: container \\\"guestbook-ui\\\" in pod \\\"guestbook-ui-5c4d9dcb47-nqnfz\\\" is waiting to start: trying and failing to pull image\"},{\"pod\":\"guestbook-ui-84774bdc6f-kkx5q\",\"container\":\"guestbook-ui\",\"logs\":{\"lines\":[\"2026-10-08T10:06:34.086788508Z AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 10.0.0.12. Set the 'ServerName' directive globally to suppress this message (repeated ×2, 10:06:34→10:06:34)\",\"2026-10-08T10:06:34.115729612Z [Thu Oct 08 10:06:34.115588 2026] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.38 (Debian) PHP/7.4.33 configured -- resuming normal operations\",\"2026-10-08T10:06:34.115746184Z [Thu Oct 08 10:06:34.115696 2026] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'\"],\"totalLines\":4,\"matchedLines\":0,\"fallback\":true}}],\"logsPrevious\":[{\"pod\":\"guestbook-ui-5c4d9dcb47-nqnfz\",\"container\":\"guestbook-ui\",\"logs\":{\"lines\":null,\"totalLines\":0,\"matchedLines\":0,\"fallback\":false},\"error\":\"failed to get logs: previous terminated container \\\"guestbook-ui\\\" in pod \\\"guestbook-ui-5c4d9dcb47-nqnfz\\\" not found\"},{\"pod\":\"guestbook-ui-84774bdc6f-kkx5q\",\"container\":\"guestbook-ui\",\"logs\":{\"lines\":null,\"totalLines\":0,\"matchedLines\":0,\"fallback\":false},\"error\":\"failed to get logs: previous terminated container \\\"guestbook-ui\\\" in pod \\\"guestbook-ui-84774bdc6f-kkx5q\\\" not found\"}],\"events\":[{\"reason\":\"Failed\",\"message\":\"Error: ErrImagePull\",\"type\":\"Warning\",\"count\":3,\"lastTimestamp\":\"2026-10-08T10:45:36Z\"},{\"reason\":\"Failed\",\"message\":\"Failed to pull image \\\"gcr.io/google-samples/gb-frontend:v99-missing\\\": 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-frontend:v99-missing: not found\",\"type\":\"Warning\",\"count\":3,\"lastTimestamp\":\"2026-10-08T10:45:36Z\"},{\"reason\":\"Failed\",\"message\":\"Error: ImagePullBackOff\",\"type\":\"Warning\",\"count\":2,\"lastTimestamp\":\"2026-10-08T10:45:24Z\"}],\"eventsTotalGroups\":3,\"logCoverage\":{\"resolvedPods\":2,\"selectedPods\":2,\"shownLines\":3,\"totalLines\":3,\"shownPods\":1,\"totalPods\":1},\"expectedPreviousLogAbsences\":[{\"pod\":\"guestbook-ui-5c4d9dcb47-nqnfz\",\"container\":\"guestbook-ui\"},{\"pod\":\"guestbook-ui-84774bdc6f-kkx5q\",\"container\":\"guestbook-ui\"}],\"relatedIssues\":[{\"severity\":\"critical\",\"source\":\"problem\",\"category\":\"image_pull_failed\",\"category_group\":\"startup\",\"id\":\"sampleissue0001\",\"grouping_scope\":\"workload\",\"kind\":\"Deployment\",\"group\":\"apps\",\"namespace\":\"guestbook\",\"name\":\"guestbook-ui\",\"reason\":\"ImagePullBackOff\",\"message\":\"Back-off pulling image \\\"gcr.io/google-samples/gb-frontend:v99-missing\\\": ErrImagePull: 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-frontend:v99-missing: not found\",\"cause\":\"Image not found: gcr.io/google-samples/gb-frontend:v99-missing\",\"action\":\"Verify the repository and tag, then update the image reference or publish the missing image.\",\"onset_unknown\":true,\"resource_created_at\":\"2026-10-08T10:44:55Z\",\"last_seen\":\"2026-10-08T10:45:42.822028Z\",\"count\":1,\"affected\":{\"pods\":1},\"members\":[{\"kind\":\"Pod\",\"namespace\":\"guestbook\",\"name\":\"guestbook-ui-5c4d9dcb47-nqnfz\"}],\"diagnostic_context\":{\"role\":\"rollup\",\"facts\":[{\"type\":\"owner_rollup\",\"message\":\"Grouped from 1 affected resource(s) under this Deployment.\",\"refs\":[{\"kind\":\"Pod\",\"namespace\":\"guestbook\",\"name\":\"guestbook-ui-5c4d9dcb47-nqnfz\"}]}]},\"change_context\":{\"changed\":true,\"what\":\"pod_template\",\"when\":\"47s\",\"evidence\":\"generation=4, observedGeneration=4, 3 owned ReplicaSets, newest ReplicaSet guestbook-ui-5c4d9dcb47 created 47s ago\"},\"issue_timing\":\"started_after_resource_was_healthy\",\"issue_timing_basis\":\"pod_creation\"}],\"changeContext\":{\"changed\":true,\"what\":\"pod_template\",\"when\":\"48s\",\"evidence\":\"generation=4, observedGeneration=4, 3 owned ReplicaSets, newest ReplicaSet guestbook-ui-5c4d9dcb47 created 48s ago\"},\"recentChanges\":[{\"kind\":\"Deployment\",\"apiVersion\":\"apps/v1\",\"namespace\":\"guestbook\",\"name\":\"guestbook-ui\",\"changeType\":\"update\",\"summary\":\"image(guestbook-ui): gcr.io/google-samples/gb-frontend:v5→...:v99-missing\",\"timestamp\":\"2026-10-08T10:44:55Z\",\"change_category\":\"spec_config\",\"rank_reason\":\"application configuration field changed\",\"application_configuration_change\":true,\"fields\":[{\"path\":\"spec.template.spec.containers[guestbook-ui].image\",\"oldValue\":\"gcr.io/google-samples/gb-frontend:v5\",\"newValue\":\"gcr.io/google-samples/gb-frontend:v99-missing\"}]},{\"kind\":\"Deployment\",\"apiVersion\":\"apps/v1\",\"namespace\":\"guestbook\",\"name\":\"guestbook-ui\",\"changeType\":\"update\",\"summary\":\"image(guestbook-ui): gcr.io/google-samples/gb-frontend:v4→gcr.io/google-samples/gb-frontend:v5\",\"timestamp\":\"2026-10-08T10:37:33Z\",\"change_category\":\"spec_config\",\"rank_reason\":\"application configuration field changed\",\"application_configuration_change\":true,\"fields\":[{\"path\":\"spec.template.spec.containers[guestbook-ui].image\",\"oldValue\":\"gcr.io/google-samples/gb-frontend:v4\",\"newValue\":\"gcr.io/google-samples/gb-frontend:v5\"}]},{\"kind\":\"Deployment\",\"apiVersion\":\"apps/v1\",\"namespace\":\"guestbook\",\"name\":\"guestbook-ui\",\"changeType\":\"update\",\"summary\":\"image(guestbook-ui): gcr.io/google-samples/gb-frontend:v5→gcr.io/google-samples/gb-frontend:v4\",\"timestamp\":\"2026-10-08T10:31:46Z\",\"change_category\":\"spec_config\",\"rank_reason\":\"application configuration field changed\",\"application_configuration_change\":true,\"fields\":[{\"path\":\"spec.template.spec.containers[guestbook-ui].image\",\"oldValue\":\"gcr.io/google-samples/gb-frontend:v5\",\"newValue\":\"gcr.io/google-samples/gb-frontend:v4\"}]}],\"recentChangesSaturated\":true,\"pods\":2,\"podNames\":[\"guestbook-ui-5c4d9dcb47-nqnfz\",\"guestbook-ui-84774bdc6f-kkx5q\"],\"warnings\":[\"Resource is reconciled by Argo CD (instance: guestbook:apps/Deployment:guestbook/guestbook-ui). Direct edits may be reverted by the next reconciliation; prefer changing the source of truth (chart values / Application spec / operator CR).\"],\"metrics\":{\"window\":{\"start\":\"2026-10-08T09:45:42Z\",\"end\":\"2026-10-08T10:45:42Z\",\"step\":\"0s\"},\"pods\":2,\"series\":[],\"error\":\"prometheus probe did not answer within 3s\"}}",
|
|
46
|
+
"evidenceRef": "ev_sampleinvestigationaaaaaaa_deploymentdiagnosebundleaa",
|
|
47
|
+
"radarEvidence": true,
|
|
48
|
+
"isError": false
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"type": "thinking",
|
|
53
|
+
"token": "I've identified the likely cause, but need to confirm whether the bad tag originated from Git or a direct live edit Argo isn't correcting. I'll check the Argo CD Application's sync status next.\n\n"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"type": "step",
|
|
57
|
+
"step": {
|
|
58
|
+
"id": "toolu_sample_diagnose_application",
|
|
59
|
+
"tool": "diagnose",
|
|
60
|
+
"status": "running",
|
|
61
|
+
"summary": "{\"kind\":\"application\",\"namespace\":\"argocd\",\"name\":\"guestbook\",\"group\":\"argoproj.io\"}"
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"type": "step",
|
|
66
|
+
"step": {
|
|
67
|
+
"id": "toolu_sample_diagnose_application",
|
|
68
|
+
"tool": "",
|
|
69
|
+
"status": "done",
|
|
70
|
+
"ms": 13,
|
|
71
|
+
"result": "{\"resource\":{\"apiVersion\":\"argoproj.io/v1alpha1\",\"kind\":\"Application\",\"metadata\":{\"creationTimestamp\":\"2026-10-08T10:06:16Z\",\"generation\":33,\"name\":\"guestbook\",\"namespace\":\"argocd\"},\"spec\":{\"destination\":{\"namespace\":\"guestbook\",\"server\":\"https://kubernetes.default.svc\"},\"project\":\"default\",\"source\":{\"path\":\"guestbook\",\"repoURL\":\"https://github.com/argoproj/argocd-example-apps\",\"targetRevision\":\"HEAD\"},\"syncPolicy\":{\"automated\":{\"prune\":true,\"selfHeal\":false}}},\"status\":{\"controllerNamespace\":\"argocd\",\"health\":{\"lastTransitionTime\":\"2026-10-08T10:44:55Z\",\"status\":\"Progressing\"},\"history\":[{\"deployStartedAt\":\"2026-10-08T10:06:18Z\",\"deployedAt\":\"2026-10-08T10:06:20Z\",\"id\":0,\"initiatedBy\":{\"automated\":true},\"revision\":\"8088f4c0d970abb09e250248cc97e35623447cb5\",\"source\":{\"path\":\"guestbook\",\"repoURL\":\"https://github.com/argoproj/argocd-example-apps\",\"targetRevision\":\"HEAD\"}},{\"deployStartedAt\":\"2026-10-08T10:37:24Z\",\"deployedAt\":\"2026-10-08T10:37:33Z\",\"id\":1,\"initiatedBy\":{\"username\":\"radar\"},\"revision\":\"8088f4c0d970abb09e250248cc97e35623447cb5\",\"source\":{\"path\":\"guestbook\",\"repoURL\":\"https://github.com/argoproj/argocd-example-apps\",\"targetRevision\":\"HEAD\"}}],\"operationState\":{\"finishedAt\":\"2026-10-08T10:37:33Z\",\"message\":\"successfully synced (all tasks run)\",\"operation\":{\"initiatedBy\":{\"automated\":true,\"username\":\"radar\"},\"retry\":{\"limit\":5},\"sync\":{\"prune\":true,\"revision\":\"8088f4c0d970abb09e250248cc97e35623447cb5\",\"source\":{\"path\":\"guestbook\",\"repoURL\":\"https://github.com/argoproj/argocd-example-apps\",\"targetRevision\":\"HEAD\"}}},\"phase\":\"Succeeded\",\"startedAt\":\"2026-10-08T10:37:24Z\",\"syncResult\":{\"resources\":[{\"group\":\"\",\"hookPhase\":\"Running\",\"kind\":\"Service\",\"message\":\"service/guestbook-ui unchanged\",\"name\":\"guestbook-ui\",\"namespace\":\"guestbook\",\"status\":\"Synced\",\"syncPhase\":\"Sync\",\"version\":\"v1\"},{\"group\":\"apps\",\"hookPhase\":\"Running\",\"images\":[\"gcr.io/google-samples/gb-frontend:v5\"],\"kind\":\"Deployment\",\"message\":\"deployment.apps/guestbook-ui configured\",\"name\":\"guestbook-ui\",\"namespace\":\"guestbook\",\"status\":\"Synced\",\"syncPhase\":\"Sync\",\"version\":\"v1\"}],\"revision\":\"8088f4c0d970abb09e250248cc97e35623447cb5\",\"source\":{\"path\":\"guestbook\",\"repoURL\":\"https://github.com/argoproj/argocd-example-apps\",\"targetRevision\":\"HEAD\"}}},\"reconciledAt\":\"2026-10-08T10:44:55Z\",\"resourceHealthSource\":\"appTree\",\"resources\":[{\"kind\":\"Service\",\"name\":\"guestbook-ui\",\"namespace\":\"guestbook\",\"status\":\"Synced\",\"version\":\"v1\"},{\"group\":\"apps\",\"kind\":\"Deployment\",\"name\":\"guestbook-ui\",\"namespace\":\"guestbook\",\"status\":\"OutOfSync\",\"version\":\"v1\"}],\"sourceHydrator\":{},\"sourceType\":\"Directory\",\"summary\":{\"images\":[\"gcr.io/google-samples/gb-frontend:v5\",\"gcr.io/google-samples/gb-frontend:v99-missing\"]},\"sync\":{\"comparedTo\":{\"destination\":{\"namespace\":\"guestbook\",\"server\":\"https://kubernetes.default.svc\"},\"source\":{\"path\":\"guestbook\",\"repoURL\":\"https://github.com/argoproj/argocd-example-apps\",\"targetRevision\":\"HEAD\"}},\"revision\":\"8088f4c0d970abb09e250248cc97e35623447cb5\",\"status\":\"OutOfSync\"}}},\"pods\":0,\"gitopsDiagnosis\":{\"tool\":\"argocd\",\"sync\":\"OutOfSync\",\"health\":\"Progressing\",\"operationPhase\":\"Succeeded\"}}",
|
|
72
|
+
"evidenceRef": "ev_sampleinvestigationaaaaaaa_applicationdiagnosebundlea",
|
|
73
|
+
"radarEvidence": true,
|
|
74
|
+
"isError": false
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"type": "done",
|
|
79
|
+
"diagnosis": {
|
|
80
|
+
"rootCause": "At 10:44:55Z the live Deployment's image was changed from `gcr.io/google-samples/gb-frontend:v5` to `:v99-missing`, a tag that does not exist in the registry, so the new pod fails with ErrImagePull / NotFound. The change did not come from Git: Argo CD reports the Deployment OutOfSync against revision `8088f4c`, which deploys `v5`. Because self-heal is off, Argo will not undo the edit.",
|
|
81
|
+
"summary": "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.",
|
|
82
|
+
"certainty": "established",
|
|
83
|
+
"steps": [
|
|
84
|
+
{
|
|
85
|
+
"text": "Re-sync the Deployment from Git to restore the `v5` image: `argocd app sync guestbook --resource apps:Deployment:guestbook-ui` (or use **Sync** on the Deployment in the Argo CD UI).",
|
|
86
|
+
"kind": "mitigate"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"text": "Confirm the rollout finishes and Argo reports Synced: `kubectl -n guestbook rollout status deploy/guestbook-ui` then `argocd app get guestbook`.",
|
|
90
|
+
"kind": "verify"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"text": "If a new version was meant to ship, publish the image, check that it exists with `crane ls gcr.io/google-samples/gb-frontend`, and change the tag in Git (`guestbook/` in argocd-example-apps), not on the live object.",
|
|
94
|
+
"kind": "investigate",
|
|
95
|
+
"precondition": "Someone intended to deploy a version other than v5"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"text": "Find who made the edit at 10:44:55Z in the API server audit log (filter by verb `update`/`patch` on `deployments/guestbook-ui` in `guestbook`).",
|
|
99
|
+
"kind": "investigate"
|
|
100
|
+
}
|
|
101
|
+
],
|
|
102
|
+
"report": "A change to the live Deployment caused this, not a change in Git. At 10:44:55Z the container image was changed from `gb-frontend:v5` to `gb-frontend:v99-missing`. The Deployment started a new pod with that tag, and the registry says the tag doesn't exist.\n\n[[radar:evidence=0]]\n\n[[radar:evidence=1|compact]]\n\nArgo CD manages this Deployment, and its view settles where the edit came from. Its last sync used Git revision `8088f4c` with image `v5`. It now marks the Deployment **OutOfSync**, which means the live object no longer matches Git. Self-heal is turned off for this Application, so Argo won't overwrite the edit by itself. The rollout will stay stuck until someone acts.\n\n[[radar:evidence=2]]\n\nThe service is not down right now. A rolling update only removes the old pod once the new one is ready, so the previous pod is still serving and the Deployment reports 1 of 1 available. I didn't check which tag that old pod runs, and with Prometheus unreachable there are no traffic metrics. With one serving pod there is no redundancy, so if that pod is lost the service has no replacement.\n\nThe fix is to re-sync the Deployment from Git, which brings back `v5`. If whoever made the edit was trying to release a new version, the right path is to publish the image and change the tag in Git. Editing the live object again would just drift from Git again. Nothing I found leaves the cause in doubt. The open item is who made the edit, and only the API server audit log can show that.",
|
|
103
|
+
"notes": "**Evidence ledger**\n- `ev_…deployment…` (diagnose, Deployment): the live pod template uses `gcr.io/google-samples/gb-frontend:v99-missing`. The new pod `guestbook-ui-5c4d9dcb47-nqnfz` is stuck because the registry answered `NotFound` for that tag (3 ErrImagePull events). The change feed shows the image went from `v5` to `v99-missing` at 10:44:55Z. The old pod `guestbook-ui-84774bdc6f-kkx5q` is still Ready, so the Deployment has 1 of 1 available. Not covered: which image the old pod runs, and who made the edit. Metrics were unavailable because Prometheus timed out.\n- `ev_…application…` (diagnose, Application guestbook): Git revision `8088f4c` was last synced at 10:37:33Z with image `v5`. The live Deployment is now **OutOfSync**, and `selfHeal: false`. Not covered: the identity of whoever changed the live object.\n- Alternative: Git changed to the bad tag. Contradicted by `ev_…application…`. The synced revision still deploys `v5`, and the live Deployment differs from Git.\n- Alternative: a registry auth or network problem. Contradicted by `ev_…deployment…`. The registry resolved the request and answered `NotFound` for the tag, which is not an auth or connection error.\n- Alternative: the app crashes after starting. Contradicted by `ev_…deployment…`. The new container never started; it is still waiting for its image to pull.",
|
|
104
|
+
"rootCauseEvidence": {
|
|
105
|
+
"status": "linked",
|
|
106
|
+
"refs": [
|
|
107
|
+
"ev_sampleinvestigationaaaaaaa_deploymentdiagnosebundleaa",
|
|
108
|
+
"ev_sampleinvestigationaaaaaaa_applicationdiagnosebundlea"
|
|
109
|
+
]
|
|
110
|
+
},
|
|
111
|
+
"evidence": [
|
|
112
|
+
{
|
|
113
|
+
"status": "linked",
|
|
114
|
+
"ref": "ev_sampleinvestigationaaaaaaa_deploymentdiagnosebundleaa",
|
|
115
|
+
"role": "cause",
|
|
116
|
+
"claim": "The pod template image was changed from v5 to v99-missing at 10:44:55Z.",
|
|
117
|
+
"gap": "change feed shows what changed, not who changed it",
|
|
118
|
+
"subject": {
|
|
119
|
+
"group": "apps",
|
|
120
|
+
"kind": "Deployment",
|
|
121
|
+
"namespace": "guestbook",
|
|
122
|
+
"name": "guestbook-ui",
|
|
123
|
+
"observation": "changes"
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"status": "linked",
|
|
128
|
+
"ref": "ev_sampleinvestigationaaaaaaa_deploymentdiagnosebundleaa",
|
|
129
|
+
"role": "symptom",
|
|
130
|
+
"claim": "The registry returns NotFound for gb-frontend:v99-missing, so the new pod's image pull fails.",
|
|
131
|
+
"gap": "events for the new pod only, sampled at this check",
|
|
132
|
+
"subject": {
|
|
133
|
+
"group": "",
|
|
134
|
+
"kind": "Pod",
|
|
135
|
+
"namespace": "guestbook",
|
|
136
|
+
"name": "guestbook-ui-5c4d9dcb47-nqnfz",
|
|
137
|
+
"observation": "events"
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"status": "linked",
|
|
142
|
+
"ref": "ev_sampleinvestigationaaaaaaa_applicationdiagnosebundlea",
|
|
143
|
+
"role": "cause",
|
|
144
|
+
"claim": "Argo CD's synced Git revision deploys v5, the live Deployment is OutOfSync, and selfHeal is false, so the edit was made outside Git and nothing reverts it.",
|
|
145
|
+
"gap": "does not identify who edited the live object",
|
|
146
|
+
"subject": {
|
|
147
|
+
"group": "argoproj.io",
|
|
148
|
+
"kind": "Application",
|
|
149
|
+
"namespace": "argocd",
|
|
150
|
+
"name": "guestbook",
|
|
151
|
+
"observation": "resource"
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"status": "linked",
|
|
156
|
+
"ref": "ev_sampleinvestigationaaaaaaa_deploymentdiagnosebundleaa",
|
|
157
|
+
"role": "context",
|
|
158
|
+
"claim": "The previous pod is still Ready and the Deployment reports 1/1 available, so the service is up on one older pod.",
|
|
159
|
+
"gap": "does not show which image tag the old pod runs, and has no traffic metrics",
|
|
160
|
+
"subject": {
|
|
161
|
+
"group": "",
|
|
162
|
+
"kind": "Pod",
|
|
163
|
+
"namespace": "guestbook",
|
|
164
|
+
"name": "guestbook-ui-84774bdc6f-kkx5q",
|
|
165
|
+
"observation": "logs"
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
],
|
|
169
|
+
"ruledOut": [
|
|
170
|
+
{
|
|
171
|
+
"hypothesis": "The bad tag came from a Git commit synced by Argo CD",
|
|
172
|
+
"evidenceIndex": 2
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"hypothesis": "Registry authentication or network failure",
|
|
176
|
+
"evidenceIndex": 1
|
|
177
|
+
}
|
|
178
|
+
],
|
|
179
|
+
"remediation": [
|
|
180
|
+
"Re-sync the Deployment from Git to restore the `v5` image: `argocd app sync guestbook --resource apps:Deployment:guestbook-ui` (or use **Sync** on the Deployment in the Argo CD UI).",
|
|
181
|
+
"Confirm the rollout finishes and Argo reports Synced: `kubectl -n guestbook rollout status deploy/guestbook-ui` then `argocd app get guestbook`.",
|
|
182
|
+
"If a new version was meant to ship, publish the image, check that it exists with `crane ls gcr.io/google-samples/gb-frontend`, and change the tag in Git (`guestbook/` in argocd-example-apps), not on the live object.",
|
|
183
|
+
"Find who made the edit at 10:44:55Z in the API server audit log (filter by verb `update`/`patch` on `deployments/guestbook-ui` in `guestbook`)."
|
|
184
|
+
],
|
|
185
|
+
"confidence": 0.95,
|
|
186
|
+
"recommendedIndex": 1,
|
|
187
|
+
"recommendedReason": "Targeted to one resource and reversible; it restores the Git-declared v5, which may not be the version whoever made the edit was trying to ship.",
|
|
188
|
+
"turns": 3
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
]
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
// @vitest-environment jsdom
|
|
2
|
+
import { act, type ReactNode } from "react";
|
|
3
|
+
import { createRoot, type Root } from "react-dom/client";
|
|
4
|
+
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
5
|
+
import { MemoryRouter } from "react-router-dom";
|
|
6
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
7
|
+
|
|
8
|
+
import type { SubscribeHandlers } from "../../api/diagnose";
|
|
9
|
+
import { EXAMPLE_INVESTIGATION_RUN } from "./exampleInvestigation";
|
|
10
|
+
import { InvestigationView } from "./InvestigationView";
|
|
11
|
+
|
|
12
|
+
const openInvestigation = vi.fn();
|
|
13
|
+
vi.mock("./exampleInvestigation", async (importOriginal) => ({
|
|
14
|
+
...(await importOriginal<typeof import("./exampleInvestigation")>()),
|
|
15
|
+
// The transcript chunk failed to load.
|
|
16
|
+
replayExampleInvestigation: (handlers: SubscribeHandlers) => {
|
|
17
|
+
queueMicrotask(() => handlers.onClosed?.("unavailable"));
|
|
18
|
+
return () => {};
|
|
19
|
+
},
|
|
20
|
+
}));
|
|
21
|
+
vi.mock("./DiagnoseContext", () => ({
|
|
22
|
+
useDiagnose: () => ({
|
|
23
|
+
refreshRuns: vi.fn(),
|
|
24
|
+
openInvestigation,
|
|
25
|
+
openQuestion: vi.fn(),
|
|
26
|
+
startError: null,
|
|
27
|
+
startRefusal: null,
|
|
28
|
+
dismissError: vi.fn(),
|
|
29
|
+
agents: [],
|
|
30
|
+
}),
|
|
31
|
+
}));
|
|
32
|
+
vi.mock("../../context/ThemeContext", () => ({
|
|
33
|
+
useTheme: () => ({ theme: "light", setTheme: vi.fn(), toggleTheme: vi.fn() }),
|
|
34
|
+
}));
|
|
35
|
+
vi.mock("../ui/Tooltip", () => ({
|
|
36
|
+
Tooltip: ({ children }: { children: ReactNode }) => children,
|
|
37
|
+
}));
|
|
38
|
+
|
|
39
|
+
describe("the example when its transcript can't load", () => {
|
|
40
|
+
Object.assign(globalThis, { IS_REACT_ACT_ENVIRONMENT: true });
|
|
41
|
+
let root: Root;
|
|
42
|
+
let container: HTMLDivElement;
|
|
43
|
+
|
|
44
|
+
beforeEach(() => {
|
|
45
|
+
vi.stubGlobal("fetch", vi.fn());
|
|
46
|
+
vi.stubGlobal(
|
|
47
|
+
"ResizeObserver",
|
|
48
|
+
class {
|
|
49
|
+
observe() {}
|
|
50
|
+
unobserve() {}
|
|
51
|
+
disconnect() {}
|
|
52
|
+
},
|
|
53
|
+
);
|
|
54
|
+
vi.stubGlobal("matchMedia", (query: string) => ({
|
|
55
|
+
matches: false,
|
|
56
|
+
media: query,
|
|
57
|
+
addEventListener() {},
|
|
58
|
+
removeEventListener() {},
|
|
59
|
+
addListener() {},
|
|
60
|
+
removeListener() {},
|
|
61
|
+
}));
|
|
62
|
+
container = document.createElement("div");
|
|
63
|
+
document.body.appendChild(container);
|
|
64
|
+
root = createRoot(container);
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
afterEach(() => {
|
|
68
|
+
act(() => root.unmount());
|
|
69
|
+
container.remove();
|
|
70
|
+
vi.unstubAllGlobals();
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
it("says so and never offers to investigate the sample resource", async () => {
|
|
74
|
+
await act(async () => {
|
|
75
|
+
root.render(
|
|
76
|
+
<QueryClientProvider client={new QueryClient()}>
|
|
77
|
+
<MemoryRouter>
|
|
78
|
+
<InvestigationView
|
|
79
|
+
run={EXAMPLE_INVESTIGATION_RUN}
|
|
80
|
+
agentLabel="Claude Code"
|
|
81
|
+
maximized
|
|
82
|
+
example
|
|
83
|
+
/>
|
|
84
|
+
</MemoryRouter>
|
|
85
|
+
</QueryClientProvider>,
|
|
86
|
+
);
|
|
87
|
+
});
|
|
88
|
+
await vi.waitFor(() =>
|
|
89
|
+
expect(container.textContent).toContain("couldn't load the example"),
|
|
90
|
+
);
|
|
91
|
+
expect(container.textContent).not.toMatch(/Investigate again/);
|
|
92
|
+
expect(openInvestigation).not.toHaveBeenCalled();
|
|
93
|
+
});
|
|
94
|
+
});
|