Skip to content

Conversation

@scbizu scbizu requested a review from Copilot July 12, 2025 07:50

This comment was marked as outdated.

@scbizu scbizu requested a review from Copilot July 12, 2025 07:53

This comment was marked as outdated.

@scbizu scbizu force-pushed the fix/nomarlize-oss-prefix branch from 62f50a3 to c53873e Compare July 12, 2025 07:56
@scbizu scbizu requested a review from Copilot July 12, 2025 07:57
@scbizu scbizu assigned cbuto and scbizu and unassigned cbuto Jul 12, 2025
@scbizu scbizu requested a review from cbuto July 12, 2025 07:59

This comment was marked as outdated.

@scbizu scbizu force-pushed the fix/nomarlize-oss-prefix branch from c53873e to 8daab2f Compare July 12, 2025 08:03
@scbizu scbizu requested a review from Copilot July 12, 2025 08:04
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 ensures that the prefix parameter is consistently treated as a directory in all ListObjects methods by appending a trailing slash when needed.

  • Introduced a normalizePath helper to add a trailing slash for non-empty paths.
  • Updated all storage backends’ ListObjects to call normalizePath after joining the prefix.
  • Added unit tests for the new normalizePath function.

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
storage.go Added normalizePath helper function
storage_test.go Added unit tests for normalizePath
tencent.go Applied normalizePath in ListObjects
oracle.go Applied normalizePath in ListObjects
openstack.go Applied normalizePath in ListObjects
microsoft.go Applied normalizePath in ListObjects
google.go Applied normalizePath in ListObjects
etcd.go Applied normalizePath in ListObjects
baidu.go Applied normalizePath in ListObjects
amazon.go Applied normalizePath in ListObjects
alibaba.go Applied normalizePath in ListObjects
Comments suppressed due to low confidence (3)

storage.go:100

  • [nitpick] Add a comment above normalizePath to describe its behavior (e.g., "// normalizePath ensures a non-empty path ends with a slash").
func normalizePath(path string) string {

storage_test.go:184

  • Consider adding test cases for nested paths (e.g., normalizePath("a/b") => "a/b/") to improve coverage for multi-segment prefixes.
	suite.Equal("prefix/", normalizePath("prefix"), "path without trailing slash normalized to path with trailing slash")

tencent.go:90

  • [nitpick] This join-and-normalize pattern is repeated across multiple backends; consider extracting a helper like joinAndNormalizePrefix to reduce duplication and ensure consistency.
	prefix = normalizePath(prefix)

@scbizu scbizu force-pushed the fix/nomarlize-oss-prefix branch from 8daab2f to 61fed52 Compare July 12, 2025 08:09
@nerdeveloper
Copy link
Member

LGTM

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.

4 participants