feat: gate cloud copies on global provider sync - #177
Conversation
|
Warning Review limit reached
Next review available in: 2 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughFile Provider 전역 동기화 증거를 수집하고 상태를 판정하는 모듈을 추가했습니다. iCloud 외 제공자의 클라우드 복사 계획과 실행은 Changes제공자 전역 동기화 게이트
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related PRs
Sequence Diagram(s)sequenceDiagram
participant 계획생성
participant provider_global_sync
participant fileproviderctl
participant 복사실행
계획생성->>provider_global_sync: inspect_new_copy_admission 호출
provider_global_sync->>fileproviderctl: 동기화 덤프 요청
fileproviderctl-->>provider_global_sync: 전역 동기화 출력 반환
provider_global_sync-->>계획생성: 상태 notice 반환
복사실행->>provider_global_sync: require_new_copy_admission 호출
provider_global_sync-->>복사실행: 허용 또는 오류 반환
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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: 4
🧹 Nitpick comments (1)
src-tauri/src/provider_global_sync.rs (1)
314-322: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win인자 없는
format!을 제거하십시오.
format!에 포맷 인자가 없습니다.clippy::useless_format경고가 발생합니다. 문자열 리터럴을 직접 사용하십시오.♻️ 제안 수정
- let dump = format!( - "com.google.drivefs.fpext\nsync engine state:\n temporarily disconnected: yes\n" - ); - let report = parse_dump(CloudProvider::GoogleDrive, &dump).unwrap(); + let dump = "com.google.drivefs.fpext\nsync engine state:\n temporarily disconnected: yes\n"; + let report = parse_dump(CloudProvider::GoogleDrive, dump).unwrap();🤖 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 `@src-tauri/src/provider_global_sync.rs` around lines 314 - 322, In the test disconnected_provider_is_error_and_fails_closed, replace the argument-free format! call used to create dump with the equivalent direct string literal, preserving the existing dump contents and assertions.
🤖 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 `@src-tauri/src/commands.rs`:
- Around line 1310-1314: Update the cloud review flow around
cloud_plan_for_inputs and create_cloud_candidate_receipt to run
provider_global_sync::inspect_new_copy_admission only once and reuse its result
for both operations. Move the remaining synchronous provider-global-sync work
into spawn_blocking so the async runtime worker is not blocked, and avoid
holding the cloud_review mutex while that blocking work executes. Preserve the
existing error mapping and require_new_copy_admission validation.
In `@src-tauri/src/provider_global_sync.rs`:
- Around line 95-100: The pending indexable count in parse_dump currently
preserves the first parsed value, so an earlier zero suppresses later positive
counts; replace the or_else accumulation in
src-tauri/src/provider_global_sync.rs lines 95-100 with maximum-value
accumulation while retaining the existing parsing behavior. The expectations in
src-tauri/tests/provider_global_sync_duplicate_count.rs lines 4-21 are correct
and require no direct change; verify they pass after updating parse_dump.
- Around line 178-211: Update the reader flow around MAX_DUMP_BYTES and the
reader thread to detect when the output reaches the byte limit, treating that
condition as truncated output. After joining the reader, return the existing
probe failure error instead of parsing the bytes whenever truncation is
detected, while preserving normal parsing for outputs below the limit.
- Around line 101-117: Normalize each trimmed dump line by removing the optional
“+ ” prefix before evaluating it in the parsing logic. Update the needs-indexing
comparisons and errors: strip_prefix handling in the relevant parser function,
while preserving existing error matching and count behavior for lines without
the prefix.
---
Nitpick comments:
In `@src-tauri/src/provider_global_sync.rs`:
- Around line 314-322: In the test
disconnected_provider_is_error_and_fails_closed, replace the argument-free
format! call used to create dump with the equivalent direct string literal,
preserving the existing dump contents and assertions.
🪄 Autofix
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: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: ec1ae7b8-b90f-471b-acb8-823aca8f70d6
📒 Files selected for processing (5)
src-tauri/src/bin/disksage-cloud-plan.rssrc-tauri/src/commands.rssrc-tauri/src/lib.rssrc-tauri/src/provider_global_sync.rssrc-tauri/tests/provider_global_sync_duplicate_count.rs
|
@opencode-agent @cwl-noema-review Formal review-only request for exact current head |
Summary
Validation
cargo test --manifest-path src-tauri/Cargo.toml provider_global_sync --libdisksage-cloud-planruns for OneDrive, Google Drive, and iCloudcodegraph syncThis is intentionally copy-admission only; existing-copy adoption and source eviction still require their existing independent evidence gates.
Summary by CodeRabbit