Skip to content

removed the log summary -different than ai-summary#1704

Merged
himanshudube97 merged 2 commits into
mainfrom
removing-unused-logsummary-endpoint
Mar 16, 2026
Merged

removed the log summary -different than ai-summary#1704
himanshudube97 merged 2 commits into
mainfrom
removing-unused-logsummary-endpoint

Conversation

@himanshudube97

@himanshudube97 himanshudube97 commented Mar 13, 2026

Copy link
Copy Markdown
Member

Currently the logs components are in the flow_logs.tsx and connectionSyncHistory.tsx files.

Summary by CodeRabbit

  • Chores

    • Removed log summary feature from flow run history. Logs now display directly.
    • Removed associated components, types, and configuration related to log summaries.
  • Tests

    • Removed test files for log summary components.

@coderabbitai

coderabbitai Bot commented Mar 13, 2026

Copy link
Copy Markdown

Walkthrough

This PR removes the log summary feature across the codebase, including summary-related components, types, tests, and configuration, simplifying the flow run history view to use only standard log display.

Changes

Cohort / File(s) Summary
Log Summary Components
src/components/Logs/LogSummaryCard.tsx, src/components/Logs/LogSummaryBlock.tsx
Deleted entire files removing LogSummary type, LogSummaryCard component, and internal LogSummaryBlock implementation with task-specific rendering logic.
Log Summary Tests
src/components/Logs/__tests__/LogSummaryBlock.test.tsx
Deleted entire test file removing unit tests for LogSummaryBlock component covering dbt run/test scenarios.
Feature Integration
src/components/Flows/SingleFlowRunHistory.tsx
Removed log summary feature: deleted enableLogSummaries state/imports, dropped conditional rendering logic, removed LogSummaryCard usage, now exclusively renders LogCard with logs data.
Configuration
src/config/constant.ts
Removed enableLogSummaries export constant that previously derived from NEXT_PUBLIC_ENABLE_LOG_SUMMARIES environment variable.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~18 minutes

Possibly related PRs

  • webapp#1644: Adds/changes AI-summary display for DBT test failures, which directly conflicts with this PR that removes the entire log-summary feature.

Suggested reviewers

  • fatchat
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is vague and confusing, using phrases like 'different than ai-summary' that don't clearly convey what log summary feature is being removed. Clarify the title to be more specific, such as 'Remove log summary feature and related components' or 'Remove LogSummaryCard and LogSummaryBlock components'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch removing-unused-logsummary-endpoint
📝 Coding Plan
  • Generate coding plan for human review comments

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.

@himanshudube97 himanshudube97 self-assigned this Mar 13, 2026

@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 (2)
src/components/Flows/SingleFlowRunHistory.tsx (2)

80-80: ⚠️ Potential issue | 🟡 Minor

Suspicious empty display value.

display="" is an empty string which is likely unintentional. Should this be display="flex" or display="block" to work with the gap property?

🐛 Proposed fix
-    <Box display="" gap="10px" sx={{ marginTop: '20px' }} data-testid="single-flow-run-logs">
+    <Box display="flex" flexDirection="column" gap="10px" sx={{ marginTop: '20px' }} data-testid="single-flow-run-logs">

Note: gap only applies when using flex or grid layout.

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

In `@src/components/Flows/SingleFlowRunHistory.tsx` at line 80, In
SingleFlowRunHistory.tsx the Box element rendered with data-testid
"single-flow-run-logs" has an empty display prop (display="") which prevents the
gap from applying; update the Box's display prop to a valid layout such as
"flex" (or "grid") so gap="10px" takes effect, e.g., change the display value on
that Box component to "flex" to enable the spacing behavior.

29-96: ⚠️ Potential issue | 🟡 Minor

Update stale test case name that references removed functionality.

