Skip to content

Fix multipart S3 composite checksum suffix#9849

Open
SergioChan wants to merge 3 commits intogetmoto:masterfrom
SergioChan:fix-s3-multipart-composite-checksum-suffix-8762
Open

Fix multipart S3 composite checksum suffix#9849
SergioChan wants to merge 3 commits intogetmoto:masterfrom
SergioChan:fix-s3-multipart-composite-checksum-suffix-8762

Conversation

@SergioChan
Copy link
Contributor

Summary

  • append the multipart part-count suffix (-N) to computed multipart S3 checksums when ChecksumAlgorithm is used
  • add a multipart regression test that verifies Moto now returns the AWS-style composite checksum format for ChecksumSHA256
  • keep behavior scoped to multipart completion checksum generation only

Testing

  • python -m pytest tests/test_s3/test_s3_multipart.py -k "checksum_has_composite_suffix"

Related

@SergioChan
Copy link
Contributor Author

Pushed a follow-up commit to address the CI failure in test_copy_key_with_args__using_multipart.

What changed

  • Updated multipart checksum formatting so the -<part_count> suffix is only added when there are multiple parts.
  • Single-part uploads now return the base checksum value without -1.

Validation

  • python -m pytest tests/test_s3/test_s3_copyobject.py -k test_copy_key_with_args__using_multipart -q
  • python -m pytest tests/test_s3/test_s3_multipart.py -k test_multipart_upload_checksum_has_composite_suffix -q

@codecov
Copy link

codecov bot commented Mar 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.12%. Comparing base (ee7a095) to head (f7cc0bb).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #9849   +/-   ##
=======================================
  Coverage   93.12%   93.12%           
=======================================
  Files        1314     1314           
  Lines      119430   119432    +2     
=======================================
+ Hits       111224   111227    +3     
+ Misses       8206     8205    -1     
Flag Coverage Δ
servertests 29.21% <0.00%> (+<0.01%) ⬆️
unittests 93.10% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@SergioChan
Copy link
Contributor Author

Thanks @codecov[bot] for the review feedback. I’m working through the requested changes and will follow up with an updated patch/answers shortly.

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.

Multipart S3 uploads - composite checksums are not given the -X suffix

2 participants