feat: add CLI progress tracker#21
Conversation
Replace try/except ValueError pattern with Path.is_relative_to() for cleaner path validation in _resolve_restore_path(). Also fix pre-existing issues in serve.py, skill.py, and pyproject.toml that were blocking tests. Added comprehensive tests for path traversal prevention including: - Normal relative paths - .openclaw prefix stripping - Absolute path rejection - Empty path rejection - Path traversal attempts (..) - Symlink escape prevention Closes #12 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughThis PR implements backup progress tracking with TTY-aware output, hardens restore path validation using safer path resolution methods, refactors the restore server lifecycle from global to explicit management, adds a new URL generation utility function, and extends test coverage for path validation edge cases. Changes
Sequence Diagram(s)No sequence diagrams generated. While the changes introduce progress instrumentation to the backup flow, the underlying control flow and component interactions remain straightforward and self-evident. Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes The PR spans multiple modules with heterogeneous change types: behavioral modifications to public APIs ( Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/ocbs/core.py`:
- Line 332: The non-interactive (non‑TTY) fallback branch that accepts
total_files: Optional[int] currently only logs progress every 100 files and
never includes the total count, causing silent runs for 1–99 files; update the
progress logic (the non‑TTY branch that checks total_files and the periodic log
that uses a 100-file interval) to (1) compute a dynamic interval like max(1,
total_files // 100) when total_files is provided so small runs still emit
progress, (2) include the total_files value in each progress message, and (3)
always emit a final completion log that includes the total_files (or total
processed when total_files is None); apply the same change to the other similar
fallback blocks referenced (the branches around the other occurrences you
noted).
In `@src/ocbs/serve.py`:
- Around line 844-856: The refactor broke the restore URL/port/path contract:
update format_restore_message(checkpoint_id, ...) and
generate_restore_url(checkpoint_id, ...) to produce the tokenized restore
endpoint that the server actually serves and that callers expect (i.e.,
/restore/<token>) and use the same default port as start_restore_server (3456)
and host parameter; ensure format_restore_message includes the generated URL so
callers in cli.py and skill.py show a usable link; keep function names
generate_restore_url and format_restore_message and accept host/port params so
callers need no other changes.
🪄 Autofix (Beta)
✅ Autofix completed
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 96903c5b-5028-4f91-8401-c178518e706f
📒 Files selected for processing (5)
pyproject.tomlsrc/ocbs/core.pysrc/ocbs/serve.pysrc/ocbs/skill.pytests/test_core.py
💤 Files with no reviewable changes (1)
- src/ocbs/skill.py
|
Note Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it. Fixes Applied SuccessfullyFixed 2 file(s) based on 2 unresolved review comments. Files modified:
Commit: The changes have been pushed to the Time taken: |
Fixed 2 file(s) based on 2 unresolved review comments. Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
Resolves #3. Adds a simple file output tracking logger to the backup command since the sub-agent failed due to auth expiration.
Summary by CodeRabbit
New Features
Improvements
Chores