The test case 'calls errorToast when fetchLogSummaries fails' in src/components/Flows/__tests__/SingleFlowRunHistory.test.tsx (lines 81-87) has a misleading name. It references fetchLogSummaries, which no longer exists in the component. The test implementation correctly tests httpGet error handling, but the name should be updated to reflect this—for example, 'calls errorToast when fetchLogs fails' (or consider removing it if it duplicates the previous test).

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

In `@src/components/Flows/SingleFlowRunHistory.tsx` around lines 29 - 96, Rename
the misleading test title that references removed fetchLogSummaries to reflect
the current behavior: in the SingleFlowRunHistory test suite update the test
name string "calls errorToast when fetchLogSummaries fails" to "calls errorToast
when fetchLogs fails" (or remove the test if it duplicates another); ensure the
test still asserts httpGet error handling and errorToast invocation for the
fetchLogs flowRun/error path.
🧹 Nitpick comments (2)
src/components/Flows/SingleFlowRunHistory.tsx (2)

38-71: Redundant nested async IIFE.

fetchLogs is already an async function, so wrapping the body in another async IIFE is unnecessary. The pattern adds indentation and complexity without benefit.

♻️ Proposed simplification
  const fetchLogs = async () => {
    if (!flowRun) {
      return;
    }
    setExpandLogs(true);
-    (async () => {
-      try {
-        const data = await httpGet(
-          session,
-          `prefect/flow_runs/${flowRun.id}/logs?offset=${Math.max(
-            flowRunOffset,
-            0
-          )}&limit=${flowRunLogsOffsetLimit}`
-        );
-
-        if (data?.logs?.logs && data.logs.logs.length >= 0) {
-          const newlogs = flowRunOffset <= 0 ? data.logs.logs : logs.concat(data.logs.logs);
-          setLogs(newlogs);
-
-          // increment the offset by 200 if we have more to fetch
-          // otherwise set it to -1 i.e. no more logs to show
-          const offsetToUpdate =
-            data.logs.logs.length >= flowRunLogsOffsetLimit
-              ? flowRunOffset + flowRunLogsOffsetLimit
-              : -1;
-          setFlowRunOffset(offsetToUpdate);
-          setRerender(!rerender);
-        }
-      } catch (err: any) {
-        console.error(err);
-        errorToast(err.message, [], globalContext);
-      }
-    })();
+    try {
+      const data = await httpGet(
+        session,
+        `prefect/flow_runs/${flowRun.id}/logs?offset=${Math.max(
+          flowRunOffset,
+          0
+        )}&limit=${flowRunLogsOffsetLimit}`
+      );
+
+      if (data?.logs?.logs && data.logs.logs.length >= 0) {
+        const newlogs = flowRunOffset <= 0 ? data.logs.logs : logs.concat(data.logs.logs);
+        setLogs(newlogs);
+
+        // increment the offset by 200 if we have more to fetch
+        // otherwise set it to -1 i.e. no more logs to show
+        const offsetToUpdate =
+          data.logs.logs.length >= flowRunLogsOffsetLimit
+            ? flowRunOffset + flowRunLogsOffsetLimit
+            : -1;
+        setFlowRunOffset(offsetToUpdate);
+      }
+    } catch (err: any) {
+      console.error(err);
+      errorToast(err.message, [], globalContext);
+    }
  };
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/Flows/SingleFlowRunHistory.tsx` around lines 38 - 71, The
fetchLogs function contains a redundant nested async IIFE; remove the inner
immediately-invoked async function and move its try/catch body directly into the
async fetchLogs function so the await httpGet(...) call and subsequent logic
(checks on data?.logs?.logs, building newlogs with logs.concat, setLogs,
computing offsetToUpdate and calling setFlowRunOffset/setRerender) execute
directly inside fetchLogs; keep existing error handling (console.error and
errorToast) and all referenced calls (httpGet, setLogs, setFlowRunOffset,
setRerender, setExpandLogs) intact.

33-33: rerender state appears to be dead code.

The rerender state is toggled at line 64 (setRerender(!rerender)) but is never read anywhere in the component. If this was previously used for log summary logic, consider removing it as part of this cleanup.

🧹 Proposed cleanup
  const [rerender, setRerender] = useState<boolean>(false);

If truly unused, remove the state entirely and the setRerender(!rerender) call at line 64.

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

In `@src/components/Flows/SingleFlowRunHistory.tsx` at line 33, The "rerender"
useState in the SingleFlowRunHistory component is dead code; remove the const
[rerender, setRerender] = useState<boolean>(false) declaration and delete the
setRerender(!rerender) toggle call (the update at the location that toggles
rerender) so that no unused state remains; ensure no other references to
"rerender" or "setRerender" exist in the component after removal.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@src/components/Flows/SingleFlowRunHistory.tsx`:
- Line 80: In SingleFlowRunHistory.tsx the Box element rendered with data-testid
"single-flow-run-logs" has an empty display prop (display="") which prevents the
gap from applying; update the Box's display prop to a valid layout such as
"flex" (or "grid") so gap="10px" takes effect, e.g., change the display value on
that Box component to "flex" to enable the spacing behavior.
- Around line 29-96: Rename the misleading test title that references removed
fetchLogSummaries to reflect the current behavior: in the SingleFlowRunHistory
test suite update the test name string "calls errorToast when fetchLogSummaries
fails" to "calls errorToast when fetchLogs fails" (or remove the test if it
duplicates another); ensure the test still asserts httpGet error handling and
errorToast invocation for the fetchLogs flowRun/error path.

