Skip to content

Comments

refactor: split sftp service into a separate crate#7060

Merged
koushiro merged 15 commits intoapache:mainfrom
Sahil-Shadwal:sftp
Dec 20, 2025
Merged

refactor: split sftp service into a separate crate#7060
koushiro merged 15 commits intoapache:mainfrom
Sahil-Shadwal:sftp

Conversation

@Sahil-Shadwal
Copy link
Contributor

Which issue does this PR close?

Closes #6921
Tracking issue: #6829

Rationale for this change

This PR splits the sftp service out of opendal-core into its own crate opendal-service-sftp as part of the core-split effort (RFC-6828). This helps in modularizing the codebase and reducing the compilation time and dependencies for the core crate.

What changes are included in this PR?

  • Moved sftp implementation from core/src/services/sftp to core/services/sftp.
  • Created a new crate opendal-service-sftp.
  • Updated opendal-core to remove sftp logic and dependencies (openssh, openssh-sftp-client).
  • Updated opendal (facade) to re-export sftp service from the new crate.
  • Refactored internal From<SftpMeta> usage to a static helper function to satisfy Rust orphan rules.
  • Added necessary configuration and dependencies to core/services/sftp/Cargo.toml.

Are there any user-facing changes?

No. The public API remains unchanged as opendal::services::Sftp is re-exported via the facade crate.

AI Usage Statement

This PR was built with the assistance of Google Gemini 3 pro

@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 18, 2025
@Sahil-Shadwal
Copy link
Contributor Author

@koushiro hey how can i fix (failing checks
Docs / build-ocaml-doc (pull_request)
Docs / build-ocaml-doc (pull_request)Failing after 4m)

@koushiro
Copy link
Member

@koushiro hey how can i fix (failing checks Docs / build-ocaml-doc (pull_request) Docs / build-ocaml-doc (pull_request)Failing after 4m)

You only need to care about the doc-test of Core CI.

test services/sftp/src/backend.rs - backend::SftpBuilder (line 81) - compile ... FAILED

failures:

---- services/sftp/src/backend.rs - backend::SftpBuilder (line 81) stdout ----
error[E0432]: unresolved import `opendal_core::services::Sftp`
 --> services/sftp/src/backend.rs:83:5
  |
3 | use opendal_core::services::Sftp;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `Sftp` in `services`
  |
help: consider importing one of these structs instead
  |
3 - use opendal_core::services::Sftp;
3 + use opendal_service_sftp::Sftp;
  |
3 - use opendal_core::services::Sftp;
3 + use openssh_sftp_client::Sftp;
  |

error[E0432]: unresolved import `anyhow`
 --> services/sftp/src/backend.rs:82:5
  |
2 | use anyhow::Result;
  |     ^^^^^^ use of unresolved module or unlinked crate `anyhow`
  |
  = help: if you wanted to use a crate named `anyhow`, use `cargo add anyhow` to add it to your `Cargo.toml`

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0432`.
Couldn't compile the test.

failures:
    services/sftp/src/backend.rs - backend::SftpBuilder (line 81)

@koushiro koushiro changed the title splitting sftp refactor: split sftp service into a separate crate Dec 20, 2025
Copy link
Member

@koushiro koushiro left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Dec 20, 2025
@koushiro koushiro merged commit 1ce6e06 into apache:main Dec 20, 2025
335 checks passed
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] Service: sftp

2 participants