Adding Buffer Size and Custom Endpoint Flags to Az SFTP#9620
Adding Buffer Size and Custom Endpoint Flags to Az SFTP#9620DevanshG1 wants to merge 1 commit intoAzure:mainfrom
Conversation
|
Validation for Breaking Change Starting...
Thanks for your contribution! |
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
|
There was a problem hiding this comment.
Pull request overview
This pull request adds two new command-line flags to the az sftp connect command: --buffer-size for configuring SFTP transfer buffer size and --endpoint-suffix for specifying custom storage account endpoint suffixes. The changes enable users to optimize transfer performance and support custom Azure environments (e.g., Azure Government, China, or private clouds).
Changes:
- Added
--buffer-sizeparameter to control SFTP transfer buffer size (default: 256 KB) - Added
--endpoint-suffixparameter to override cloud-specific endpoint detection - Refactored
_get_storage_endpoint_suffixto_resolve_endpoint_suffixwith custom suffix support and validation
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/sftp/setup.py | Version bump from 1.0.0b1 to 1.0.0b2 |
| src/sftp/HISTORY.rst | Release notes documenting the new parameters |
| src/sftp/azext_sftp/constants.py | Added DEFAULT_BUFFER_SIZE_BYTES constant (256 KB) |
| src/sftp/azext_sftp/_params.py | Added buffer_size and endpoint_suffix parameter definitions |
| src/sftp/azext_sftp/_help.py | Updated documentation and examples for new parameters |
| src/sftp/azext_sftp/sftp_info.py | Added buffer_size support to SFTPSession and build_args method |
| src/sftp/azext_sftp/custom.py | Renamed and enhanced endpoint resolution with validation; added buffer_size parameter |
| src/sftp/azext_sftp/tests/latest/test_sftp_info.py | Added unit tests for buffer_size default and custom values |
| src/sftp/azext_sftp/tests/latest/test_custom.py | Added tests for endpoint_suffix validation and cloud-specific resolution; updated mock references |
This checklist is used to make sure that common guidelines for a pull request are followed.
Related command
General Guidelines
azdev style <YOUR_EXT>locally? (pip install azdevrequired)python scripts/ci/test_index.py -qlocally? (pip install wheel==0.30.0required)For new extensions:
About Extension Publish
There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update
src/index.jsonautomatically.You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify
src/index.json.