@skyhook-io/radar-app 1.18.0 → 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.
Files changed (126) hide show
  1. package/README.md +6 -0
  2. package/package.json +2 -3
  3. package/src/App.tsx +43 -12
  4. package/src/api/client.deleteResource.test.tsx +111 -0
  5. package/src/api/client.gitops-destination.test.tsx +55 -0
  6. package/src/api/client.resource-list.test.ts +76 -0
  7. package/src/api/client.resourceAudit.test.tsx +57 -0
  8. package/src/api/client.resourcePath.test.ts +107 -0
  9. package/src/api/client.ts +197 -57
  10. package/src/api/quotas.ts +9 -20
  11. package/src/api/radarFeatures.ts +2 -0
  12. package/src/api/resourceLists.test.ts +84 -0
  13. package/src/api/resourceLists.ts +71 -0
  14. package/src/components/capacity/CapacityDemand.tsx +6 -3
  15. package/src/components/capacity/CapacityOverview.tsx +14 -7
  16. package/src/components/capacity/CapacityPoolDetail.tsx +7 -5
  17. package/src/components/capacity/ClusterSchedulingCard.tsx +3 -3
  18. package/src/components/capacity/shared.tsx +9 -5
  19. package/src/components/cnpg/CNPGOverview.tsx +4 -1
  20. package/src/components/cnpg/CNPGView.tsx +1 -0
  21. package/src/components/cnpg/actions/useCNPGWriteGuard.tsx +1 -0
  22. package/src/components/compare/CompareResourcePicker.test.tsx +58 -0
  23. package/src/components/compare/CompareViewRoute.tsx +5 -1
  24. package/src/components/compare/useCompareCandidates.ts +1 -1
  25. package/src/components/compare/useCompareLauncher.tsx +4 -2
  26. package/src/components/diagnose/ApplyDialog.test.tsx +10 -0
  27. package/src/components/diagnose/ApplyDialog.tsx +8 -1
  28. package/src/components/diagnose/AssessmentCard.tsx +60 -0
  29. package/src/components/diagnose/DiagnoseSurface.tsx +5 -0
  30. package/src/components/diagnose/InvestigationEvidencePane.test.tsx +62 -2
  31. package/src/components/diagnose/InvestigationEvidenceSections.tsx +6 -5
  32. package/src/components/diagnose/InvestigationView.tsx +47 -13
  33. package/src/components/diagnose/StoryExcerpt.tsx +24 -5
  34. package/src/components/diagnose/assessmentCopy.ts +11 -0
  35. package/src/components/diagnose/investigationEvidence/adapters/changes.ts +36 -1
  36. package/src/components/diagnose/investigationEvidence/adapters/crossplane.test.tsx +85 -0
  37. package/src/components/diagnose/investigationEvidence/adapters/issues.ts +1 -0
  38. package/src/components/diagnose/investigationEvidence/adapters/listCoverage.test.ts +415 -0
  39. package/src/components/diagnose/investigationEvidence/adapters/prometheus.test.ts +2 -1
  40. package/src/components/diagnose/investigationEvidence/adapters/prometheus.ts +2 -1
  41. package/src/components/diagnose/investigationEvidence/adapters/resource.ts +107 -8
  42. package/src/components/diagnose/investigationEvidence/adapters/testdata/crossplane-paused-get-resource.json +28 -0
  43. package/src/components/diagnose/investigationEvidence/bodies/index.tsx +2 -0
  44. package/src/components/diagnose/investigationEvidence/bodies/inventory.tsx +66 -16
  45. package/src/components/diagnose/investigationEvidence/bodies/workload.tsx +5 -1
  46. package/src/components/diagnose/investigationEvidence/builder.ts +16 -2
  47. package/src/components/diagnose/investigationEvidence/cardParts.tsx +7 -2
  48. package/src/components/diagnose/investigationEvidence/excerpt.ts +2 -0
  49. package/src/components/diagnose/investigationEvidence/identity.test.ts +1 -1
  50. package/src/components/diagnose/investigationEvidence/observations.ts +8 -3
  51. package/src/components/diagnose/investigationEvidence/projection.test.ts +81 -4
  52. package/src/components/diagnose/investigationEvidence/types.ts +15 -0
  53. package/src/components/diagnose/investigationEvidencePresentation.test.ts +36 -2
  54. package/src/components/diagnose/investigationEvidencePresentation.ts +33 -8
  55. package/src/components/diagnose/storyParts.test.tsx +53 -0
  56. package/src/components/diagnose/toolCallLabel.test.ts +9 -0
  57. package/src/components/diagnose/toolCallLabel.ts +2 -0
  58. package/src/components/execution/BatchExecutionView.image-browse.test.tsx +46 -0
  59. package/src/components/execution/BatchExecutionView.tsx +6 -4
  60. package/src/components/gitops/GitOpsView.identity.test.tsx +113 -0
  61. package/src/components/gitops/GitOpsView.tsx +62 -40
  62. package/src/components/gitops/useDestinationCluster.ts +2 -1
  63. package/src/components/helm/ArtifactHubSourceSearch.test.tsx +124 -0
  64. package/src/components/helm/ArtifactHubSourceSearch.tsx +240 -0
  65. package/src/components/helm/ChartBrowser.tsx +9 -8
  66. package/src/components/helm/HelmReleaseDrawer.tsx +6 -2
  67. package/src/components/helm/HelmView.tsx +34 -23
  68. package/src/components/helm/InstallWizard.tsx +6 -2
  69. package/src/components/helm/TrackChartSourceDialog.render.test.tsx +269 -96
  70. package/src/components/helm/TrackChartSourceDialog.tsx +607 -104
  71. package/src/components/helm/ValuesViewer.test.tsx +1 -0
  72. package/src/components/helm/ValuesViewer.tsx +4 -2
  73. package/src/components/home/ClusterHealthCard.tsx +28 -21
  74. package/src/components/home/MCPSetupDialog.test.tsx +27 -2
  75. package/src/components/home/MCPSetupDialog.tsx +14 -2
  76. package/src/components/home/mcpToolCatalog.ts +39 -2
  77. package/src/components/issues/IssuesPane.render.test.tsx +5 -5
  78. package/src/components/nav/PrimaryNavRail.tsx +34 -2
  79. package/src/components/product-hunt/ProductHuntNotice.render.test.tsx +120 -0
  80. package/src/components/product-hunt/ProductHuntNotice.test.ts +121 -0
  81. package/src/components/product-hunt/ProductHuntNotice.tsx +202 -0
  82. package/src/components/product-hunt/launchWindow.ts +78 -0
  83. package/src/components/product-hunt/useProductHuntRailEntry.test.tsx +76 -0
  84. package/src/components/product-hunt/useProductHuntRailEntry.ts +27 -0
  85. package/src/components/resource/PrometheusCharts.overlays.test.ts +45 -0
  86. package/src/components/resource/PrometheusCharts.tsx +2 -2
  87. package/src/components/resources/CompositeRenderer.tsx +4 -0
  88. package/src/components/resources/ResourcesView.tsx +30 -68
  89. package/src/components/resources/renderers/PodRenderer.tsx +4 -1
  90. package/src/components/settings/LocalConnectionSettings.tsx +1 -0
  91. package/src/components/settings/MyPermissionsDialog.tsx +12 -9
  92. package/src/components/traffic/TrafficSourcePill.test.tsx +110 -0
  93. package/src/components/traffic/TrafficSourcePill.tsx +111 -0
  94. package/src/components/traffic/TrafficView.tsx +9 -55
  95. package/src/components/ui/DiagnosticsOverlay.test.ts +25 -0
  96. package/src/components/ui/DiagnosticsOverlay.tsx +2 -1
  97. package/src/components/ui/Omnibar.note.test.tsx +141 -0
  98. package/src/components/ui/Omnibar.tsx +82 -18
  99. package/src/components/ui/RadarOmnibar.test.tsx +201 -0
  100. package/src/components/ui/RadarOmnibar.tsx +39 -4
  101. package/src/components/ui/SearchSyntaxHelp.test.tsx +39 -0
  102. package/src/components/ui/SearchSyntaxHelp.tsx +23 -2
  103. package/src/components/ui/UpdateNotification.manual.test.tsx +177 -0
  104. package/src/components/ui/UpdateNotification.test.tsx +4 -1
  105. package/src/components/ui/UpdateNotification.tsx +61 -10
  106. package/src/components/ui/omnibar-match.test.ts +15 -8
  107. package/src/components/ui/omnibar-match.ts +11 -6
  108. package/src/components/ui/searchCoverage.fixtures.ts +16 -0
  109. package/src/components/ui/searchCoverageNote.test.ts +245 -0
  110. package/src/components/ui/searchCoverageNote.ts +222 -0
  111. package/src/components/usage-data/UsageDataPrompt.tsx +19 -1
  112. package/src/components/whats-new/WhatsNew.test.ts +10 -0
  113. package/src/components/whats-new/WhatsNew.tsx +5 -4
  114. package/src/components/whats-new/WhatsNewDialog.test.tsx +20 -0
  115. package/src/components/whats-new/releaseNotes.ts +57 -5
  116. package/src/components/workload/WorkloadView.tsx +18 -6
  117. package/src/components/workspace/layout.tsx +2 -1
  118. package/src/contexts/CapabilitiesContext.tsx +1 -0
  119. package/src/hooks/useGitOpsWriteGuard.test.tsx +126 -2
  120. package/src/hooks/useGitOpsWriteGuard.ts +25 -3
  121. package/src/hooks/useResolvedGitOpsOwner.ts +14 -9
  122. package/src/hooks/useResourceCounts.ts +2 -0
  123. package/src/index.css +87 -4
  124. package/src/index.ts +7 -0
  125. package/src/utils/artifacthub.test.ts +18 -0
  126. package/src/utils/artifacthub.ts +9 -0
