Skip to content

fix: container/volume listing, Files for stopped containers, chart tooltips - #66

Merged
enegalan merged 3 commits into
mainfrom
fix/container-volume-files-tooltips
Jul 23, 2026
Merged

fix: container/volume listing, Files for stopped containers, chart tooltips#66
enegalan merged 3 commits into
mainfrom
fix/container-volume-files-tooltips

Conversation

@enegalan

@enegalan enegalan commented Jul 23, 2026

Copy link
Copy Markdown
Owner

Summary

  • Skip corrupt engine leftovers that appear in ps but cannot be inspected so Volumes and Containers lists no longer fail or show broken rows.
  • Browse Files on stopped containers via archive (cp + tar); map missing/not-running containers to clear HTTP errors.
  • Fix macOS volume stored-data browsing (guest paths) and chart tooltips (build History overlay; Stats styling).

Test plan

  • Open Volumes with a corrupt/uninspectable container present — list loads without error
  • Browse Stored data on a volume on macOS — files appear from the guest
  • Open Files on a stopped container — directory listing works
  • Open Inspect/Bind mounts for a missing container — “container not found” (not “operation failed”)
  • Build detail History tooltip floats above tabs; container Stats tooltips stay readable
  • Container Stats “only for running” note uses muted style (same as Exec)

Summary by CodeRabbit

  • Bug Fixes
    • Improved volume browsing on macOS and made volume screens more resilient to unavailable or corrupted engine entries.
    • Restored file browsing for stopped containers and improved messaging for missing, stopped, or invalid containers and mounts.
    • Fixed container history and statistics tooltip positioning and rendering.
    • Hid invalid container entries that cannot be inspected.
    • Standardized the notice shown when statistics are available only for running containers.
  • Tests
    • Added coverage for container error handling, file listing, and invalid container entries.

Skip corrupt engine leftovers in lists, browse stopped-container files via archive,
read volume paths from the guest on macOS, and fix chart tooltips / Stats styling.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@enegalan, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 37 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 4cc9ad82-4866-4075-88cc-2bdb19db87c0

📥 Commits

Reviewing files that changed from the base of the PR and between 894a88d and e3a3a19.

📒 Files selected for processing (4)
  • backend/internal/runtime/container_detail.go
  • backend/internal/runtime/volume_detail.go
  • backend/test/runtime/container_files_test.go
  • ui/lib/widgets/logs_panel.dart
📝 Walkthrough

Walkthrough

Runtime handling now distinguishes missing and stopped containers, supports browsing stopped-container files and guest volumes, filters invalid container entries, and makes volume inspection resilient. Build-history and stats charts use improved tooltips, while stopped-container and log presentation were adjusted.

Changes

Runtime container handling

