Skip to content

OU-1272: fix config, refresh interval and expanded items memoization to avoid unnecessary re renders#361

Merged
openshift-merge-bot[bot] merged 1 commit intoopenshift:mainfrom
jgbernalp:fix-view-rerender
May 1, 2026
Merged

OU-1272: fix config, refresh interval and expanded items memoization to avoid unnecessary re renders#361
openshift-merge-bot[bot] merged 1 commit intoopenshift:mainfrom
jgbernalp:fix-view-rerender

Conversation

@jgbernalp
Copy link
Copy Markdown
Contributor

@jgbernalp jgbernalp commented Apr 21, 2026

This PR:

  • updates the log generation local container to use mingrammer
  • Optimizes re renders by memoizing
    • page components
    • virtualized table rows and making functions stable
    • configuration context

Summary by CodeRabbit

  • Bug Fixes

    • Honor the selected refresh delay on the refresh control
    • Prevent log queries from running until logging configuration is loaded
  • Performance

    • Smoother virtualized logs rendering and more stable scrolling
    • Improved row expansion handling to avoid unexpected collapses
  • Chores

    • Changed log parsing to derive level/severity from numeric status
    • Updated test log generator to emit JSON logs in the new format and destination

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Apr 21, 2026
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Apr 21, 2026

@jgbernalp: This pull request references OU-1272 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "5.0.0" version, but no target version was set.

Details

In response to this:

This PR:

  • updates the log generation local container to use mingrammer
  • Optimizes re renders by memoizing
  • page components
  • virtualized table rows and making functions stable
  • configuration context

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 21, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 3e71e994-3492-4215-b460-f527d36d028d

📥 Commits

Reviewing files that changed from the base of the PR and between 5b9db3b and 859040b.

📒 Files selected for processing (11)
  • hack/docker-compose/docker-compose.test.yml
  • hack/docker-compose/loki/promtail-config.yml
  • web/src/components/alerts/logs-alerts-metrics.tsx
  • web/src/components/logs-table.tsx
  • web/src/components/refresh-interval-dropdown.tsx
  • web/src/components/virtualized-logs-table.tsx
  • web/src/hooks/LogsConfigProvider.tsx
  • web/src/hooks/useLogs.ts
  • web/src/pages/logs-detail-page.tsx
  • web/src/pages/logs-dev-page.tsx
  • web/src/pages/logs-page.tsx
✅ Files skipped from review due to trivial changes (1)
  • web/src/hooks/useLogs.ts
🚧 Files skipped from review as they are similar to previous changes (9)
  • web/src/components/alerts/logs-alerts-metrics.tsx
  • web/src/components/refresh-interval-dropdown.tsx
  • web/src/pages/logs-detail-page.tsx
  • web/src/pages/logs-dev-page.tsx
  • hack/docker-compose/docker-compose.test.yml
  • web/src/pages/logs-page.tsx
  • hack/docker-compose/loki/promtail-config.yml
  • web/src/components/virtualized-logs-table.tsx
  • web/src/components/logs-table.tsx

Walkthrough

Updated test log-generator image/command and promtail pipeline to use JSON statuslevel templating; refactored log table/virtualized table to use refs, memoization, and stable caches; moved config fetch into provider on mount and replaced consumer async fetches with a synced config ref; memoized page wrappers and adjusted timers.

Changes

