-
Notifications
You must be signed in to change notification settings - Fork 716
Open
Labels
coregood first issueGood for newcomersGood for newcomersgood first vibeGood for Code AgentsGood for Code Agents
Description
Prompts
For joining this event, please clarify the tools and LLMs you are using.
Splitting service/layer {name} into its own crate
- Goals & constraints
- Extract `core/src/{kind}s/{name}` into a new crate `core/{kind}s/{name}`, crate name `opendal-{kind}-{name}`, while keeping the public surface (`opendal::{kind}s::{Name}`) unchanged.
- Preserve the existing feature flag: `services-{name}` for services, `layers-{name}` for layers. No behavior-test changes.
- Steps
1) Workspace & dependencies
- Create `core/{kind}s/{name}/Cargo.toml`: depend on `opendal-core` (path, default-features=false); move all {kind}-specific third-party deps/versions here.
- In root crate `core/Cargo.toml`:
- Add optional dependency `opendal-{kind}-{name}`.
- Map feature `services-{name}` -> `["dep:opendal-service-{name}"]` or `layers-{name}` -> `["dep:opendal-layer-{name}"]`.
- In `core/core/Cargo.toml`, remove this {kind}’s feature and its deps.
2) Code migration
- Move all `core/core/src/{kind}s/{name}/**` into `core/{kind}s/{name}/src/`, flatten modules in `lib.rs` (`mod backend; ...` or layer-specific modules) and re-export public types (`pub use backend::{NameBuilder as Name}` / layer types).
- Remove `mod {name}; pub use {name}::*;` from `core/core/src/{kind}s/mod.rs`.
- Fix imports: `crate::` -> `opendal_core::` (or `crate::` inside the new crate); resolve visibility by making shared helpers `pub` in core rather than duplicating.
- Registration: if applicable, keep `#[ctor] fn register() { DEFAULT_OPERATOR_REGISTRY.register::<Name>(SCHEME); }` in the new crate.
3) Facade re-export
- In `core/src/lib.rs`, under the relevant feature gate, `pub use opendal-{kind}-{name}::*;` so `opendal::{kind}s::{Name}` remains available.
4) Docs & examples
- Update docs/examples imports to the new crate (or facade) paths.
- If core docs/examples depended on this {kind}, optionally swap to another built-in {kind} during the migration to keep docs building.
5) Tests & behavior
- Move unit/integration tests with the code (keep paths/features). If core tests reference it, ensure they go through the facade feature.
- Minimal verify: `cargo check -p opendal-{kind}-{name}`; optionally `cargo check -p opendal --features {kind}s-{name}`.
6) Cleanup & compatibility
- Delete sources and deps from core.
- If external use needs a core-private helper, expose it (`pub`) instead of duplicating.
- Risks to watch
- Cross-crate visibility: widen visibility rather than copy code.
- Preserve existing API/feature names and behavior.Tasks
- Setup opnedal_core crate: refactor: Split core out to prepare for splitting #6858
- Think about how to handle memory service in core, do we need to move it? or just keep it?
- Split services
- aliyun-drive refactor: Split service aliyun drive to new crate #6879
- Service: alluxio [core split] Service: alluxio #6881
- azblob refactor: Split all azure storage services and ghac #6874
- azdls refactor: Split all azure storage services and ghac #6874
- azfile refactor: Split all azure storage services and ghac #6874
- Service: b2 [core split] Service: b2 #6882
- Service: cacache [core split] Service: cacache #6883
- Service: cloudflare-kv [core split] Service: cloudflare-kv #6884
- Service: compfs [core split] Service: compfs #6885
- Service: cos [core split] Service: cos #6886
- Service: d1 [core split] Service: d1 #6887
- Service: dashmap [core split] Service: dashmap #6888
- Service: dbfs [core split] Service: dbfs #6889
- Service: dropbox [core split] Service: dropbox #6890
- Service: etcd [core split] Service: etcd #6891
- Service: foundationdb [core split] Service: foundationdb #6892
- Service: fs [core split] Service: fs #6893
- Service: ftp [core split] Service: ftp #6894
- Service: gcs [core split] Service: gcs #6895
- Service: gdrive [core split] Service: gdrive #6896
- ghac refactor: Split all azure storage services and ghac #6874
- Service: github [core split] Service: github #6897
- Service: gridfs [core split] Service: gridfs #6898
- Service: hdfs [core split] Service: hdfs #6899
- Service: hdfs-native [core split] Service: hdfs-native #6900
- http refactor(services/http): Move services http out as a crate #6870
- moka: refactor(services/moka): Move services moka out as a crate #6868
- redis @AryanBagade
- s3: refactor: Move services s3 out as a crate #6866
- Service: huggingface [core split] Service: huggingface #6901
- Service: ipfs [core split] Service: ipfs #6902
- Service: ipmfs [core split] Service: ipmfs #6903
- Service: koofr [core split] Service: koofr #6904
- Service: lakefs [core split] Service: lakefs #6905
- Service: memcached [core split] Service: memcached #6906
- Service: mini-moka [core split] Service: mini-moka #6907
- Service: mongodb [core split] Service: mongodb #6908
- Service: monoiofs [core split] Service: monoiofs #6909
- Service: mysql [core split] Service: mysql #6910
- Service: obs [core split] Service: obs #6911
- Service: onedrive [core split] Service: onedrive #6912
- Service: opfs [core split] Service: opfs #6913
- Service: oss [core split] Service: oss #6914
- Service: pcloud [core split] Service: pcloud #6915
- Service: persy [core split] Service: persy #6916
- Service: postgresql [core split] Service: postgresql #6917
- Service: redb [core split] Service: redb #6918
- Service: rocksdb [core split] Service: rocksdb #6919
- Service: seafile [core split] Service: seafile #6920
- Service: sftp [core split] Service: sftp #6921
- Service: sled [core split] Service: sled #6922
- Service: sqlite [core split] Service: sqlite #6923
- Service: surrealdb [core split] Service: surrealdb #6924
- Service: swift [core split] Service: swift #6925
- Service: tikv [core split] Service: tikv #6926
- Service: upyun [core split] Service: upyun #6927
- Service: vercel-artifacts [core split] Service: vercel-artifacts #6928
- Service: vercel-blob [core split] Service: vercel-blob #6929
- Service: webdav [core split] Service: webdav #6930
- Service: webhdfs [core split] Service: webhdfs #6931
- Service: yandex-disk [core split] Service: yandex-disk #6932
- Split layers
- refactor: Split async_backtrace layer to new crate #6867
- await_tree refactor: Split await tree layer to new crate #6875
- Layer: chaos [core split] Layer: chaos #6933
- Layer: concurrent_limit [core split] Layer: concurrent_limit #6934
- Layer: dtrace [core split] Layer: dtrace #6935
- Layer: fastmetrics [core split] Layer: fastmetrics #6936
- Layer: fastrace [core split] Layer: fastrace #6937
- Layer: immutable_index [core split] Layer: immutable_index #6938
- Layer: logging [core split] Layer: logging #6939
- Layer: metrics [core split] Layer: metrics #6940
- Layer: mime_guess [core split] Layer: mime_guess #6941
- Layer: observe [core split] Layer: observe #6942
- Layer: otelmetrics [core split] Layer: otelmetrics #6943
- Layer: oteltrace [core split] Layer: oteltrace #6944
- Layer: prometheus [core split] Layer: prometheus #6945
- Layer: prometheus_client [core split] Layer: prometheus_client #6946
- Layer: retry [core split] Layer: retry #6947
- Layer: tail_cut [core split] Layer: tail_cut #6948
- Layer: throttle [core split] Layer: throttle #6949
- Layer: timeout [core split] Layer: timeout #6950
- Layer: tracing [core split] Layer: tracing #6951
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
coregood first issueGood for newcomersGood for newcomersgood first vibeGood for Code AgentsGood for Code Agents