@@ -14,6 +14,15 @@ describe("describeToolCall", () => {
14
14
  ).toBe("Listing Ingresses");
15
15
  });
16
16
 
17
+ it("scopes the runtime inventory to its namespace", () => {
18
+ expect(describeToolCall("get_runtime_versions", JSON.stringify({ runtime: "php" }))).toBe(
19
+ "Reading runtime versions of running images",
20
+ );
21
+ expect(
22
+ describeToolCall("get_runtime_versions", JSON.stringify({ namespace: "shop", runtime: "php" })),
23
+ ).toBe("Reading runtime versions of running images in shop");
24
+ });
25
+
17
26
  it("names the target from the call's arguments", () => {
18
27
  expect(
19
28
  describeToolCall(
@@ -68,6 +68,8 @@ export function describeToolCall(tool: string, args?: string): string {
68
68
  return "Running the cluster audit";
69
69
  case "get_cluster_upgrade_readiness":
70
70
  return "Checking upgrade readiness";
71
+ case "get_runtime_versions":
72
+ return scoped("Reading runtime versions of running images");
71
73
  case "apply_resource":
72
74
  return "Applying the change";
73
75
  case "patch_resource":
@@ -0,0 +1,46 @@
1
+ import { renderToStaticMarkup } from 'react-dom/server'
2
+ import { describe, expect, it, vi } from 'vitest'
3
+ import { BatchExecutionFullscreen } from './BatchExecutionView'
4
+
5
+ const auth = vi.hoisted(() => ({ enabled: false }))
6
+
7
+ vi.mock('../../api/client', () => ({
8
+ useResource: () => ({}),
9
+ useWorkloadPods: () => ({}),
10
+ useJobSetResources: () => ({ data: undefined, isLoading: false }),
11
+ useWorkloadRuns: () => ({ isLoading: false, error: undefined, data: { collection: 'runs', runs: [], total: 0, truncated: false } }),
12
+ useImageMetadata: () => ({ data: undefined, isLoading: false, error: undefined }),
13
+ ApiError: class ApiError extends Error {},
14
+ }))
15
+
16
+ vi.mock('../../contexts/CapabilitiesContext', async (importOriginal) => ({
17
+ ...(await importOriginal<typeof import('../../contexts/CapabilitiesContext')>()),
18
+ useIsAuthEnabled: () => auth.enabled,
19
+ }))
20
+
21
+ const image = 'trafex/php-nginx:3.6.0'
22
+
23
+ function render() {
24
+ return renderToStaticMarkup(
25
+ <BatchExecutionFullscreen
26
+ kind="CronJob" apiKind="cronjobs" namespace="legacy" name="nightly-invoice"
27
+ resource={{ spec: { schedule: '0 3 * * *', jobTemplate: { spec: { template: { spec: { containers: [{ name: 'invoice', image }] } } } } }, status: {} }}
28
+ />,
29
+ )
30
+ }
31
+
32
+ describe('template image in the run view', () => {
33
+ it('opens the image browser when auth is off', () => {
34
+ auth.enabled = false
35
+ const html = render()
36
+ expect(html).toMatch(new RegExp(`<button[^>]*>${image}</button>`))
37
+ expect(html).not.toContain('decoration-dotted')
38
+ })
39
+
40
+ it('stays text and marks the explanation when auth is on, where a template has no Pod to browse through', () => {
41
+ auth.enabled = true
42
+ const html = render()
43
+ expect(html).not.toMatch(new RegExp(`<button[^>]*>${image}</button>`))
44
+ expect(html).toMatch(new RegExp(`<span class="[^"]*decoration-dotted[^"]*" tabindex="0">${image}<span class="sr-only">. With sign-in on, browse an image&#x27;s files from one of its Pods.</span></span>`))
45
+ })
46
+ })
@@ -740,7 +740,7 @@ function ExecutionUnitDetails({ unit, namespace, pullSecrets, compact }: { unit:
740
740
  <div className={clsx(!compact && 'rounded-md bg-theme-elevated/40 px-3 py-2')}>
741
741
  {!compact && <div className="mb-1 flex items-center justify-between gap-3"><span className="truncate text-xs font-medium text-theme-text-primary">{unit.name}</span><span className="text-[10px] uppercase tracking-wide text-theme-text-tertiary">{unit.type}</span></div>}
742
742
  <div className="space-y-1">
743
- {unit.image && <DefinitionFact label="Image" value={unit.image} mono onClick={canBrowseImage ? () => setBrowseImage(true) : undefined} tooltip={canBrowseImage ? 'Browse image filesystem from registry' : undefined} />}
743
+ {unit.image && <DefinitionFact label="Image" value={unit.image} mono onClick={canBrowseImage ? () => setBrowseImage(true) : undefined} tooltip={canBrowseImage ? 'Browse image filesystem from registry' : IMAGE_BROWSE_VIA_POD} hint={!canBrowseImage} />}
744
744
  {unit.command && <DefinitionFact label="Command" value={unit.command} mono />}
745
745
  {!compact && unit.requests && <DefinitionFact label="Requests" value={unit.requests} />}
746
746
  {!compact && unit.limits && <DefinitionFact label="Limits" value={unit.limits} />}
@@ -760,15 +760,17 @@ function ExecutionUnitDetails({ unit, namespace, pullSecrets, compact }: { unit:
760
760
  )
761
761
  }
762
762
 
763
- function DefinitionFact({ label, value, mono = false, onClick, tooltip }: { label: string; value: string; mono?: boolean; onClick?: () => void; tooltip?: string }) {
764
- const valueClassName = clsx('break-words text-theme-text-primary', mono && 'font-mono text-xs', onClick && 'text-accent-text hover:underline')
763
+ const IMAGE_BROWSE_VIA_POD = "With sign-in on, browse an image's files from one of its Pods."
764
+
765
+ function DefinitionFact({ label, value, mono = false, onClick, tooltip, hint = false }: { label: string; value: string; mono?: boolean; onClick?: () => void; tooltip?: string; hint?: boolean }) {
766
+ const valueClassName = clsx('break-words text-theme-text-primary', mono && 'font-mono text-xs', onClick && 'text-accent-text hover:underline', hint && 'cursor-help underline decoration-dotted decoration-theme-text-tertiary underline-offset-2')
765
767
  return (
766
768
  <div className="flex items-start justify-between gap-3 text-sm">
767
769
  <span className="shrink-0 text-theme-text-tertiary">{label}</span>
768
770
  <Tooltip content={tooltip ?? value} delay={300} wrapperClassName="min-w-0 text-right">
769
771
  {onClick
770
772
  ? <button type="button" onClick={onClick} className={clsx(valueClassName, 'text-right')}>{value}</button>
771
- : <span className={valueClassName}>{value}</span>}
773
+ : <span className={valueClassName} tabIndex={hint ? 0 : undefined}>{value}{hint && tooltip && <span className="sr-only">. {tooltip}</span>}</span>}
772
774
  </Tooltip>
773
775
  </div>
774
776
  )
@@ -0,0 +1,113 @@
1
+ import { describe, expect, it, vi } from 'vitest'
2
+ import { renderToString } from 'react-dom/server'
3
+ import { MemoryRouter } from 'react-router-dom'
4
+ import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
5
+
6
+ const destinationRequest = vi.hoisted(() => vi.fn())
7
+ const state = vi.hoisted(() => ({ apiVersion: 'app.k8s.io/v1beta1', loading: false, treeLoading: false, kind: 'Application', error: '', remote: false }))
8
+ vi.mock('../../api/client', async (importOriginal) => {
9
+ const actual = await importOriginal<typeof import('../../api/client')>()
10
+ return {
11
+ ...actual,
12
+ useResource: () => ({ isLoading: state.loading, error: state.error ? new Error(state.error) : null, data: state.loading || state.error ? undefined : {
13
+ apiVersion: state.apiVersion, kind: state.kind, metadata: { name: 'wordpress', namespace: 'shop' },
14
+ spec: { project: 'default', destination: { server: 'https://kubernetes.default.svc' } },
15
+ status: { sync: { status: 'Synced' }, health: { status: 'Healthy' }, conditions: [{ type: 'Ready', status: 'True' }] },
16
+ } }),
17
+ useGitOpsTree: () => ({ isLoading: state.treeLoading, error: null, data: undefined }),
18
+ useGitOpsInsights: () => ({ isLoading: false, error: null, data: state.remote ? { summary: { tool: 'argocd', remoteDestination: true }, issues: [], changes: [], history: [], plan: [], capabilities: {} } : undefined }),
19
+ }
20
+ })
21
+ vi.mock('../ui/Toast', () => ({ useToast: () => ({ showError: vi.fn(), showSuccess: vi.fn(), showToast: vi.fn() }) }))
22
+ vi.mock('../useContextSwitchFlow', () => ({ useContextSwitchFlow: () => ({ confirmDialog: null }) }))
23
+ vi.mock('./useDestinationCluster', () => ({ useDestinationCluster: (...args: unknown[]) => { destinationRequest(...args); return {} } }))
24
+ vi.mock('../../hooks/useKeyboardShortcuts', () => ({ useRegisterShortcut: () => {} }))
25
+ vi.mock('../../hooks/usePreviousIntegrationSettings', () => ({ usePreviousIntegrationSettings: () => ({}), previousSettingsNote: () => undefined }))
26
+
27
+ import { GitOpsView } from './GitOpsView'
28
+
29
+ function render(group = 'argoproj.io', kind = 'applications') {
30
+ const client = new QueryClient({ defaultOptions: { queries: { retry: false } } })
31
+ const html = renderToString(
32
+ <QueryClientProvider client={client}>
33
+ <MemoryRouter initialEntries={[`/gitops/detail/${kind}/shop/wordpress?apiGroup=${group}`]}>
34
+ <GitOpsView namespaces={[]} onOpenResource={() => {}} />
35
+ </MemoryRouter>
36
+ </QueryClientProvider>,
37
+ )
38
+ client.clear()
39
+ return html
40
+ }
41
+
42
+ describe('GitOps detail identity', () => {
43
+ it.each([false, true])('refuses a foreign Application even while tree loading is %s', (treeLoading) => {
44
+ Object.assign(state, { apiVersion: 'app.k8s.io/v1beta1', kind: 'Application', error: '', loading: false, treeLoading })
45
+ const html = render()
46
+ expect(html).toContain('Application.app.k8s.io shop/wordpress is not a supported Argo CD or Flux resource')
47
+ expect(html).not.toContain('ArgoCD')
48
+ expect(html).not.toContain('FluxCD')
49
+ expect(html).not.toContain('Sync…')
50
+ expect(html).not.toContain('Reconcile')
51
+ })
52
+
53
+ it('keeps actions hidden until the resource confirms its group', () => {
54
+ Object.assign(state, { loading: true, treeLoading: true })
55
+ const html = render()
56
+ expect(html).not.toContain('ArgoCD')
57
+ expect(html).not.toContain('Sync…')
58
+ expect(html).not.toContain('is not a supported Argo CD or Flux resource')
59
+ })
60
+
61
+ it('keeps the Argo CD header and actions for a real Application', () => {
62
+ Object.assign(state, { apiVersion: 'argoproj.io/v1alpha1', kind: 'Application', error: '', loading: false, treeLoading: true })
63
+ const html = render()
64
+ expect(html).toContain('ArgoCD')
65
+ expect(html).toContain('Sync…')
66
+ expect(html).toContain('Healthy')
67
+ expect(html).not.toContain('is not a supported Argo CD or Flux resource')
68
+ })
69
+ it('preserves Flux reconcile controls', () => {
70
+ Object.assign(state, { apiVersion: 'kustomize.toolkit.fluxcd.io/v1', kind: 'Kustomization', loading: false, treeLoading: true, error: '', remote: false })
71
+ const html = render('kustomize.toolkit.fluxcd.io', 'kustomizations')
72
+ expect(html).toContain('FluxCD')
73
+ expect(html).toContain('Reconcile')
74
+ expect(html).not.toContain('ArgoCD')
75
+ })
76
+
77
+ it('does not classify Argo Workflows as Argo CD', () => {
78
+ Object.assign(state, { apiVersion: 'argoproj.io/v1alpha1', kind: 'Workflow', loading: false, treeLoading: false, error: '', remote: false })
79
+ const html = render('argoproj.io', 'workflows')
80
+ expect(html).toContain('Workflow.argoproj.io shop/wordpress is not a supported Argo CD or Flux resource')
81
+ expect(html).not.toContain('ArgoCD')
82
+ })
83
+
84
+ it('shows the resource read error without claiming an identity', () => {
85
+ Object.assign(state, { loading: false, error: 'access denied' })
86
+ const html = render()
87
+ expect(html).toContain('access denied')
88
+ expect(html).not.toContain('is not a supported Argo CD or Flux resource')
89
+ expect(html).not.toContain('ArgoCD')
90
+ expect(html).not.toContain('Sync…')
91
+ state.error = ''
92
+ })
93
+
94
+ it.each([
95
+ ['applications', 'Application', 'source.toolkit.fluxcd.io'],
96
+ ['kustomizations', 'Kustomization', 'source.toolkit.fluxcd.io'],
97
+ ])('rejects %s in the wrong Flux group', (plural, kind, group) => {
98
+ Object.assign(state, { apiVersion: `${group}/v1`, kind, loading: false, treeLoading: false, error: '', remote: false })
99
+ const html = render(group, plural)
100
+ expect(html).toContain('is not a supported Argo CD or Flux resource')
101
+ expect(html).not.toContain('FluxCD')
102
+ expect(html).not.toContain('Reconcile')
103
+ expect(html).not.toContain('ArgoCD')
104
+ })
105
+
106
+ it('ignores a misleading remote destination from an older backend', () => {
107
+ Object.assign(state, { apiVersion: 'app.k8s.io/v1beta1', kind: 'Application', loading: false, error: '', remote: true })
108
+ render('app.k8s.io')
109
+ expect(destinationRequest).toHaveBeenLastCalledWith(false, 'applications', 'shop', 'wordpress', 'app.k8s.io')
110
+ state.remote = false
111
+ })
112
+
113
+ })
@@ -1,3 +1,4 @@
1
+ import type { ResourceCoverage } from '@skyhook-io/k8s-ui'
1
2
  import { useEffect, useMemo, useRef, useState } from 'react'
2
3
  import { useLocation, useNavigate } from 'react-router-dom'
3
4
  import { useQuery } from '@tanstack/react-query'
@@ -21,6 +22,7 @@ import {
21
22
  formatGitOpsSourceUrl,
22
23
  getGitOpsResourceStatus,
23
24
  getGitOpsTool,
25
+ gitOpsDetailGroup,
24
26
  isDestinationRef,
25
27
  isArgoOperationInProgress,
26
28
  isArgoSuspendedByRadar,
@@ -53,7 +55,9 @@ import { useDestinationCluster } from './useDestinationCluster'
53
55
  import { destinationToast } from './destination-toast'
54
56
 
55
57
  import {
58
+ ApiError,
56
59
  fetchJSON,
60
+ fetchResourceList as fetchCoveredResourceList,
57
61
  buildArgoResourceSyncVars,
58
62
  useApplyResource,
59
63
  useArgoRefresh,
@@ -72,8 +76,8 @@ import {
72
76
  useResource,
73
77
  } from '../../api/client'
74
78
  import { useAPIResources, GITOPS_KINDS } from '../../api/apiResources'
79
+ import { combinedListStatus, lowerBound } from '../../api/resourceLists'
75
80
  import { useConnection } from '../../context/ConnectionContext'
76
- import { apiUrl, getAuthHeaders, getCredentialsMode } from '../../api/config'
77
81
  import { useRegisterShortcut } from '../../hooks/useKeyboardShortcuts'
78
82
  import { CodeViewer } from '../ui/CodeViewer'
79
83
  import { ArgoResourceDiffLoader } from './ArgoResourceDiffLoader'
@@ -97,6 +101,7 @@ const GITOPS_ROWS_REFRESH_INTERVAL_MS = 120_000
97
101
 
98
102
  interface ResourceCountsResponse {
99
103
  counts: Record<string, number>
104
+ coverage?: Record<string, ResourceCoverage>
100
105
  forbidden?: string[]
101
106
  unavailable?: string[]
102
107
  }
@@ -182,6 +187,19 @@ function GitOpsTableView({ namespaces, onClearNamespaces }: { namespaces: string
182
187
  const rowsQuery = useQuery({
183
188
  queryKey: ['gitops-rows-main', namespaces, apiResources?.length ?? 0],
184
189
  queryFn: async () => {
190
+ const coverage: ResourceCoverage[] = []
191
+ const failures: unknown[] = []
192
+ const fetchResourceList = async (kind: string, group: string, namespacesParam: string): Promise<any[]> => {
193
+ try {
194
+ const result = await fetchCoveredResourceList<any>(kind, { group, namespaces: namespacesParam ? namespacesParam.split(',') : [] })
195
+ coverage.push(result.coverage)
196
+ return result.items
197
+ } catch (error) {
198
+ if (error instanceof ApiError && error.status === 401) throw error
199
+ failures.push(error)
200
+ return []
201
+ }
202
+ }
185
203
  const hasApplications = hasAPIResource(apiResources, 'applications', 'argoproj.io')
186
204
  const hasApplicationSets = hasAPIResource(apiResources, 'applicationsets', 'argoproj.io')
187
205
  const hasKustomizations = hasAPIResource(apiResources, 'kustomizations', 'kustomize.toolkit.fluxcd.io')
@@ -201,13 +219,17 @@ function GitOpsTableView({ namespaces, onClearNamespaces }: { namespaces: string
201
219
  hasOCIRepos ? fetchResourceList('ocirepositories', 'source.toolkit.fluxcd.io', '') : Promise.resolve([]),
202
220
  hasBuckets ? fetchResourceList('buckets', 'source.toolkit.fluxcd.io', '') : Promise.resolve([]),
203
221
  ])
222
+ if (coverage.length === 0 && failures.length > 0) throw failures[0]
204
223
  const fluxSourceUrls = buildFluxSourceUrlMap([...gitRepos, ...helmRepos, ...ociRepos, ...buckets])
205
- return [
224
+ // Discovery that finds no row kind is itself a complete answer: nothing
225
+ // was fetched because there is nothing to fetch.
226
+ const rowKindsDiscovered = hasApplications || hasApplicationSets || hasKustomizations || hasHelmReleases
227
+ return { coverageStatus: combinedListStatus(coverage, failures.length > 0, apiResources != null && !rowKindsDiscovered), rows: [
206
228
  ...applications.map((r) => normalizeArgoApplication(r)),
207
229
  ...applicationSets.map((r) => normalizeArgoApplicationSet(r)),
208
230
  ...kustomizations.map((r) => normalizeFluxKustomization(r, fluxSourceUrls)),
209
231
  ...helmReleases.map((r) => normalizeFluxHelmRelease(r, fluxSourceUrls)),
210
- ]
232
+ ] }
211
233
  },
212
234
  enabled: !apiResourcesLoading,
213
235
  staleTime: 30_000,
@@ -246,7 +268,7 @@ function GitOpsTableView({ namespaces, onClearNamespaces }: { namespaces: string
246
268
  useEffect(() => {
247
269
  if (!hasGitOpsRowResource || rowsQuery.error) { setColdRetrying(false); return }
248
270
  if (apiResourcesLoading || rowsQuery.isFetching) return
249
- if ((rowsQuery.data?.length ?? 0) > 0) { setColdRetrying(false); return }
271
+ if ((rowsQuery.data?.rows.length ?? 0) > 0) { setColdRetrying(false); return }
250
272
  if (coldRetriesRef.current >= 4) { setColdRetrying(false); return }
251
273
  setColdRetrying(true)
252
274
  const t = window.setTimeout(() => { coldRetriesRef.current += 1; refetchTable() }, 2000)
@@ -295,11 +317,13 @@ function GitOpsTableView({ namespaces, onClearNamespaces }: { namespaces: string
295
317
  return (
296
318
  <>
297
319
  <SharedGitOpsTableView
298
- rows={rowsQuery.data ?? []}
320
+ rows={rowsQuery.data?.rows ?? []}
321
+ coverageStatus={rowsQuery.data?.coverageStatus ?? 'unknown'}
299
322
  loading={apiResourcesLoading || countsQuery.isLoading || rowsQuery.isLoading || coldRetrying}
300
- error={(rowsQuery.error as Error | null) ?? null}
323
+ error={rowsQuery.error}
301
324
  counts={countsQuery.data?.counts ?? {}}
302
325
  countsUnavailable={countsQuery.data?.unavailable}
326
+ countsPartial={Object.entries(countsQuery.data?.coverage ?? {}).filter(([, c]) => lowerBound(c)).map(([key]) => key)}
303
327
  freshnessSlot={
304
328
  <FreshnessControl
305
329
  mode="auto"
@@ -373,20 +397,22 @@ function GitOpsDetailView({ namespaces, onOpenResource, onOpenSettings }: GitOps
373
397
  const treeQ = useGitOpsTree(kind, namespace, name, group, namespaces)
374
398
  const insightsQ = useGitOpsInsights(kind, namespace, name, group, namespaces)
375
399
  const switchFlow = useContextSwitchFlow()
376
- const status = resourceQ.data ? getGitOpsResourceStatus(kind, resourceQ.data) : null
377
- const tool = getGitOpsTool(kind, group)
400
+ const effectiveGroup = gitOpsDetailGroup(group, resourceQ.data)
401
+ const tool = resourceQ.data ? getGitOpsTool(kind, effectiveGroup) : null
402
+ const isArgoApp = tool === 'argo' && kind === 'applications'
403
+ const status = tool && resourceQ.data ? getGitOpsResourceStatus(kind, resourceQ.data) : null
378
404
  // Argo "auto-sync ON" is determined by spec.syncPolicy.automated being set,
379
405
  // not by health.status === Suspended (which is Argo's CronJob-style suspend).
380
406
  // The toggle button reads from this so the label flips correctly when an
381
407
  // app is in Manual mode or suspended via Radar's annotations.
382
- const argoAutoSyncEnabled = kind === 'applications' && Boolean(resourceQ.data?.spec?.syncPolicy?.automated)
408
+ const argoAutoSyncEnabled = isArgoApp && Boolean(resourceQ.data?.spec?.syncPolicy?.automated)
383
409
  // Radar-driven Argo suspension is signaled by annotations that record the
384
410
  // pre-suspend prune/selfHeal state for restoration on resume. When present,
385
411
  // the app is in a deliberately-paused state (vs. Manual mode, which is a
386
412
  // normal operational choice) and should surface a Suspended chip alongside
387
413
  // the other status indicators. Shared with the fleet table's row normalizer
388
414
  // (isArgoSuspendedByRadar) so both surfaces agree on what "suspended" means.
389
- const argoSuspendedByRadar = kind === 'applications' && isArgoSuspendedByRadar(resourceQ.data)
415
+ const argoSuspendedByRadar = isArgoApp && isArgoSuspendedByRadar(resourceQ.data)
390
416
  const effectiveSuspended = (status?.suspended ?? false) || argoSuspendedByRadar
391
417
  // Lifecycle gate: when the resource is pending deletion, mutating
392
418
  // actions are futile (the controller is processing finalizers and
@@ -453,9 +479,9 @@ function GitOpsDetailView({ namespaces, onOpenResource, onOpenSettings }: GitOps
453
479
  setSyncDialogTarget(null)
454
480
  }
455
481
 
456
- const detailRow = resourceQ.data ? normalizeDetailResource(kind, group, resourceQ.data) : null
482
+ const detailRow = tool && resourceQ.data ? normalizeDetailResource(kind, effectiveGroup, tool, resourceQ.data) : null
457
483
  const tree = treeQ.data ?? null
458
- const helmValues = useMemo(() => extractHelmValues(kind, resourceQ.data), [kind, resourceQ.data])
484
+ const helmValues = useMemo(() => (tool ? extractHelmValues(kind, resourceQ.data) : null), [tool, kind, resourceQ.data])
459
485
  const graphFilters = useMemo<GitOpsTreeFilters>(() => ({
460
486
  kinds: graphKinds,
461
487
  sync: graphSync,
@@ -466,8 +492,8 @@ function GitOpsDetailView({ namespaces, onOpenResource, onOpenSettings }: GitOps
466
492
  const graphFacets = useMemo(() => buildTreeFacets(tree), [tree])
467
493
  // The tree and insights load separately; either one seeing a remote
468
494
  // destination is enough to keep its resources from opening here.
469
- const remoteDestination = !!(tree?.remoteDestination || insightsQ.data?.summary?.remoteDestination)
470
- const destination = useDestinationCluster(remoteDestination, kind, namespace, name)
495
+ const remoteDestination = tool !== null && !!(tree?.remoteDestination || insightsQ.data?.summary?.remoteDestination)
496
+ const destination = useDestinationCluster(remoteDestination, kind, namespace, name, effectiveGroup)
471
497
 
472
498
  function openResourceFromTree(ref: GitOpsTreeRef | GitOpsInsightRef, node?: GitOpsTreeNode) {
473
499
  // Locality comes from the node, not the name: a remote app can deploy a
@@ -542,9 +568,11 @@ function GitOpsDetailView({ namespaces, onOpenResource, onOpenSettings }: GitOps
542
568
 
543
569
  const isRunning = resourceQ.data?.status?.operationState?.phase === 'Running'
544
570
  const operationInProgress = isArgoOperationInProgress(resourceQ.data)
545
- const isFluxWorkload = kind === 'kustomizations' || kind === 'helmreleases'
571
+ const isFluxWorkload = tool === 'flux' && (kind === 'kustomizations' || kind === 'helmreleases')
546
572
  const isFlux = tool === 'flux'
547
- const isArgoApp = kind === 'applications'
573
+ const notGitOpsError = resourceQ.data && tool === null
574
+ ? new Error(notGitOpsMessage(resourceQ.data.kind ?? apiKind?.kind ?? kind, effectiveGroup, namespace, name))
575
+ : null
548
576
 
549
577
  // Detail-page shortcuts. Skip when a modal is already open so a stray "s"
550
578
  // in an input field doesn't pop another sync dialog.
@@ -658,7 +686,7 @@ function GitOpsDetailView({ namespaces, onOpenResource, onOpenSettings }: GitOps
658
686
  group,
659
687
  namespace,
660
688
  name,
661
- toolLabel: tool === 'argo' ? 'ArgoCD' : 'FluxCD',
689
+ toolLabel: tool === 'argo' ? 'ArgoCD' : tool === 'flux' ? 'FluxCD' : undefined,
662
690
  kindLabel: apiKind?.kind ?? kind,
663
691
  }}
664
692
  parent={parent}
@@ -666,8 +694,8 @@ function GitOpsDetailView({ namespaces, onOpenResource, onOpenSettings }: GitOps
666
694
  terminating={terminating}
667
695
  terminatingChipTooltip={terminatingChipTooltip}
668
696
  terminatingActionTooltip={terminatingActionTooltip}
669
- detail={detail}
670
- insight={insightsQ.data ?? null}
697
+ detail={tool ? detail : undefined}
698
+ insight={tool ? insightsQ.data ?? null : null}
671
699
  insightLoading={insightsQ.isLoading}
672
700
  healthDocsUrl={GITOPS_HEALTH_DOCS_URL}
673
701
  remoteDestinationHint={<RemoteDestinationCloudHint />}
@@ -702,7 +730,7 @@ function GitOpsDetailView({ namespaces, onOpenResource, onOpenSettings }: GitOps
702
730
  // Defer the success toast until we know whether the follow-on
703
731
  // sync was triggered, so a successful create-namespace + sync
704
732
  // failure doesn't yield a misleading "sync triggered" toast.
705
- if (kind === 'applications') {
733
+ if (isArgoApp) {
706
734
  argoSync.mutate(
707
735
  { namespace, name },
708
736
  {
@@ -745,7 +773,7 @@ function GitOpsDetailView({ namespaces, onOpenResource, onOpenSettings }: GitOps
745
773
  fullscreen={graphFullscreen}
746
774
  onToggleFullscreen={() => setGraphFullscreen(!graphFullscreen)}
747
775
  resourceLoading={resourceQ.isLoading}
748
- resourceError={(resourceQ.error as Error | null) ?? null}
776
+ resourceError={(resourceQ.error as Error | null) ?? notGitOpsError}
749
777
  onNavigateRoot={() => navigate('/gitops')}
750
778
  onNavigateParent={parent ? () => {
751
779
  const params = new URLSearchParams()
@@ -981,16 +1009,23 @@ function tryParseYaml(value: string): unknown {
981
1009
 
982
1010
 
983
1011
 
984
- function normalizeDetailResource(kind: string, group: string, resource: any): GitOpsRow | null {
985
- if (kind === 'applications') return normalizeArgoApplication(resource)
986
- if (kind === 'applicationsets') return normalizeArgoApplicationSet(resource)
987
- if (kind === 'kustomizations') return normalizeFluxKustomization(resource)
988
- if (kind === 'helmreleases') return normalizeFluxHelmRelease(resource)
1012
+ // notGitOpsMessage matches the tree/insights endpoints' refusal text.
1013
+ function notGitOpsMessage(kind: string, group: string, namespace: string, name: string): string {
1014
+ const kindGroup = group ? `${kind}.${group}` : kind
1015
+ const ref = namespace ? `${namespace}/${name}` : name
1016
+ return `${kindGroup} ${ref} is not a supported Argo CD or Flux resource, so it has no GitOps view`
1017
+ }
1018
+
1019
+ function normalizeDetailResource(kind: string, group: string, tool: 'argo' | 'flux', resource: any): GitOpsRow | null {
1020
+ if (tool === 'argo' && kind === 'applications') return normalizeArgoApplication(resource)
1021
+ if (tool === 'argo' && kind === 'applicationsets') return normalizeArgoApplicationSet(resource)
1022
+ if (tool === 'flux' && kind === 'kustomizations') return normalizeFluxKustomization(resource)
1023
+ if (tool === 'flux' && kind === 'helmreleases') return normalizeFluxHelmRelease(resource)
989
1024
  const status = getGitOpsResourceStatus(kind, resource)
990
1025
  return {
991
1026
  id: `${group}/${kind}/${resource.metadata?.namespace ?? ''}/${resource.metadata?.name ?? ''}`,
992
1027
  mode: 'applications',
993
- tool: getGitOpsTool(kind, group),
1028
+ tool,
994
1029
  kindName: kind,
995
1030
  kind: resource.kind ?? kind,
996
1031
  group,
@@ -1051,19 +1086,6 @@ function hasAPIResource(resources: APIResource[] | undefined, name: string, grou
1051
1086
  return (resources ?? []).some((resource) => resource.name === name && resource.group === group)
1052
1087
  }
1053
1088
 
1054
- async function fetchResourceList(kind: string, group: string, namespacesParam: string): Promise<any[]> {
1055
- const params = new URLSearchParams()
1056
- if (namespacesParam) params.set('namespaces', namespacesParam)
1057
- if (group) params.set('group', group)
1058
- const res = await fetch(apiUrl(`/resources/${kind}?${params}`), {
1059
- credentials: getCredentialsMode(),
1060
- headers: getAuthHeaders(),
1061
- })
1062
- if (res.status === 400 || res.status === 403 || res.status === 404) return []
1063
- if (!res.ok) throw new Error(`Failed to fetch ${kind}: HTTP ${res.status}`)
1064
- return res.json()
1065
- }
1066
-
1067
1089
  function isTerminating(resource: any): boolean {
1068
1090
  return Boolean(resource?.metadata?.deletionTimestamp)
1069
1091
  }
@@ -17,8 +17,9 @@ export function useDestinationCluster(
17
17
  kind: string,
18
18
  namespace: string,
19
19
  name: string,
20
+ group: string,
20
21
  ): DestinationCluster {
21
- const destination = useGitOpsDestination(kind, namespace, name, !!remote)
22
+ const destination = useGitOpsDestination(kind, namespace, name, !!remote, group)
22
23
  const contexts = useContexts()
23
24
  const capabilities = useCapabilities()
24
25
  const contextName = destination.data?.contexts[0]
@@ -0,0 +1,124 @@
1
+ // @vitest-environment jsdom
2
+ import { act } from 'react'
3
+ import { createRoot, type Root } from 'react-dom/client'
4
+ import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
5
+ import { afterEach, beforeEach, expect, it, vi } from 'vitest'
6
+ import type { ArtifactHubChart } from '../../types'
7
+ import { ArtifactHubSourceSearch, artifactHubChartSource } from './ArtifactHubSourceSearch'
8
+
9
+ Object.assign(globalThis, { IS_REACT_ACT_ENVIRONMENT: true })
10
+
11
+ const chart: ArtifactHubChart = { packageId: 'chart', name: 'podinfo', version: '6.15.0', stars: 0, repository: { name: 'podinfo', url: 'https://charts.example.test' } }
12
+ const fetchMock = vi.fn<typeof fetch>()
13
+ const add = vi.fn()
14
+ const configured = vi.fn()
15
+ let root: Root
16
+ let queries: QueryClient
17
+
18
+ beforeEach(() => {
19
+ fetchMock.mockReset()
20
+ add.mockReset()
21
+ configured.mockReset()
22
+ vi.stubGlobal('fetch', fetchMock)
23
+ queries = new QueryClient({ defaultOptions: { queries: { retry: false } } })
24
+ const container = document.createElement('div')
25
+ document.body.appendChild(container)
26
+ root = createRoot(container)
27
+ })
28
+
29
+ afterEach(async () => {
30
+ await act(async () => root.unmount())
31
+ queries.clear()
32
+ document.body.replaceChildren()
33
+ vi.unstubAllGlobals()
34
+ })
35
+
36
+ async function render() {
37
+ await act(async () => root.render(<QueryClientProvider client={queries}><ArtifactHubSourceSearch chartName="podinfo" disabled={false} isConfigured={() => false} onAdd={add} onConfigured={configured} manualAction={<button>Add manually</button>} /></QueryClientProvider>))
38
+ }
39
+
40
+ async function click(text: string) {
41
+ const button = Array.from(document.querySelectorAll('button')).find(button => button.textContent === text)
42
+ expect(button).toBeDefined()
43
+ await act(async () => button?.click())
44
+ await act(async () => { await new Promise(resolve => setTimeout(resolve, 20)) })
45
+ }
46
+
47
+ it('sends only the chart name after a click and never downloads or selects a result automatically', async () => {
48
+ fetchMock.mockResolvedValue(new Response(JSON.stringify({ charts: [chart, { ...chart, name: 'another-chart' }], total: 2 })))
49
+ await render()
50
+ expect(fetchMock).not.toHaveBeenCalled()
51
+ expect(document.body.textContent).not.toContain('Add repository')
52
+ await click('Search ArtifactHub')
53
+ expect(fetchMock).toHaveBeenCalledTimes(1)
54
+ const url = new URL(String(fetchMock.mock.calls[0][0]), 'http://localhost')
55
+ expect(url.pathname).toBe('/api/helm/artifacthub/search')
56
+ expect(Object.fromEntries(url.searchParams)).toEqual({ query: 'podinfo', limit: '60' })
57
+ expect(document.querySelectorAll('button[aria-label^="Choose source:"]')).toHaveLength(1)
58
+ expect(add).not.toHaveBeenCalled()
59
+ await click('podinfohttps://charts.example.test')
60
+ await click('Add repository')
61
+ expect(add).toHaveBeenCalledWith(chart, { type: 'repository', url: 'https://charts.example.test' })
62
+ expect(fetchMock).toHaveBeenCalledTimes(1)
63
+ })
64
+
65
+ it('shows failures and allows retry while preserving manual-source guidance', async () => {
66
+ fetchMock.mockRejectedValueOnce(new Error('offline')).mockResolvedValueOnce(new Response(JSON.stringify({ charts: [], total: 0 })))
67
+ await render()
68
+ await click('Search ArtifactHub')
69
+ expect(document.body.textContent).toContain('You can still add a source manually.')
70
+ await click('Retry search')
71
+ expect(document.body.textContent).toContain('No exact chart-name matches on this page.')
72
+ })
73
+
74
+ it('paginates unfiltered search results even when a page has no exact matches', async () => {
75
+ fetchMock.mockResolvedValueOnce(new Response(JSON.stringify({ charts: Array.from({ length: 60 }, () => ({ ...chart, name: 'different' })), total: 60 })))
76
+ .mockResolvedValueOnce(new Response(JSON.stringify({ charts: [chart], total: 1 })))
77
+ await render()
78
+ await click('Search ArtifactHub')
79
+ expect(document.body.textContent).toContain('No exact chart-name matches on this page.')
80
+ await click('Next results')
81
+ expect(String(fetchMock.mock.calls[1][0])).toContain('offset=60')
82
+ expect(document.body.textContent).toContain('Search page 2')
83
+ expect(document.querySelectorAll('button[aria-label^="Choose source:"]')).toHaveLength(1)
84
+ await click('Previous results')
85
+ expect(document.body.textContent).toContain('Search page 1')
86
+ })
87
+
88
+ it('filters unsafe addresses and maps OCI chart references to their parent prefix', () => {
89
+ const source = (url: string) => artifactHubChartSource({ ...chart, repository: { name: 'example', url } }, 'podinfo')
90
+ expect(source('oci://registry.example.test/team/podinfo/')).toEqual({ type: 'oci', url: 'oci://registry.example.test/team/podinfo', prefix: 'oci://registry.example.test/team' })
91
+ expect(source('oci://REGISTRY.example.test/Team/podinfo')).toEqual({ type: 'oci', url: 'oci://registry.example.test/Team/podinfo', prefix: 'oci://registry.example.test/Team' })
92
+ expect(source('https://CHARTS.example.test/Team/')).toEqual({ type: 'repository', url: 'https://charts.example.test/Team' })
93
+ expect(source('https://charts.example.test/team')).toEqual({ type: 'repository', url: 'https://charts.example.test/team' })
94
+ for (const url of ['file:///tmp/chart', 'javascript:alert(1)', 'https://user:password@example.test/charts', 'https://example.test/charts?token=secret', 'https://example.test/#secret', 'oci://registry.example.test/team/other']) {
95
+ expect(source(url)).toBeUndefined()
96
+ }
97
+ })
98
+
99
+ it.each([false, true])('keeps one representative publisher, badge and repository name together regardless of response order (%s)', async reverse => {
100
+ const ordinary = { ...chart, packageId: 'ordinary', repository: { ...chart.repository, name: 'ordinary', organizationDisplayName: 'Other Publisher' } }
101
+ const official = { ...chart, packageId: 'official', official: true, repository: { ...chart.repository, name: 'official-charts', displayName: 'Official Charts', organizationDisplayName: 'Publisher Team' } }
102
+ fetchMock.mockResolvedValue(new Response(JSON.stringify({ charts: reverse ? [official, ordinary] : [ordinary, official] })))
103
+ await render()
104
+ await click('Search ArtifactHub')
105
+ expect(document.querySelectorAll('button[aria-label^="Choose source:"]')).toHaveLength(1)
106
+ expect(document.body.textContent).toContain('Publisher Team')
107
+ expect(document.body.textContent).not.toContain('Other Publisher')
108
+ expect(document.body.textContent).toContain('ArtifactHub official package')
109
+ expect(document.body.textContent).not.toContain('ArtifactHub official repository')
110
+ expect(add).not.toHaveBeenCalled()
111
+ await act(async () => document.querySelector<HTMLButtonElement>('button[aria-label^="Choose source:"]')?.click())
112
+ await click('Add repository')
113
+ expect(add).toHaveBeenCalledWith(official, { type: 'repository', url: chart.repository.url })
114
+ })
115
+
116
+ it.each([false, true])('uses a stable listing identity when duplicate badges tie (%s)', async reverse => {
117
+ const first = { ...chart, packageId: 'a', repository: { ...chart.repository, name: 'first', userAlias: 'first-account', verifiedPublisher: true } }
118
+ const second = { ...chart, packageId: 'b', repository: { ...chart.repository, name: 'second', userAlias: 'second-account', verifiedPublisher: true } }
119
+ fetchMock.mockResolvedValue(new Response(JSON.stringify({ charts: reverse ? [second, first] : [first, second] })))
120
+ await render()
121
+ await click('Search ArtifactHub')
122
+ expect(document.body.textContent).toContain('first-account')
123
+ expect(document.body.textContent).not.toContain('second-account')
124
+ })