Cohort / File(s) Summary
Test infra: log generator
hack/docker-compose/docker-compose.test.yml
Swapped log-generator image to mingrammer/flog:0.4.3 and replaced its command/args; output file/path and generation behavior changed.
Promtail config
hack/docker-compose/loki/promtail-config.yml
Replaced regex extraction of "lvl" with a json stage reading status and a template stage that maps numeric statuslevel; system2 also templates severity_text from level.
Logs table & row expansion
web/src/components/logs-table.tsx
Switched expansion state to expandedItemsRef: MutableRefObject<Set<number>>, synchronized ref from state, used functional setExpandedItems updates, avoided in-place sort by copying data, memoized row factory and className callback, and updated VirtualizedLogsTable props.
Virtualized table body & cache
web/src/components/virtualized-logs-table.tsx
Created a stable CellMeasurerCache via useMemo, added a ref to force re-measurement and clearAll() on subsequent renders when expandedItems/showResources change; added optional props expandedItems and showResources to the exported component interface/signature.
Refresh interval timer
web/src/components/refresh-interval-dropdown.tsx
Initialized delay from selected option, removed separate restart helper, consolidated timer into one effect that clears/sets interval on delay change, and uses onRefreshRef to call the latest callback without restarting for callback changes.
Config provider & hook changes
web/src/hooks/LogsConfigProvider.tsx, web/src/hooks/useLogs.ts
Removed fetchConfig() from LogsContextType; provider now fetches config once on mount and exposes { config, configLoaded }. useLogs reads a configRef synced from context and uses it synchronously in getLogs/getMoreLogs/getVolume/getHistogram.
Pages: guard and memoization
web/src/pages/logs-page.tsx, web/src/pages/logs-dev-page.tsx, web/src/pages/logs-detail-page.tsx
runQuery now returns early when configLoaded is false; page wrapper components are wrapped with React.memo and assigned explicit displayNames.
Alerts metrics effect
web/src/components/alerts/logs-alerts-metrics.tsx
Added configLoaded (plus tenant and config.schema) to effect deps and short-circuited the getLogs effect until config is loaded.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

