object/sftp: fix endpoint parsing for path colons - #7406
Merged
Conversation
Contributor
Author
|
Contributor
There was a problem hiding this comment.
Pull request overview
Improves SFTP endpoint parsing for custom ports, IPv6 hosts, and timestamped paths.
Changes:
- Extracts endpoint parsing into a dedicated helper.
- Adds table-driven parser tests.
- Documents supported SFTP formats in English and Chinese.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
pkg/object/sftp.go |
Implements endpoint parsing. |
pkg/object/object_storage_test.go |
Tests endpoint formats and errors. |
docs/en/guide/sync.md |
Documents SFTP syntax. |
docs/zh_cn/guide/sync.md |
Adds corresponding Chinese documentation. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Only treat a numeric field before the path separator as an explicit SSH port, so relative paths containing colons remain valid path names. Add parser coverage for IPv6 default ports and relative timestamped paths. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
jiefenghuang
approved these changes
Aug 19, 2026
Treat empty SFTP endpoint paths as invalid instead of letting filepath.Clean turn them into '.', and add parser coverage for empty paths and unusual relative path names. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7406 +/- ##
==========================================
+ Coverage 34.44% 40.94% +6.49%
==========================================
Files 140 178 +38
Lines 48323 58902 +10579
==========================================
+ Hits 16645 24115 +7470
- Misses 29995 31851 +1856
- Partials 1683 2936 +1253 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
No description provided.