@skyhook-io/radar-app 1.18.1 → 1.18.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/App.tsx +23 -8
- package/src/api/client.deleteResource.test.tsx +111 -0
- package/src/api/client.resourceAudit.test.tsx +57 -0
- package/src/api/client.resourcePath.test.ts +107 -0
- package/src/api/client.ts +136 -37
- package/src/components/capacity/CapacityDemand.tsx +6 -3
- package/src/components/capacity/CapacityOverview.tsx +14 -7
- package/src/components/capacity/CapacityPoolDetail.tsx +7 -5
- package/src/components/capacity/ClusterSchedulingCard.tsx +3 -3
- package/src/components/capacity/shared.tsx +9 -5
- package/src/components/cnpg/CNPGOverview.tsx +4 -1
- package/src/components/cnpg/actions/useCNPGWriteGuard.tsx +1 -0
- package/src/components/diagnose/ApplyDialog.test.tsx +10 -0
- package/src/components/diagnose/ApplyDialog.tsx +8 -1
- package/src/components/diagnose/AssessmentCard.tsx +60 -0
- package/src/components/diagnose/DiagnoseSurface.tsx +5 -0
- package/src/components/diagnose/InvestigationEvidencePane.test.tsx +62 -2
- package/src/components/diagnose/InvestigationEvidenceSections.tsx +6 -5
- package/src/components/diagnose/InvestigationView.tsx +47 -13
- package/src/components/diagnose/assessmentCopy.ts +11 -0
- package/src/components/diagnose/investigationEvidence/adapters/changes.ts +36 -1
- package/src/components/diagnose/investigationEvidence/adapters/crossplane.test.tsx +85 -0
- package/src/components/diagnose/investigationEvidence/adapters/issues.ts +1 -0
- package/src/components/diagnose/investigationEvidence/adapters/prometheus.test.ts +2 -1
- package/src/components/diagnose/investigationEvidence/adapters/prometheus.ts +2 -1
- package/src/components/diagnose/investigationEvidence/adapters/testdata/crossplane-paused-get-resource.json +28 -0
- package/src/components/diagnose/investigationEvidence/bodies/index.tsx +2 -0
- package/src/components/diagnose/investigationEvidence/bodies/workload.tsx +5 -1
- package/src/components/diagnose/investigationEvidence/builder.ts +3 -1
- package/src/components/diagnose/investigationEvidence/cardParts.tsx +7 -2
- package/src/components/diagnose/investigationEvidence/identity.test.ts +1 -1
- package/src/components/diagnose/investigationEvidence/observations.ts +7 -3
- package/src/components/diagnose/investigationEvidence/projection.test.ts +57 -3
- package/src/components/diagnose/investigationEvidencePresentation.test.ts +36 -2
- package/src/components/diagnose/investigationEvidencePresentation.ts +33 -8
- package/src/components/diagnose/storyParts.test.tsx +53 -0
- package/src/components/helm/ChartBrowser.tsx +4 -4
- package/src/components/helm/HelmReleaseDrawer.tsx +6 -2
- package/src/components/helm/HelmView.tsx +34 -23
- package/src/components/helm/InstallWizard.tsx +6 -2
- package/src/components/helm/ValuesViewer.test.tsx +1 -0
- package/src/components/helm/ValuesViewer.tsx +4 -2
- package/src/components/home/ClusterHealthCard.tsx +28 -21
- package/src/components/home/MCPSetupDialog.test.tsx +27 -2
- package/src/components/home/MCPSetupDialog.tsx +14 -2
- package/src/components/home/mcpToolCatalog.ts +29 -2
- package/src/components/issues/IssuesPane.render.test.tsx +5 -5
- package/src/components/nav/PrimaryNavRail.tsx +34 -2
- package/src/components/product-hunt/ProductHuntNotice.render.test.tsx +120 -0
- package/src/components/product-hunt/ProductHuntNotice.test.ts +121 -0
- package/src/components/product-hunt/ProductHuntNotice.tsx +202 -0
- package/src/components/product-hunt/launchWindow.ts +78 -0
- package/src/components/product-hunt/useProductHuntRailEntry.test.tsx +76 -0
- package/src/components/product-hunt/useProductHuntRailEntry.ts +27 -0
- package/src/components/resources/CompositeRenderer.tsx +4 -0
- package/src/components/resources/ResourcesView.tsx +1 -1
- package/src/components/settings/LocalConnectionSettings.tsx +1 -0
- package/src/components/ui/RadarOmnibar.test.tsx +18 -0
- package/src/components/ui/RadarOmnibar.tsx +1 -0
- package/src/components/ui/SearchSyntaxHelp.test.tsx +39 -0
- package/src/components/ui/SearchSyntaxHelp.tsx +23 -2
- package/src/components/ui/UpdateNotification.test.tsx +2 -0
- package/src/components/ui/UpdateNotification.tsx +32 -5
- package/src/components/usage-data/UsageDataPrompt.tsx +19 -1
- package/src/components/workload/WorkloadView.tsx +10 -4
- package/src/components/workspace/layout.tsx +2 -1
- package/src/contexts/CapabilitiesContext.tsx +1 -0
- package/src/hooks/useGitOpsWriteGuard.test.tsx +126 -2
- package/src/hooks/useGitOpsWriteGuard.ts +25 -3
- package/src/hooks/useResolvedGitOpsOwner.ts +14 -9
- package/src/index.css +85 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"resource": {
|
|
3
|
+
"apiVersion": "s3.example.crossplane.io/v1",
|
|
4
|
+
"kind": "Bucket",
|
|
5
|
+
"metadata": {
|
|
6
|
+
"name": "archive",
|
|
7
|
+
"namespace": "shop",
|
|
8
|
+
"annotations": { "crossplane.io/paused": "true" }
|
|
9
|
+
},
|
|
10
|
+
"spec": { "providerConfigRef": { "name": "fixture" } },
|
|
11
|
+
"status": {
|
|
12
|
+
"conditions": [
|
|
13
|
+
{ "type": "Ready", "status": "True", "reason": "Available" },
|
|
14
|
+
{ "type": "Synced", "status": "False", "reason": "ReconcilePaused", "message": "Fixture controller pause observation" }
|
|
15
|
+
]
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"resourceContext": {
|
|
19
|
+
"tier": "basic",
|
|
20
|
+
"statusSummary": {
|
|
21
|
+
"conditions": [
|
|
22
|
+
{ "type": "Ready", "status": "True", "reason": "Available" },
|
|
23
|
+
{ "type": "Synced", "status": "False", "reason": "ReconcilePaused", "message": "Fixture controller pause observation" }
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"warnings": []
|
|
28
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getCrossplanePauseState, isManagedResource, isComposite } from "@skyhook-io/k8s-ui/components/resources/resource-utils-crossplane";
|
|
1
2
|
import type { MetricsChangeCoverage } from "../../investigationMetrics";
|
|
2
3
|
import type {
|
|
3
4
|
InvestigationEvidenceData,
|
|
@@ -109,6 +110,7 @@ export function evidenceHasDetails(
|
|
|
109
110
|
case "resource": {
|
|
110
111
|
const replicas = data.resourceContext?.workloadSummary?.replicas;
|
|
111
112
|
return Boolean(
|
|
113
|
+
((isManagedResource(data.resource) || isComposite(data.resource) || getCrossplanePauseState(data.resource) === "acknowledged") && getCrossplanePauseState(data.resource)) ||
|
|
112
114
|
investigationResourceEvidenceHasDetails(data.resource) ||
|
|
113
115
|
replicas?.desired !== undefined ||
|
|
114
116
|
data.resourceContext?.statusSummary?.conditions?.length ||
|
|
@@ -14,6 +14,8 @@ import type {
|
|
|
14
14
|
DiagnosisResourceRef,
|
|
15
15
|
DiagnosisScalerRef,
|
|
16
16
|
} from "../../diagnoseEvidenceTypes";
|
|
17
|
+
import { getCrossplanePauseState, isManagedResource, isComposite } from "@skyhook-io/k8s-ui/components/resources/resource-utils-crossplane";
|
|
18
|
+
import { CrossplanePauseChip, CrossplanePauseNotice } from "@skyhook-io/k8s-ui/components/resources/renderers/CrossplanePauseContext";
|
|
17
19
|
import { InvestigationResourceEvidence } from "../../InvestigationResourceEvidence";
|
|
18
20
|
import { EvidenceNavigationContext } from "../navigation";
|
|
19
21
|
import {
|
|
@@ -131,6 +133,7 @@ export function CrashBody({ data }: { data: EvidenceDataOf<"crash"> }) {
|
|
|
131
133
|
|
|
132
134
|
export function ResourceBody({ data }: { data: EvidenceDataOf<"resource"> }) {
|
|
133
135
|
const replicas = data.resourceContext?.workloadSummary?.replicas;
|
|
136
|
+
const crossplane = isManagedResource(data.resource) || isComposite(data.resource) || getCrossplanePauseState(data.resource) === "acknowledged";
|
|
134
137
|
// SealedSecret's dedicated body renders the resource's conditions beside
|
|
135
138
|
// its controller state, so repeating the derived summary here adds noise.
|
|
136
139
|
const conditions =
|
|
@@ -145,6 +148,7 @@ export function ResourceBody({ data }: { data: EvidenceDataOf<"resource"> }) {
|
|
|
145
148
|
return (
|
|
146
149
|
<div className="space-y-3">
|
|
147
150
|
<InvestigationResourceEvidence resource={data.resource} />
|
|
151
|
+
{crossplane && getCrossplanePauseState(data.resource) ? <div className="space-y-1.5"><CrossplanePauseChip state={getCrossplanePauseState(data.resource)} compact /><CrossplanePauseNotice data={data.resource} /></div> : null}
|
|
148
152
|
{data.gitOpsDiagnosis ? (
|
|
149
153
|
<GitOpsStatusBody status={data.gitOpsDiagnosis} />
|
|
150
154
|
) : null}
|
|
@@ -182,7 +186,7 @@ export function ResourceBody({ data }: { data: EvidenceDataOf<"resource"> }) {
|
|
|
182
186
|
className="flex min-w-0 items-start gap-2 text-xs"
|
|
183
187
|
>
|
|
184
188
|
<StatusDot
|
|
185
|
-
tone={conditionStatusTone(condition)}
|
|
189
|
+
tone={conditionStatusTone(condition, data.resource)}
|
|
186
190
|
className="mt-1 shrink-0"
|
|
187
191
|
/>
|
|
188
192
|
<p className="min-w-0 text-theme-text-secondary">
|
|
@@ -213,7 +213,9 @@ export function projectInvestigationEvidence(
|
|
|
213
213
|
source,
|
|
214
214
|
investigationResultLabel(source),
|
|
215
215
|
"Only part of this investigation result was saved, so Radar could not summarize it here.",
|
|
216
|
-
|
|
216
|
+
// Nothing of the result is shown, so this is an unknown, not a
|
|
217
|
+
// sampling cap that still shows part of the answer.
|
|
218
|
+
"unknown",
|
|
217
219
|
);
|
|
218
220
|
continue;
|
|
219
221
|
}
|
|
@@ -7,9 +7,11 @@ import {
|
|
|
7
7
|
Info,
|
|
8
8
|
SquareArrowOutUpRight,
|
|
9
9
|
} from "lucide-react";
|
|
10
|
+
import { getCrossplaneConditionTone } from "@skyhook-io/k8s-ui/components/resources/resource-utils-crossplane";
|
|
10
11
|
import { defaultConditionTone, displayKind } from "@skyhook-io/k8s-ui";
|
|
11
12
|
import type {
|
|
12
13
|
InvestigationEvidenceData,
|
|
14
|
+
InvestigationKubernetesResource,
|
|
13
15
|
InvestigationEvidenceGroup,
|
|
14
16
|
InvestigationEvidenceObservation,
|
|
15
17
|
InvestigationEvidenceSource,
|
|
@@ -149,8 +151,11 @@ export function ResourceFact({
|
|
|
149
151
|
export function conditionStatusTone(condition: {
|
|
150
152
|
type: string;
|
|
151
153
|
status: string;
|
|
152
|
-
|
|
153
|
-
|
|
154
|
+
reason?: string;
|
|
155
|
+
}, resource?: InvestigationKubernetesResource): "healthy" | "degraded" | "unhealthy" | "unknown" | "neutral" {
|
|
156
|
+
switch (getCrossplaneConditionTone(resource, condition) ?? defaultConditionTone(condition)) {
|
|
157
|
+
case "neutral":
|
|
158
|
+
return "neutral";
|
|
154
159
|
case "ok":
|
|
155
160
|
return "healthy";
|
|
156
161
|
case "warning":
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
type DiagnosisPodLogEntry,
|
|
16
16
|
diagnosisSeverityTone,
|
|
17
17
|
} from "../diagnoseEvidenceTypes";
|
|
18
|
+
import { getCrossplaneConditionTone } from "@skyhook-io/k8s-ui/components/resources/resource-utils-crossplane";
|
|
18
19
|
import { investigationResourceEvidenceSummary } from "../investigationResourceEvidenceModel";
|
|
19
20
|
import { kindToPluralWithGroup } from "../../../utils/navigation";
|
|
20
21
|
import { pluralToKind } from "@skyhook-io/k8s-ui";
|
|
@@ -101,7 +102,8 @@ export function addTopologyLimitations(
|
|
|
101
102
|
source,
|
|
102
103
|
"Topology coverage",
|
|
103
104
|
warning,
|
|
104
|
-
|
|
105
|
+
!partiality.requiresNamespaceFilter &&
|
|
106
|
+
(normalized.includes("large graph") || normalized.includes("too large"))
|
|
105
107
|
? "truncated"
|
|
106
108
|
: "unknown",
|
|
107
109
|
);
|
|
@@ -135,7 +137,9 @@ export function addTopologyLimitations(
|
|
|
135
137
|
source,
|
|
136
138
|
"Topology scale",
|
|
137
139
|
scaleDetails.join(" "),
|
|
138
|
-
|
|
140
|
+
// A graph that was never built shows nothing, so it is an unknown; the
|
|
141
|
+
// other notes describe a graph that is shown with detail grouped.
|
|
142
|
+
partiality.requiresNamespaceFilter ? "unknown" : "truncated",
|
|
139
143
|
);
|
|
140
144
|
}
|
|
141
145
|
|
|
@@ -669,7 +673,7 @@ export function addResourceObservation(
|
|
|
669
673
|
(available !== undefined && available < desired) ||
|
|
670
674
|
(replicas?.unavailable ?? 0) > 0);
|
|
671
675
|
const adverseCondition = (context?.statusSummary?.conditions ?? []).some(
|
|
672
|
-
(condition) => defaultConditionTone(condition) === "fail",
|
|
676
|
+
(condition) => (getCrossplaneConditionTone(resource, condition) ?? defaultConditionTone(condition)) === "fail",
|
|
673
677
|
);
|
|
674
678
|
const gitOpsAdverse = Boolean(
|
|
675
679
|
gitOpsDiagnosis &&
|
|
@@ -279,6 +279,7 @@ describe("strict evidence adapters", () => {
|
|
|
279
279
|
expect.objectContaining({
|
|
280
280
|
source: "Issue-related changes",
|
|
281
281
|
kind: "unknown",
|
|
282
|
+
presentation: "history",
|
|
282
283
|
message: expect.stringContaining("incomplete for part of the window"),
|
|
283
284
|
}),
|
|
284
285
|
]);
|
|
@@ -1856,7 +1857,8 @@ describe("strict evidence adapters", () => {
|
|
|
1856
1857
|
),
|
|
1857
1858
|
]);
|
|
1858
1859
|
expect(result.groups).toHaveLength(0);
|
|
1859
|
-
expect(result.limitations[0]).toMatchObject({ kind: "
|
|
1860
|
+
expect(result.limitations[0]).toMatchObject({ kind: "unknown" });
|
|
1861
|
+
expect(result.limitations[0].presentation).toBeUndefined();
|
|
1860
1862
|
expect(result.limitations[0].source).toBe("Issue scan");
|
|
1861
1863
|
expect(result.limitations[0].message).toContain(
|
|
1862
1864
|
"Only part of this investigation result was saved",
|
|
@@ -2096,6 +2098,56 @@ describe("honest zero and partial-result states", () => {
|
|
|
2096
2098
|
);
|
|
2097
2099
|
});
|
|
2098
2100
|
|
|
2101
|
+
it("tells admission history bounds apart from failed or unchecked admission reads", () => {
|
|
2102
|
+
const started =
|
|
2103
|
+
"Radar has recorded changes only since 2026-10-27T23:42:31Z; earlier changes in the window are unknown.";
|
|
2104
|
+
const watched =
|
|
2105
|
+
"Radar has watched MutatingWebhookConfigurations only since 2026-10-27T23:42:37Z; earlier changes in the window are unknown.";
|
|
2106
|
+
const evicted =
|
|
2107
|
+
"Radar has evicted older change history; earlier changes in the window are unknown.";
|
|
2108
|
+
const denied =
|
|
2109
|
+
"ValidatingWebhookConfiguration changes are not readable by the caller.";
|
|
2110
|
+
const failed =
|
|
2111
|
+
"Radar failed to record a MutatingWebhookConfiguration change at 2026-10-28T00:00:00Z; changes in the window may be missing.";
|
|
2112
|
+
const admission = (incomplete: string) =>
|
|
2113
|
+
project([
|
|
2114
|
+
tool("changes", "get_changes", {
|
|
2115
|
+
changes: [],
|
|
2116
|
+
clusterScopedChanges: { changes: [], incomplete },
|
|
2117
|
+
}),
|
|
2118
|
+
]).limitations.filter(
|
|
2119
|
+
(entry) => entry.source === "Cluster-scoped admission changes",
|
|
2120
|
+
);
|
|
2121
|
+
|
|
2122
|
+
expect(admission(`${started} ${watched} ${evicted}`)).toEqual([
|
|
2123
|
+
expect.objectContaining({
|
|
2124
|
+
kind: "unknown",
|
|
2125
|
+
presentation: "history",
|
|
2126
|
+
message: `${started} ${watched} ${evicted}`,
|
|
2127
|
+
}),
|
|
2128
|
+
]);
|
|
2129
|
+
// The producer keeps the startup notes beside another gap; the gap stays
|
|
2130
|
+
// an open question and only the bounds become history.
|
|
2131
|
+
const mixed = admission(`${denied} ${failed} ${started}`);
|
|
2132
|
+
expect(mixed).toEqual([
|
|
2133
|
+
expect.objectContaining({
|
|
2134
|
+
kind: "unknown",
|
|
2135
|
+
message: `${denied} ${failed}`,
|
|
2136
|
+
}),
|
|
2137
|
+
expect.objectContaining({
|
|
2138
|
+
kind: "unknown",
|
|
2139
|
+
presentation: "history",
|
|
2140
|
+
message: started,
|
|
2141
|
+
}),
|
|
2142
|
+
]);
|
|
2143
|
+
expect(mixed[0].presentation).toBeUndefined();
|
|
2144
|
+
const uncached = admission(
|
|
2145
|
+
"Current ValidatingWebhookConfigurations are not cached, so their scope could not be checked; their changes are listed as may_apply.",
|
|
2146
|
+
);
|
|
2147
|
+
expect(uncached).toHaveLength(1);
|
|
2148
|
+
expect(uncached[0].presentation).toBeUndefined();
|
|
2149
|
+
});
|
|
2150
|
+
|
|
2099
2151
|
it("creates receipts only for confirmed complete zero-result reads", () => {
|
|
2100
2152
|
const result = project([
|
|
2101
2153
|
tool("diagnose", "diagnose", {
|
|
@@ -2337,13 +2389,15 @@ describe("honest zero and partial-result states", () => {
|
|
|
2337
2389
|
});
|
|
2338
2390
|
expect(result.limitations).toEqual(
|
|
2339
2391
|
expect.arrayContaining([
|
|
2392
|
+
// The graph was never built, so these are unknowns, not caps on a
|
|
2393
|
+
// graph that is shown.
|
|
2340
2394
|
expect.objectContaining({
|
|
2341
2395
|
source: "Topology coverage",
|
|
2342
|
-
kind: "
|
|
2396
|
+
kind: "unknown",
|
|
2343
2397
|
}),
|
|
2344
2398
|
expect.objectContaining({
|
|
2345
2399
|
source: "Topology scale",
|
|
2346
|
-
kind: "
|
|
2400
|
+
kind: "unknown",
|
|
2347
2401
|
message: expect.stringContaining("namespace-scoped topology search"),
|
|
2348
2402
|
}),
|
|
2349
2403
|
]),
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
2
|
import type { HPADiagnosisState } from "@skyhook-io/k8s-ui";
|
|
3
3
|
import {
|
|
4
|
+
assessmentLimitLines,
|
|
4
5
|
evidenceDisplaySnapshot,
|
|
5
6
|
groupEvidenceCoverage,
|
|
6
7
|
} from "./investigationEvidencePresentation";
|
|
@@ -446,12 +447,45 @@ describe("coverage presentation", () => {
|
|
|
446
447
|
limitation("Container logs", "Connection timed out", "error"),
|
|
447
448
|
]);
|
|
448
449
|
expect(groups[0].hasError).toBe(true);
|
|
449
|
-
expect(groups[0].bookkeepingOnly).toBe(false);
|
|
450
|
-
expect(groups[1].bookkeepingOnly).toBe(true);
|
|
451
450
|
expect(groups[0].summary).toContain("Forbidden");
|
|
452
451
|
expect(groups[0].summary).toContain("Connection timed out");
|
|
453
452
|
expect(groups[0].limitations).toHaveLength(3);
|
|
454
453
|
});
|
|
454
|
+
it("folds a source into the routine line only when every limit on it is routine", () => {
|
|
455
|
+
const watched =
|
|
456
|
+
"Radar has watched MutatingWebhookConfigurations only since 2026-10-27T23:42:37Z; earlier changes in the window are unknown.";
|
|
457
|
+
const failed =
|
|
458
|
+
"Radar failed to record a MutatingWebhookConfiguration change at 2026-10-28T00:00:00Z; changes in the window may be missing.";
|
|
459
|
+
const routineOnly = assessmentLimitLines([
|
|
460
|
+
limitation("Container logs", "Logs sampled", "truncated"),
|
|
461
|
+
limitation("Cluster-scoped admission changes", watched, "unknown", true),
|
|
462
|
+
limitation(
|
|
463
|
+
"Recent changes",
|
|
464
|
+
"Secret object history incomplete",
|
|
465
|
+
"unknown",
|
|
466
|
+
true,
|
|
467
|
+
),
|
|
468
|
+
]);
|
|
469
|
+
expect(routineOnly.open).toEqual([]);
|
|
470
|
+
expect(routineOnly.routine).toEqual([
|
|
471
|
+
"Container logs: Only part of the logs was checked.",
|
|
472
|
+
`Cluster-scoped admission changes: ${watched}`,
|
|
473
|
+
"Recent changes: Change history is incomplete.",
|
|
474
|
+
]);
|
|
475
|
+
// A failed read keeps its source open, whole, so the line is the one
|
|
476
|
+
// Captured results shows and its dedupe still matches.
|
|
477
|
+
const mixed = assessmentLimitLines([
|
|
478
|
+
limitation("Container logs", "Logs sampled", "truncated"),
|
|
479
|
+
limitation("Container logs", "Forbidden: cannot read pod logs", "error"),
|
|
480
|
+
limitation("Cluster-scoped admission changes", watched, "unknown", true),
|
|
481
|
+
limitation("Cluster-scoped admission changes", failed, "unknown"),
|
|
482
|
+
]);
|
|
483
|
+
expect(mixed.open).toEqual([
|
|
484
|
+
"Container logs: Forbidden: cannot read pod logs",
|
|
485
|
+
`Cluster-scoped admission changes: ${watched} · ${failed}`,
|
|
486
|
+
]);
|
|
487
|
+
expect(mixed.routine).toEqual([]);
|
|
488
|
+
});
|
|
455
489
|
it("keeps history-only neutral and unknown limitations verbatim", () => {
|
|
456
490
|
expect(
|
|
457
491
|
groupEvidenceCoverage([
|
|
@@ -105,8 +105,37 @@ export interface EvidenceCoverageGroup {
|
|
|
105
105
|
limitations: InvestigationEvidenceLimitation[];
|
|
106
106
|
hasError: boolean;
|
|
107
107
|
historyOnly: boolean;
|
|
108
|
-
/** Every entry is a sampling cap or a history bound:
|
|
109
|
-
|
|
108
|
+
/** Every entry is a sampling cap or a history bound: routine, not an open question. */
|
|
109
|
+
routineOnly: boolean;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/** A sampling cap or a history bound: bookkeeping for the record, not an open question. */
|
|
113
|
+
function routineLimitation(entry: InvestigationEvidenceLimitation): boolean {
|
|
114
|
+
return (
|
|
115
|
+
entry.kind === "truncated" ||
|
|
116
|
+
(entry.kind === "unknown" && entry.presentation === "history")
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Radar's own limits for the assessment headline, one line per source.
|
|
122
|
+
* `open` holds reads Radar could not complete, which qualify the answer and
|
|
123
|
+
* sit under Still open; `routine` holds sampling caps and history bounds,
|
|
124
|
+
* which hold on most runs and are shown folded beneath it. A source with
|
|
125
|
+
* anything else keeps its whole line open, so the line matches the one
|
|
126
|
+
* Captured results groups and is not repeated there.
|
|
127
|
+
*/
|
|
128
|
+
export function assessmentLimitLines(
|
|
129
|
+
limitations: InvestigationEvidenceLimitation[],
|
|
130
|
+
): { open: string[]; routine: string[] } {
|
|
131
|
+
const open: string[] = [];
|
|
132
|
+
const routine: string[] = [];
|
|
133
|
+
for (const group of groupEvidenceCoverage(limitations)) {
|
|
134
|
+
const line = `${group.label}: ${group.summary}`;
|
|
135
|
+
if (group.routineOnly) routine.push(line);
|
|
136
|
+
else open.push(line);
|
|
137
|
+
}
|
|
138
|
+
return { open, routine };
|
|
110
139
|
}
|
|
111
140
|
|
|
112
141
|
/** Group the presentation, not the underlying limitations or health qualification. */
|
|
@@ -126,11 +155,7 @@ export function groupEvidenceCoverage(
|
|
|
126
155
|
(entry) => entry.kind === "unknown" && entry.presentation === "history",
|
|
127
156
|
);
|
|
128
157
|
const truncated = entries.some((entry) => entry.kind === "truncated");
|
|
129
|
-
const ordinaryLimits = entries.every(
|
|
130
|
-
(entry) =>
|
|
131
|
-
entry.kind === "truncated" ||
|
|
132
|
-
(entry.kind === "unknown" && entry.presentation === "history"),
|
|
133
|
-
);
|
|
158
|
+
const ordinaryLimits = entries.every(routineLimitation);
|
|
134
159
|
let summary: string;
|
|
135
160
|
if (errors.length) {
|
|
136
161
|
// Never replace permission/transport failures with a benign sampling note.
|
|
@@ -160,7 +185,7 @@ export function groupEvidenceCoverage(
|
|
|
160
185
|
limitations: entries,
|
|
161
186
|
hasError: errors.length > 0,
|
|
162
187
|
historyOnly,
|
|
163
|
-
|
|
188
|
+
routineOnly: ordinaryLimits,
|
|
164
189
|
};
|
|
165
190
|
})
|
|
166
191
|
.sort(
|
|
@@ -144,6 +144,41 @@ describe("ResultCard under the story contract", () => {
|
|
|
144
144
|
expect(html).toContain("Previous logs: could not be read");
|
|
145
145
|
});
|
|
146
146
|
|
|
147
|
+
it("folds Radar's routine limits into one muted line beneath Still open", () => {
|
|
148
|
+
const routine = [
|
|
149
|
+
"Cluster-scoped admission changes: Radar has recorded changes only since 2026-10-27T23:42:31Z; earlier changes in the window are unknown.",
|
|
150
|
+
"Container logs: Only part of the logs was checked.",
|
|
151
|
+
];
|
|
152
|
+
const html = renderToStaticMarkup(
|
|
153
|
+
<ResultCard
|
|
154
|
+
diagnosis={storyDiagnosis}
|
|
155
|
+
section="conclusion"
|
|
156
|
+
assessmentRoutineLimits={routine}
|
|
157
|
+
/>,
|
|
158
|
+
);
|
|
159
|
+
const stillOpen = html.slice(
|
|
160
|
+
html.indexOf("data-assessment-unresolved"),
|
|
161
|
+
html.indexOf("data-assessment-routine-limits"),
|
|
162
|
+
);
|
|
163
|
+
expect(stillOpen).toContain("Whether the Atlas password was rotated");
|
|
164
|
+
expect(stillOpen).not.toContain("Radar has recorded changes only since");
|
|
165
|
+
expect(html).toContain("Radar's coverage · 2 routine limits");
|
|
166
|
+
expect(html).toContain('aria-expanded="false"');
|
|
167
|
+
// Folded, never dropped: the lines stay in the document for the disclosure.
|
|
168
|
+
expect(html).toContain("Radar has recorded changes only since");
|
|
169
|
+
|
|
170
|
+
// Without open questions the folded line still renders on its own.
|
|
171
|
+
const alone = renderToStaticMarkup(
|
|
172
|
+
<ResultCard
|
|
173
|
+
diagnosis={{ ...storyDiagnosis, unresolved: [] }}
|
|
174
|
+
section="conclusion"
|
|
175
|
+
assessmentRoutineLimits={routine.slice(1)}
|
|
176
|
+
/>,
|
|
177
|
+
);
|
|
178
|
+
expect(alone).not.toContain("data-assessment-unresolved");
|
|
179
|
+
expect(alone).toContain("Radar's coverage · 1 routine limit<");
|
|
180
|
+
});
|
|
181
|
+
|
|
147
182
|
it("says nothing when the agent listed nothing unresolved: the certainty word carries it", () => {
|
|
148
183
|
const html = renderToStaticMarkup(
|
|
149
184
|
<ResultCard
|
|
@@ -283,6 +318,24 @@ describe("assessmentCopyText", () => {
|
|
|
283
318
|
text.indexOf("Still open:"),
|
|
284
319
|
);
|
|
285
320
|
});
|
|
321
|
+
it("copies routine limits after the steps, apart from Still open", () => {
|
|
322
|
+
const text = assessmentCopyText(storyDiagnosis, {
|
|
323
|
+
limits: ["Previous logs: could not be read"],
|
|
324
|
+
routineLimits: ["Recent changes: Change history is incomplete."],
|
|
325
|
+
});
|
|
326
|
+
expect(text).toContain(
|
|
327
|
+
"Radar's coverage (routine limits):\n- Recent changes: Change history is incomplete.",
|
|
328
|
+
);
|
|
329
|
+
const stillOpen = text.slice(
|
|
330
|
+
text.indexOf("Still open:"),
|
|
331
|
+
text.indexOf("\n\n", text.indexOf("Still open:")),
|
|
332
|
+
);
|
|
333
|
+
expect(stillOpen).toContain("- Previous logs: could not be read");
|
|
334
|
+
expect(stillOpen).not.toContain("Change history is incomplete");
|
|
335
|
+
expect(text.indexOf("Next steps:")).toBeLessThan(
|
|
336
|
+
text.indexOf("Radar's coverage"),
|
|
337
|
+
);
|
|
338
|
+
});
|
|
286
339
|
it("names the recommended step and counts the rest for a legacy remediation list", () => {
|
|
287
340
|
const text = assessmentCopyText(
|
|
288
341
|
{
|
|
@@ -124,8 +124,8 @@ export function ChartBrowser({ onChartSelect }: ChartBrowserProps) {
|
|
|
124
124
|
|
|
125
125
|
return (
|
|
126
126
|
<div className="flex flex-col h-full">
|
|
127
|
-
{/* Toolbar */}
|
|
128
|
-
<div className="flex items-center gap-4 px-4 py-3 border-b border-theme-border bg-theme-surface/50 shrink-0">
|
|
127
|
+
{/* Toolbar. Phones: the controls wrap and search takes its own row. */}
|
|
128
|
+
<div className="flex items-center gap-4 px-4 py-3 border-b border-theme-border bg-theme-surface/50 shrink-0 phone:flex-wrap phone:gap-2 phone:px-3">
|
|
129
129
|
<div className="flex items-center gap-2 text-theme-text-secondary">
|
|
130
130
|
<Package className="w-5 h-5" />
|
|
131
131
|
<span className="font-medium">Charts</span>
|
|
@@ -214,7 +214,7 @@ export function ChartBrowser({ onChartSelect }: ChartBrowserProps) {
|
|
|
214
214
|
|
|
215
215
|
{/* ArtifactHub filters */}
|
|
216
216
|
{chartSource === 'artifacthub' && (
|
|
217
|
-
<div className="flex items-center gap-3">
|
|
217
|
+
<div className="flex items-center gap-3 phone:flex-wrap phone:gap-x-3 phone:gap-y-2">
|
|
218
218
|
<label className="flex items-center gap-1.5 text-sm text-theme-text-secondary">
|
|
219
219
|
<input
|
|
220
220
|
type="checkbox"
|
|
@@ -252,7 +252,7 @@ export function ChartBrowser({ onChartSelect }: ChartBrowserProps) {
|
|
|
252
252
|
)}
|
|
253
253
|
|
|
254
254
|
{/* Search */}
|
|
255
|
-
<div className="flex-1 relative">
|
|
255
|
+
<div className="flex-1 relative phone:order-last phone:basis-full">
|
|
256
256
|
<Search className="absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-theme-text-tertiary" />
|
|
257
257
|
<Input
|
|
258
258
|
placeholder={chartSource === 'local' ? "Search charts..." : "Search ArtifactHub..."}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AlertBanner } from '@skyhook-io/k8s-ui/components/ui/drawer-components'
|
|
2
2
|
import { useState, useCallback, useEffect, useRef } from 'react'
|
|
3
3
|
import { flushSync } from 'react-dom'
|
|
4
|
-
import { FetchResult, useDockReservedHeight, compareVersions } from '@skyhook-io/k8s-ui'
|
|
4
|
+
import { FetchResult, useDockReservedHeight, compareVersions, usePhoneLayout } from '@skyhook-io/k8s-ui'
|
|
5
5
|
import { startViewTransitionSafe } from '@skyhook-io/k8s-ui/utils/view-transition'
|
|
6
6
|
import { TRANSITION_DRAWER } from '../../utils/animation'
|
|
7
7
|
import { useRefreshAnimation } from '../../hooks/useRefreshAnimation'
|
|
@@ -167,6 +167,10 @@ export function HelmReleaseDrawer({ release, onClose, onNavigateToResource, isOp
|
|
|
167
167
|
const [selectedSourceUpgrade, setSelectedSourceUpgrade] = useState<SourceUpgradeSelection | null>(null)
|
|
168
168
|
const selectedSourceRef = useRef<SourceUpgradeSelection | null>(null)
|
|
169
169
|
const [adjustValues, setAdjustValues] = useState(false)
|
|
170
|
+
// Phones upgrade with the existing values. An adjustment already open when
|
|
171
|
+
// a phone rotates to portrait stays visible, since its edits would
|
|
172
|
+
// otherwise apply unseen.
|
|
173
|
+
const isPhone = usePhoneLayout()
|
|
170
174
|
const [editedUpgradeYaml, setEditedUpgradeYaml] = useState('')
|
|
171
175
|
const [upgradeYamlError, setUpgradeYamlError] = useState<string | null>(null)
|
|
172
176
|
const [upgradeValuesSeeded, setUpgradeValuesSeeded] = useState(false)
|
|
@@ -1006,7 +1010,7 @@ export function HelmReleaseDrawer({ release, onClose, onNavigateToResource, isOp
|
|
|
1006
1010
|
)}
|
|
1007
1011
|
</div>
|
|
1008
1012
|
)}
|
|
1009
|
-
{upgradeProgress.length === 0 && canHelmWrite && (
|
|
1013
|
+
{upgradeProgress.length === 0 && canHelmWrite && (!isPhone || adjustValues) && (
|
|
1010
1014
|
<div className="mt-3 border-t border-theme-border pt-3">
|
|
1011
1015
|
<Tooltip content="Edit the user-supplied Helm values that Radar will pass to this upgrade.">
|
|
1012
1016
|
<button
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useState, useMemo, useRef, useEffect, useCallback, forwardRef } from 'react'
|
|
2
2
|
import { useRegisterShortcuts } from '../../hooks/useKeyboardShortcuts'
|
|
3
3
|
import { Package, Search, ArrowUpCircle, LayoutGrid, List, Shield, GitBranch, ChevronRight, RotateCcw, Clock } from 'lucide-react'
|
|
4
|
-
import { PaneLoader, PageHeader, SortableTh, FreshnessControl, type SortDir, Input } from '@skyhook-io/k8s-ui'
|
|
4
|
+
import { PaneLoader, PageHeader, SortableTh, FreshnessControl, type SortDir, Input, usePhoneLayout } from '@skyhook-io/k8s-ui'
|
|
5
5
|
import { useConnection } from '../../context/ConnectionContext'
|
|
6
6
|
import { clsx } from 'clsx'
|
|
7
7
|
import { useHelmReleases, useHelmBatchUpgradeInfo, isForbiddenError } from '../../api/client'
|
|
@@ -51,6 +51,11 @@ export function HelmView({ namespaces, selectedRelease, onReleaseClick }: HelmVi
|
|
|
51
51
|
}),
|
|
52
52
|
[],
|
|
53
53
|
)
|
|
54
|
+
// Phones hide these columns, so a sort on one of them (set at a wider
|
|
55
|
+
// width) would order the list with no visible header; fall back to the
|
|
56
|
+
// server's order there instead.
|
|
57
|
+
const isPhone = usePhoneLayout()
|
|
58
|
+
const effectiveSort = isPhone && sort && PHONE_HIDDEN_SORT_KEYS.has(sort.key) ? null : sort
|
|
54
59
|
|
|
55
60
|
const filteredReleases = useMemo(() => {
|
|
56
61
|
if (!releases) return []
|
|
@@ -64,10 +69,10 @@ export function HelmView({ namespaces, selectedRelease, onReleaseClick }: HelmVi
|
|
|
64
69
|
)
|
|
65
70
|
: releases
|
|
66
71
|
|
|
67
|
-
if (!
|
|
68
|
-
const factor =
|
|
69
|
-
return [...filtered].sort((a, b) => compareReleases(a, b,
|
|
70
|
-
}, [releases, searchTerm,
|
|
72
|
+
if (!effectiveSort) return filtered
|
|
73
|
+
const factor = effectiveSort.dir === 'asc' ? 1 : -1
|
|
74
|
+
return [...filtered].sort((a, b) => compareReleases(a, b, effectiveSort.key) * factor)
|
|
75
|
+
}, [releases, searchTerm, effectiveSort])
|
|
71
76
|
|
|
72
77
|
// Keyboard navigation state
|
|
73
78
|
const searchInputRef = useRef<HTMLInputElement>(null)
|
|
@@ -78,7 +83,7 @@ export function HelmView({ namespaces, selectedRelease, onReleaseClick }: HelmVi
|
|
|
78
83
|
|
|
79
84
|
// Reset highlight when the visible order changes (search or sort) — otherwise
|
|
80
85
|
// the index would point at whatever release shifted into that row.
|
|
81
|
-
useEffect(() => { setHighlightedIndex(-1) }, [searchTerm,
|
|
86
|
+
useEffect(() => { setHighlightedIndex(-1) }, [searchTerm, effectiveSort])
|
|
82
87
|
|
|
83
88
|
// Scroll highlighted row into view
|
|
84
89
|
useEffect(() => {
|
|
@@ -301,16 +306,18 @@ export function HelmView({ namespaces, selectedRelease, onReleaseClick }: HelmVi
|
|
|
301
306
|
)}
|
|
302
307
|
</div>
|
|
303
308
|
) : (
|
|
309
|
+
// On phones the fixed-width columns would leave Name no room;
|
|
310
|
+
// what they hide is all in the release detail.
|
|
304
311
|
<table className="w-full table-fixed">
|
|
305
312
|
<thead className="bg-theme-base sticky top-0 z-10">
|
|
306
313
|
<tr>
|
|
307
|
-
<SortableTh label="Name" sortKey="name" activeKey={
|
|
308
|
-
<SortableTh label="Namespace" sortKey="namespace" activeKey={
|
|
309
|
-
<SortableTh label="Chart" sortKey="chart" activeKey={
|
|
310
|
-
<SortableTh label="App Version" sortKey="appVersion" activeKey={
|
|
311
|
-
<SortableTh label="Status" sortKey="status" activeKey={
|
|
312
|
-
<SortableTh label="Rev" sortKey="revision" activeKey={
|
|
313
|
-
<SortableTh label="Updated" sortKey="updated" activeKey={
|
|
314
|
+
<SortableTh label="Name" sortKey="name" activeKey={effectiveSort?.key ?? null} direction={effectiveSort?.dir ?? 'asc'} onSort={onSort} className="w-[28%] phone:w-auto" />
|
|
315
|
+
<SortableTh label="Namespace" sortKey="namespace" activeKey={effectiveSort?.key ?? null} direction={effectiveSort?.dir ?? 'asc'} onSort={onSort} className="w-[18%] phone:hidden" />
|
|
316
|
+
<SortableTh label="Chart" sortKey="chart" activeKey={effectiveSort?.key ?? null} direction={effectiveSort?.dir ?? 'asc'} onSort={onSort} className="w-[22%] phone:hidden" />
|
|
317
|
+
<SortableTh label="App Version" sortKey="appVersion" activeKey={effectiveSort?.key ?? null} direction={effectiveSort?.dir ?? 'asc'} onSort={onSort} className="w-24 hidden xl:table-cell" />
|
|
318
|
+
<SortableTh label="Status" sortKey="status" activeKey={effectiveSort?.key ?? null} direction={effectiveSort?.dir ?? 'asc'} onSort={onSort} className="w-40 phone:w-[6.5rem]" />
|
|
319
|
+
<SortableTh label="Rev" sortKey="revision" activeKey={effectiveSort?.key ?? null} direction={effectiveSort?.dir ?? 'asc'} onSort={onSort} className="w-16 phone:hidden" />
|
|
320
|
+
<SortableTh label="Updated" sortKey="updated" activeKey={effectiveSort?.key ?? null} direction={effectiveSort?.dir ?? 'asc'} onSort={onSort} className="w-24 phone:hidden" />
|
|
314
321
|
</tr>
|
|
315
322
|
</thead>
|
|
316
323
|
<tbody className="table-divide-subtle">
|
|
@@ -361,6 +368,9 @@ function releaseIdentityKey(release: Pick<HelmRelease, 'namespace' | 'name' | 's
|
|
|
361
368
|
|
|
362
369
|
type HelmSortKey = 'name' | 'namespace' | 'chart' | 'appVersion' | 'status' | 'revision' | 'updated'
|
|
363
370
|
|
|
371
|
+
// Columns the release table hides on phones (the phone: classes on the headers).
|
|
372
|
+
const PHONE_HIDDEN_SORT_KEYS: ReadonlySet<HelmSortKey> = new Set<HelmSortKey>(['namespace', 'chart', 'revision', 'updated'])
|
|
373
|
+
|
|
364
374
|
function compareReleases(a: HelmRelease, b: HelmRelease, key: HelmSortKey): number {
|
|
365
375
|
let cmp: number
|
|
366
376
|
switch (key) {
|
|
@@ -535,10 +545,10 @@ const ReleaseRow = forwardRef<HTMLTableRowElement, ReleaseRowProps>(
|
|
|
535
545
|
: 'hover:bg-theme-surface/50'
|
|
536
546
|
)}
|
|
537
547
|
>
|
|
538
|
-
<td className="px-4 py-3">
|
|
539
|
-
<div className="flex min-w-0 items-center gap-2">
|
|
548
|
+
<td className="px-4 py-3 phone:px-3">
|
|
549
|
+
<div className="flex min-w-0 items-center gap-2 phone:flex-wrap phone:gap-y-1">
|
|
540
550
|
<Package className="w-4 h-4 text-theme-text-tertiary shrink-0" />
|
|
541
|
-
<span className="min-w-0 truncate text-sm font-medium text-theme-text-primary">{release.name}</span>
|
|
551
|
+
<span className="min-w-0 truncate text-sm font-medium text-theme-text-primary phone:max-w-[calc(100%-1.5rem)] phone:shrink-0">{release.name}</span>
|
|
542
552
|
{getHealthBadge()}
|
|
543
553
|
{listOperation && <HelmOperationChip operation={listOperation} />}
|
|
544
554
|
{release.managedByFluxHelmRelease && (
|
|
@@ -557,13 +567,14 @@ const ReleaseRow = forwardRef<HTMLTableRowElement, ReleaseRowProps>(
|
|
|
557
567
|
</Tooltip>
|
|
558
568
|
)}
|
|
559
569
|
</div>
|
|
570
|
+
<span className="hidden truncate pl-6 text-xs text-theme-text-tertiary phone:block">{release.namespace}</span>
|
|
560
571
|
</td>
|
|
561
|
-
<td className="px-4 py-3 w-[18%]">
|
|
572
|
+
<td className="px-4 py-3 w-[18%] phone:hidden">
|
|
562
573
|
<Tooltip content={release.namespace}>
|
|
563
574
|
<span className="block truncate text-sm text-theme-text-secondary">{release.namespace}</span>
|
|
564
575
|
</Tooltip>
|
|
565
576
|
</td>
|
|
566
|
-
<td className="px-4 py-3 w-[22%]">
|
|
577
|
+
<td className="px-4 py-3 w-[22%] phone:hidden">
|
|
567
578
|
<Tooltip content={`${release.chart}-${release.chartVersion}`}>
|
|
568
579
|
<span className="text-sm text-theme-text-secondary truncate block">
|
|
569
580
|
{release.chart}-{release.chartVersion}
|
|
@@ -579,11 +590,11 @@ const ReleaseRow = forwardRef<HTMLTableRowElement, ReleaseRowProps>(
|
|
|
579
590
|
</Tooltip>
|
|
580
591
|
)}
|
|
581
592
|
</td>
|
|
582
|
-
<td className="px-4 py-3 w-40">
|
|
593
|
+
<td className="px-4 py-3 w-40 phone:w-[6.5rem] phone:px-3">
|
|
583
594
|
{isHelmReleaseActionable(release.status) ? (
|
|
584
595
|
<Tooltip content="Click row to view rollback / history / logs and recover">
|
|
585
596
|
<span
|
|
586
|
-
className={clsx('badge inline-flex items-center gap-1', getStatusColor(release.status))}
|
|
597
|
+
className={clsx('badge inline-flex items-center gap-1 phone:whitespace-normal', getStatusColor(release.status))}
|
|
587
598
|
>
|
|
588
599
|
{release.status}
|
|
589
600
|
<ChevronRight className="w-3 h-3 opacity-70" />
|
|
@@ -592,7 +603,7 @@ const ReleaseRow = forwardRef<HTMLTableRowElement, ReleaseRowProps>(
|
|
|
592
603
|
) : (
|
|
593
604
|
<span
|
|
594
605
|
className={clsx(
|
|
595
|
-
'badge',
|
|
606
|
+
'badge phone:whitespace-normal',
|
|
596
607
|
getStatusColor(release.status)
|
|
597
608
|
)}
|
|
598
609
|
>
|
|
@@ -600,10 +611,10 @@ const ReleaseRow = forwardRef<HTMLTableRowElement, ReleaseRowProps>(
|
|
|
600
611
|
</span>
|
|
601
612
|
)}
|
|
602
613
|
</td>
|
|
603
|
-
<td className="px-4 py-3 w-16">
|
|
614
|
+
<td className="px-4 py-3 w-16 phone:hidden">
|
|
604
615
|
<span className="text-sm text-theme-text-secondary">{release.revision}</span>
|
|
605
616
|
</td>
|
|
606
|
-
<td className="px-4 py-3 w-24">
|
|
617
|
+
<td className="px-4 py-3 w-24 phone:hidden">
|
|
607
618
|
<Tooltip content={release.updated}>
|
|
608
619
|
<span className="text-sm text-theme-text-secondary">
|
|
609
620
|
{formatAge(release.updated)}
|