🚥 Pre-merge checks | ✅ 12
✅ Passed checks (12 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main objectives: memoization optimizations to avoid unnecessary re-renders, covering config, refresh interval, and expanded items handling across multiple components.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed Repository contains no Go test files or Ginkgo tests, making the check for stable and deterministic test names not applicable to this PR.
Test Structure And Quality ✅ Passed The custom check for Ginkgo test code quality is not applicable to this pull request. The PR modifies 11 files consisting of YAML configuration files and TypeScript/React components, but does not modify any Go test files.
Microshift Test Compatibility ✅ Passed The pull request does not add any new Ginkgo e2e tests. Git diff explicitly confirms no test files were modified.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The check is not applicable to this PR. It contains only TypeScript/React components, hooks, and YAML configuration files for a logging plugin—no Ginkgo e2e tests were added.
Topology-Aware Scheduling Compatibility ✅ Passed PR modifies only React/TypeScript UI components and Docker Compose configs; no Kubernetes manifests, operators, or scheduling constraints are modified or introduced.
Ote Binary Stdout Contract ✅ Passed The OTE Binary Stdout Contract check is not applicable to this pull request. The PR modifies only YAML configuration files and TypeScript/React web components, with no changes to Go code or process-level code.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The custom check applies to pull requests adding new Ginkgo e2e tests. This PR contains no such tests, only Docker Compose, YAML pipeline, and React component changes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 and usage tips.

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 21, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
web/src/components/refresh-interval-dropdown.tsx (1)

49-77: ⚠️ Potential issue | 🟡 Minor

Confirm the new mount-time refresh is intentional.

With delay now initialized from the persisted selection (line 49) and the effect triggering onRefreshRef.current?.() once whenever delay !== 0 (line 72), any page that mounts this dropdown with a stored non-OFF interval will fire an extra onRefresh on mount. Since logs-page also has its own useEffect([...configLoaded]) that calls runQuery() when the config loads, pages can end up refreshing twice on initial mount. This appears unintentional given the commit message focuses on "memoization to avoid unnecessary re renders." If the goal is only "refresh immediately when the user picks a new interval," consider gating the immediate call to skip the initial render:

🔧 Optional: skip immediate call on first mount
+  const isFirstRun = React.useRef(true);
   React.useEffect(() => {
     clearTimer();

     if (delay !== 0) {
-      onRefreshRef.current?.();
+      if (!isFirstRun.current) {
+        onRefreshRef.current?.();
+      }
       timer.current = setInterval(() => onRefreshRef.current?.(), delay);
     }
+    isFirstRun.current = false;

     return () => clearTimer();
   }, [delay]);

Additionally, the pattern on line 52 (onRefreshRef.current = onRefresh; during render) is a side effect during render. Consider wrapping it in React.useLayoutEffect or, on React 19.2+, prefer useEffectEvent to align with React guidelines.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@web/src/components/refresh-interval-dropdown.tsx` around lines 49 - 77, The
effect that watches delay causes an immediate onRefresh on mount when delay is
initialized from persisted state; to fix it, add a mounted/ref guard so the
useEffect that calls onRefreshRef.current only triggers the immediate onRefresh
when delay changes after mount (i.e., skip the first run), and move the
render-time assignment onRefreshRef.current = onRefresh into a
React.useLayoutEffect (or useEffectEvent if available) so you don't perform side
effects during render; update the existing symbols delay, timer, onRefreshRef,
the useEffect block, and the handleSelectedValue/setStoredRefreshInterval flow
to ensure selecting a new interval still triggers an immediate refresh but
initial mount does not.
🧹 Nitpick comments (3)
web/src/components/refresh-interval-dropdown.tsx (1)

51-52: This pattern is safe in React 17.0.2; concurrent rendering concern does not apply.

Line 52 mutates onRefreshRef.current during render, which would be problematic in React 18+ with concurrent rendering enabled. However, this project targets React 17.0.2, which does not enable concurrent rendering by default. The pattern is safe and intentionally avoids including onRefresh in the useEffect dependency array (line 77) to prevent unnecessary effect re-runs.

If the project plans to upgrade to React 18+, consider using React.useLayoutEffect() to move the mutation after commit:

  const onRefreshRef = React.useRef(onRefresh);
- onRefreshRef.current = onRefresh;
+ React.useLayoutEffect(() => {
+   onRefreshRef.current = onRefresh;
+ });

(Note: useEffectEvent mentioned in the original suggestion is not available in React 17 or 18; it was introduced in React 19.2.)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@web/src/components/refresh-interval-dropdown.tsx` around lines 51 - 52, The
current code assigns onRefreshRef.current = onRefresh during render which is
unsafe for concurrent rendering; update the component to set
onRefreshRef.current inside a lifecycle hook instead (e.g., move the assignment
into a React.useLayoutEffect or React.useEffect) so the ref mutation happens
after commit; locate the onRefreshRef and onRefresh symbols and the effect that
currently omits onRefresh (the effect around useEffect at/near the former line
77) and ensure the hook updates onRefreshRef.current without adding onRefresh to
unrelated effect dependency arrays.
web/src/components/logs-table.tsx (1)

171-218: Expansion correctness now relies on the parent row memoization always re-rendering.

Reading expandedItemsRef.current inside TableRowComponent means the row itself never subscribes to the expansion state — it only reflects the latest ref value if its parent happens to re-render. Today this works because RowMemo in virtualized-logs-table.tsx has a custom comparator that returns false (re-render) unless isScrolling. If that comparator is ever tightened, or if a row is expanded/collapsed while scrolling is true, the expand UI will silently desynchronize from state.

Since handleRowToggle is already stable, consider keeping expandedItems as a real prop (or a derived isExpanded per row) so memoization remains correctness-safe rather than relying on the memo comparator's current behavior.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@web/src/components/logs-table.tsx` around lines 171 - 218, The
TableRowComponent currently reads expansion state from expandedItemsRef.current
which makes expansion UI depend on parent re-renders; change TableRow so
expansion is passed as a real prop (e.g., add expandedItems:Set<number> or
better, an isExpanded:boolean computed per row) instead of reading
expandedItemsRef inside TableRowComponent, update TableRow signature and the
call sites (where RowMemo in virtualized-logs-table.tsx renders
TableRowComponent) to pass the per-row isExpanded and keep handleRowToggle as
the stable callback; this ensures TableRow/RowMemo correctness even if the
RowMemo comparator is tightened or scrolling is true.
web/src/components/virtualized-logs-table.tsx (1)

132-210: Consider invalidating the measurement cache when the dataset identity changes.

Memoizing cellMeasurementCache with [] provides good stability, but because keyMapper keys heights by rowIndex, entries persist across full dataset swaps (e.g., a new query result). Rows that are remeasured on next render will overwrite entries, but rows not currently visible retain their cached height, which may not match the new log at that position. When data fundamentally changes, call cellMeasurementCache.clearAll() to prevent stale heights from leaking into new rows.

♻️ One possible approach
   const cellMeasurementCache = React.useMemo(
     () =>
       new CellMeasurerCache({
         fixedWidth: true,
         minHeight: 1,
         keyMapper: (rowIndex) => rowIndex,
       }),
     [],
   );
+
+  // Reset cached row heights when the underlying dataset identity changes
+  // so stale heights from previous results don't leak into new rows at the same index.
+  React.useEffect(() => {
+    cellMeasurementCache.clearAll();
+  }, [data, cellMeasurementCache]);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@web/src/components/virtualized-logs-table.tsx` around lines 132 - 210, The
CellMeasurerCache (cellMeasurementCache) is memoized with [] but keys heights by
rowIndex (keyMapper), so when the underlying dataset (data) is replaced stale
heights can be reused; fix by invalidating the cache when dataset identity
changes: either include data (or a stable dataset id) in the memo dependencies
for the CellMeasurerCache creation or add a useEffect that watches data and
calls cellMeasurementCache.clearAll() whenever the data reference changes so
cached heights are cleared before VirtualTableBody/rowRenderer reuse them.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@hack/docker-compose/docker-compose.test.yml`:
- Around line 35-42: Remove the --overwrite flag from the command array in the
test docker-compose service (leave --loop, --format=json, --type=log,
--number=10, --delay=100ms, --output=/var/log/fake.log intact) so flog appends
instead of truncating /var/log/fake.log; this avoids disturbing promtail's
position tracking (positions.yaml) — if disk growth is a concern, implement
external rotation/cleanup instead of using --overwrite.

In `@web/src/components/logs-table.tsx`:
- Around line 301-312: The length-only check for dataChanged can miss updates
when streaming saturates (e.g., STREAMING_MAX_LOGS_LIMIT); change the logic in
the block using prevLogsDataRef, logsData, dataChanged, expandedItems and
setExpandedItems so it also resets expandedItems when the logsData reference
changes or when streaming append occurs: instead of only comparing
result.length, use reference inequality (prevLogsDataRef.current !== logsData)
or detect streaming appends (appendData/streamingResponse cases) to
setExpandedItems(new Set()). Update the comparison around prevLogsDataRef and
dataChanged to trigger a reset whenever logsData is a new object (or when
streaming append is detected) so expanded detail rows don’t point to rotated
entries.

In `@web/src/hooks/useLogs.ts`:
- Around line 272-273: The change made configRef.current read synchronous which
allows getLogs/getMoreLogs/getVolume/getHistogram to run against defaultConfig
before LogsConfigProvider finishes loading; revert to waiting for the real
config by reading via the provider's async loader or by guarding calls: update
the callers (or the hook wrappers around
getLogs/getMoreLogs/getVolume/getHistogram) to await logsContext.fetchConfig()
or check logsContext.configLoaded before using configRef.current, and
specifically ensure logs-alerts-metrics.tsx does not call getLogs without a
configLoaded guard; use the existing LogsConfigProvider symbols (configRef,
fetchConfig, configLoaded, getLogs/getMoreLogs/getVolume/getHistogram) to
implement the wait so queries never execute against defaultConfig.

---

Outside diff comments:
In `@web/src/components/refresh-interval-dropdown.tsx`:
- Around line 49-77: The effect that watches delay causes an immediate onRefresh
on mount when delay is initialized from persisted state; to fix it, add a
mounted/ref guard so the useEffect that calls onRefreshRef.current only triggers
the immediate onRefresh when delay changes after mount (i.e., skip the first
run), and move the render-time assignment onRefreshRef.current = onRefresh into
a React.useLayoutEffect (or useEffectEvent if available) so you don't perform
side effects during render; update the existing symbols delay, timer,
onRefreshRef, the useEffect block, and the
handleSelectedValue/setStoredRefreshInterval flow to ensure selecting a new
interval still triggers an immediate refresh but initial mount does not.

---

Nitpick comments:
In `@web/src/components/logs-table.tsx`:
- Around line 171-218: The TableRowComponent currently reads expansion state
from expandedItemsRef.current which makes expansion UI depend on parent
re-renders; change TableRow so expansion is passed as a real prop (e.g., add
expandedItems:Set<number> or better, an isExpanded:boolean computed per row)
instead of reading expandedItemsRef inside TableRowComponent, update TableRow
signature and the call sites (where RowMemo in virtualized-logs-table.tsx
renders TableRowComponent) to pass the per-row isExpanded and keep
handleRowToggle as the stable callback; this ensures TableRow/RowMemo
correctness even if the RowMemo comparator is tightened or scrolling is true.

In `@web/src/components/refresh-interval-dropdown.tsx`:
- Around line 51-52: The current code assigns onRefreshRef.current = onRefresh
during render which is unsafe for concurrent rendering; update the component to
set onRefreshRef.current inside a lifecycle hook instead (e.g., move the
assignment into a React.useLayoutEffect or React.useEffect) so the ref mutation
happens after commit; locate the onRefreshRef and onRefresh symbols and the
effect that currently omits onRefresh (the effect around useEffect at/near the
former line 77) and ensure the hook updates onRefreshRef.current without adding
onRefresh to unrelated effect dependency arrays.

In `@web/src/components/virtualized-logs-table.tsx`:
- Around line 132-210: The CellMeasurerCache (cellMeasurementCache) is memoized
with [] but keys heights by rowIndex (keyMapper), so when the underlying dataset
(data) is replaced stale heights can be reused; fix by invalidating the cache
when dataset identity changes: either include data (or a stable dataset id) in
the memo dependencies for the CellMeasurerCache creation or add a useEffect that
watches data and calls cellMeasurementCache.clearAll() whenever the data
reference changes so cached heights are cleared before
VirtualTableBody/rowRenderer reuse them.
🪄 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: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 88260fd0-54e0-4802-a045-7469735fdb82

📥 Commits

Reviewing files that changed from the base of the PR and between 754e091 and 2b1836d.

📒 Files selected for processing (10)
  • hack/docker-compose/docker-compose.test.yml
  • hack/docker-compose/loki/promtail-config.yml
  • web/src/components/logs-table.tsx
  • web/src/components/refresh-interval-dropdown.tsx
  • web/src/components/virtualized-logs-table.tsx
  • web/src/hooks/LogsConfigProvider.tsx
  • web/src/hooks/useLogs.ts
  • web/src/pages/logs-detail-page.tsx
  • web/src/pages/logs-dev-page.tsx
  • web/src/pages/logs-page.tsx

Comment thread hack/docker-compose/docker-compose.test.yml Outdated
Comment thread web/src/components/logs-table.tsx
Comment thread web/src/hooks/useLogs.ts
@jgbernalp jgbernalp marked this pull request as draft April 21, 2026 13:02
@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 21, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
web/src/pages/logs-page.tsx (1)

104-116: ⚠️ Potential issue | 🟠 Major

Apply the config-loaded guard to volume queries too.

runQuery now avoids calling config-backed APIs before config is loaded, but runVolume can still be triggered from LogsToolbar and call getVolume with the default/incomplete config.

Proposed fix
   const runVolume = () => {
+    if (!configLoaded) return;
+
     getVolume({ query, tenant, timeRange, schema });
   };
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@web/src/pages/logs-page.tsx` around lines 104 - 116, runVolume currently
calls getVolume regardless of configLoaded; add the same configLoaded guard used
in runQuery so volume queries don't run before config is ready. Modify the
runVolume function to return early when configLoaded is false (like runQuery
does), then call getVolume({ query, tenant, timeRange, schema }) only when
configLoaded is true; this mirrors the protection already applied for
runQuery/getLogs and runQuery/getHistogram.
web/src/pages/logs-detail-page.tsx (1)

134-146: ⚠️ Potential issue | 🟠 Major

Guard volume queries until config is loaded.

This page now protects logs and histogram requests, but runVolume can still execute before configLoaded and use the default config via getVolume.

Proposed fix
   const runVolume = () => {
+    if (!configLoaded) return;
+
     getVolume({ query, tenant: tenant.current, namespace, timeRange, schema });
   };
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@web/src/pages/logs-detail-page.tsx` around lines 134 - 146, The runVolume
function should guard against running before configuration is ready: add the
same configLoaded check used in runQuery so runVolume returns early when
configLoaded is false. Update the runVolume implementation (the function that
calls getVolume) to only call getVolume({ query, tenant: tenant.current,
namespace, timeRange, schema }) when configLoaded is true, mirroring the
protection around runQuery and getHistogram to prevent using default config.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@web/src/components/alerts/logs-alerts-metrics.tsx`:
- Around line 24-32: The effect in the component uses tenant and config.schema
inside its body (when calling getLogs) but they are not listed in the dependency
array, so update the useEffect dependencies to include tenant and config.schema
(or getSchema(config.schema) if you prefer tracking the derived schema)
alongside rule?.query, timeRange, and configLoaded; ensure the symbols mentioned
are used: useEffect, getLogs, rule?.query, timeRange, configLoaded, tenant,
config.schema, and getSchema so the effect re-runs whenever tenant or schema
change.

---

Outside diff comments:
In `@web/src/pages/logs-detail-page.tsx`:
- Around line 134-146: The runVolume function should guard against running
before configuration is ready: add the same configLoaded check used in runQuery
so runVolume returns early when configLoaded is false. Update the runVolume
implementation (the function that calls getVolume) to only call getVolume({
query, tenant: tenant.current, namespace, timeRange, schema }) when configLoaded
is true, mirroring the protection around runQuery and getHistogram to prevent
using default config.

In `@web/src/pages/logs-page.tsx`:
- Around line 104-116: runVolume currently calls getVolume regardless of
configLoaded; add the same configLoaded guard used in runQuery so volume queries
don't run before config is ready. Modify the runVolume function to return early
when configLoaded is false (like runQuery does), then call getVolume({ query,
tenant, timeRange, schema }) only when configLoaded is true; this mirrors the
protection already applied for runQuery/getLogs and runQuery/getHistogram.
🪄 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: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 349efc66-7b71-41ca-92a0-bc39a93f6e5c

📥 Commits

Reviewing files that changed from the base of the PR and between 2b1836d and 5b9db3b.

📒 Files selected for processing (11)
  • hack/docker-compose/docker-compose.test.yml
  • hack/docker-compose/loki/promtail-config.yml
  • web/src/components/alerts/logs-alerts-metrics.tsx
  • web/src/components/logs-table.tsx
  • web/src/components/refresh-interval-dropdown.tsx
  • web/src/components/virtualized-logs-table.tsx
  • web/src/hooks/LogsConfigProvider.tsx
  • web/src/hooks/useLogs.ts
  • web/src/pages/logs-detail-page.tsx
  • web/src/pages/logs-dev-page.tsx
  • web/src/pages/logs-page.tsx
✅ Files skipped from review due to trivial changes (1)
  • web/src/components/refresh-interval-dropdown.tsx
🚧 Files skipped from review as they are similar to previous changes (7)
  • hack/docker-compose/docker-compose.test.yml
  • hack/docker-compose/loki/promtail-config.yml
  • web/src/hooks/useLogs.ts
  • web/src/pages/logs-dev-page.tsx
  • web/src/components/virtualized-logs-table.tsx
  • web/src/hooks/LogsConfigProvider.tsx
  • web/src/components/logs-table.tsx

Comment thread web/src/components/alerts/logs-alerts-metrics.tsx Outdated
…unnecessary re renders

Signed-off-by: Gabriel Bernal <gbernal@redhat.com>
@jgbernalp jgbernalp marked this pull request as ready for review April 21, 2026 14:17
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 21, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 21, 2026

@jgbernalp: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@jgbernalp
Copy link
Copy Markdown
Contributor Author

/cherry-pick release-6.2

@openshift-cherrypick-robot
Copy link
Copy Markdown

@jgbernalp: once the present PR merges, I will cherry-pick it on top of release-6.2 in a new PR and assign it to you.

Details

In response to this:

/cherry-pick release-6.2

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@jgbernalp
Copy link
Copy Markdown
Contributor Author

/cherry-pick release-6.1

@openshift-cherrypick-robot
Copy link
Copy Markdown

@jgbernalp: once the present PR merges, I will cherry-pick it on top of release-6.1 in a new PR and assign it to you.

Details

In response to this:

/cherry-pick release-6.1

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@PeterYurkovich
Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Apr 27, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 27, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jgbernalp, PeterYurkovich

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [PeterYurkovich,jgbernalp]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@etmurasaki
Copy link
Copy Markdown
Contributor

/label qe-approved

@openshift-ci openshift-ci Bot added the qe-approved Signifies that QE has signed off on this PR label May 1, 2026
@openshift-merge-bot openshift-merge-bot Bot merged commit 68b12d5 into openshift:main May 1, 2026
7 checks passed
@openshift-cherrypick-robot
Copy link
Copy Markdown

@jgbernalp: new pull request created: #364

Details

In response to this:

/cherry-pick release-6.2

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-cherrypick-robot
Copy link
Copy Markdown

@jgbernalp: new pull request created: #365

Details

In response to this:

/cherry-pick release-6.1

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. qe-approved Signifies that QE has signed off on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants