Skip to content

fix: support russh-sftp 2.3 API#114

Open
cfilipescu wants to merge 2 commits into
Miyoshi-Ryota:mainfrom
cfilipescu:fix-russh-sftp-2-3-api
Open

fix: support russh-sftp 2.3 API#114
cfilipescu wants to merge 2 commits into
Miyoshi-Ryota:mainfrom
cfilipescu:fix-russh-sftp-2-3-api

Conversation

@cfilipescu

Copy link
Copy Markdown

Summary

  • replace the removed SftpSession::new_opts call with SftpSession::new_with_config
  • preserve the existing optional upload timeout by setting request_timeout_secs when provided
  • fixes fresh builds that resolve russh-sftp to 2.3.x from the current russh-sftp = "2.1.1" requirement

Testing

  • cargo +1.95.0 check
  • cargo +1.95.0 fmt --check (passes; rustfmt warns that two configured import options are nightly-only)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ea611792fd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/client.rs
if let Some(timeout_seconds) = timeout_seconds {
sftp_config.request_timeout_secs = timeout_seconds;
}
let sftp = SftpSession::new_with_config(channel.into_stream(), sftp_config).await?;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Bump the russh-sftp requirement with the new API

This call now requires the russh-sftp 2.3 API, but Cargo.toml still declares russh-sftp = "2.1.1" (Cargo.toml:21). In workspaces or downstream builds whose lockfile already contains russh-sftp 2.1.x, Cargo is allowed to keep that version, where SftpSession only has new/new_opts and no new_with_config, so updating this crate can fail to compile until the transitive dependency is manually updated. Please raise the dependency floor to the first version that provides new_with_config.

Useful? React with 👍 / 👎.

@cfilipescu

Copy link
Copy Markdown
Author

Addressed the dependency-floor issue by bumping russh-sftp from 2.1.1 to 2.1.2, which is the first version that provides SftpSession::new_with_config and Config::request_timeout_secs.

Additional verification:

  • cargo +1.95.0 check with latest compatible dependencies
  • cargo +1.95.0 update -p russh-sftp --precise 2.1.2 && cargo +1.95.0 check to verify the new lower bound

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant