Harden server parsing and shell command handling#1229
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughServer metric parsing now handles truncated or malformed input, irregular whitespace, and non-positive network time deltas. Container lifecycle and UI commands quote shell arguments through a shared helper. Persistent shell execution buffers stderr separately, ignores stderr completion markers for exit status, and includes stderr in command output. Tests cover these parsing, quoting, timing, and shell-output behaviors. Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 `@lib/data/model/server/conn.dart`:
- Around line 23-26: Update the Conn parsing flow to parse the MaxConn and
AttemptFails tokens before constructing Conn, using the existing index symbols
_maxConnIndex and _attemptFailsIndex. Return null when either int parse fails,
and pass the validated parsed values to Conn instead of defaulting invalid
tokens to zero.
In `@lib/data/model/server/cpu.dart`:
- Around line 138-141: Update the CPU row parsing loop around the item trimming
and matches-length check so blank lines are skipped with continue rather than
terminating parsing. Preserve termination only for a non-CPU record when needed
to avoid consuming later /proc/stat sections, while continuing to parse
subsequent valid CPU rows.
🪄 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 UI
Review profile: CHILL
Plan: Pro
Run ID: 139ef35f-396a-482f-b2d2-19a8f055d9fc
📒 Files selected for processing (11)
lib/data/model/server/conn.dartlib/data/model/server/cpu.dartlib/data/model/server/net_speed.dartlib/data/provider/container.dartlib/data/ssh/persistent_shell.dartlib/view/page/container/actions.darttest/conn_test.darttest/container_test.darttest/cpu_test.darttest/net_speed_test.darttest/persistent_shell_test.dart
Summary
Testing
Conn.parse,SingleCpuCore.parse,NetSpeed,shellSingleQuote, andPersistentShellSummary by CodeRabbit