Skip to content

Filter debug logs#392

Merged
brucetony merged 6 commits into
developfrom
389-filter-debug-logs
Jun 25, 2026
Merged

Filter debug logs#392
brucetony merged 6 commits into
developfrom
389-filter-debug-logs

Conversation

@brucetony

@brucetony brucetony commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features
    • Added a Logs button to analysis controls, automatically shown only when logs are available.
    • Added a Debug toggle to optionally hide/show DEBUG entries in log views.
    • Updated the refresh control to display a spinning icon while active.
  • Bug Fixes
    • Log download/copy and empty-state messaging now reflect the currently visible (optionally filtered) log entries.
    • Updated execution-status handling across the UI (progress, counters, severity tags, and related button behavior) to align with the new Executing/Executed states.

@brucetony brucetony linked an issue Jun 24, 2026 that may be closed by this pull request
@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7f74fe6e-44f2-4379-bee1-80329c964b9a

📥 Commits

Reviewing files that changed from the base of the PR and between c43d112 and cff3d41.

📒 Files selected for processing (1)
  • test/components/analysis/AnalysisControlButtons.spec.ts

📝 Walkthrough

Walkthrough

Analysis controls, status mapping, and table logic now use executing/executed pod statuses instead of running/finished. The analysis log viewer adds DEBUG filtering with a toggle, and related tests and mock responses are updated.

Changes

Pod status updates and derived analysis behavior

Layer / File(s) Summary
PodStatus values and derived status mapping
app/services/Api.ts, app/components/analysis/AnalysisControlButtons.vue, app/components/analysis/AnalysesTable.vue, app/components/analysis/ContainerCounter.vue, app/utils/count-analyses.ts, app/utils/status-tag-severity.ts
PodStatus changes to executing/executed, and the button-state, progress, counter, and severity logic now map those statuses in place of running/finished.
Logs button and DEBUG filter flow
app/components/analysis/AnalysisControlButtons.vue, app/components/analysis/logs/AnalysisLogCardContent.vue, app/components/analysis/logs/ContainerLogs.vue, app/components/analysis/logs/RefreshSwitch.vue
The Logs control uses logsActive, log cards accept showDebug and filter DEBUG entries for rendering/export, ContainerLogs wires the toggle through all cards, and the refresh toggle icon spins when active.
Status and log behavior tests
test/components/analysis/AnalysisTable.spec.ts, test/components/analysis/AnalysisUpdateButton.spec.ts, test/components/analysis/ContainerCounter.spec.ts, test/mockapi/handlers.ts, test/utils/count-analyses.test.ts, test/utils/status-tag-severity.test.ts, test/components/analysis/AnalysisControlButtons.spec.ts
Tests and mock pod-status payloads are updated to match the new executing/executed status values, the revised counter and severity mappings, and the logs button visibility assertions.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • PrivateAIM/node-ui#313: Overlaps with the Logs button state and visibility logic in AnalysisControlButtons.vue.
  • PrivateAIM/node-ui#361: Touches the same log viewer components, including AnalysisLogCardContent.vue and ContainerLogs.vue.
  • PrivateAIM/node-ui#377: Also changes the same analysis log rendering pipeline and prop flow in AnalysisLogCardContent.vue and ContainerLogs.vue.

Poem

🐇 Hop, hop, the statuses got new names today,
Executing and executed now lead the way.
DEBUG logs can hide or shine with a little toggle light,
And the refresh icon spins on active night.
This bunny thumps a happy drum —
clean logs and status flows have come!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main change: adding debug-log filtering across analysis log views.
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.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 389-filter-debug-logs

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: 1

Caution

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

⚠️ Outside diff range comments (1)
app/components/analysis/logs/AnalysisLogCardContent.vue (1)

158-180: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Download/copy buttons can become no-op when all entries are DEBUG-filtered.

downloadLogs/copyToClipboard now operate on the filtered displayed*Lines, but the header button groups remain gated on the raw nginxLines.length / analysisLines.length (lines 204 and 263). When a card contains only DEBUG entries and showDebug is off, the download/copy buttons still render but produce empty output (silently swallowed by the if (logs) guard) while the panel shows the empty state. Gate the button groups on the displayed lists for consistency.

♻️ Suggested template adjustment (lines 204 & 263)
-          <div class="log-btns" v-if="nginxLines.length">
+          <div class="log-btns" v-if="displayedNginxLines.length">
-          <div class="log-btns" v-if="analysisLines.length">
+          <div class="log-btns" v-if="displayedAnalysisLines.length">
🤖 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 `@app/components/analysis/logs/AnalysisLogCardContent.vue` around lines 158 -
180, The download/copy controls in AnalysisLogCardContent.vue are still rendered
based on the raw nginxLines/analysisLines counts, but the actions now use the
filtered displayedNginxLines/displayedAnalysisLines. Update the header
button-group visibility checks to use the displayed lists so the buttons
disappear when DEBUG filtering leaves no visible entries, keeping the UI
consistent with the empty state and avoiding no-op downloads/copies.
🤖 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 `@app/components/analysis/AnalysisControlButtons.vue`:
- Around line 140-146: The Logs button state list in AnalysisControlButtons.vue
is missing PodStatus.Running, so the link stays hidden for running analyses.
Update logsButtonActiveStates in the AnalysisControlButtons component to include
PodStatus.Running alongside the existing live/error states, keeping it aligned
with how analysisExecutionStatus is handled elsewhere in the UI.

---

Outside diff comments:
In `@app/components/analysis/logs/AnalysisLogCardContent.vue`:
- Around line 158-180: The download/copy controls in AnalysisLogCardContent.vue
are still rendered based on the raw nginxLines/analysisLines counts, but the
actions now use the filtered displayedNginxLines/displayedAnalysisLines. Update
the header button-group visibility checks to use the displayed lists so the
buttons disappear when DEBUG filtering leaves no visible entries, keeping the UI
consistent with the empty state and avoiding no-op downloads/copies.
🪄 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: e1590f2b-8e23-49ca-b287-068ab6e27f3b

📥 Commits

Reviewing files that changed from the base of the PR and between a16033a and 165f165.

📒 Files selected for processing (4)
  • app/components/analysis/AnalysisControlButtons.vue
  • app/components/analysis/logs/AnalysisLogCardContent.vue
  • app/components/analysis/logs/ContainerLogs.vue
  • app/components/analysis/logs/RefreshSwitch.vue

Comment thread app/components/analysis/AnalysisControlButtons.vue
@brucetony brucetony merged commit 2403153 into develop Jun 25, 2026
4 checks passed
@brucetony brucetony deleted the 389-filter-debug-logs branch June 25, 2026 08:16
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.

Filter debug logs

1 participant