feat: extended file attributes (RFC 0004)#78
Merged
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
1185c82 to
ea3f329
Compare
ea3f329 to
c1517e2
Compare
There was a problem hiding this comment.
Pull request overview
Implements RFC 0004 by extending snapshot file metadata to include POSIX attributes (mode/uid/gid/btime/flags), extended attributes (xattrs), and a filesystem/source type (fs_type) across local/SFTP/cloud sources, with CLI controls and updated docs/tests.
Changes:
- Extend core models (
core.FileMeta,core.SourceInfo) to store extended POSIX metadata, xattrs, andfs_type. - Add local (Linux/macOS) best-effort collectors for btime/flags/xattrs (+ stubs elsewhere) and wire them into local scans; populate mode/uid/gid from SFTP attrs.
- Add CLI flags to control metadata collection and update completions, docs, and engine equality/tests accordingly.
Reviewed changes
Copilot reviewed 22 out of 23 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| rfcs/0004-extended-file-attributes.md | Marks RFC as implemented; adds notes for future cloud metadata mapping. |
| pkg/source/sftp_source.go | Adds FsType and extracts mode/uid/gid from SFTP FileStat. |
| pkg/source/onedrive.go | Populates FsType for OneDrive sources. |
| pkg/source/local_source_xattr_unix.go | Implements Linux/macOS extended metadata + xattr listing/reading. |
| pkg/source/local_source_xattr_test.go | Adds Linux/macOS tests for extended metadata + xattr filtering behavior. |
| pkg/source/local_source_xattr_stub.go | Provides no-op implementations for unsupported platforms. |
| pkg/source/local_source_xattr_linux.go | Linux statx-based btime, ioctl flags, and filesystem type detection. |
| pkg/source/local_source_xattr_darwin.go | macOS btime/flags/fs type detection via stat/statfs. |
| pkg/source/local_source.go | Wires extended metadata collection into local walk and exposes options/FsType. |
| pkg/source/gdrive.go | Populates FsType for Google Drive sources. |
| internal/engine/backup_scan_test.go | Adds tests validating equality semantics for extended fields and helpers. |
| internal/engine/backup_scan.go | Extends metadata equality to include mode/uid/gid/btime/flags/xattrs. |
| internal/core/models.go | Adds extended metadata + xattrs to FileMeta and fs_type to SourceInfo. |
| internal/core/core_test.go | Adds tests for JSON omitempty and hash stability with xattrs. |
| go.sum | Cleans up sums after module dependency adjustments. |
| go.mod | Promotes/adds dependencies needed by the updated code paths. |
| docs/user-guide.md | Documents new CLI flags and extended metadata behavior for local/SFTP. |
| docs/spec.md | Updates snapshot format examples/field descriptions (mode/uid/gid/btime/flags/xattrs, fs_type). |
| cmd/cloudstic/usage.go | Adds the new backup flags to usage output. |
| cmd/cloudstic/completion.go | Updates shell completions to include the new backup flags. |
| cmd/cloudstic/cmd_backup_test.go | Adds CLI/initSource tests for extended local-source options. |
| cmd/cloudstic/cmd_backup.go | Adds new backup flags and threads options into local source initialization. |
| cmd/cloudstic/cmd_auth.go | Updates auth flows to call the new initSource signature. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Author
|
Addressed the Copilot review comments on PR #78 in commit 35cb3e4. What changed:
Validation run:
|
35cb3e4 to
9c1c534
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implement RFC 0004 by adding extended file attribute and POSIX metadata capture in backup scans, with platform-aware handling and CLI controls.
What Changes
core.FileMetawith metadata fields:mode,uid,gid,btime,flags,xattrscore.SourceInfowithfs_type.-skip-mode,-skip-flags,-skip-xattrs,-xattr-namespacesTracking
rfcs/0004-extended-file-attributes.mdNotes
main.