Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: behavior tests ci #15

Closed
wants to merge 34 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
25eafea
fix: rename and fetchdata (#3)
ho-229 Jun 17, 2024
74f0fd1
refactor: tickets
ho-229 Jun 19, 2024
87e6b58
refactor: Placeholder
ho-229 Jun 23, 2024
d9586e5
chore: PlaceholderFile
ho-229 Jun 23, 2024
c6a1260
chore: export modules
ho-229 Jun 24, 2024
7678aa7
chore: filter info
ho-229 Jun 24, 2024
35e91d7
chore: request
ho-229 Jun 24, 2024
5bfa6b3
refactor: returns Result::Err to response error
ho-229 Jun 25, 2024
2418bda
feat: placeholder auxiblity functions
ho-229 Jun 29, 2024
b545b72
feat: SyncFilter::state_changed
ho-229 Jun 29, 2024
27ca2f5
chore: sync root
ho-229 Jul 1, 2024
9248f2f
fix: clippy
ho-229 Jul 1, 2024
9e52c38
docs
ho-229 Jul 1, 2024
b794e58
refactor: bump dependencies
ho-229 Jul 1, 2024
b7467c5
fix: SyncRootId::to_components
ho-229 Jul 2, 2024
5349093
rename to cloud-filter
ho-229 Jul 2, 2024
b8cf57b
docs
ho-229 Jul 2, 2024
b8db3da
fix: segfault
ho-229 Jul 5, 2024
6b00b57
released 0.0.2
ho-229 Jul 5, 2024
0241891
refactor: Placeholder::info
ho-229 Jul 8, 2024
493d29d
refactor: SyncRootInfo
ho-229 Jul 10, 2024
67bf486
chore: check fields of SyncRootInfo
ho-229 Jul 14, 2024
c0e31c0
refactor: remove path ext
ho-229 Jul 14, 2024
ca6cf55
docs: Fix broken links in README.md (#4)
Xuanwo Jul 21, 2024
4e3690d
chore: Use windows target to build docs (#5)
Xuanwo Jul 21, 2024
f437056
feat: async filter
ho-229 Jul 23, 2024
7235bd0
fix: async filter
ho-229 Jul 24, 2024
7a4ff53
released 0.0.3
ho-229 Jul 24, 2024
c1a1275
feat: bump `windows` to 0.58.0 (#6)
ho-229 Jul 28, 2024
13286c2
chore: is_registered returns error when encounter unexpected error
ho-229 Jul 28, 2024
99cbd90
feat: behavior tests (#7)
ho-229 Aug 3, 2024
8eb00a8
docs: lib.rs
ho-229 Aug 10, 2024
682a37f
released 0.0.4
ho-229 Aug 10, 2024
5a9e255
fix: behavior test ci
ho-229 Aug 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: check

on:
workflow_dispatch:
push:
Expand All @@ -25,7 +26,7 @@ jobs:
- uses: Swatinem/rust-cache@v2

- name: clippy
run: cargo clippy --all-features
run: cargo clippy --all-features --workspace
env:
RUSTFLAGS: "-Dwarnings"

Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/test_behavior.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: test behavior

on:
workflow_dispatch:
push:
paths:
- "**.rs"
- "**/Cargo.toml"
- ".github/workflows/test_behavior.yml"
pull_request:
paths:
- "**.rs"
- "**/Cargo.toml"
- ".github/workflows/test_behavior.yml"

jobs:
test:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable

- name: cargo test
run: cargo test --test behavior --all-features
39 changes: 30 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,42 +1,63 @@
[package]
name = "wincs"
version = "0.1.0"
name = "cloud-filter"
version = "0.0.4"
authors = [
"ok-nick <nick.libraries@gmail.com>",
"ho-229 <ho229v3666@gmail.com>",
]
edition = "2021"
description = "A safe and idiomatic wrapper around the Windows Cloud Filter API"
license = "MIT"
repository = "https://github.com/ho-229/cloud-filter-rs"
documentation = "https://docs.rs/cloud-filter"
exclude = ["examples/", ".github/", "test/"]

[package.metadata.docs.rs]
default-target = "x86_64-pc-windows-msvc"

[dependencies]
flagset = "0.4.5"
widestring = "1.0.2"
memoffset = "0.6.4"
windows = { version = "0.33.0", features = [
"alloc",
nt-time = "0.8.0"
memoffset = "0.9.1"
windows = { version = "0.58.0", features = [
"Win32_Foundation",
"Win32_Storage_CloudFilters",
"Win32_System_SystemServices",
"Win32_System_CorrelationVector",
"Win32_Storage_FileSystem",
"Win32_System_IO",
"Storage_Provider",
"Win32_System_Memory",
"Storage",
"Storage_Search",
"Foundation",
"Foundation_Collections",
"Win32_Security_Authorization",
"Win32_UI_Shell",
"Win32_System_Com",
"Win32_UI_Shell_PropertiesSystem",
"Win32_System_Com_StructuredStorage",
"Win32_Storage_EnhancedStorage",
"Win32_System_Ole",
"Win32_System_Search",
"Storage_Streams",
"Win32_System_Ioctl",
"Win32_Security",
] }
globset = { version = "0.4.9", optional = true }

[dev-dependencies]
libtest-mimic = "0.7.3"
futures = "0.3.30"
anyhow = "1.0.86"
powershell_script = "1.1.0"

[features]
# Enable globs in the `info::FetchPlaceholders` struct.
globs = ["globset"]

# TODO: temporarily ignored
[workspace]
members = ["examples/sftp"]

[[test]]
harness = false
name = "behavior"
path = "tests/behavior/main.rs"
37 changes: 20 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
<div align="center">
<h1><code>wincs</code></h1>
<h1><code>cloud-filter</code></h1>
<p><strong>Windows Cloud Sync</strong></p>
<p>
<a href="https://docs.rs/wincs/0.0.0/wincs/"><img src="https://img.shields.io/readthedocs/wincs" alt="docs" /></a>
<a href="https://crates.io/crates/wincs"><img src="https://img.shields.io/crates/v/wincs" alt="crates" /></a>
<a href="https://discord.gg/w9Bc6xH7uC"><img src="https://img.shields.io/discord/834969350061424660?label=discord" alt="discord" /></a>
<a href="https://docs.rs/cloud-filter/"><img src="https://img.shields.io/docsrs/cloud-filter" alt="docs" /></a>
<a href="https://crates.io/crates/cloud-filter"><img src="https://img.shields.io/crates/v/cloud-filter" alt="crates" /></a>
</p>
</div>

> **Warning**
> Read more about the future of `wincs` in [issue #8](https://github.com/ok-nick/wincs/issues/8).
> This is a fork of [wincs](https://github.com/ok-nick/wincs), thanks for [ok-nick](https://github.com/ok-nick)'s great work.

`wincs` is a safe and idiomatic wrapper around the native [Windows Cloud Filter API](https://docs.microsoft.com/en-us/windows/win32/cfapi/build-a-cloud-file-sync-engine). The Cloud Filter API enables developers to implement their own remote file system from within user space. It is much like [FUSE](#why-not-fuse), although it contains many first-class Windows features that are only available through its API.
`cloud-filter` is a safe and idiomatic wrapper around the native [Windows Cloud Filter API](https://docs.microsoft.com/en-us/windows/win32/cfapi/build-a-cloud-file-sync-engine). The Cloud Filter API enables developers to implement their own remote file system from within user space. It is much like [FUSE](#why-not-fuse), although it contains many first-class Windows features that are only available through its API.
For example:

* [Placeholder files](#what-are-placeholders)
* Partial files
* Full files
Expand Down Expand Up @@ -41,33 +40,37 @@ For example:
As of right now, the Cloud Filter API is used in production by OneDrive, Google Drive, Dropbox, and many other clients.

## Examples
Below is a simple snippet of implementing a sync engine. For more, in-depth examples, please check out the [examples directory](https://github.com/ok-nick/wincs/tree/main/examples).
```rs
// TODO
```

Below is a simple snippet of implementing a sync engine. For more, in-depth examples, please check out the [examples directory](https://github.com/ho-229/cloud-filter/tree/main/examples).

## FAQ

### Why not FUSE?
Unfortunately, FUSE is only implemented for Unix-like operating systems. Luckily, there are numerous alternatives for implementing file systems on Windows, such as `dokany` or `winfsp`.

#### Why not `dokany`?
`dokany` has a Rust API and is accessible using safe code. However, it is fairly low-level and does not have the first-class capabilities supported by `wincs`. Read more [here](#wincs).

`dokany` has a Rust API and is accessible using safe code. However, it is fairly low-level and does not have the first-class capabilities supported by `cloud-filter`.

#### Why not `winfsp`?
Unlike `dokany`, `winfsp` currently does not have a Rust API. Perhaps at some point it may, but even so, it is impossible to have the first-class features supported by `wincs`. Read more [here](#wincs).

Unlike `dokany`, `winfsp` currently does not have a Rust API. Perhaps at some point it may, but even so, it is impossible to have the first-class features supported by `cloud-filter`.

### What are placeholders?

Placeholders are internally [NTFS sparse files](https://docs.microsoft.com/en-us/windows/win32/fileio/sparse-files) and some [reparse point magic](https://docs.microsoft.com/en-us/windows/win32/cfapi/build-a-cloud-file-sync-engine#compatibility-with-applications-that-use-reparse-points). To put it simple, they are empty files that are meant to represent real files, although are not backed by any allocation unless requested. The way they work is heavily dependent on the sync engines' configuration. Know that if a process were to read the content of the placeholder, it would be "hydrated" (its file contents would be allocated). For more information, read [here](https://docs.microsoft.com/en-us/windows/win32/cfapi/build-a-cloud-file-sync-engine).

### I know `wincs` is maintained, but does Microsoft maintain the Cloud Filter API?
Of course, it is used by Microsoft's very own OneDrive Client. I have reported numerous issues and received quick feedback via the [Microsoft Q&A](https://docs.microsoft.com/en-us/answers/search.html?c=7&includeChildren=false&type=question&redirect=search%2Fsearch&sort=newest&q=cfapi). There are a lot of undocumented and unimplemented portions of the API, although they are not necessary for the features described [here](#wincs).
### I know `cloud-filter` is maintained, but does Microsoft maintain the Cloud Filter API?

Of course, it is used by Microsoft's very own OneDrive Client. I have reported numerous issues and received quick feedback via the [Microsoft Q&A](https://docs.microsoft.com/en-us/answers/search.html?c=7&includeChildren=false&type=question&redirect=search%2Fsearch&sort=newest&q=cfapi). There are a lot of undocumented and unimplemented portions of the API, although they are not necessary for the features described.

### Why is `cloud-filter` only for remote files?

### Why is `wincs` only for remote files?
You are more than welcome to use it for local files, although the extra features may not suit your needs. It is recommended to instead use [ProjFS](https://docs.microsoft.com/en-us/windows/win32/projfs/projected-file-system), of which is also backed by Microsoft, but dedicated to "high-speed backing data stores."

## Additional Resources
If you are looking to contribute or want a deeper understanding of `wincs`, be sure to check out these resources:

If you are looking to contribute or want a deeper understanding of `cloud-filter`, be sure to check out these resources:
* [Build a Cloud Sync Engine that Supports Placeholder Files](https://docs.microsoft.com/en-us/windows/win32/cfapi/build-a-cloud-file-sync-engine)
* [Integrate a Cloud Storage Provider](https://docs.microsoft.com/en-us/windows/win32/shell/integrate-cloud-storage)
* [Microsoft Q&A Containing "cfapi"](https://docs.microsoft.com/en-us/answers/search.html?c=7&includeChildren=false&type=question&redirect=search%2Fsearch&sort=newest&q=cfapi)
Expand Down
2 changes: 1 addition & 1 deletion examples/sftp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
edition = "2021"

[dependencies]
wincs = { path = "../../" }
cloud-filter = { path = "../../" }
widestring = "1.0.2"
ssh2 = "0.9.4"
thiserror = "1.0.30"
Expand Down
Loading
Loading