---

Nitpick comments:
In `@src/components/Flows/SingleFlowRunHistory.tsx`:
- Around line 38-71: The fetchLogs function contains a redundant nested async
IIFE; remove the inner immediately-invoked async function and move its try/catch
body directly into the async fetchLogs function so the await httpGet(...) call
and subsequent logic (checks on data?.logs?.logs, building newlogs with
logs.concat, setLogs, computing offsetToUpdate and calling
setFlowRunOffset/setRerender) execute directly inside fetchLogs; keep existing
error handling (console.error and errorToast) and all referenced calls (httpGet,
setLogs, setFlowRunOffset, setRerender, setExpandLogs) intact.
- Line 33: The "rerender" useState in the SingleFlowRunHistory component is dead
code; remove the const [rerender, setRerender] = useState<boolean>(false)
declaration and delete the setRerender(!rerender) toggle call (the update at the
location that toggles rerender) so that no unused state remains; ensure no other
references to "rerender" or "setRerender" exist in the component after removal.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 41a8348a-afc8-4c8d-8c8c-dcf9327591db

📥 Commits

Reviewing files that changed from the base of the PR and between 58f17d9 and 3f18b2a.

📒 Files selected for processing (5)
  • src/components/Flows/SingleFlowRunHistory.tsx
  • src/components/Logs/LogSummaryBlock.tsx
  • src/components/Logs/LogSummaryCard.tsx
  • src/components/Logs/__tests__/LogSummaryBlock.test.tsx
  • src/config/constant.ts
💤 Files with no reviewable changes (4)
  • src/components/Logs/tests/LogSummaryBlock.test.tsx
  • src/components/Logs/LogSummaryBlock.tsx
  • src/components/Logs/LogSummaryCard.tsx
  • src/config/constant.ts

@sentry

sentry Bot commented Mar 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.39%. Comparing base (58f17d9) to head (3f18b2a).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1704      +/-   ##
==========================================
+ Coverage   75.32%   75.39%   +0.06%     
==========================================
  Files         107      105       -2     
  Lines        7991     7936      -55     
  Branches     1948     1925      -23     
==========================================
- Hits         6019     5983      -36     
+ Misses       1847     1830      -17     
+ Partials      125      123       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@himanshudube97 himanshudube97 merged commit cfce3aa into main Mar 16, 2026
6 checks passed
@himanshudube97 himanshudube97 deleted the removing-unused-logsummary-endpoint branch March 16, 2026 07:34
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.

2 participants