Skip to content

fix: root at s3 upload part copy - #1247

Merged
ferhatelmas merged 1 commit into
masterfrom
ferhat/s3-upload-part-copy
Jul 20, 2026
Merged

fix: root at s3 upload part copy#1247
ferhatelmas merged 1 commit into
masterfrom
ferhat/s3-upload-part-copy

Conversation

@ferhatelmas

Copy link
Copy Markdown
Member

What kind of change does this PR introduce?

Bug fix

What is the current behavior?

S3 upload part copy response doesn't set root tag name correct.

What is the new behavior?

It sets now and regression test validates the wire.
SDK doesn't care about root tag but might not be compatible with strict clients.

Additional context

S3 docs

Signed-off-by: ferhat elmas <elmas.ferhat@gmail.com>
Copilot AI review requested due to automatic review settings July 20, 2026 21:23
@ferhatelmas
ferhatelmas requested a review from a team as a code owner July 20, 2026 21:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 29779999775

Coverage remained the same at 79.556%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 12754
Covered Lines: 10595
Line Coverage: 83.07%
Relevant Branches: 7448
Covered Branches: 5477
Branch Coverage: 73.54%
Branches in Coverage %: Yes
Coverage Strength: 426.81 hits per line

💛 - Coveralls

@claude claude 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.

LGTM. Simple, correct fix that wraps the UploadPartCopy response in the CopyPartResult root element, matching the S3 API spec and the pattern already used elsewhere in this file (e.g. copyObject -> CopyObjectResult).

Extended reasoning...

Overview

This PR touches a single method (uploadPartCopy) in src/storage/protocols/s3/s3-handler.ts, changing the shape of the responseBody returned to the XML serializer so the wire response is wrapped in a CopyPartResult root tag instead of emitting bare ETag/LastModified fields. The test file was updated to issue a raw signed HTTP request and assert on the actual XML text (root tag name, presence of <ETag>/<LastModified>, closing tag), rather than relying on the AWS SDK's lenient parsing, which previously masked the missing root element.

Security risks

None. This is a pure response-shape fix with no changes to auth, input parsing, or data access. The values being serialized (ETag, LastModified) are already computed upstream and unchanged.

Level of scrutiny

Low. This is a narrowly scoped, mechanical fix aligning one endpoint's response format with the S3 API spec and with sibling methods in the same file that already follow this root-tag convention (CopyObjectResult, ListPartsResult, InitiateMultipartUploadResult, etc). The change is a straightforward object-nesting edit plus a regression test that directly exercises the wire format, giving good confidence the fix is correct.

Other factors

No CODEOWNER-restricted or auth/crypto-sensitive code is touched. The updated test is a meaningful improvement since it now validates the actual XML rather than the SDK's parsed representation.

@ferhatelmas
ferhatelmas merged commit 8cd3594 into master Jul 20, 2026
39 of 40 checks passed
@ferhatelmas
ferhatelmas deleted the ferhat/s3-upload-part-copy branch July 20, 2026 21:37
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