Skip to content

frontend: capture optional x-ambry-part-number in signed chunk ID metadata#3215

Merged
j-tyler merged 1 commit intolinkedin:masterfrom
j-tyler:j-tyler/add-part-number-header
Mar 20, 2026
Merged

frontend: capture optional x-ambry-part-number in signed chunk ID metadata#3215
j-tyler merged 1 commit intolinkedin:masterfrom
j-tyler:j-tyler/add-part-number-header

Conversation

@j-tyler
Copy link
Copy Markdown
Contributor

@j-tyler j-tyler commented Mar 20, 2026

Summary

Add a new x-ambry-part-number header that clients may include on chunk upload requests. When present, PostBlobHandler captures the value into the signed chunk ID metadata map alongside the existing BLOB_SIZE, SESSION, and EXPIRATION_TIME fields. This allows downstream consumers to determine chunk ordering at upload time rather than waiting for the stitch request.

The header is optional. When absent, no metadata key is added and existing behavior is completely unchanged. The Ambry server performs no validation on the value — it is stored as an opaque string.

Also fix the HashMap initial capacity in setSignedIdMetadataAndBlobSize from 2 to 6, matching the actual number of entries (4 existing + 1 optional).

Testing Done

Code already had good test coverage. Added new assertions for changed behavior.

…adata

Add a new x-ambry-part-number header that clients may include on chunk
upload requests. When present, PostBlobHandler captures the value into
the signed chunk ID metadata map alongside the existing BLOB_SIZE,
SESSION, and EXPIRATION_TIME fields. This allows downstream consumers
to determine chunk ordering at upload time rather than waiting for the
stitch request.

The header is optional. When absent, no metadata key is added and
existing behavior is completely unchanged. The Ambry server performs no
validation on the value — it is stored as an opaque string.

Also fix the HashMap initial capacity in setSignedIdMetadataAndBlobSize
from 2 to 6, matching the actual number of entries (4 existing + 1
optional).
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.81%. Comparing base (52ba813) to head (fadb6b1).
⚠️ Report is 356 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3215      +/-   ##
============================================
+ Coverage     64.24%   69.81%   +5.56%     
- Complexity    10398    12821    +2423     
============================================
  Files           840      930      +90     
  Lines         71755    79129    +7374     
  Branches       8611     9468     +857     
============================================
+ Hits          46099    55242    +9143     
+ Misses        23004    20940    -2064     
- Partials       2652     2947     +295     

☔ 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.

Copy link
Copy Markdown
Collaborator

@justinlin-linkedin justinlin-linkedin left a comment

Choose a reason for hiding this comment

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

LGTM

@j-tyler j-tyler merged commit 066af16 into linkedin:master Mar 20, 2026
5 checks passed
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