Skip to content

Comments

refactor: Split logging/retry/timeout layer to new crates#7053

Merged
Xuanwo merged 6 commits intomainfrom
extract-logging-retry-timeout-layers
Dec 18, 2025
Merged

refactor: Split logging/retry/timeout layer to new crates#7053
Xuanwo merged 6 commits intomainfrom
extract-logging-retry-timeout-layers

Conversation

@koushiro
Copy link
Member

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?

  • split logging layer into a separate crate
  • split retry layer into a separate crate
  • split timeout layer into a separate crate

Are there any user-facing changes?

AI Usage Statement

Zed with GPT-5.1 Codex-Max

Copilot AI review requested due to automatic review settings December 17, 2025 09:43
@koushiro koushiro requested a review from Xuanwo as a code owner December 17, 2025 09:43
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. releases-note/refactor The PR does a refactor on code or has a title that begins with "refactor" labels Dec 17, 2025
@koushiro koushiro force-pushed the extract-logging-retry-timeout-layers branch from 1a29b6a to f5a7a4c Compare December 17, 2025 09:45
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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::* to opendal_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() and OpRead::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.

@Xuanwo
Copy link
Member

Xuanwo commented Dec 17, 2025

Hi, @koushiro seems #6964 and #6961 are still working on. What about we ping the author first before moving on?

@koushiro koushiro force-pushed the extract-logging-retry-timeout-layers branch from a781c95 to e0cc931 Compare December 18, 2025 12:19
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Dec 18, 2025
@Xuanwo Xuanwo merged commit c00adee into main Dec 18, 2025
703 of 707 checks passed
@Xuanwo Xuanwo deleted the extract-logging-retry-timeout-layers branch December 18, 2025 16:12
@zhiqiang-zz
Copy link

cooool

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer releases-note/refactor The PR does a refactor on code or has a title that begins with "refactor" size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[core split] Layer: timeout [core split] Layer: retry [core split] Layer: logging

3 participants