feat(caching): frontend response cache (TanStack Query) + full hook migration#676
feat(caching): frontend response cache (TanStack Query) + full hook migration#676kaviththiranga wants to merge 23 commits into
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThis PR adds a shared TanStack Query seam, migrates portal data fetching, polling, pagination, and mutations to it, and propagates background refresh state into UI overlays. It also adds test wrappers, hook coverage, platform widget migrations, and release metadata. ChangesResponse-cache foundation
Plugin migrations
Background refresh UI
Release metadata and validation
Estimated code review effort: 5 (Critical) | ~150 minutes Possibly related issues
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 14
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
plugins/openchoreo-observability/src/hooks/useFinOpsReports.ts (1)
18-45: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winCustom time range is silently ignored in
useFinOpsReports.The query key omits
filters.customStartTime/filters.customEndTime, so changing custom dates won't trigger a refetch. Additionally,calculateTimeRangeis called without the custom times, so even a manual refresh would use wrong bounds. Compare withuseRCAReportswhich correctly passes both the key fields and the{ startTime, endTime }argument.🐛 Proposed fix to include custom time range in query key and calculateTimeRange
const { data, loading, error, refetch } = useOpenChoreoQuery( [ 'finops-reports', namespace, projectName, filters.environment?.name, filters.timeRange, + filters.customStartTime, + filters.customEndTime, filters.rcaStatus, ], () => { - const { startTime, endTime } = calculateTimeRange(filters.timeRange); + const { startTime, endTime } = calculateTimeRange(filters.timeRange, { + startTime: filters.customStartTime, + endTime: filters.customEndTime, + }); return observabilityApi.getFinOpsReports(🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@plugins/openchoreo-observability/src/hooks/useFinOpsReports.ts` around lines 18 - 45, `useFinOpsReports` is not handling custom time range updates correctly because the `useOpenChoreoQuery` key and `calculateTimeRange` call both ignore `filters.customStartTime` and `filters.customEndTime`. Update the query key in `useFinOpsReports` to include the custom time fields, and pass those same values into `calculateTimeRange` so refetches and manual loads use the correct bounds. Use `useRCAReports` as the reference for matching the key composition and time-range argument shape.
🧹 Nitpick comments (5)
plugins/openchoreo-workflows/src/hooks/useWorkflowRuns.ts (1)
16-22: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winExtract shared active-status helper to eliminate duplication.
hasActiveRunsduplicates the status-check logic fromisActiveinuseWorkflowRunDetails.ts(lines 27–30) — both check(run.phase || run.status)?.toLowerCase()for'pending'or'running'. Extract a sharedisRunStatusActive(run)helper and reuse it in both hooks to prevent divergence.♻️ Suggested shared helper
Create a shared utility (e.g., in a
utils/activeStatus.tsfile):import { WorkflowRun } from '../types'; /** True while a run is still active (Pending or Running). */ export function isRunStatusActive(run?: WorkflowRun | null): boolean { const status = (run?.phase || run?.status)?.toLowerCase(); return status === 'pending' || status === 'running'; }Then update
useWorkflowRuns.ts:+import { isRunStatusActive } from '../utils/activeStatus'; + -// Check if there are any active runs (Pending or Running) -function hasActiveRuns(runs?: WorkflowRun[]): boolean { - return !!runs?.some(run => { - const status = (run.phase || run.status)?.toLowerCase(); - return status === 'pending' || status === 'running'; - }); -} +function hasActiveRuns(runs?: WorkflowRun[]): boolean { + return !!runs?.some(isRunStatusActive); +}And update
useWorkflowRunDetails.ts:+import { isRunStatusActive } from '../utils/activeStatus'; - -/** True while the run is still active (Pending or Running) — drives the poll. */ -function isActive(run?: WorkflowRun | null): boolean { - const status = (run?.phase || run?.status)?.toLowerCase(); - return status === 'pending' || status === 'running'; -}🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@plugins/openchoreo-workflows/src/hooks/useWorkflowRuns.ts` around lines 16 - 22, The active-run status check is duplicated between hasActiveRuns in useWorkflowRuns and isActive in useWorkflowRunDetails. Extract a shared helper like isRunStatusActive(run) in a common utility and have both hooks call it so the phase/status normalization and pending/running check live in one place. Update the two hook functions to delegate to the shared helper and keep their existing behavior unchanged.plugins/openchoreo-react/src/hooks/useOpenChoreoCache.ts (1)
39-55: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick winMemoize the returned cache object to prevent downstream re-renders.
The hook returns a fresh object literal on every render. Downstream consumers (e.g.,
useTraceSpans.ts) placecacheinuseCallbackdependency arrays, so the callback (and any effects depending on it) re-create every render. SinceuseQueryClient()returns a stable reference, wrapping the return inuseMemowith[queryClient]makes the object referentially stable.♻️ Proposed refactor
+import { useMemo } from 'react'; import { useQueryClient, type QueryKey } from '`@tanstack/react-query`';export function useOpenChoreoCache(): OpenChoreoCache { const queryClient = useQueryClient(); - return { - setData: (queryKey, updater) => - queryClient.setQueryData(queryKey, updater), - invalidate: queryKey => { - void queryClient.invalidateQueries({ queryKey }); - }, - fetchQuery: (queryKey, fetcher, options) => - queryClient.fetchQuery({ - queryKey, - queryFn: fetcher, - staleTime: options?.staleTime, - }), - getData: queryKey => queryClient.getQueryData(queryKey), - }; + return useMemo<OpenChoreoCache>( + () => ({ + setData: (queryKey, updater) => + queryClient.setQueryData(queryKey, updater), + invalidate: queryKey => { + void queryClient.invalidateQueries({ queryKey }); + }, + fetchQuery: (queryKey, fetcher, options) => + queryClient.fetchQuery({ + queryKey, + queryFn: fetcher, + staleTime: options?.staleTime, + }), + getData: queryKey => queryClient.getQueryData(queryKey), + }), + [queryClient], + ); }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@plugins/openchoreo-react/src/hooks/useOpenChoreoCache.ts` around lines 39 - 55, The useOpenChoreoCache hook returns a new cache object on every render, which breaks referential stability for consumers like useTraceSpans that depend on cache in useCallback/useEffect arrays. Wrap the returned object in useMemo inside useOpenChoreoCache, with queryClient as the dependency, and keep the setData, invalidate, fetchQuery, and getData methods unchanged so the cache object stays stable across renders.plugins/openchoreo/src/components/Environments/hooks/useReleases.ts (1)
25-41: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low valueAlign
useReleases.refetchwith the actual query contract (plugins/openchoreo/src/components/Environments/hooks/useReleases.ts)useOpenChoreoQueryexposes a fire-and-forgetrefetch, and current callers just invokerefetchReleases()without awaiting it. ThePromise<void>return type here suggests sequencing that the implementation doesn’t provide, so make it() => voidor return the underlyingrefetchdirectly.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@plugins/openchoreo/src/components/Environments/hooks/useReleases.ts` around lines 25 - 41, `useReleases` is wrapping `useOpenChoreoQuery` refetch with an async signature that implies awaiting/ordering it does not provide. Update the `refetch` field in the returned object to match the actual fire-and-forget contract used by `useOpenChoreoQuery` and current callers of `refetchReleases`, either by making it a void-returning callback or by returning the underlying `refetch` directly from the hook.plugins/openchoreo-react/src/hooks/useAllEntitiesOfKinds.ts (1)
11-12: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick winAvoid manual
.join(',')in query keys — pass arrays directly.TanStack Query deep-serializes array elements in query keys via
hashKey, so['all-entities-of-kinds', kinds, namespaces ?? []]produces distinct cache entries for distinct array contents. The current.join(',')approach creates collision risk:useAllEntitiesOfKinds(['a,b'])anduseAllEntitiesOfKinds(['a', 'b'])both produce the key segment'a,b', so the second call could receive stale cached data from the first without refetching.♻️ Proposed fix
- ['all-entities-of-kinds', kinds.join(','), (namespaces ?? []).join(',')], + ['all-entities-of-kinds', kinds, namespaces ?? []],🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@plugins/openchoreo-react/src/hooks/useAllEntitiesOfKinds.ts` around lines 11 - 12, The query key in useAllEntitiesOfKinds is collapsing distinct inputs by using kinds.join(',') and (namespaces ?? []).join(','), which can cause cache collisions. Update useOpenChoreoQuery to pass the kinds and namespaces arrays directly in the key so TanStack Query can hash them by contents, and keep the existing hook logic otherwise unchanged.plugins/openchoreo-react/src/hooks/useCreateComponentPath.ts (1)
32-64: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winConsider extracting shared cluster-template detection logic.
useCreateComponentPathanduseCreateResourcePathshare identical structure: the samegetEntityFacetsquery pattern, the samehasClusterTemplates === truegating, the samestaleTime: 5 * 60_000, and the same namespace-fallbackuseMemo. They differ only in the query key,spec.typefilter value, and path builder function. A shareduseHasClusterTemplates(templateType: string)hook would eliminate this duplication and keep the two paths in sync if the facet query contract changes.♻️ Suggested shared hook
function useHasClusterTemplates(templateType: string): { hasClusterTemplates: boolean | undefined; loading: boolean } { const catalogApi = useApi(catalogApiRef); return useOpenChoreoQuery( [`cluster-${templateType.toLowerCase()}-templates`], () => catalogApi .getEntityFacets({ filter: { kind: 'Template', 'metadata.namespace': CLUSTER_NAMESPACE, 'spec.type': templateType, }, facets: ['metadata.name'], }) .then(({ facets }) => (facets['metadata.name']?.length ?? 0) > 0), { staleTime: 5 * 60_000 }, ); }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@plugins/openchoreo-react/src/hooks/useCreateComponentPath.ts` around lines 32 - 64, `useCreateComponentPath` duplicates the same cluster-template detection and namespace fallback logic used in `useCreateResourcePath`; extract that shared behavior into a reusable hook such as `useHasClusterTemplates(templateType)` so both paths stay aligned. Move the `useOpenChoreoQuery`/`catalogApi.getEntityFacets` logic, the `hasClusterTemplates === true` check, and the `staleTime: 5 * 60_000` handling into the shared hook, then keep only the path-builder-specific parts in each caller (`buildCreateComponentPath` vs the resource path builder) while preserving the `CLUSTER_NAMESPACE` and namespace fallback behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@plugins/openchoreo-ci/src/hooks/useWorkflowData.ts`:
- Around line 119-133: The async refresh helpers in useWorkflowData are
resolving too early because fetchBuilds and fetchComponentDetails call
refetchBuildsQuery/refetchComponentDetails without returning or awaiting the
promise. Update these methods to return the refetch promise directly (or await
it) so useOpenChoreoMutation in Workflows.tsx can keep refreshOp.isLoading true
until the refetch finishes.
In `@plugins/openchoreo-observability/src/hooks/useTraces.ts`:
- Around line 93-99: The `useTraces` hook currently returns `error.message`
directly, which can become `undefined` for non-Error rejections and break the
expected string-or-null shape. Update the error mapping in `useTraces` to follow
the same fallback pattern used in `useRuntimeEvents` and `useRuntimeLogs`, using
the `error` value’s message when available and a safe fallback string otherwise
so the returned `error` is always a string or null.
In `@plugins/openchoreo-observability/src/hooks/useWirelogsEnvironments.ts`:
- Around line 101-105: The `useWirelogsEnvironments` hook’s `enrichError` branch
can return `undefined` for non-Error rejections because it reads `.message`
directly. Update the `error` field assembly in `useWirelogsEnvironments` to
mirror the fallback behavior used in `useRuntimeEvents` and `useRuntimeLogs`, so
`enrichError` always produces a string by using its message when present and a
default failure message otherwise; keep the existing `useProjectEnvironments`
`error` value unchanged.
In `@plugins/openchoreo-react/src/hooks/useOpenChoreoMutation.ts`:
- Around line 74-86: The mutation hook callbacks are not awaiting user-provided
handlers, so async onSuccess/onError rejections can escape handling. Update
useOpenChoreoMutation to await the optional onSuccess and onError callbacks
after the existing query invalidation logic, and ensure the options type
signatures for these handlers allow void | Promise<void>. Use the onSuccess and
onError wrappers in useOpenChoreoMutation as the fix point.
In `@plugins/openchoreo-react/src/hooks/useProjects.ts`:
- Around line 18-19: The `useProjects` query key currently collapses `undefined`
and `[]` namespaces into the same cache entry because `namespaces ??
[]).join(',')` yields an empty string for both cases. Update `useProjects` to
disambiguate the key in `useOpenChoreoQuery` so `undefined` (fetch all) and an
empty array (fetch none) produce different cache keys, and keep the `enabled`
behavior aligned with that distinction so `data ?? []` cannot return stale
full-project results for `useProjects([])`.
In `@plugins/openchoreo-workflows/src/hooks/useNamespaces.ts`:
- Around line 18-20: The useNamespaces hook is using a too-generic React Query
key that can collide with other plugins sharing the same app-level QueryClient.
Update the query key in useNamespaces to use a domain-prefixed array consistent
with the other hooks in this PR, and keep the listNamespaces fetcher unchanged
so the cache entry is uniquely scoped to the openchoreo workflows plugin.
In `@plugins/openchoreo-workflows/src/hooks/useWorkflowRunDetails.ts`:
- Around line 56-69: The retry loop in useWorkflowRunDetails is duplicating
TanStack QueryClient’s global retry behavior, which can cause the NotFoundError
backoff to run twice. Update the query configuration for the workflow run fetch
so it disables query-level retries by setting retry to false/0, and keep the
existing getWorkflowRun/NotFoundError wait loop as the only retry path.
In `@plugins/openchoreo-workflows/src/hooks/useWorkflowSchema.ts`:
- Around line 47-49: The refetch wrapper in useWorkflowSchema is returning
before the underlying query refresh finishes, because the async refetch callback
calls refetch() without awaiting it. Update the refetch implementation in
useWorkflowSchema so it properly awaits the existing refetch function and only
resolves after the actual refresh completes, keeping the Promise<void> contract
accurate.
In
`@plugins/openchoreo/src/components/AccessControl/hooks/useClusterRoles.test.tsx`:
- Around line 6-8: The test helper makeRole is returning a shape that does not
match ClusterRole, because it uses rules instead of actions and hides the
mismatch with as any. Update makeRole in useClusterRoles.test.tsx to construct a
proper ClusterRole mock with actions: string[] so the test reflects the real
type and catches regressions when role.actions is used.
In `@plugins/openchoreo/src/components/AccessControl/hooks/useUserTypes.ts`:
- Around line 59-61: `fetchUserTypes` in `useUserTypes` is returning before the
refresh finishes because it calls `refetch()` without awaiting or returning it.
Update the `fetchUserTypes` async function to await the `refetch` call (or
return its promise) so the `Promise<void>` only resolves after the user types
have been reloaded. Keep the fix localized to the `fetchUserTypes` callback and
ensure there is no floating promise.
In
`@plugins/openchoreo/src/components/Environments/OverviewCard/useDeploymentStatus.ts`:
- Around line 44-46: The refresh method in useDeploymentStatus resolves too
early because it wraps refetch() in an async callback without returning or
awaiting the promise. Update the refresh implementation so callers awaiting
refresh() will wait for the refetch result, matching the promise behavior used
by useEnvironmentData, and keep the logic centered on the refresh and refetch
symbols in useDeploymentStatus.
In
`@plugins/openchoreo/src/components/ResourceDefinition/useResourceDefinition.ts`:
- Around line 117-119: The refresh method in useResourceDefinition currently
calls refetch without awaiting it, so callers cannot rely on refresh() finishing
only after data is updated. Update the refresh implementation to return or await
the refetch promise from refetch(), preserving the async contract so any await
refresh() call in useResourceDefinition correctly waits for the latest data.
- Around line 54-59: Guard the API kind mapping in useResourceDefinition so
unsupported kinds do not call mapKindToApiKind(kind) during render. Compute
apiKind only when isSupported is true, or otherwise skip the mapping and let
ResourceDefinitionTab’s fallback path handle unsupported entities. Keep
canOperate and definitionKey based on the safe, conditional apiKind value so
unsupported resources render without throwing.
In
`@plugins/openchoreo/src/components/Workflows/OverviewCard/useWorkflowsSummary.ts`:
- Around line 187-189: The refresh method in useWorkflowsSummary is returning
before the data actually updates because refetch() is not awaited. Update the
refresh function to await refetch so callers of refresh only resolve after the
fetch completes, matching the behavior used in the other hooks and keeping the
async contract consistent.
---
Outside diff comments:
In `@plugins/openchoreo-observability/src/hooks/useFinOpsReports.ts`:
- Around line 18-45: `useFinOpsReports` is not handling custom time range
updates correctly because the `useOpenChoreoQuery` key and `calculateTimeRange`
call both ignore `filters.customStartTime` and `filters.customEndTime`. Update
the query key in `useFinOpsReports` to include the custom time fields, and pass
those same values into `calculateTimeRange` so refetches and manual loads use
the correct bounds. Use `useRCAReports` as the reference for matching the key
composition and time-range argument shape.
---
Nitpick comments:
In `@plugins/openchoreo-react/src/hooks/useAllEntitiesOfKinds.ts`:
- Around line 11-12: The query key in useAllEntitiesOfKinds is collapsing
distinct inputs by using kinds.join(',') and (namespaces ?? []).join(','), which
can cause cache collisions. Update useOpenChoreoQuery to pass the kinds and
namespaces arrays directly in the key so TanStack Query can hash them by
contents, and keep the existing hook logic otherwise unchanged.
In `@plugins/openchoreo-react/src/hooks/useCreateComponentPath.ts`:
- Around line 32-64: `useCreateComponentPath` duplicates the same
cluster-template detection and namespace fallback logic used in
`useCreateResourcePath`; extract that shared behavior into a reusable hook such
as `useHasClusterTemplates(templateType)` so both paths stay aligned. Move the
`useOpenChoreoQuery`/`catalogApi.getEntityFacets` logic, the
`hasClusterTemplates === true` check, and the `staleTime: 5 * 60_000` handling
into the shared hook, then keep only the path-builder-specific parts in each
caller (`buildCreateComponentPath` vs the resource path builder) while
preserving the `CLUSTER_NAMESPACE` and namespace fallback behavior.
In `@plugins/openchoreo-react/src/hooks/useOpenChoreoCache.ts`:
- Around line 39-55: The useOpenChoreoCache hook returns a new cache object on
every render, which breaks referential stability for consumers like
useTraceSpans that depend on cache in useCallback/useEffect arrays. Wrap the
returned object in useMemo inside useOpenChoreoCache, with queryClient as the
dependency, and keep the setData, invalidate, fetchQuery, and getData methods
unchanged so the cache object stays stable across renders.
In `@plugins/openchoreo-workflows/src/hooks/useWorkflowRuns.ts`:
- Around line 16-22: The active-run status check is duplicated between
hasActiveRuns in useWorkflowRuns and isActive in useWorkflowRunDetails. Extract
a shared helper like isRunStatusActive(run) in a common utility and have both
hooks call it so the phase/status normalization and pending/running check live
in one place. Update the two hook functions to delegate to the shared helper and
keep their existing behavior unchanged.
In `@plugins/openchoreo/src/components/Environments/hooks/useReleases.ts`:
- Around line 25-41: `useReleases` is wrapping `useOpenChoreoQuery` refetch with
an async signature that implies awaiting/ordering it does not provide. Update
the `refetch` field in the returned object to match the actual fire-and-forget
contract used by `useOpenChoreoQuery` and current callers of `refetchReleases`,
either by making it a void-returning callback or by returning the underlying
`refetch` directly from the hook.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 5bdde14f-1603-46a5-add9-6282d3be62ad
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (114)
.changeset/response-cache-foundation.mdpackages/app/package.jsonpackages/app/src/components/Root/Root.tsxpackages/app/src/queryClient.tspackages/test-utils/package.jsonpackages/test-utils/src/index.tspackages/test-utils/src/queryClientBareWrapper.tsxpackages/test-utils/src/queryClientWrapper.tsxplugins/openchoreo-ci/src/components/Workflows/Workflows.test.tsxplugins/openchoreo-ci/src/components/Workflows/Workflows.tsxplugins/openchoreo-ci/src/hooks/useWorkflowData.tsplugins/openchoreo-ci/src/hooks/useWorkflowRetention.tsplugins/openchoreo-ci/src/hooks/useWorkflowRun.tsplugins/openchoreo-observability/package.jsonplugins/openchoreo-observability/src/components/Alerts/ObservabilityAlertsPage.tsxplugins/openchoreo-observability/src/components/Incidents/ObservabilityProjectIncidentsPage.tsxplugins/openchoreo-observability/src/components/Metrics/HTTPMetricsSection.tsxplugins/openchoreo-observability/src/components/Metrics/ObservabilityMetricsPage.test.tsxplugins/openchoreo-observability/src/components/Metrics/ObservabilityMetricsPage.tsxplugins/openchoreo-observability/src/components/RuntimeEvents/ObservabilityRuntimeEventsPage.tsxplugins/openchoreo-observability/src/components/RuntimeLogs/ObservabilityProjectRuntimeLogsPage.tsxplugins/openchoreo-observability/src/components/RuntimeLogs/ObservabilityRuntimeLogsPage.tsxplugins/openchoreo-observability/src/hooks/useComponentAlerts.tsplugins/openchoreo-observability/src/hooks/useDataPlaneNetPolProvider.test.tsplugins/openchoreo-observability/src/hooks/useDataPlaneNetPolProvider.tsplugins/openchoreo-observability/src/hooks/useFinOpsReport.test.tsplugins/openchoreo-observability/src/hooks/useFinOpsReport.tsplugins/openchoreo-observability/src/hooks/useFinOpsReports.test.tsplugins/openchoreo-observability/src/hooks/useFinOpsReports.tsplugins/openchoreo-observability/src/hooks/useGetComponentsByProject.tsplugins/openchoreo-observability/src/hooks/useMetrics.tsplugins/openchoreo-observability/src/hooks/useProjectIncidents.tsplugins/openchoreo-observability/src/hooks/useProjectRuntimeLogs.test.tsplugins/openchoreo-observability/src/hooks/useProjectRuntimeLogs.tsplugins/openchoreo-observability/src/hooks/useRCAReport.tsplugins/openchoreo-observability/src/hooks/useRCAReports.tsplugins/openchoreo-observability/src/hooks/useRuntimeEvents.test.tsplugins/openchoreo-observability/src/hooks/useRuntimeEvents.tsplugins/openchoreo-observability/src/hooks/useRuntimeLogs.tsplugins/openchoreo-observability/src/hooks/useSpanDetails.tsplugins/openchoreo-observability/src/hooks/useTraceSpans.tsplugins/openchoreo-observability/src/hooks/useTraces.test.tsplugins/openchoreo-observability/src/hooks/useTraces.tsplugins/openchoreo-observability/src/hooks/useUpdateIncident.tsplugins/openchoreo-observability/src/hooks/useWirelogsEnvironments.test.tsxplugins/openchoreo-observability/src/hooks/useWirelogsEnvironments.tsplugins/openchoreo-react/package.jsonplugins/openchoreo-react/src/hooks/useAllEntitiesOfKinds.test.tsxplugins/openchoreo-react/src/hooks/useAllEntitiesOfKinds.tsplugins/openchoreo-react/src/hooks/useAsyncOperation.tsplugins/openchoreo-react/src/hooks/useCreateComponentPath.tsplugins/openchoreo-react/src/hooks/useCreateResourcePath.test.tsxplugins/openchoreo-react/src/hooks/useCreateResourcePath.tsplugins/openchoreo-react/src/hooks/useOpenChoreoCache.tsplugins/openchoreo-react/src/hooks/useOpenChoreoInfiniteQuery.tsplugins/openchoreo-react/src/hooks/useOpenChoreoMutation.test.tsxplugins/openchoreo-react/src/hooks/useOpenChoreoMutation.tsplugins/openchoreo-react/src/hooks/useOpenChoreoQuery.test.tsxplugins/openchoreo-react/src/hooks/useOpenChoreoQuery.tsplugins/openchoreo-react/src/hooks/useProjectEnvironments.test.tsxplugins/openchoreo-react/src/hooks/useProjectEnvironments.tsplugins/openchoreo-react/src/hooks/useProjects.test.tsplugins/openchoreo-react/src/hooks/useProjects.tsplugins/openchoreo-react/src/hooks/useSecretReferences.tsplugins/openchoreo-react/src/index.tsplugins/openchoreo-workflows/src/components/GenericWorkflowsPage/GenericWorkflowsPage.tsxplugins/openchoreo-workflows/src/hooks/useNamespaces.tsplugins/openchoreo-workflows/src/hooks/useWorkflowRunDetails.tsplugins/openchoreo-workflows/src/hooks/useWorkflowRunLogs.tsplugins/openchoreo-workflows/src/hooks/useWorkflowRuns.tsplugins/openchoreo-workflows/src/hooks/useWorkflowSchema.tsplugins/openchoreo-workflows/src/hooks/useWorkflows.tsplugins/openchoreo/src/components/AccessControl/hooks/useActions.tsplugins/openchoreo/src/components/AccessControl/hooks/useClusterRoleBindings.tsplugins/openchoreo/src/components/AccessControl/hooks/useClusterRoles.test.tsxplugins/openchoreo/src/components/AccessControl/hooks/useClusterRoles.tsplugins/openchoreo/src/components/AccessControl/hooks/useHierarchyData.tsplugins/openchoreo/src/components/AccessControl/hooks/useNamespaceRoleBindings.tsplugins/openchoreo/src/components/AccessControl/hooks/useNamespaceRoles.tsplugins/openchoreo/src/components/AccessControl/hooks/useUserTypes.tsplugins/openchoreo/src/components/CellDiagram/CellDiagram.test.tsxplugins/openchoreo/src/components/CellDiagram/useCellEnvironments.test.tsxplugins/openchoreo/src/components/CellDiagram/useCellEnvironments.tsplugins/openchoreo/src/components/ClusterDataplaneOverview/hooks/useClusterDataplaneEnvironments.tsplugins/openchoreo/src/components/DataplaneOverview/hooks/useDataplaneEnvironments.tsplugins/openchoreo/src/components/DeleteEntity/hooks/useEntityExistsCheck.tsplugins/openchoreo/src/components/EnvironmentOverview/hooks/useEnvironmentDeployedComponents.tsplugins/openchoreo/src/components/EnvironmentOverview/useEnvironmentPipelines.tsplugins/openchoreo/src/components/Environments/Environments.test.tsxplugins/openchoreo/src/components/Environments/Environments.tsxplugins/openchoreo/src/components/Environments/EnvironmentsContext.tsxplugins/openchoreo/src/components/Environments/OverviewCard/useDeploymentStatus.tsplugins/openchoreo/src/components/Environments/PipelineDAG/DeployFlowCanvas.tsxplugins/openchoreo/src/components/Environments/PipelineDAG/PipelineCanvas.test.tsxplugins/openchoreo/src/components/Environments/PipelineDAG/PipelineCanvas.tsxplugins/openchoreo/src/components/Environments/hooks/useAutoDeploy.tsplugins/openchoreo/src/components/Environments/hooks/useAutoDeployUpdate.tsplugins/openchoreo/src/components/Environments/hooks/useEnvironmentData.test.tsxplugins/openchoreo/src/components/Environments/hooks/useEnvironmentData.tsplugins/openchoreo/src/components/Environments/hooks/useIncidentsSummary.tsplugins/openchoreo/src/components/Environments/hooks/useInvokeUrl.tsplugins/openchoreo/src/components/Environments/hooks/useReleaseReadiness.tsplugins/openchoreo/src/components/Environments/hooks/useReleases.tsplugins/openchoreo/src/components/Environments/styles.tsplugins/openchoreo/src/components/Projects/hooks/useDeploymentPipeline.tsplugins/openchoreo/src/components/Projects/hooks/useEnvironments.tsplugins/openchoreo/src/components/Projects/hooks/useProjectContentFacets.test.tsxplugins/openchoreo/src/components/Projects/hooks/useProjectContentFacets.tsplugins/openchoreo/src/components/ResourceDefinition/useResourceDefinition.tsplugins/openchoreo/src/components/RuntimeLogs/OverviewCard/useLogsSummary.tsplugins/openchoreo/src/components/Secrets/SecretsPage.tsxplugins/openchoreo/src/components/Secrets/hooks/useSecrets.test.tsxplugins/openchoreo/src/components/Secrets/hooks/useSecrets.tsplugins/openchoreo/src/components/Workflows/OverviewCard/useWorkflowsSummary.ts
Add TanStack Query behind a `useOpenChoreoQuery` wrapper that returns the
ContentLoader-friendly { loading, isRefetching, data, error, refetch } shape.
Mount QueryClientProvider in Root, clearing the cache on sign-out. Migrate
useEnvironmentData to the cache and show a refresh overlay in the Deploy
canvas top-right on background refetch. Add a shared query test wrapper.
Signed-off-by: Kavith Lokuhewage <kaviththiranga@gmail.com>
…le-read hooks to the response cache Signed-off-by: Kavith Lokuhewage <kaviththiranga@gmail.com>
… useOpenChoreoCache seam Signed-off-by: Kavith Lokuhewage <kaviththiranga@gmail.com>
…conditions Signed-off-by: Kavith Lokuhewage <kaviththiranga@gmail.com>
…, CI) to the cache Signed-off-by: Kavith Lokuhewage <kaviththiranga@gmail.com>
… query cache Signed-off-by: Kavith Lokuhewage <kaviththiranga@gmail.com>
…ness reads Signed-off-by: Kavith Lokuhewage <kaviththiranga@gmail.com>
…nrichment, workflow-run-details retry poller Signed-off-by: Kavith Lokuhewage <kaviththiranga@gmail.com>
…vents pagination trio Signed-off-by: Kavith Lokuhewage <kaviththiranga@gmail.com>
…ate useAsyncOperation Signed-off-by: Kavith Lokuhewage <kaviththiranga@gmail.com>
…d bare query wrapper Signed-off-by: Kavith Lokuhewage <kaviththiranga@gmail.com>
Signed-off-by: Kavith Lokuhewage <kaviththiranga@gmail.com>
49d1d2e to
f527dc0
Compare
…ror fallbacks, key collisions, retry policy Signed-off-by: Kavith Lokuhewage <kaviththiranga@gmail.com>
Signed-off-by: Kavith Lokuhewage <kaviththiranga@gmail.com>
…d-query staleness, cache memoization, abortable retry Signed-off-by: Kavith Lokuhewage <kaviththiranga@gmail.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
plugins/openchoreo-observability/src/hooks/useProjectRuntimeLogs.ts (1)
190-190: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value
getCursorcomment describes a fallback that doesn't exist in the code.The comment says "falling back to the last timestamp for the single-component / unfiltered case where there's no map," but the implementation is
page?.nextCursor ?? null— there is no fallback to any timestamp. This could mislead future maintainers into thinking a fallback exists.📝 Proposed comment fix
- // The per-component cursor is computed in the fetcher and returned as - // `nextCursor`; getCursor just surfaces it (falling back to the last - // timestamp for the single-component / unfiltered case where there's no map). + // The per-component cursor is computed in the fetcher and returned as + // `nextCursor`; getCursor just surfaces it. When `nextCursor` is + // undefined (no more pages), returns null to stop pagination. getCursor: (_last, page) => page?.nextCursor ?? null,🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@plugins/openchoreo-observability/src/hooks/useProjectRuntimeLogs.ts` at line 190, The comment around getCursor in useProjectRuntimeLogs is misleading because it mentions a timestamp fallback that the implementation does not perform. Update or remove that comment so it accurately reflects the actual behavior of getCursor: it simply returns page?.nextCursor or null, with no special fallback path. Keep the wording aligned with the cursor logic in the query setup to avoid confusing future maintainers.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@plugins/openchoreo-observability/src/hooks/useProjectRuntimeLogs.ts`:
- Around line 202-214: The fetchLogs wrapper in useProjectRuntimeLogs currently
fires refresh without returning it, so callers awaiting fetchLogs will not wait
for the refetch to complete. Update the fetchLogs function to return the refresh
call (or otherwise make it awaitable), and check the related reset handling in
the same hook so unused reset logic is either wired into refresh/fetchLogs or
removed if it is no longer needed.
---
Nitpick comments:
In `@plugins/openchoreo-observability/src/hooks/useProjectRuntimeLogs.ts`:
- Line 190: The comment around getCursor in useProjectRuntimeLogs is misleading
because it mentions a timestamp fallback that the implementation does not
perform. Update or remove that comment so it accurately reflects the actual
behavior of getCursor: it simply returns page?.nextCursor or null, with no
special fallback path. Keep the wording aligned with the cursor logic in the
query setup to avoid confusing future maintainers.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: a1c20fdc-9f9d-4189-8e48-9bf8dd219394
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (115)
.changeset/response-cache-foundation.mdpackages/app/package.jsonpackages/app/src/components/Root/Root.tsxpackages/app/src/queryClient.tspackages/test-utils/package.jsonpackages/test-utils/src/index.tspackages/test-utils/src/queryClientBareWrapper.tsxpackages/test-utils/src/queryClientWrapper.tsxplugins/openchoreo-ci/src/components/Workflows/Workflows.test.tsxplugins/openchoreo-ci/src/components/Workflows/Workflows.tsxplugins/openchoreo-ci/src/hooks/useWorkflowData.tsplugins/openchoreo-ci/src/hooks/useWorkflowRetention.tsplugins/openchoreo-ci/src/hooks/useWorkflowRun.tsplugins/openchoreo-observability/package.jsonplugins/openchoreo-observability/src/components/Alerts/ObservabilityAlertsPage.tsxplugins/openchoreo-observability/src/components/Incidents/ObservabilityProjectIncidentsPage.tsxplugins/openchoreo-observability/src/components/Metrics/HTTPMetricsSection.tsxplugins/openchoreo-observability/src/components/Metrics/ObservabilityMetricsPage.test.tsxplugins/openchoreo-observability/src/components/Metrics/ObservabilityMetricsPage.tsxplugins/openchoreo-observability/src/components/RuntimeEvents/ObservabilityRuntimeEventsPage.tsxplugins/openchoreo-observability/src/components/RuntimeLogs/ObservabilityProjectRuntimeLogsPage.tsxplugins/openchoreo-observability/src/components/RuntimeLogs/ObservabilityRuntimeLogsPage.tsxplugins/openchoreo-observability/src/hooks/useComponentAlerts.tsplugins/openchoreo-observability/src/hooks/useDataPlaneNetPolProvider.test.tsplugins/openchoreo-observability/src/hooks/useDataPlaneNetPolProvider.tsplugins/openchoreo-observability/src/hooks/useFinOpsReport.test.tsplugins/openchoreo-observability/src/hooks/useFinOpsReport.tsplugins/openchoreo-observability/src/hooks/useFinOpsReports.test.tsplugins/openchoreo-observability/src/hooks/useFinOpsReports.tsplugins/openchoreo-observability/src/hooks/useGetComponentsByProject.tsplugins/openchoreo-observability/src/hooks/useMetrics.tsplugins/openchoreo-observability/src/hooks/useProjectIncidents.tsplugins/openchoreo-observability/src/hooks/useProjectRuntimeLogs.test.tsplugins/openchoreo-observability/src/hooks/useProjectRuntimeLogs.tsplugins/openchoreo-observability/src/hooks/useRCAReport.tsplugins/openchoreo-observability/src/hooks/useRCAReports.tsplugins/openchoreo-observability/src/hooks/useRuntimeEvents.test.tsplugins/openchoreo-observability/src/hooks/useRuntimeEvents.tsplugins/openchoreo-observability/src/hooks/useRuntimeLogs.tsplugins/openchoreo-observability/src/hooks/useSpanDetails.tsplugins/openchoreo-observability/src/hooks/useTraceSpans.tsplugins/openchoreo-observability/src/hooks/useTraces.test.tsplugins/openchoreo-observability/src/hooks/useTraces.tsplugins/openchoreo-observability/src/hooks/useUpdateIncident.tsplugins/openchoreo-observability/src/hooks/useWirelogsEnvironments.test.tsxplugins/openchoreo-observability/src/hooks/useWirelogsEnvironments.tsplugins/openchoreo-react/package.jsonplugins/openchoreo-react/src/hooks/useAllEntitiesOfKinds.test.tsxplugins/openchoreo-react/src/hooks/useAllEntitiesOfKinds.tsplugins/openchoreo-react/src/hooks/useAsyncOperation.tsplugins/openchoreo-react/src/hooks/useCreateComponentPath.tsplugins/openchoreo-react/src/hooks/useCreateResourcePath.test.tsxplugins/openchoreo-react/src/hooks/useCreateResourcePath.tsplugins/openchoreo-react/src/hooks/useOpenChoreoCache.tsplugins/openchoreo-react/src/hooks/useOpenChoreoInfiniteQuery.tsplugins/openchoreo-react/src/hooks/useOpenChoreoMutation.test.tsxplugins/openchoreo-react/src/hooks/useOpenChoreoMutation.tsplugins/openchoreo-react/src/hooks/useOpenChoreoQuery.test.tsxplugins/openchoreo-react/src/hooks/useOpenChoreoQuery.tsplugins/openchoreo-react/src/hooks/useProjectEnvironments.test.tsxplugins/openchoreo-react/src/hooks/useProjectEnvironments.tsplugins/openchoreo-react/src/hooks/useProjects.test.tsplugins/openchoreo-react/src/hooks/useProjects.tsplugins/openchoreo-react/src/hooks/useSecretReferences.tsplugins/openchoreo-react/src/index.tsplugins/openchoreo-workflows/src/components/GenericWorkflowsPage/GenericWorkflowsPage.tsxplugins/openchoreo-workflows/src/hooks/useNamespaces.tsplugins/openchoreo-workflows/src/hooks/useWorkflowRunDetails.tsplugins/openchoreo-workflows/src/hooks/useWorkflowRunLogs.tsplugins/openchoreo-workflows/src/hooks/useWorkflowRuns.tsplugins/openchoreo-workflows/src/hooks/useWorkflowSchema.tsplugins/openchoreo-workflows/src/hooks/useWorkflows.tsplugins/openchoreo/src/components/AccessControl/hooks/useActions.tsplugins/openchoreo/src/components/AccessControl/hooks/useClusterRoleBindings.tsplugins/openchoreo/src/components/AccessControl/hooks/useClusterRoles.test.tsxplugins/openchoreo/src/components/AccessControl/hooks/useClusterRoles.tsplugins/openchoreo/src/components/AccessControl/hooks/useHierarchyData.tsplugins/openchoreo/src/components/AccessControl/hooks/useNamespaceRoleBindings.tsplugins/openchoreo/src/components/AccessControl/hooks/useNamespaceRoles.tsplugins/openchoreo/src/components/AccessControl/hooks/useUserTypes.tsplugins/openchoreo/src/components/CellDiagram/CellDiagram.test.tsxplugins/openchoreo/src/components/CellDiagram/useCellEnvironments.test.tsxplugins/openchoreo/src/components/CellDiagram/useCellEnvironments.tsplugins/openchoreo/src/components/ClusterDataplaneOverview/hooks/useClusterDataplaneEnvironments.tsplugins/openchoreo/src/components/DataplaneOverview/hooks/useDataplaneEnvironments.tsplugins/openchoreo/src/components/DeleteEntity/hooks/useEntityExistsCheck.tsplugins/openchoreo/src/components/EnvironmentOverview/hooks/useEnvironmentDeployedComponents.tsplugins/openchoreo/src/components/EnvironmentOverview/useEnvironmentPipelines.tsplugins/openchoreo/src/components/Environments/Environments.test.tsxplugins/openchoreo/src/components/Environments/Environments.tsxplugins/openchoreo/src/components/Environments/EnvironmentsContext.tsxplugins/openchoreo/src/components/Environments/OverviewCard/useDeploymentStatus.tsplugins/openchoreo/src/components/Environments/PipelineDAG/DeployFlowCanvas.tsxplugins/openchoreo/src/components/Environments/PipelineDAG/PipelineCanvas.test.tsxplugins/openchoreo/src/components/Environments/PipelineDAG/PipelineCanvas.tsxplugins/openchoreo/src/components/Environments/hooks/useAutoDeploy.tsplugins/openchoreo/src/components/Environments/hooks/useAutoDeployUpdate.tsplugins/openchoreo/src/components/Environments/hooks/useEnvironmentData.test.tsxplugins/openchoreo/src/components/Environments/hooks/useEnvironmentData.tsplugins/openchoreo/src/components/Environments/hooks/useIncidentsSummary.tsplugins/openchoreo/src/components/Environments/hooks/useInvokeUrl.tsplugins/openchoreo/src/components/Environments/hooks/useReleaseReadiness.tsplugins/openchoreo/src/components/Environments/hooks/useReleases.tsplugins/openchoreo/src/components/Environments/styles.tsplugins/openchoreo/src/components/Projects/hooks/useDeploymentPipeline.tsplugins/openchoreo/src/components/Projects/hooks/useEnvironments.tsplugins/openchoreo/src/components/Projects/hooks/useProjectContentFacets.test.tsxplugins/openchoreo/src/components/Projects/hooks/useProjectContentFacets.tsplugins/openchoreo/src/components/ResourceDefinition/useResourceDefinition.tsplugins/openchoreo/src/components/RuntimeLogs/OverviewCard/useLogsSummary.tsplugins/openchoreo/src/components/Secrets/SecretsPage.tsxplugins/openchoreo/src/components/Secrets/hooks/useSecrets.test.tsxplugins/openchoreo/src/components/Secrets/hooks/useSecrets.tsplugins/openchoreo/src/components/Workflows/OverviewCard/useWorkflowsSummary.tsplugins/openchoreo/src/hooks/useSecretReferences.ts
💤 Files with no reviewable changes (1)
- plugins/openchoreo/src/hooks/useSecretReferences.ts
✅ Files skipped from review due to trivial changes (5)
- plugins/openchoreo/src/components/Environments/Environments.test.tsx
- plugins/openchoreo-react/src/hooks/useAsyncOperation.ts
- plugins/openchoreo-observability/package.json
- plugins/openchoreo-observability/src/hooks/useDataPlaneNetPolProvider.test.ts
- .changeset/response-cache-foundation.md
🚧 Files skipped from review as they are similar to previous changes (105)
- plugins/openchoreo-workflows/src/hooks/useNamespaces.ts
- packages/test-utils/src/index.ts
- plugins/openchoreo/src/components/AccessControl/hooks/useClusterRoles.test.tsx
- packages/app/package.json
- plugins/openchoreo/src/components/Environments/PipelineDAG/PipelineCanvas.tsx
- packages/test-utils/src/queryClientBareWrapper.tsx
- plugins/openchoreo-observability/src/hooks/useTraces.test.ts
- plugins/openchoreo/src/components/Environments/hooks/useAutoDeployUpdate.ts
- plugins/openchoreo-observability/src/hooks/useWirelogsEnvironments.test.tsx
- plugins/openchoreo-observability/src/components/Metrics/ObservabilityMetricsPage.tsx
- plugins/openchoreo-react/src/hooks/useOpenChoreoMutation.test.tsx
- plugins/openchoreo/src/components/Environments/Environments.tsx
- plugins/openchoreo/src/components/CellDiagram/useCellEnvironments.test.tsx
- plugins/openchoreo-workflows/src/components/GenericWorkflowsPage/GenericWorkflowsPage.tsx
- packages/app/src/queryClient.ts
- plugins/openchoreo/src/components/Environments/hooks/useInvokeUrl.ts
- packages/test-utils/package.json
- plugins/openchoreo/src/components/DataplaneOverview/hooks/useDataplaneEnvironments.ts
- plugins/openchoreo-ci/src/components/Workflows/Workflows.test.tsx
- plugins/openchoreo/src/components/Environments/styles.ts
- plugins/openchoreo-observability/src/components/Incidents/ObservabilityProjectIncidentsPage.tsx
- plugins/openchoreo-ci/src/hooks/useWorkflowRetention.ts
- packages/test-utils/src/queryClientWrapper.tsx
- plugins/openchoreo-react/src/hooks/useProjects.test.ts
- plugins/openchoreo/src/components/Environments/hooks/useReleaseReadiness.ts
- plugins/openchoreo-observability/src/components/Metrics/HTTPMetricsSection.tsx
- plugins/openchoreo/src/components/Environments/hooks/useEnvironmentData.test.tsx
- packages/app/src/components/Root/Root.tsx
- plugins/openchoreo-workflows/src/hooks/useWorkflows.ts
- plugins/openchoreo/src/components/ClusterDataplaneOverview/hooks/useClusterDataplaneEnvironments.ts
- plugins/openchoreo/src/components/AccessControl/hooks/useClusterRoleBindings.ts
- plugins/openchoreo/src/components/Environments/hooks/useIncidentsSummary.ts
- plugins/openchoreo-observability/src/components/Metrics/ObservabilityMetricsPage.test.tsx
- plugins/openchoreo-observability/src/hooks/useDataPlaneNetPolProvider.ts
- plugins/openchoreo-react/src/index.ts
- plugins/openchoreo-observability/src/hooks/useRCAReports.ts
- plugins/openchoreo-ci/src/hooks/useWorkflowRun.ts
- plugins/openchoreo/src/components/Environments/EnvironmentsContext.tsx
- plugins/openchoreo-observability/src/hooks/useRCAReport.ts
- plugins/openchoreo-react/src/hooks/useSecretReferences.ts
- plugins/openchoreo-observability/src/components/RuntimeLogs/ObservabilityRuntimeLogsPage.tsx
- plugins/openchoreo-observability/src/hooks/useTraceSpans.ts
- plugins/openchoreo/src/components/Projects/hooks/useProjectContentFacets.test.tsx
- plugins/openchoreo/src/components/CellDiagram/useCellEnvironments.ts
- plugins/openchoreo/src/components/Environments/PipelineDAG/PipelineCanvas.test.tsx
- plugins/openchoreo/src/components/Environments/hooks/useEnvironmentData.ts
- plugins/openchoreo-observability/src/hooks/useSpanDetails.ts
- plugins/openchoreo-observability/src/hooks/useFinOpsReport.test.ts
- plugins/openchoreo-observability/src/hooks/useRuntimeEvents.ts
- plugins/openchoreo/src/components/Environments/hooks/useReleases.ts
- plugins/openchoreo/src/components/AccessControl/hooks/useActions.ts
- plugins/openchoreo/src/components/AccessControl/hooks/useClusterRoles.ts
- plugins/openchoreo/src/components/Environments/PipelineDAG/DeployFlowCanvas.tsx
- plugins/openchoreo/src/components/EnvironmentOverview/useEnvironmentPipelines.ts
- plugins/openchoreo-workflows/src/hooks/useWorkflowSchema.ts
- plugins/openchoreo-observability/src/hooks/useFinOpsReports.ts
- plugins/openchoreo/src/components/AccessControl/hooks/useUserTypes.ts
- plugins/openchoreo-observability/src/hooks/useGetComponentsByProject.ts
- plugins/openchoreo/src/components/Secrets/SecretsPage.tsx
- plugins/openchoreo/src/components/Workflows/OverviewCard/useWorkflowsSummary.ts
- plugins/openchoreo-react/src/hooks/useAllEntitiesOfKinds.ts
- plugins/openchoreo-workflows/src/hooks/useWorkflowRunDetails.ts
- plugins/openchoreo-react/package.json
- plugins/openchoreo/src/components/Projects/hooks/useDeploymentPipeline.ts
- plugins/openchoreo-ci/src/components/Workflows/Workflows.tsx
- plugins/openchoreo-observability/src/components/Alerts/ObservabilityAlertsPage.tsx
- plugins/openchoreo-react/src/hooks/useCreateComponentPath.ts
- plugins/openchoreo/src/components/Projects/hooks/useEnvironments.ts
- plugins/openchoreo/src/components/Secrets/hooks/useSecrets.test.tsx
- plugins/openchoreo-workflows/src/hooks/useWorkflowRunLogs.ts
- plugins/openchoreo-observability/src/hooks/useWirelogsEnvironments.ts
- plugins/openchoreo-react/src/hooks/useProjects.ts
- plugins/openchoreo-observability/src/hooks/useComponentAlerts.ts
- plugins/openchoreo/src/components/DeleteEntity/hooks/useEntityExistsCheck.ts
- plugins/openchoreo-react/src/hooks/useCreateResourcePath.ts
- plugins/openchoreo/src/components/AccessControl/hooks/useNamespaceRoles.ts
- plugins/openchoreo/src/components/EnvironmentOverview/hooks/useEnvironmentDeployedComponents.ts
- plugins/openchoreo-react/src/hooks/useCreateResourcePath.test.tsx
- plugins/openchoreo-react/src/hooks/useOpenChoreoInfiniteQuery.ts
- plugins/openchoreo-react/src/hooks/useProjectEnvironments.test.tsx
- plugins/openchoreo-observability/src/components/RuntimeLogs/ObservabilityProjectRuntimeLogsPage.tsx
- plugins/openchoreo/src/components/AccessControl/hooks/useNamespaceRoleBindings.ts
- plugins/openchoreo/src/components/Environments/OverviewCard/useDeploymentStatus.ts
- plugins/openchoreo-observability/src/hooks/useRuntimeLogs.ts
- plugins/openchoreo/src/components/ResourceDefinition/useResourceDefinition.ts
- plugins/openchoreo-workflows/src/hooks/useWorkflowRuns.ts
- plugins/openchoreo/src/components/Projects/hooks/useProjectContentFacets.ts
- plugins/openchoreo-react/src/hooks/useOpenChoreoMutation.ts
- plugins/openchoreo-react/src/hooks/useProjectEnvironments.ts
- plugins/openchoreo-react/src/hooks/useAllEntitiesOfKinds.test.tsx
- plugins/openchoreo-observability/src/hooks/useRuntimeEvents.test.ts
- plugins/openchoreo/src/components/Environments/hooks/useAutoDeploy.ts
- plugins/openchoreo/src/components/RuntimeLogs/OverviewCard/useLogsSummary.ts
- plugins/openchoreo-observability/src/hooks/useProjectIncidents.ts
- plugins/openchoreo-observability/src/hooks/useMetrics.ts
- plugins/openchoreo/src/components/AccessControl/hooks/useHierarchyData.ts
- plugins/openchoreo-observability/src/hooks/useTraces.ts
- plugins/openchoreo/src/components/Secrets/hooks/useSecrets.ts
- plugins/openchoreo-observability/src/hooks/useFinOpsReport.ts
- plugins/openchoreo-observability/src/components/RuntimeEvents/ObservabilityRuntimeEventsPage.tsx
- plugins/openchoreo-react/src/hooks/useOpenChoreoQuery.test.tsx
- plugins/openchoreo/src/components/CellDiagram/CellDiagram.test.tsx
- plugins/openchoreo-observability/src/hooks/useFinOpsReports.test.ts
- plugins/openchoreo-ci/src/hooks/useWorkflowData.ts
- plugins/openchoreo-observability/src/hooks/useUpdateIncident.ts
…oard widgets + linked-plane cards) Signed-off-by: Kavith Lokuhewage <kaviththiranga@gmail.com>
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
plugins/platform-engineer-core/src/components/HomePagePlatformDetailsCard/HomePagePlatformDetailsCard.tsx (1)
177-190: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winSame error check issue — cached platform details blanked on refetch failures.
The
if (error)check returns the error UI even whendataholds cached platform details from a previous successful fetch. A background refetch failure setserrorwhiledataremains populated, blanking the view instead of preserving cached content.🔧 Proposed fix
- if (error) { + if (error && !data) {🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@plugins/platform-engineer-core/src/components/HomePagePlatformDetailsCard/HomePagePlatformDetailsCard.tsx` around lines 177 - 190, The error branch in HomePagePlatformDetailsCard currently hides the view whenever the query has an error, even if cached data is still available. Update the conditional rendering in HomePagePlatformDetailsCard to prefer showing the existing `data` when it is present and only render the failure state when there is no usable platform details payload. Use the existing `error`, `data`, and the component’s main render path to keep cached content visible during refetch failures.plugins/openchoreo/src/components/ClusterObservabilityPlaneOverview/ClusterObservabilityPlaneLinkedPlanesCard.tsx (1)
95-109: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winSame error check issue — cached data blanked on refetch failures.
The
if (error)check blanks cached data on background refetch failures, same pattern asObservabilityPlaneLinkedPlanesCard. Apply the!dataguard:🔧 Proposed fix
- if (error) { + if (error && !data) {🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@plugins/openchoreo/src/components/ClusterObservabilityPlaneOverview/ClusterObservabilityPlaneLinkedPlanesCard.tsx` around lines 95 - 109, The error-state rendering in ClusterObservabilityPlaneLinkedPlanesCard is too aggressive and hides existing cached data during background refetch failures. Update the error branch in the component’s main render logic to only show the empty/error Card when there is no data available, mirroring the guarded pattern used in ObservabilityPlaneLinkedPlanesCard by checking both the query result and !data before returning the failure state.plugins/openchoreo/src/components/ObservabilityPlaneOverview/ObservabilityPlaneLinkedPlanesCard.tsx (1)
95-109: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winPreserve cached planes on refetch errors.
errorcan be set whiledatastill holds the last successful planes, soif (error)replaces the populated card with the error state after a background refetch failure. Guard on!datahere so cached planes stay visible.🔧 Proposed fix
- if (error) { + if (error && !data) {🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@plugins/openchoreo/src/components/ObservabilityPlaneOverview/ObservabilityPlaneLinkedPlanesCard.tsx` around lines 95 - 109, The Linked Planes card in ObservabilityPlaneLinkedPlanesCard should not replace already loaded planes with the error empty state during a background refetch failure. Update the conditional around the existing error handling so it only renders the failure UI when there is no cached data available, and let the normal data rendering path continue when data is still present. Use the existing ObservabilityPlaneLinkedPlanesCard render logic and its error/data checks to keep previously fetched planes visible.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In
`@plugins/openchoreo/src/components/ClusterObservabilityPlaneOverview/ClusterObservabilityPlaneLinkedPlanesCard.tsx`:
- Around line 95-109: The error-state rendering in
ClusterObservabilityPlaneLinkedPlanesCard is too aggressive and hides existing
cached data during background refetch failures. Update the error branch in the
component’s main render logic to only show the empty/error Card when there is no
data available, mirroring the guarded pattern used in
ObservabilityPlaneLinkedPlanesCard by checking both the query result and !data
before returning the failure state.
In
`@plugins/openchoreo/src/components/ObservabilityPlaneOverview/ObservabilityPlaneLinkedPlanesCard.tsx`:
- Around line 95-109: The Linked Planes card in
ObservabilityPlaneLinkedPlanesCard should not replace already loaded planes with
the error empty state during a background refetch failure. Update the
conditional around the existing error handling so it only renders the failure UI
when there is no cached data available, and let the normal data rendering path
continue when data is still present. Use the existing
ObservabilityPlaneLinkedPlanesCard render logic and its error/data checks to
keep previously fetched planes visible.
In
`@plugins/platform-engineer-core/src/components/HomePagePlatformDetailsCard/HomePagePlatformDetailsCard.tsx`:
- Around line 177-190: The error branch in HomePagePlatformDetailsCard currently
hides the view whenever the query has an error, even if cached data is still
available. Update the conditional rendering in HomePagePlatformDetailsCard to
prefer showing the existing `data` when it is present and only render the
failure state when there is no usable platform details payload. Use the existing
`error`, `data`, and the component’s main render path to keep cached content
visible during refetch failures.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: d160a11d-8b68-47f5-818e-76c3ad3036dd
📒 Files selected for processing (6)
.changeset/cache-platform-plane-fetches.mdplugins/openchoreo/src/components/ClusterObservabilityPlaneOverview/ClusterObservabilityPlaneLinkedPlanesCard.tsxplugins/openchoreo/src/components/ObservabilityPlaneOverview/ObservabilityPlaneLinkedPlanesCard.tsxplugins/platform-engineer-core/src/components/AgentHealthWidget/AgentHealthWidget.tsxplugins/platform-engineer-core/src/components/HomePagePlatformDetailsCard/HomePagePlatformDetailsCard.tsxplugins/platform-engineer-core/src/components/InfrastructureWidget/InfrastructureWidget.tsx
✅ Files skipped from review due to trivial changes (1)
- .changeset/cache-platform-plane-fetches.md
…efined Passing staleTime: undefined to useQuery overrides the 30s default (resolves to 0), so every remount refetched and the response cache never actually served cached data. Forward staleTime/refetchInterval/enabled only when set, matching the existing retry handling. Adds a remount regression test. Signed-off-by: Kavith Lokuhewage <kaviththiranga@gmail.com>
…ound refresh Both hooks folded isRefetching into loading, so a background revalidation re-triggered the full skeleton and blanked the cached view every staleTime window. Report loading for first-load only and expose isRefetching separately. Signed-off-by: Kavith Lokuhewage <kaviththiranga@gmail.com>
Add a shared RefreshOverlay primitive (design system) and thread isRefetching through the portal's cached hooks so a background revalidation shows a subtle corner spinner instead of silently swapping data. Covers the home dashboard, plane cards, access-control, secrets, project, environment, workflow and observability surfaces; SummaryWidgetWrapper gains a refreshing prop. Signed-off-by: Kavith Lokuhewage <kaviththiranga@gmail.com>
Signed-off-by: Kavith Lokuhewage <kaviththiranga@gmail.com>
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
plugins/openchoreo-observability/src/hooks/useDataPlaneNetPolProvider.ts (1)
44-65: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick winPass the AbortSignal through to
fetchApi.fetch.useOpenChoreoQueryalready supplies{ signal }, and wiring it into the request will cancel stale in-flight calls on unmount or query-key changes.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@plugins/openchoreo-observability/src/hooks/useDataPlaneNetPolProvider.ts` around lines 44 - 65, Pass the AbortSignal from useOpenChoreoQuery into the request inside useDataPlaneNetPolProvider so stale calls can be canceled on unmount or key changes. Update the async fetch callback to accept the signal argument and forward it to fetchApi.fetch along with the existing URL and params, keeping the rest of the response handling in place.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/design-system/src/components/RefreshOverlay/RefreshOverlay.tsx`:
- Around line 22-35: The RefreshOverlay reduced-motion handling only covers the
spinner variant, so the bar variant still animates in `prefers-reduced-motion`
mode. Update the `bar` styles in `RefreshOverlay` to target the MUI
`LinearProgress` indeterminate child classes (such as the bar1/bar2 elements)
and disable their animation when reduced motion is requested, similar to how
`spinner` is handled.
In
`@plugins/openchoreo-workflows/src/components/WorkflowDetailsPage/WorkflowDetailsPage.tsx`:
- Line 104: The overlay state in WorkflowDetailsPage is using a combined
`refreshing` flag from `workflowsRefetching` and `runsRefetching`, which makes
the runs overlay label inaccurate. Update the overlay usage in
`WorkflowDetailsPage` so the “Refreshing runs…” label is driven by
`runsRefetching` only, or change the label to a generic refresh message if it
should reflect both queries. Make the same adjustment anywhere the `refreshing`
value is used for the overlay so the UI matches the actual data being refetched.
---
Nitpick comments:
In `@plugins/openchoreo-observability/src/hooks/useDataPlaneNetPolProvider.ts`:
- Around line 44-65: Pass the AbortSignal from useOpenChoreoQuery into the
request inside useDataPlaneNetPolProvider so stale calls can be canceled on
unmount or key changes. Update the async fetch callback to accept the signal
argument and forward it to fetchApi.fetch along with the existing URL and
params, keeping the rest of the response handling in place.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 4588956e-7a03-47ff-900b-2206ade02490
📒 Files selected for processing (83)
.changeset/background-refresh-indicators.md.changeset/response-cache-foundation.mdpackages/design-system/src/components/RefreshOverlay/RefreshOverlay.test.tsxpackages/design-system/src/components/RefreshOverlay/RefreshOverlay.tsxpackages/design-system/src/components/RefreshOverlay/index.tspackages/design-system/src/index.tsplugins/openchoreo-ci/src/hooks/useWorkflowData.tsplugins/openchoreo-ci/src/hooks/useWorkflowRun.tsplugins/openchoreo-observability/src/components/Alerts/ObservabilityAlertsPage.tsxplugins/openchoreo-observability/src/components/CostAnalysis/CostAnalysisReport.tsxplugins/openchoreo-observability/src/components/Incidents/ObservabilityProjectIncidentsPage.tsxplugins/openchoreo-observability/src/components/Metrics/ObservabilityMetricsPage.tsxplugins/openchoreo-observability/src/components/RCA/RCAReport.tsxplugins/openchoreo-observability/src/components/Traces/ObservabilityTracesPage.tsxplugins/openchoreo-observability/src/hooks/useComponentAlerts.tsplugins/openchoreo-observability/src/hooks/useDataPlaneNetPolProvider.tsplugins/openchoreo-observability/src/hooks/useFinOpsReport.tsplugins/openchoreo-observability/src/hooks/useFinOpsReports.tsplugins/openchoreo-observability/src/hooks/useGetComponentsByProject.tsplugins/openchoreo-observability/src/hooks/useMetrics.tsplugins/openchoreo-observability/src/hooks/useProjectIncidents.tsplugins/openchoreo-observability/src/hooks/useProjectRuntimeLogs.tsplugins/openchoreo-observability/src/hooks/useRCAReport.tsplugins/openchoreo-observability/src/hooks/useRCAReports.tsplugins/openchoreo-observability/src/hooks/useRuntimeEvents.tsplugins/openchoreo-observability/src/hooks/useRuntimeLogs.tsplugins/openchoreo-observability/src/hooks/useTraces.tsplugins/openchoreo-observability/src/hooks/useWirelogsEnvironments.tsplugins/openchoreo-react/src/components/SummaryWidgetWrapper/SummaryWidgetWrapper.tsxplugins/openchoreo-react/src/hooks/useAllEntitiesOfKinds.tsplugins/openchoreo-react/src/hooks/useCreateComponentPath.tsplugins/openchoreo-react/src/hooks/useCreateResourcePath.tsplugins/openchoreo-react/src/hooks/useOpenChoreoInfiniteQuery.tsplugins/openchoreo-react/src/hooks/useOpenChoreoQuery.test.tsxplugins/openchoreo-react/src/hooks/useOpenChoreoQuery.tsplugins/openchoreo-react/src/hooks/useProjectEnvironments.tsplugins/openchoreo-react/src/hooks/useSecretReferences.tsplugins/openchoreo-workflows/src/components/GenericWorkflowsPage/GenericWorkflowsPage.tsxplugins/openchoreo-workflows/src/components/WorkflowDetailsPage/WorkflowDetailsPage.tsxplugins/openchoreo-workflows/src/components/WorkflowRunsContent/WorkflowRunsContent.tsxplugins/openchoreo-workflows/src/hooks/useNamespaces.tsplugins/openchoreo-workflows/src/hooks/useWorkflowRunDetails.tsplugins/openchoreo-workflows/src/hooks/useWorkflowRunLogs.tsplugins/openchoreo-workflows/src/hooks/useWorkflowRuns.tsplugins/openchoreo-workflows/src/hooks/useWorkflowSchema.tsplugins/openchoreo-workflows/src/hooks/useWorkflows.tsplugins/openchoreo/src/components/AccessControl/ActionsTab/ActionsTab.tsxplugins/openchoreo/src/components/AccessControl/hooks/useActions.tsplugins/openchoreo/src/components/AccessControl/hooks/useClusterRoleBindings.tsplugins/openchoreo/src/components/AccessControl/hooks/useClusterRoles.tsplugins/openchoreo/src/components/AccessControl/hooks/useHierarchyData.tsplugins/openchoreo/src/components/AccessControl/hooks/useNamespaceRoleBindings.tsplugins/openchoreo/src/components/AccessControl/hooks/useNamespaceRoles.tsplugins/openchoreo/src/components/AccessControl/hooks/useUserTypes.tsplugins/openchoreo/src/components/CellDiagram/useCellEnvironments.test.tsxplugins/openchoreo/src/components/CellDiagram/useCellEnvironments.tsplugins/openchoreo/src/components/ClusterDataplaneOverview/ClusterDataplaneEnvironmentsCard.tsxplugins/openchoreo/src/components/ClusterDataplaneOverview/hooks/useClusterDataplaneEnvironments.tsplugins/openchoreo/src/components/ClusterObservabilityPlaneOverview/ClusterObservabilityPlaneLinkedPlanesCard.tsxplugins/openchoreo/src/components/DataplaneOverview/DataplaneEnvironmentsCard.tsxplugins/openchoreo/src/components/DataplaneOverview/hooks/useDataplaneEnvironments.tsplugins/openchoreo/src/components/DeleteEntity/hooks/useEntityExistsCheck.tsplugins/openchoreo/src/components/DeleteEntity/types.tsplugins/openchoreo/src/components/EnvironmentOverview/EnvironmentDeployedComponentsCard.tsxplugins/openchoreo/src/components/EnvironmentOverview/EnvironmentPipelinesTab.tsxplugins/openchoreo/src/components/EnvironmentOverview/hooks/useEnvironmentDeployedComponents.tsplugins/openchoreo/src/components/EnvironmentOverview/useEnvironmentPipelines.tsplugins/openchoreo/src/components/Environments/hooks/useAutoDeploy.tsplugins/openchoreo/src/components/Environments/hooks/useInvokeUrl.tsplugins/openchoreo/src/components/Environments/hooks/useReleaseReadiness.tsplugins/openchoreo/src/components/Environments/hooks/useReleases.tsplugins/openchoreo/src/components/ObservabilityPlaneOverview/ObservabilityPlaneLinkedPlanesCard.tsxplugins/openchoreo/src/components/Projects/ProjectContentsCard/ProjectContentsCard.tsxplugins/openchoreo/src/components/Projects/hooks/useDeploymentPipeline.tsplugins/openchoreo/src/components/Projects/hooks/useEnvironments.tsplugins/openchoreo/src/components/Projects/hooks/useProjectContentFacets.tsplugins/openchoreo/src/components/ResourceDefinition/useResourceDefinition.tsplugins/openchoreo/src/components/Secrets/SecretsPage.tsxplugins/openchoreo/src/components/Secrets/hooks/useSecrets.tsplugins/openchoreo/src/components/Workflows/OverviewCard/useWorkflowsSummary.tsplugins/platform-engineer-core/src/components/AgentHealthWidget/AgentHealthWidget.tsxplugins/platform-engineer-core/src/components/HomePagePlatformDetailsCard/HomePagePlatformDetailsCard.tsxplugins/platform-engineer-core/src/components/InfrastructureWidget/InfrastructureWidget.tsx
✅ Files skipped from review due to trivial changes (3)
- packages/design-system/src/components/RefreshOverlay/index.ts
- .changeset/background-refresh-indicators.md
- .changeset/response-cache-foundation.md
🚧 Files skipped from review as they are similar to previous changes (58)
- plugins/openchoreo/src/components/CellDiagram/useCellEnvironments.test.tsx
- plugins/openchoreo-observability/src/components/Alerts/ObservabilityAlertsPage.tsx
- plugins/openchoreo-observability/src/components/Metrics/ObservabilityMetricsPage.tsx
- plugins/openchoreo/src/components/Secrets/hooks/useSecrets.ts
- plugins/openchoreo/src/components/AccessControl/hooks/useUserTypes.ts
- plugins/openchoreo/src/components/Environments/hooks/useInvokeUrl.ts
- plugins/openchoreo/src/components/DataplaneOverview/hooks/useDataplaneEnvironments.ts
- plugins/openchoreo/src/components/ObservabilityPlaneOverview/ObservabilityPlaneLinkedPlanesCard.tsx
- plugins/openchoreo-observability/src/hooks/useRCAReports.ts
- plugins/openchoreo-workflows/src/hooks/useWorkflowRunLogs.ts
- plugins/openchoreo-observability/src/hooks/useFinOpsReport.ts
- plugins/platform-engineer-core/src/components/AgentHealthWidget/AgentHealthWidget.tsx
- plugins/openchoreo/src/components/ClusterDataplaneOverview/hooks/useClusterDataplaneEnvironments.ts
- plugins/openchoreo/src/components/Projects/hooks/useDeploymentPipeline.ts
- plugins/openchoreo-workflows/src/hooks/useWorkflowSchema.ts
- plugins/openchoreo-observability/src/components/Incidents/ObservabilityProjectIncidentsPage.tsx
- plugins/openchoreo-ci/src/hooks/useWorkflowRun.ts
- plugins/openchoreo-workflows/src/components/GenericWorkflowsPage/GenericWorkflowsPage.tsx
- plugins/openchoreo/src/components/ClusterObservabilityPlaneOverview/ClusterObservabilityPlaneLinkedPlanesCard.tsx
- plugins/openchoreo-observability/src/hooks/useGetComponentsByProject.ts
- plugins/openchoreo-workflows/src/hooks/useWorkflowRuns.ts
- plugins/openchoreo/src/components/Projects/hooks/useProjectContentFacets.ts
- plugins/openchoreo/src/components/AccessControl/hooks/useNamespaceRoles.ts
- plugins/openchoreo/src/components/EnvironmentOverview/useEnvironmentPipelines.ts
- plugins/openchoreo-react/src/hooks/useSecretReferences.ts
- plugins/openchoreo-workflows/src/hooks/useWorkflows.ts
- plugins/openchoreo-observability/src/hooks/useFinOpsReports.ts
- plugins/platform-engineer-core/src/components/HomePagePlatformDetailsCard/HomePagePlatformDetailsCard.tsx
- plugins/openchoreo-observability/src/hooks/useRCAReport.ts
- plugins/openchoreo-workflows/src/hooks/useWorkflowRunDetails.ts
- plugins/openchoreo-react/src/hooks/useCreateResourcePath.ts
- plugins/openchoreo/src/components/Secrets/SecretsPage.tsx
- plugins/openchoreo/src/components/Environments/hooks/useAutoDeploy.ts
- plugins/openchoreo-react/src/hooks/useProjectEnvironments.ts
- plugins/openchoreo/src/components/AccessControl/hooks/useActions.ts
- plugins/openchoreo/src/components/Environments/hooks/useReleaseReadiness.ts
- plugins/openchoreo-observability/src/hooks/useWirelogsEnvironments.ts
- plugins/openchoreo/src/components/Projects/hooks/useEnvironments.ts
- plugins/openchoreo-ci/src/hooks/useWorkflowData.ts
- plugins/openchoreo-observability/src/hooks/useProjectIncidents.ts
- plugins/openchoreo-react/src/hooks/useAllEntitiesOfKinds.ts
- plugins/openchoreo/src/components/AccessControl/hooks/useNamespaceRoleBindings.ts
- plugins/openchoreo-observability/src/hooks/useRuntimeEvents.ts
- plugins/openchoreo-observability/src/hooks/useProjectRuntimeLogs.ts
- plugins/openchoreo/src/components/Workflows/OverviewCard/useWorkflowsSummary.ts
- plugins/platform-engineer-core/src/components/InfrastructureWidget/InfrastructureWidget.tsx
- plugins/openchoreo/src/components/CellDiagram/useCellEnvironments.ts
- plugins/openchoreo/src/components/AccessControl/hooks/useClusterRoleBindings.ts
- plugins/openchoreo/src/components/AccessControl/hooks/useHierarchyData.ts
- plugins/openchoreo/src/components/ResourceDefinition/useResourceDefinition.ts
- plugins/openchoreo-observability/src/hooks/useTraces.ts
- plugins/openchoreo-react/src/hooks/useCreateComponentPath.ts
- plugins/openchoreo/src/components/EnvironmentOverview/hooks/useEnvironmentDeployedComponents.ts
- plugins/openchoreo/src/components/DeleteEntity/hooks/useEntityExistsCheck.ts
- plugins/openchoreo-react/src/hooks/useOpenChoreoQuery.ts
- plugins/openchoreo-observability/src/hooks/useRuntimeLogs.ts
- plugins/openchoreo-observability/src/hooks/useMetrics.ts
- plugins/openchoreo/src/components/AccessControl/hooks/useClusterRoles.ts
Add unit tests across the migrated data hooks to lift codecov patch coverage, and fix three review findings: await refetch in useProjectRuntimeLogs.fetchLogs, drive the WorkflowDetailsPage runs overlay from runsRefetching, and freeze the RefreshOverlay bar variant under prefers-reduced-motion. Signed-off-by: Kavith Lokuhewage <kaviththiranga@gmail.com>
…surfaces Wire RefreshOverlay onto the AccessControl roles/mappings tabs, the environment setup/detail panes, and the runtime logs/events pages (suppressed in live-poll mode). Closes the silent-refresh gaps left by the initial rollout. Signed-off-by: Kavith Lokuhewage <kaviththiranga@gmail.com>
Wrap the immediate cache reads after an async fetchQuery/fetchSpans in waitFor. getData/getQueryData is read directly off the QueryClient, so under CI worker contention the synchronous read could land before the write settled (Tests job flake on useOpenChoreoCache). Signed-off-by: Kavith Lokuhewage <kaviththiranga@gmail.com>
Introduces a client-side response cache behind a swappable seam and migrates the
portal's data-fetching hooks onto it. Cached data now paints instantly on tab
switch / remount, and a background refresh shows a subtle overlay instead of
blanking the view.
Four hooks wrap TanStack Query so no plugin imports it directly:
useOpenChoreoQuery— cached reads →{ data, loading, isRefetching, error, refetch }useOpenChoreoMutation— writes that re-throw on error + invalidate on successuseOpenChoreoInfiniteQuery— cursor pagination + live poll (runtime logs/events)useOpenChoreoCache— imperative access (optimistic writes, keyed-Map hooks)Provider mounts in the app root; cache clears on sign-out.
Fixes: openchoreo/openchoreo#4125
Summary by CodeRabbit
Summary by CodeRabbit
New Features
Bug Fixes
Tests