refactor: Split logging/retry/timeout layer to new crates#7053
Merged
Conversation
1a29b6a to
f5a7a4c
Compare
There was a problem hiding this comment.
Pull request overview
This PR refactors the logging, retry, and timeout layers by extracting them from the core crate into separate crates (opendal-layer-logging, opendal-layer-retry, and opendal-layer-timeout). This modularization improves code organization and allows these layers to be independently versioned and maintained.
Key Changes:
- Created three new layer crates with their own Cargo.toml configurations
- Updated all imports from
crate::*toopendal_core::*in the extracted layers - Added feature flags (
layers-logging,layers-retry,layers-timeout) for optional inclusion - Updated documentation examples to use the new import paths
- Made
Executor::into_inner()andOpRead::range_mut()public to support cross-crate access
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| core/src/lib.rs | Added feature-gated re-exports for the three new layer crates |
| core/Cargo.toml | Added dependencies and feature flags for the new layer crates |
| core/Cargo.lock | Updated with new layer crate entries and dependencies |
| core/core/Cargo.toml | Removed backon dependency (moved to retry layer) |
| core/core/src/lib.rs | Updated documentation examples to use HttpClientLayer instead of LoggingLayer |
| core/core/src/layers/mod.rs | Removed exports for logging, timeout, and retry layers |
| core/core/src/types/operator/operator.rs | Updated documentation examples with new import patterns |
| core/core/src/types/operator/builder.rs | Updated documentation examples, commented out layer usage |
| core/core/src/types/execute/executor.rs | Changed into_inner() from pub(crate) to pub for cross-crate access |
| core/core/src/raw/ops.rs | Changed range_mut() from pub(crate) to pub for retry layer access |
| core/layers/logging/Cargo.toml | New crate configuration for logging layer |
| core/layers/logging/src/lib.rs | Updated imports to use opendal_core, cleaned up documentation formatting |
| core/layers/retry/Cargo.toml | New crate configuration for retry layer with dependencies |
| core/layers/retry/src/lib.rs | Updated imports, test uses new layer imports |
| core/layers/timeout/Cargo.toml | New crate configuration for timeout layer |
| core/layers/timeout/src/lib.rs | Updated imports, refactored tests to remove TypeEraseLayer dependency |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Member
Xuanwo
reviewed
Dec 18, 2025
a781c95 to
e0cc931
Compare
…ry-timeout-layers
Xuanwo
approved these changes
Dec 18, 2025
|
cooool |
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.
Which issue does this PR close?
Part of #6829
Closes #6939
Closes #6947
Closes #6950
Rationale for this change
Tests across these three layers are interdependent, so it's best to modify them together.
What changes are included in this PR?
Are there any user-facing changes?
AI Usage Statement
Zed with GPT-5.1 Codex-Max