feat: drive identity by name (RFC 0008)#84
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
7ea7ee2 to
a0a0852
Compare
a0a0852 to
60e9da8
Compare
There was a problem hiding this comment.
Pull request overview
This PR implements RFC 0008, enabling cloud drive selection by human-readable name instead of opaque IDs. The -drive-id CLI flag is removed in favor of encoding the drive name in the source URI's host component (e.g., gdrive://Company Data/path). Both Google Drive and OneDrive sources gain drive-name resolution logic that first tries a direct ID lookup, then falls back to a name-based search with ambiguity detection.
Changes:
- Add drive-name-based URI parsing (
scheme://Drive Name/path) and wire it through the CLI, removing the-drive-idflag from backup args, completions, and help text. - Implement
resolveDriveNamefor both Google Drive and OneDrive sources, with fallback from ID lookup to name search and ambiguity/not-found error handling. - Update documentation (user guide, sources, RFC) and add the new RFC 0008 document.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
rfcs/0008-drive-identity-by-name.md |
New RFC describing the drive-by-name feature |
rfcs/0007-cloud-subdirectory-backup.md |
Status update from "Adopted" to "Implemented" |
pkg/source/onedrive.go |
Add driveName/driveID fields, resolveDriveName, getRootURL, and updated Info() |
pkg/source/onedrive_changes.go |
Use getRootURL() for delta token URL construction |
pkg/source/gdrive.go |
Add WithDriveName option and drive-name resolution logic |
cmd/cloudstic/cmd_backup.go |
Remove -drive-id flag, pass uri.host as drive name to source constructors |
cmd/cloudstic/store.go |
Parse :// URI format to extract drive name as host component |
cmd/cloudstic/store_test.go |
Add test cases for drive-name URI parsing |
cmd/cloudstic/usage.go |
Update help text to reflect new URI format |
cmd/cloudstic/completion.go |
Remove -drive-id from bash/zsh/fish completions |
docs/user-guide.md |
Update examples, flag tables, and section headings |
docs/sources.md |
Update source documentation for new URI convention |
scripts/check.sh |
Add markdownlint step to check script |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Implement RFC 0008 by enabling drive selection and identity resolution by name for cloud sources.
What Changes
rfcs/0008-drive-identity-by-name.mddocs/user-guide.mddocs/sources.mdBehavior Notes
Testing
Tracking
rfcs/0008-drive-identity-by-name.md