Add VFS cache status API endpoints for file manager integration#8
Add VFS cache status API endpoints for file manager integration#8
Conversation
- Implement 3 new RC endpoints: vfs/status, vfs/file-status, vfs/dir-status - Add VFSStatusCache() and VFSStatusCacheWithPercentage() methods to Item - Enhance writeback system with Get() and IsUploading() methods - Support 5 cache status types: FULL, PARTIAL, NONE, DIRTY, UPLOADING - Return cache percentage (0-100) for partial files - Include comprehensive test suite with 100% coverage - Document all endpoints in MANUAL.md with examples and use cases This enables file manager integrations to display cache status overlays like native cloud storage clients, showing which files are cached, partially cached, or being uploaded. Fixes rclone#8779
…endpoints\n\n- Fix merge conflicts with base branch\n- Align API implementation with documentation:\n - vfs/status: Returns aggregate cache status statistics\n - vfs/file-status: Returns detailed cache status for specific files\n - vfs/dir-status: Returns cache status for all files in a directory\n- Fix data race in VFSStatusCacheWithPercentage method\n- Improve parameter handling and error checking\n- Remove redundant _readDir() call that may cause race conditions\n- Add comprehensive test suite for all endpoints\n- Include documentation in MANUAL-API-ADDENDUM.md\n- Clean up .gitignore to remove personal development files\n\nThis addresses the issues identified in PR #5 review comments. Co-authored-by: Qwen-Coder <[email protected]>
- Add vfs/status: Returns aggregate cache status statistics - Add vfs/file-status: Returns detailed cache status for specific files - Add vfs/dir-status: Returns cache status for files in a directory - Update MANUAL-API-ADDENDUM.md with API documentation - Include comprehensive test suite for all endpoints
Summary of ChangesHello @lfgranja, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the VFS (Virtual File System) functionality by exposing detailed cache status information through new Remote Control (RC) API endpoints. These additions enable external applications, such as file managers, to monitor VFS cache health, display cache overlays, and gain deeper insights into file caching and upload processes. The changes involve introducing new API handlers, updating core VFS cache logic to expose status details, and refactoring the writeback system for improved clarity and functionality. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
PR Compliance Guide 🔍(Compliance updated until commit 2f09cf1)Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label Previous compliance checksCompliance check up to commit 13f0336
Compliance check up to commit 355e756
Compliance check up to commit 77bb38f
Compliance check up to commit a456877
Compliance check up to commit a456877
Compliance check up to commit 09dc050
Compliance check up to commit 8a3a168
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
User description
This PR introduces new RC API endpoints that provide detailed information about the VFS cache status. These endpoints are valuable for file manager integrations that need to display cache status overlays and for monitoring overall cache health.
Addresses #7
Changes from original rclone:
New RC API endpoints:
vfs/status: Returns aggregate cache status statistics for the VFSvfs/file-status: Returns detailed cache status for specific filesvfs/dir-status: Returns cache status for files in a directoryDetailed changes:
VFSStatusCache()andVFSStatusCacheWithPercentage()methods tovfs/vfscache.Itemto get cache status and percentageGetAggregateStats()method tovfs/vfscache.Cacheto get aggregate statisticsvfs/rc.gofor the three new endpointsvfs/rc_test.goMANUAL-API-ADDENDUM.mdwith documentation for the new endpointsAPI responses:
vfs/statusreturns counts for each cache status type (FULL, PARTIAL, NONE, DIRTY, UPLOADING) and aggregate statisticsvfs/file-statusreturns detailed cache status for individual files including name, status, percentage cached, and upload statusvfs/dir-statusreturns cache status for all files in a directory, grouped by status typeThese changes allow applications to monitor and display VFS cache status information effectively.
PR Type
Enhancement, Tests
Description
Add three new RC API endpoints for VFS cache status monitoring
Implement cache status detection methods in Item and Cache classes
Add comprehensive test suite with 20+ test cases covering all endpoints
Improve error handling with rc.NewErrParamInvalid() for parameter validation
Add NormalizePath() utility function for consistent path handling
Diagram Walkthrough
File Walkthrough
5 files
Add three new VFS cache status RC API endpointsAdd cache status query methods and aggregate statisticsImplement cache status detection with percentage calculationAdd IsUploading method and fix typo in commentExtract NormalizePath utility function for path handling3 files
Comprehensive test suite for cache status endpointsAdd local backend import and remove FIXME commentsRemove all backends import, use specific backend1 files
Add platform-specific error handling for dup operation1 files
Document three new VFS cache status API endpoints