Layer / File(s) Summary
Container error contracts and filtering
backend/internal/runtime/command_error.go, backend/internal/runtime/errors.go, backend/internal/httpkit/runtime_errors.go, backend/internal/runtime/container_detail.go, backend/internal/runtime/nerdctl.go, backend/test/runtime/*
Container-not-found and container-not-running errors are classified, exposed through HTTP responses, used during inspection, and invalid empty-name entries are skipped.
File and volume listing behavior
backend/internal/runtime/container_detail.go, backend/internal/runtime/volume_detail.go, backend/internal/runtime/guest_darwin.go, backend/test/runtime/container_files_test.go
Stopped containers can use archive-based file listing, tar output is normalized into immediate children, guest volume paths are resolved inside the guest, and volume usage inspection continues past individual failures.

UI chart and state presentation

Layer / File(s) Summary
Chart and container-state presentation
ui/lib/screens/build_detail_screen.dart, ui/lib/screens/container_detail_screen.dart, ui/lib/widgets/logs_panel.dart, CHANGELOG.md
Build-history tooltips use an overlay, stats charts render touch indicators and multi-series tooltips, stopped-container messaging is rendered by the stats tab, empty log text is cleared, and the fixes are documented.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant _BuildHistoryChart
  participant OverlayPortal
  participant _BuildHistoryTooltip
  User->>_BuildHistoryChart: Touch or hover a history point
  _BuildHistoryChart->>OverlayPortal: Show or update tooltip overlay
  OverlayPortal->>_BuildHistoryTooltip: Render selected build metrics
  _BuildHistoryTooltip-->>User: Display duration, steps, and cached status
Loading

Possibly related PRs

  • enegalan/calf#60: Introduced the guest command execution path used by macOS volume file listing.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.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 captures the main themes: container/volume listing, stopped-container file browsing, and chart tooltip fixes.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/container-volume-files-tooltips

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

🧹 Nitpick comments (2)
backend/internal/runtime/container_detail.go (1)

277-321: 🎯 Functional Correctness | 🔵 Trivial | ⚖️ Poor tradeoff

Field-count-based tar -tv parsing is fragile across tar variants.

Size/modified-time extraction relies on fixed field offsets (fields[4], fields[5:8]/fields[5:7]). BusyBox tar (common in Alpine-based images), GNU tar, and BSD tar format their -tv columns differently (e.g., combined vs. separate owner/group fields), so this could silently mis-parse size or modified time depending on the container's base image.

🤖 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 `@backend/internal/runtime/container_detail.go` around lines 277 - 321, Replace
the fixed-index size and modified-time parsing in the tar listing parser with
variant-tolerant extraction that handles BusyBox, GNU, and BSD tar column
layouts. Update the logic surrounding mode, name, size, and modified assignment
while preserving symlink handling, directory detection, and child deduplication.
backend/internal/runtime/volume_detail.go (1)

254-289: 🚀 Performance & Scalability | 🔵 Trivial | ⚖️ Poor tradeoff

Per-container inspect is now sequential — consider bounded concurrency for hosts with many containers.

The resiliency fix (continuing past a bad container instead of failing the whole batch) is correct, but it replaces one batched inspect with N sequential subprocess calls, adding latency to every volume-list request proportional to container count.

🤖 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 `@backend/internal/runtime/volume_detail.go` around lines 254 - 289, The
volumeNamesInUse function now inspects containers sequentially, causing latency
to scale linearly with container count. Add bounded concurrency around
inspectContainer and parseContainerMounts, limiting the number of workers or
in-flight subprocesses while preserving the current behavior of skipping
uninspectable containers and returning the collected volume names.
🤖 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 `@backend/internal/runtime/container_detail.go`:
- Around line 63-67: Update the JSON parsing flow around json.Unmarshal in the
container detail retrieval function to handle errors separately: return or wrap
the actual unmarshal error when parsing fails, and retain ErrContainerNotFound
only for a successfully parsed empty rows result. Preserve the existing
successful path for non-empty rows.
- Around line 146-147: Update the command construction in the container detail
flow to pass dirPath through the existing shellQuote helper instead of
fmt.Sprintf("%q") before executing via sh -c. Preserve the existing shellQuote
usage for cp arguments in the archive helper.

In `@backend/internal/runtime/volume_detail.go`:
- Around line 301-305: Update enrichVolumesInUse to preserve the error returned
by volumeNamesInUse and emit a diagnostic log containing the failure details
before applying the existing empty inUse fallback; keep the volume enrichment
flow unchanged after logging.

---

Nitpick comments:
In `@backend/internal/runtime/container_detail.go`:
- Around line 277-321: Replace the fixed-index size and modified-time parsing in
the tar listing parser with variant-tolerant extraction that handles BusyBox,
GNU, and BSD tar column layouts. Update the logic surrounding mode, name, size,
and modified assignment while preserving symlink handling, directory detection,
and child deduplication.

In `@backend/internal/runtime/volume_detail.go`:
- Around line 254-289: The volumeNamesInUse function now inspects containers
sequentially, causing latency to scale linearly with container count. Add
bounded concurrency around inspectContainer and parseContainerMounts, limiting
the number of workers or in-flight subprocesses while preserving the current
behavior of skipping uninspectable containers and returning the collected volume
names.
🪄 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 Plus

Run ID: 8490601f-3649-4886-aed2-10e86095ef88

📥 Commits

Reviewing files that changed from the base of the PR and between c081875 and 894a88d.

📒 Files selected for processing (13)
  • CHANGELOG.md
  • backend/internal/httpkit/runtime_errors.go
  • backend/internal/runtime/command_error.go
  • backend/internal/runtime/container_detail.go
  • backend/internal/runtime/errors.go
  • backend/internal/runtime/guest_darwin.go
  • backend/internal/runtime/nerdctl.go
  • backend/internal/runtime/volume_detail.go
  • backend/test/runtime/container_files_test.go
  • backend/test/runtime/nerdctl_test.go
  • ui/lib/screens/build_detail_screen.dart
  • ui/lib/screens/container_detail_screen.dart
  • ui/lib/widgets/logs_panel.dart

Comment thread backend/internal/runtime/container_detail.go
Comment thread backend/internal/runtime/container_detail.go Outdated
Comment thread backend/internal/runtime/volume_detail.go
…and concurrency

- Added detailed error messages for container inspection failures to aid debugging.
- Implemented bounded concurrency for volume inspection to improve performance and prevent overwhelming the system.
- Introduced new utility functions for parsing tar output, enhancing the handling of size and modification date extraction.
- Added comprehensive tests for the new parsing logic to ensure correctness across different tar output formats.
@enegalan
enegalan merged commit 2137388 into main Jul 23, 2026
3 checks passed
@enegalan
enegalan deleted the fix/container-volume-files-tooltips branch July 23, 2026 17:39
@coderabbitai coderabbitai Bot mentioned this pull request Aug 16, 2026
3 tasks
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.

1 participant