Skip to content

feat(caching): frontend response cache (TanStack Query) + full hook migration#676

Open
kaviththiranga wants to merge 23 commits into
openchoreo:mainfrom
kaviththiranga:feat/response-cache-only
Open

feat(caching): frontend response cache (TanStack Query) + full hook migration#676
kaviththiranga wants to merge 23 commits into
openchoreo:mainfrom
kaviththiranga:feat/response-cache-only

Conversation

@kaviththiranga

@kaviththiranga kaviththiranga commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

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 success
  • useOpenChoreoInfiniteQuery — 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

    • Added portal-wide background refresh UI using RefreshOverlay (with corner spinner or bar variant).
    • Migrated data fetching to query-driven hooks with cached reads that refresh in the background.
  • Bug Fixes

    • Improved sign-out by clearing cached data to prevent stale, user-specific views.
    • Reduced “blank on refresh” behavior by keeping previously loaded data during background revalidation.
  • Tests

    • Updated hook/component tests to use query-provider wrappers and adjusted refresh/auto-fetch expectations.

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This 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.

Changes

Response-cache foundation

Layer / File(s) Summary
App provider and cache policy
packages/app/src/queryClient.ts, packages/app/src/components/Root/Root.tsx, packages/app/package.json
Adds the shared QueryClient, root provider, default cache policy, and cache clearing on sign-out.
Reusable query APIs
plugins/openchoreo-react/src/hooks/useOpenChoreo*.ts, plugins/openchoreo-react/src/index.ts
Adds wrapped query, mutation, cache, and infinite-query hooks with typed public contracts.
Test infrastructure
packages/test-utils/*
Adds isolated QueryClient factories and wrappers combining query and Backstage API providers.

Plugin migrations

Layer / File(s) Summary
CI and workflows
plugins/openchoreo-ci/src/**, plugins/openchoreo-workflows/src/**
Replaces manual fetches and timers with query-driven loading, polling, mutations, and refetch state.
Observability
plugins/openchoreo-observability/src/**
Migrates alerts, metrics, incidents, reports, traces, spans, logs, events, and wirelog enrichment to query and cache primitives.
OpenChoreo portal
plugins/openchoreo/src/**
Migrates access control, environments, projects, secrets, resources, deployments, and workflow summaries to cached queries and invalidating mutations.
Platform widgets
plugins/platform-engineer-core/src/components/**
Converts platform overview and infrastructure widgets to query-backed aggregate data.

Background refresh UI

Layer / File(s) Summary
RefreshOverlay
packages/design-system/src/components/RefreshOverlay/**, packages/design-system/src/index.ts
Adds accessible corner-spinner and top-bar refresh indicators with reduced-motion handling.
Portal surfaces
plugins/openchoreo/**, plugins/openchoreo-observability/**, plugins/openchoreo-workflows/**, plugins/openchoreo-react/src/components/SummaryWidgetWrapper/**
Displays background refresh indicators while retaining cached content and separating loading from isRefetching.

Release metadata and validation

Layer / File(s) Summary
Tests and changesets
**/*.test.*, .changeset/*
Updates tests for query providers, caching, polling, pagination, mutation invalidation, and refresh overlays, and documents package releases.

Estimated code review effort: 5 (Critical) | ~150 minutes

Possibly related issues

Possibly related PRs

Suggested reviewers: sameerajayasoma, stefinie123, akila-i

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is too brief and does not follow the required template sections. Expand it to include the template headings, especially Purpose, Goals, Approach, User stories, Release note, Tests, and Security checks.
Docstring Coverage ⚠️ Warning Docstring coverage is 26.60% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the cache migration and hook refactor.
Linked Issues check ✅ Passed The changes implement TanStack Query caching, a thin seam, sign-out cache clearing, and hook migration as requested by #4125.
Out of Scope Changes check ✅ Passed No clear out-of-scope changes are evident; the added hooks, overlays, tests, and package updates all support the caching migration.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 win

Custom 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, calculateTimeRange is called without the custom times, so even a manual refresh would use wrong bounds. Compare with useRCAReports which 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 win

Extract shared active-status helper to eliminate duplication.

hasActiveRuns duplicates the status-check logic from isActive in useWorkflowRunDetails.ts (lines 27–30) — both check (run.phase || run.status)?.toLowerCase() for 'pending' or 'running'. Extract a shared isRunStatusActive(run) helper and reuse it in both hooks to prevent divergence.

♻️ Suggested shared helper

Create a shared utility (e.g., in a utils/activeStatus.ts file):

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 win

Memoize 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) place cache in useCallback dependency arrays, so the callback (and any effects depending on it) re-create every render. Since useQueryClient() returns a stable reference, wrapping the return in useMemo with [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 value

Align useReleases.refetch with the actual query contract (plugins/openchoreo/src/components/Environments/hooks/useReleases.ts) useOpenChoreoQuery exposes a fire-and-forget refetch, and current callers just invoke refetchReleases() without awaiting it. The Promise<void> return type here suggests sequencing that the implementation doesn’t provide, so make it () => void or return the underlying refetch directly.

🤖 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 win

Avoid 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']) and useAllEntitiesOfKinds(['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 win

Consider extracting shared cluster-template detection logic.

useCreateComponentPath and useCreateResourcePath share identical structure: the same getEntityFacets query pattern, the same hasClusterTemplates === true gating, the same staleTime: 5 * 60_000, and the same namespace-fallback useMemo. They differ only in the query key, spec.type filter value, and path builder function. A shared useHasClusterTemplates(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

📥 Commits

Reviewing files that changed from the base of the PR and between 14f1052 and 49d1d2e.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (114)
  • .changeset/response-cache-foundation.md
  • packages/app/package.json
  • packages/app/src/components/Root/Root.tsx
  • packages/app/src/queryClient.ts
  • packages/test-utils/package.json
  • packages/test-utils/src/index.ts
  • packages/test-utils/src/queryClientBareWrapper.tsx
  • packages/test-utils/src/queryClientWrapper.tsx
  • plugins/openchoreo-ci/src/components/Workflows/Workflows.test.tsx
  • plugins/openchoreo-ci/src/components/Workflows/Workflows.tsx
  • plugins/openchoreo-ci/src/hooks/useWorkflowData.ts
  • plugins/openchoreo-ci/src/hooks/useWorkflowRetention.ts
  • plugins/openchoreo-ci/src/hooks/useWorkflowRun.ts
  • plugins/openchoreo-observability/package.json
  • plugins/openchoreo-observability/src/components/Alerts/ObservabilityAlertsPage.tsx
  • plugins/openchoreo-observability/src/components/Incidents/ObservabilityProjectIncidentsPage.tsx
  • plugins/openchoreo-observability/src/components/Metrics/HTTPMetricsSection.tsx
  • plugins/openchoreo-observability/src/components/Metrics/ObservabilityMetricsPage.test.tsx
  • plugins/openchoreo-observability/src/components/Metrics/ObservabilityMetricsPage.tsx
  • plugins/openchoreo-observability/src/components/RuntimeEvents/ObservabilityRuntimeEventsPage.tsx
  • plugins/openchoreo-observability/src/components/RuntimeLogs/ObservabilityProjectRuntimeLogsPage.tsx
  • plugins/openchoreo-observability/src/components/RuntimeLogs/ObservabilityRuntimeLogsPage.tsx
  • plugins/openchoreo-observability/src/hooks/useComponentAlerts.ts
  • plugins/openchoreo-observability/src/hooks/useDataPlaneNetPolProvider.test.ts
  • plugins/openchoreo-observability/src/hooks/useDataPlaneNetPolProvider.ts
  • plugins/openchoreo-observability/src/hooks/useFinOpsReport.test.ts
  • plugins/openchoreo-observability/src/hooks/useFinOpsReport.ts
  • plugins/openchoreo-observability/src/hooks/useFinOpsReports.test.ts
  • plugins/openchoreo-observability/src/hooks/useFinOpsReports.ts
  • plugins/openchoreo-observability/src/hooks/useGetComponentsByProject.ts
  • plugins/openchoreo-observability/src/hooks/useMetrics.ts
  • plugins/openchoreo-observability/src/hooks/useProjectIncidents.ts
  • plugins/openchoreo-observability/src/hooks/useProjectRuntimeLogs.test.ts
  • plugins/openchoreo-observability/src/hooks/useProjectRuntimeLogs.ts
  • plugins/openchoreo-observability/src/hooks/useRCAReport.ts
  • plugins/openchoreo-observability/src/hooks/useRCAReports.ts
  • plugins/openchoreo-observability/src/hooks/useRuntimeEvents.test.ts
  • plugins/openchoreo-observability/src/hooks/useRuntimeEvents.ts
  • plugins/openchoreo-observability/src/hooks/useRuntimeLogs.ts
  • plugins/openchoreo-observability/src/hooks/useSpanDetails.ts
  • plugins/openchoreo-observability/src/hooks/useTraceSpans.ts
  • plugins/openchoreo-observability/src/hooks/useTraces.test.ts
  • plugins/openchoreo-observability/src/hooks/useTraces.ts
  • plugins/openchoreo-observability/src/hooks/useUpdateIncident.ts
  • plugins/openchoreo-observability/src/hooks/useWirelogsEnvironments.test.tsx
  • plugins/openchoreo-observability/src/hooks/useWirelogsEnvironments.ts
  • plugins/openchoreo-react/package.json
  • plugins/openchoreo-react/src/hooks/useAllEntitiesOfKinds.test.tsx
  • plugins/openchoreo-react/src/hooks/useAllEntitiesOfKinds.ts
  • plugins/openchoreo-react/src/hooks/useAsyncOperation.ts
  • plugins/openchoreo-react/src/hooks/useCreateComponentPath.ts
  • plugins/openchoreo-react/src/hooks/useCreateResourcePath.test.tsx
  • plugins/openchoreo-react/src/hooks/useCreateResourcePath.ts
  • plugins/openchoreo-react/src/hooks/useOpenChoreoCache.ts
  • plugins/openchoreo-react/src/hooks/useOpenChoreoInfiniteQuery.ts
  • plugins/openchoreo-react/src/hooks/useOpenChoreoMutation.test.tsx
  • plugins/openchoreo-react/src/hooks/useOpenChoreoMutation.ts
  • plugins/openchoreo-react/src/hooks/useOpenChoreoQuery.test.tsx
  • plugins/openchoreo-react/src/hooks/useOpenChoreoQuery.ts
  • plugins/openchoreo-react/src/hooks/useProjectEnvironments.test.tsx
  • plugins/openchoreo-react/src/hooks/useProjectEnvironments.ts
  • plugins/openchoreo-react/src/hooks/useProjects.test.ts
  • plugins/openchoreo-react/src/hooks/useProjects.ts
  • plugins/openchoreo-react/src/hooks/useSecretReferences.ts
  • plugins/openchoreo-react/src/index.ts
  • plugins/openchoreo-workflows/src/components/GenericWorkflowsPage/GenericWorkflowsPage.tsx
  • plugins/openchoreo-workflows/src/hooks/useNamespaces.ts
  • plugins/openchoreo-workflows/src/hooks/useWorkflowRunDetails.ts
  • plugins/openchoreo-workflows/src/hooks/useWorkflowRunLogs.ts
  • plugins/openchoreo-workflows/src/hooks/useWorkflowRuns.ts
  • plugins/openchoreo-workflows/src/hooks/useWorkflowSchema.ts
  • plugins/openchoreo-workflows/src/hooks/useWorkflows.ts
  • plugins/openchoreo/src/components/AccessControl/hooks/useActions.ts
  • plugins/openchoreo/src/components/AccessControl/hooks/useClusterRoleBindings.ts
  • plugins/openchoreo/src/components/AccessControl/hooks/useClusterRoles.test.tsx
  • plugins/openchoreo/src/components/AccessControl/hooks/useClusterRoles.ts
  • plugins/openchoreo/src/components/AccessControl/hooks/useHierarchyData.ts
  • plugins/openchoreo/src/components/AccessControl/hooks/useNamespaceRoleBindings.ts
  • plugins/openchoreo/src/components/AccessControl/hooks/useNamespaceRoles.ts
  • plugins/openchoreo/src/components/AccessControl/hooks/useUserTypes.ts
  • plugins/openchoreo/src/components/CellDiagram/CellDiagram.test.tsx
  • plugins/openchoreo/src/components/CellDiagram/useCellEnvironments.test.tsx
  • plugins/openchoreo/src/components/CellDiagram/useCellEnvironments.ts
  • plugins/openchoreo/src/components/ClusterDataplaneOverview/hooks/useClusterDataplaneEnvironments.ts
  • plugins/openchoreo/src/components/DataplaneOverview/hooks/useDataplaneEnvironments.ts
  • plugins/openchoreo/src/components/DeleteEntity/hooks/useEntityExistsCheck.ts
  • plugins/openchoreo/src/components/EnvironmentOverview/hooks/useEnvironmentDeployedComponents.ts
  • plugins/openchoreo/src/components/EnvironmentOverview/useEnvironmentPipelines.ts
  • plugins/openchoreo/src/components/Environments/Environments.test.tsx
  • plugins/openchoreo/src/components/Environments/Environments.tsx
  • plugins/openchoreo/src/components/Environments/EnvironmentsContext.tsx
  • plugins/openchoreo/src/components/Environments/OverviewCard/useDeploymentStatus.ts
  • plugins/openchoreo/src/components/Environments/PipelineDAG/DeployFlowCanvas.tsx
  • plugins/openchoreo/src/components/Environments/PipelineDAG/PipelineCanvas.test.tsx
  • plugins/openchoreo/src/components/Environments/PipelineDAG/PipelineCanvas.tsx
  • plugins/openchoreo/src/components/Environments/hooks/useAutoDeploy.ts
  • plugins/openchoreo/src/components/Environments/hooks/useAutoDeployUpdate.ts
  • plugins/openchoreo/src/components/Environments/hooks/useEnvironmentData.test.tsx
  • plugins/openchoreo/src/components/Environments/hooks/useEnvironmentData.ts
  • plugins/openchoreo/src/components/Environments/hooks/useIncidentsSummary.ts
  • plugins/openchoreo/src/components/Environments/hooks/useInvokeUrl.ts
  • plugins/openchoreo/src/components/Environments/hooks/useReleaseReadiness.ts
  • plugins/openchoreo/src/components/Environments/hooks/useReleases.ts
  • plugins/openchoreo/src/components/Environments/styles.ts
  • plugins/openchoreo/src/components/Projects/hooks/useDeploymentPipeline.ts
  • plugins/openchoreo/src/components/Projects/hooks/useEnvironments.ts
  • plugins/openchoreo/src/components/Projects/hooks/useProjectContentFacets.test.tsx
  • plugins/openchoreo/src/components/Projects/hooks/useProjectContentFacets.ts
  • plugins/openchoreo/src/components/ResourceDefinition/useResourceDefinition.ts
  • plugins/openchoreo/src/components/RuntimeLogs/OverviewCard/useLogsSummary.ts
  • plugins/openchoreo/src/components/Secrets/SecretsPage.tsx
  • plugins/openchoreo/src/components/Secrets/hooks/useSecrets.test.tsx
  • plugins/openchoreo/src/components/Secrets/hooks/useSecrets.ts
  • plugins/openchoreo/src/components/Workflows/OverviewCard/useWorkflowsSummary.ts

Comment thread plugins/openchoreo-ci/src/hooks/useWorkflowData.ts
Comment thread plugins/openchoreo-observability/src/hooks/useTraces.ts
Comment thread plugins/openchoreo-react/src/hooks/useOpenChoreoMutation.ts
Comment thread plugins/openchoreo-react/src/hooks/useProjects.ts Outdated
Comment thread plugins/openchoreo/src/components/ResourceDefinition/useResourceDefinition.ts Outdated
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>
@kaviththiranga kaviththiranga force-pushed the feat/response-cache-only branch from 49d1d2e to f527dc0 Compare July 9, 2026 05:21
…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>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
plugins/openchoreo-observability/src/hooks/useProjectRuntimeLogs.ts (1)

190-190: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

getCursor comment 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

📥 Commits

Reviewing files that changed from the base of the PR and between 49d1d2e and 1dd9cc1.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (115)
  • .changeset/response-cache-foundation.md
  • packages/app/package.json
  • packages/app/src/components/Root/Root.tsx
  • packages/app/src/queryClient.ts
  • packages/test-utils/package.json
  • packages/test-utils/src/index.ts
  • packages/test-utils/src/queryClientBareWrapper.tsx
  • packages/test-utils/src/queryClientWrapper.tsx
  • plugins/openchoreo-ci/src/components/Workflows/Workflows.test.tsx
  • plugins/openchoreo-ci/src/components/Workflows/Workflows.tsx
  • plugins/openchoreo-ci/src/hooks/useWorkflowData.ts
  • plugins/openchoreo-ci/src/hooks/useWorkflowRetention.ts
  • plugins/openchoreo-ci/src/hooks/useWorkflowRun.ts
  • plugins/openchoreo-observability/package.json
  • plugins/openchoreo-observability/src/components/Alerts/ObservabilityAlertsPage.tsx
  • plugins/openchoreo-observability/src/components/Incidents/ObservabilityProjectIncidentsPage.tsx
  • plugins/openchoreo-observability/src/components/Metrics/HTTPMetricsSection.tsx
  • plugins/openchoreo-observability/src/components/Metrics/ObservabilityMetricsPage.test.tsx
  • plugins/openchoreo-observability/src/components/Metrics/ObservabilityMetricsPage.tsx
  • plugins/openchoreo-observability/src/components/RuntimeEvents/ObservabilityRuntimeEventsPage.tsx
  • plugins/openchoreo-observability/src/components/RuntimeLogs/ObservabilityProjectRuntimeLogsPage.tsx
  • plugins/openchoreo-observability/src/components/RuntimeLogs/ObservabilityRuntimeLogsPage.tsx
  • plugins/openchoreo-observability/src/hooks/useComponentAlerts.ts
  • plugins/openchoreo-observability/src/hooks/useDataPlaneNetPolProvider.test.ts
  • plugins/openchoreo-observability/src/hooks/useDataPlaneNetPolProvider.ts
  • plugins/openchoreo-observability/src/hooks/useFinOpsReport.test.ts
  • plugins/openchoreo-observability/src/hooks/useFinOpsReport.ts
  • plugins/openchoreo-observability/src/hooks/useFinOpsReports.test.ts
  • plugins/openchoreo-observability/src/hooks/useFinOpsReports.ts
  • plugins/openchoreo-observability/src/hooks/useGetComponentsByProject.ts
  • plugins/openchoreo-observability/src/hooks/useMetrics.ts
  • plugins/openchoreo-observability/src/hooks/useProjectIncidents.ts
  • plugins/openchoreo-observability/src/hooks/useProjectRuntimeLogs.test.ts
  • plugins/openchoreo-observability/src/hooks/useProjectRuntimeLogs.ts
  • plugins/openchoreo-observability/src/hooks/useRCAReport.ts
  • plugins/openchoreo-observability/src/hooks/useRCAReports.ts
  • plugins/openchoreo-observability/src/hooks/useRuntimeEvents.test.ts
  • plugins/openchoreo-observability/src/hooks/useRuntimeEvents.ts
  • plugins/openchoreo-observability/src/hooks/useRuntimeLogs.ts
  • plugins/openchoreo-observability/src/hooks/useSpanDetails.ts
  • plugins/openchoreo-observability/src/hooks/useTraceSpans.ts
  • plugins/openchoreo-observability/src/hooks/useTraces.test.ts
  • plugins/openchoreo-observability/src/hooks/useTraces.ts
  • plugins/openchoreo-observability/src/hooks/useUpdateIncident.ts
  • plugins/openchoreo-observability/src/hooks/useWirelogsEnvironments.test.tsx
  • plugins/openchoreo-observability/src/hooks/useWirelogsEnvironments.ts
  • plugins/openchoreo-react/package.json
  • plugins/openchoreo-react/src/hooks/useAllEntitiesOfKinds.test.tsx
  • plugins/openchoreo-react/src/hooks/useAllEntitiesOfKinds.ts
  • plugins/openchoreo-react/src/hooks/useAsyncOperation.ts
  • plugins/openchoreo-react/src/hooks/useCreateComponentPath.ts
  • plugins/openchoreo-react/src/hooks/useCreateResourcePath.test.tsx
  • plugins/openchoreo-react/src/hooks/useCreateResourcePath.ts
  • plugins/openchoreo-react/src/hooks/useOpenChoreoCache.ts
  • plugins/openchoreo-react/src/hooks/useOpenChoreoInfiniteQuery.ts
  • plugins/openchoreo-react/src/hooks/useOpenChoreoMutation.test.tsx
  • plugins/openchoreo-react/src/hooks/useOpenChoreoMutation.ts
  • plugins/openchoreo-react/src/hooks/useOpenChoreoQuery.test.tsx
  • plugins/openchoreo-react/src/hooks/useOpenChoreoQuery.ts
  • plugins/openchoreo-react/src/hooks/useProjectEnvironments.test.tsx
  • plugins/openchoreo-react/src/hooks/useProjectEnvironments.ts
  • plugins/openchoreo-react/src/hooks/useProjects.test.ts
  • plugins/openchoreo-react/src/hooks/useProjects.ts
  • plugins/openchoreo-react/src/hooks/useSecretReferences.ts
  • plugins/openchoreo-react/src/index.ts
  • plugins/openchoreo-workflows/src/components/GenericWorkflowsPage/GenericWorkflowsPage.tsx
  • plugins/openchoreo-workflows/src/hooks/useNamespaces.ts
  • plugins/openchoreo-workflows/src/hooks/useWorkflowRunDetails.ts
  • plugins/openchoreo-workflows/src/hooks/useWorkflowRunLogs.ts
  • plugins/openchoreo-workflows/src/hooks/useWorkflowRuns.ts
  • plugins/openchoreo-workflows/src/hooks/useWorkflowSchema.ts
  • plugins/openchoreo-workflows/src/hooks/useWorkflows.ts
  • plugins/openchoreo/src/components/AccessControl/hooks/useActions.ts
  • plugins/openchoreo/src/components/AccessControl/hooks/useClusterRoleBindings.ts
  • plugins/openchoreo/src/components/AccessControl/hooks/useClusterRoles.test.tsx
  • plugins/openchoreo/src/components/AccessControl/hooks/useClusterRoles.ts
  • plugins/openchoreo/src/components/AccessControl/hooks/useHierarchyData.ts
  • plugins/openchoreo/src/components/AccessControl/hooks/useNamespaceRoleBindings.ts
  • plugins/openchoreo/src/components/AccessControl/hooks/useNamespaceRoles.ts
  • plugins/openchoreo/src/components/AccessControl/hooks/useUserTypes.ts
  • plugins/openchoreo/src/components/CellDiagram/CellDiagram.test.tsx
  • plugins/openchoreo/src/components/CellDiagram/useCellEnvironments.test.tsx
  • plugins/openchoreo/src/components/CellDiagram/useCellEnvironments.ts
  • plugins/openchoreo/src/components/ClusterDataplaneOverview/hooks/useClusterDataplaneEnvironments.ts
  • plugins/openchoreo/src/components/DataplaneOverview/hooks/useDataplaneEnvironments.ts
  • plugins/openchoreo/src/components/DeleteEntity/hooks/useEntityExistsCheck.ts
  • plugins/openchoreo/src/components/EnvironmentOverview/hooks/useEnvironmentDeployedComponents.ts
  • plugins/openchoreo/src/components/EnvironmentOverview/useEnvironmentPipelines.ts
  • plugins/openchoreo/src/components/Environments/Environments.test.tsx
  • plugins/openchoreo/src/components/Environments/Environments.tsx
  • plugins/openchoreo/src/components/Environments/EnvironmentsContext.tsx
  • plugins/openchoreo/src/components/Environments/OverviewCard/useDeploymentStatus.ts
  • plugins/openchoreo/src/components/Environments/PipelineDAG/DeployFlowCanvas.tsx
  • plugins/openchoreo/src/components/Environments/PipelineDAG/PipelineCanvas.test.tsx
  • plugins/openchoreo/src/components/Environments/PipelineDAG/PipelineCanvas.tsx
  • plugins/openchoreo/src/components/Environments/hooks/useAutoDeploy.ts
  • plugins/openchoreo/src/components/Environments/hooks/useAutoDeployUpdate.ts
  • plugins/openchoreo/src/components/Environments/hooks/useEnvironmentData.test.tsx
  • plugins/openchoreo/src/components/Environments/hooks/useEnvironmentData.ts
  • plugins/openchoreo/src/components/Environments/hooks/useIncidentsSummary.ts
  • plugins/openchoreo/src/components/Environments/hooks/useInvokeUrl.ts
  • plugins/openchoreo/src/components/Environments/hooks/useReleaseReadiness.ts
  • plugins/openchoreo/src/components/Environments/hooks/useReleases.ts
  • plugins/openchoreo/src/components/Environments/styles.ts
  • plugins/openchoreo/src/components/Projects/hooks/useDeploymentPipeline.ts
  • plugins/openchoreo/src/components/Projects/hooks/useEnvironments.ts
  • plugins/openchoreo/src/components/Projects/hooks/useProjectContentFacets.test.tsx
  • plugins/openchoreo/src/components/Projects/hooks/useProjectContentFacets.ts
  • plugins/openchoreo/src/components/ResourceDefinition/useResourceDefinition.ts
  • plugins/openchoreo/src/components/RuntimeLogs/OverviewCard/useLogsSummary.ts
  • plugins/openchoreo/src/components/Secrets/SecretsPage.tsx
  • plugins/openchoreo/src/components/Secrets/hooks/useSecrets.test.tsx
  • plugins/openchoreo/src/components/Secrets/hooks/useSecrets.ts
  • plugins/openchoreo/src/components/Workflows/OverviewCard/useWorkflowsSummary.ts
  • plugins/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

Comment thread plugins/openchoreo-observability/src/hooks/useProjectRuntimeLogs.ts
…oard widgets + linked-plane cards)

Signed-off-by: Kavith Lokuhewage <kaviththiranga@gmail.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 win

Same error check issue — cached platform details blanked on refetch failures.

The if (error) check returns the error UI even when data holds cached platform details from a previous successful fetch. A background refetch failure sets error while data remains 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 win

Same error check issue — cached data blanked on refetch failures.

The if (error) check blanks cached data on background refetch failures, same pattern as ObservabilityPlaneLinkedPlanesCard. Apply the !data guard:

🔧 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 win

Preserve cached planes on refetch errors. error can be set while data still holds the last successful planes, so if (error) replaces the populated card with the error state after a background refetch failure. Guard on !data here 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

📥 Commits

Reviewing files that changed from the base of the PR and between 1dd9cc1 and ac22309.

📒 Files selected for processing (6)
  • .changeset/cache-platform-plane-fetches.md
  • plugins/openchoreo/src/components/ClusterObservabilityPlaneOverview/ClusterObservabilityPlaneLinkedPlanesCard.tsx
  • plugins/openchoreo/src/components/ObservabilityPlaneOverview/ObservabilityPlaneLinkedPlanesCard.tsx
  • plugins/platform-engineer-core/src/components/AgentHealthWidget/AgentHealthWidget.tsx
  • plugins/platform-engineer-core/src/components/HomePagePlatformDetailsCard/HomePagePlatformDetailsCard.tsx
  • plugins/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>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
plugins/openchoreo-observability/src/hooks/useDataPlaneNetPolProvider.ts (1)

44-65: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Pass the AbortSignal through to fetchApi.fetch. useOpenChoreoQuery already 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

📥 Commits

Reviewing files that changed from the base of the PR and between ac22309 and 01a8338.

📒 Files selected for processing (83)
  • .changeset/background-refresh-indicators.md
  • .changeset/response-cache-foundation.md
  • packages/design-system/src/components/RefreshOverlay/RefreshOverlay.test.tsx
  • packages/design-system/src/components/RefreshOverlay/RefreshOverlay.tsx
  • packages/design-system/src/components/RefreshOverlay/index.ts
  • packages/design-system/src/index.ts
  • plugins/openchoreo-ci/src/hooks/useWorkflowData.ts
  • plugins/openchoreo-ci/src/hooks/useWorkflowRun.ts
  • plugins/openchoreo-observability/src/components/Alerts/ObservabilityAlertsPage.tsx
  • plugins/openchoreo-observability/src/components/CostAnalysis/CostAnalysisReport.tsx
  • plugins/openchoreo-observability/src/components/Incidents/ObservabilityProjectIncidentsPage.tsx
  • plugins/openchoreo-observability/src/components/Metrics/ObservabilityMetricsPage.tsx
  • plugins/openchoreo-observability/src/components/RCA/RCAReport.tsx
  • plugins/openchoreo-observability/src/components/Traces/ObservabilityTracesPage.tsx
  • plugins/openchoreo-observability/src/hooks/useComponentAlerts.ts
  • plugins/openchoreo-observability/src/hooks/useDataPlaneNetPolProvider.ts
  • plugins/openchoreo-observability/src/hooks/useFinOpsReport.ts
  • plugins/openchoreo-observability/src/hooks/useFinOpsReports.ts
  • plugins/openchoreo-observability/src/hooks/useGetComponentsByProject.ts
  • plugins/openchoreo-observability/src/hooks/useMetrics.ts
  • plugins/openchoreo-observability/src/hooks/useProjectIncidents.ts
  • plugins/openchoreo-observability/src/hooks/useProjectRuntimeLogs.ts
  • plugins/openchoreo-observability/src/hooks/useRCAReport.ts
  • plugins/openchoreo-observability/src/hooks/useRCAReports.ts
  • plugins/openchoreo-observability/src/hooks/useRuntimeEvents.ts
  • plugins/openchoreo-observability/src/hooks/useRuntimeLogs.ts
  • plugins/openchoreo-observability/src/hooks/useTraces.ts
  • plugins/openchoreo-observability/src/hooks/useWirelogsEnvironments.ts
  • plugins/openchoreo-react/src/components/SummaryWidgetWrapper/SummaryWidgetWrapper.tsx
  • plugins/openchoreo-react/src/hooks/useAllEntitiesOfKinds.ts
  • plugins/openchoreo-react/src/hooks/useCreateComponentPath.ts
  • plugins/openchoreo-react/src/hooks/useCreateResourcePath.ts
  • plugins/openchoreo-react/src/hooks/useOpenChoreoInfiniteQuery.ts
  • plugins/openchoreo-react/src/hooks/useOpenChoreoQuery.test.tsx
  • plugins/openchoreo-react/src/hooks/useOpenChoreoQuery.ts
  • plugins/openchoreo-react/src/hooks/useProjectEnvironments.ts
  • plugins/openchoreo-react/src/hooks/useSecretReferences.ts
  • plugins/openchoreo-workflows/src/components/GenericWorkflowsPage/GenericWorkflowsPage.tsx
  • plugins/openchoreo-workflows/src/components/WorkflowDetailsPage/WorkflowDetailsPage.tsx
  • plugins/openchoreo-workflows/src/components/WorkflowRunsContent/WorkflowRunsContent.tsx
  • plugins/openchoreo-workflows/src/hooks/useNamespaces.ts
  • plugins/openchoreo-workflows/src/hooks/useWorkflowRunDetails.ts
  • plugins/openchoreo-workflows/src/hooks/useWorkflowRunLogs.ts
  • plugins/openchoreo-workflows/src/hooks/useWorkflowRuns.ts
  • plugins/openchoreo-workflows/src/hooks/useWorkflowSchema.ts
  • plugins/openchoreo-workflows/src/hooks/useWorkflows.ts
  • plugins/openchoreo/src/components/AccessControl/ActionsTab/ActionsTab.tsx
  • plugins/openchoreo/src/components/AccessControl/hooks/useActions.ts
  • plugins/openchoreo/src/components/AccessControl/hooks/useClusterRoleBindings.ts
  • plugins/openchoreo/src/components/AccessControl/hooks/useClusterRoles.ts
  • plugins/openchoreo/src/components/AccessControl/hooks/useHierarchyData.ts
  • plugins/openchoreo/src/components/AccessControl/hooks/useNamespaceRoleBindings.ts
  • plugins/openchoreo/src/components/AccessControl/hooks/useNamespaceRoles.ts
  • plugins/openchoreo/src/components/AccessControl/hooks/useUserTypes.ts
  • plugins/openchoreo/src/components/CellDiagram/useCellEnvironments.test.tsx
  • plugins/openchoreo/src/components/CellDiagram/useCellEnvironments.ts
  • plugins/openchoreo/src/components/ClusterDataplaneOverview/ClusterDataplaneEnvironmentsCard.tsx
  • plugins/openchoreo/src/components/ClusterDataplaneOverview/hooks/useClusterDataplaneEnvironments.ts
  • plugins/openchoreo/src/components/ClusterObservabilityPlaneOverview/ClusterObservabilityPlaneLinkedPlanesCard.tsx
  • plugins/openchoreo/src/components/DataplaneOverview/DataplaneEnvironmentsCard.tsx
  • plugins/openchoreo/src/components/DataplaneOverview/hooks/useDataplaneEnvironments.ts
  • plugins/openchoreo/src/components/DeleteEntity/hooks/useEntityExistsCheck.ts
  • plugins/openchoreo/src/components/DeleteEntity/types.ts
  • plugins/openchoreo/src/components/EnvironmentOverview/EnvironmentDeployedComponentsCard.tsx
  • plugins/openchoreo/src/components/EnvironmentOverview/EnvironmentPipelinesTab.tsx
  • plugins/openchoreo/src/components/EnvironmentOverview/hooks/useEnvironmentDeployedComponents.ts
  • plugins/openchoreo/src/components/EnvironmentOverview/useEnvironmentPipelines.ts
  • plugins/openchoreo/src/components/Environments/hooks/useAutoDeploy.ts
  • plugins/openchoreo/src/components/Environments/hooks/useInvokeUrl.ts
  • plugins/openchoreo/src/components/Environments/hooks/useReleaseReadiness.ts
  • plugins/openchoreo/src/components/Environments/hooks/useReleases.ts
  • plugins/openchoreo/src/components/ObservabilityPlaneOverview/ObservabilityPlaneLinkedPlanesCard.tsx
  • plugins/openchoreo/src/components/Projects/ProjectContentsCard/ProjectContentsCard.tsx
  • plugins/openchoreo/src/components/Projects/hooks/useDeploymentPipeline.ts
  • plugins/openchoreo/src/components/Projects/hooks/useEnvironments.ts
  • plugins/openchoreo/src/components/Projects/hooks/useProjectContentFacets.ts
  • plugins/openchoreo/src/components/ResourceDefinition/useResourceDefinition.ts
  • plugins/openchoreo/src/components/Secrets/SecretsPage.tsx
  • plugins/openchoreo/src/components/Secrets/hooks/useSecrets.ts
  • plugins/openchoreo/src/components/Workflows/OverviewCard/useWorkflowsSummary.ts
  • plugins/platform-engineer-core/src/components/AgentHealthWidget/AgentHealthWidget.tsx
  • plugins/platform-engineer-core/src/components/HomePagePlatformDetailsCard/HomePagePlatformDetailsCard.tsx
  • plugins/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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Frontend response caching for the OpenChoreo portal

1 participant