Skip to content

Align Stage Block Content-MD5 response with Azure - #2811

Merged
Akanksha Jain (jainakanksha-msft) merged 12 commits into
mainfrom
copilot/fix-azure-azurite-issue-2394
Nov 5, 2026
Merged

Akanksha Jain (jainakanksha-msft) merged 12 commits into
mainfrom
copilot/fix-azure-azurite-issue-2394

Conversation

Copilot AI commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Stage Block omitted Content-MD5 even when clients supplied a valid MD5 checksum. Azure returns the calculated Content-MD5 for API version 2019-02-02 and later, while continuing to return CRC64 when MD5 is not supplied.

  • Handler behavior
    • Return calculated Content-MD5 for Stage Block requests with Content-MD5 and API version 2019-02-02 or later.
    • Preserve computed x-ms-content-crc64 responses when no MD5 is supplied.
    • Return Content-MD5 for 2019-02-02, matching Azure's inclusive boundary.
contentMD5: shouldReturnContentMD5 ? calculatedContentMD5 : undefined,
xMsContentCrc64: calculatedCRC64,
  • Regression coverage

    • Added focused Loki/SQL assertions for 2019-02-02 and later MD5 response behavior.
    • Added coverage that 2019-02-02 returns Content-MD5.
    • Kept existing CRC64 response behavior covered.
  • Changelog

    • Added an Upcoming Release Blob entry for the Stage Block response alignment.

Fixes #2394

Original prompt

Fix Azure/Azurite issue #2394. Align Stage Block responses with Azure: for API versions after 2019-02-02, when the request supplies Content-MD5, return the already calculated MD5 as the response Content-MD5; otherwise preserve calculated CRC64 behavior. Add a focused Loki/SQL regression assertion, an Upcoming Release ChangeLog entry, and run targeted tests, build, and lint. Keep the change limited to BlockBlobHandler and its focused tests. The locally validated implementation changed src/blob/handlers/BlockBlobHandler.ts, tests/blob/apis/blockblob.test.ts, and ChangeLog.md. Include 'Fixes #2394' in the PR body.

Copilot AI lite review requested due to automatic review settings September 24, 2026 08:38

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 wasn't able to review any files in this pull request.


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Co-authored-by: jainakanksha-msft <181211853+jainakanksha-msft@users.noreply.github.com>
Co-authored-by: jainakanksha-msft <181211853+jainakanksha-msft@users.noreply.github.com>
@jainakanksha-msft Akanksha Jain (jainakanksha-msft) changed the title [WIP] Fix Azure/Azurite issue #2394 by aligning Stage Block responses Return Content-MD5 from Stage Block Sep 24, 2026
@jainakanksha-msft
Akanksha Jain (jainakanksha-msft) marked this pull request as ready for review September 24, 2026 08:45
Co-authored-by: jainakanksha-msft <181211853+jainakanksha-msft@users.noreply.github.com>
Co-authored-by: jainakanksha-msft <181211853+jainakanksha-msft@users.noreply.github.com>
Copilot AI changed the title Return Content-MD5 from Stage Block Align Stage Block Content-MD5 response with Azure Sep 24, 2026

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 review overview

🟡 Changes recommended

Omitted-version handling and API-version boundary coverage remain unresolved.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Low severity

Open (1)

Comment thread tests/blob/apis/blockblob.test.ts Resolved

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 review overview

🟢 Approval recommended

No unresolved issues were identified, and the focused changes include regression coverage.

Review effort: Lite
Findings: None

Resolved since last review (1)

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 review overview

🔵 Needs a closer look

Targeted tests, build, and lint were not executed, so runtime validation remains pending.

Review effort: Lite
Findings: None

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 review overview

🟢 Approval recommended

No unresolved blocking issues were identified; standard CI validation remains appropriate.

Review effort: Lite
Findings: None

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.

🟢 Approval recommended

No active review issues remain, and the change includes targeted regression coverage for modern, boundary-version, and existing CRC64 behavior.

No open issues 🎉

Review effort: Lite

Return Content-MD5 for API version 2019-02-02 itself, matching Azure's inclusive version contract, and correct the regression test and release note.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jainakanksha-msft

Copy link
Copy Markdown
Member

Copilot The named branch now contains commit 5cab18d1645f69e4a0250d6c0b0402f81d1e5ae5, but this Copilot-managed PR's refs/pull/2811/head remains pinned to 8e63cd67b669ac54d2edafc46b58fb5443d7180a. Please adopt the exact boundary fix into the managed PR head and push it through the coding-agent workflow so it becomes visible in PR #2811. The required change is: use >= for API version 2019-02-02, expect Content-MD5 in the exact-boundary test, and say “2019-02-02 and later” in the changelog. Do not revert the corrected PR description or Fixes #2394. Run the focused test, build, lint, and diff check.

Copilot AI commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

Copilot The named branch now contains commit 5cab18d1645f69e4a0250d6c0b0402f81d1e5ae5, but this Copilot-managed PR's refs/pull/2811/head remains pinned to `8e63cd67b669ac54d2edafc46b58fb5443d7180...

The inclusive boundary fix is in commit 5cab18d and has been pushed to the managed PR head. The focused tests (2), build, lint, and diff check pass; the PR description and Fixes #2394 remain unchanged.

@jainakanksha-msft

Copy link
Copy Markdown
Member

Copilot Latest main (fad3f41f59eddcc106b512fe58d8d2507d506ff7) has been merged into the named PR branch in merge commit 78ea5d5cfd2f13750c09ed34e2069c780e330958. The merge retains inclusive-boundary commit 5cab18d1645f69e4a0250d6c0b0402f81d1e5ae5, and the diff against current main remains limited to ChangeLog.md, BlockBlobHandler.ts, and blockblob.test.ts. Please adopt 78ea5d5c into the Copilot-managed PR head so PR #2811 visibly updates from main, then run build, lint, focused Stage Block tests, and diff check. Do not revert Fixes #2394 or the inclusive >= behavior.

Copilot AI commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

Copilot Latest main (fad3f41f59eddcc106b512fe58d8d2507d506ff7) has been merged into the named PR branch in merge commit 78ea5d5cfd2f13750c09ed34e2069c780e330958. The merge retains inclusive-bou...

Merge commit 78ea5d5 is now on the Copilot-managed PR head. Build, lint, focused Stage Block tests (2 passing), and diff check pass; the inclusive >= behavior and Fixes #2394 remain intact.

Follow existing Azurite version-gating patterns by keeping the one-use 2019-02-02 threshold next to the behavior it controls.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings November 5, 2026 07:55
@jainakanksha-msft

Copy link
Copy Markdown
Member

Copilot Please adopt commit e353204306d88c2de5da82771f332d58ad105deb from the named branch into the Copilot-managed PR head. It removes the one-use STAGE_BLOCK_CONTENT_MD5_RESPONSE_API_VERSION constant and inlines requestApiVersion >= "2019-02-02", matching existing Azurite version-gating patterns without changing behavior. Preserve merge commit 78ea5d5c, the inclusive boundary test, changelog, and Fixes #2394. Run build, lint, focused Stage Block tests, formatting, and diff check.

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.

🟡 Changes recommended

A test gap remains for pre-2019-02-02 clients, leaving the legacy behavior that should omit contentMD5 unverified.

1 open issue

Review effort: Lite

Comment on lines +502 to +503
const shouldReturnContentMD5 =
contentMD5 !== undefined && requestApiVersion >= "2019-02-02";

Copilot AI commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

Copilot Please adopt commit e353204306d88c2de5da82771f332d58ad105deb from the named branch into the Copilot-managed PR head. It removes the one-use STAGE_BLOCK_CONTENT_MD5_RESPONSE_API_VERSION co...

e353204 is already the managed PR head. Build, lint, focused Stage Block tests (29 passing), and git diff --check pass. Prettier check reports pre-existing style differences across both files; I left them unchanged to avoid unrelated formatting churn.

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.

🔵 Needs a closer look

An active finding remains because the version-gate behavior for pre-boundary clients is not covered by a regression test.

1 open issue

Review effort: Lite

@jainakanksha-msft
Akanksha Jain (jainakanksha-msft) merged commit 46f38b4 into main Nov 5, 2026
47 checks passed
@jainakanksha-msft
Akanksha Jain (jainakanksha-msft) deleted the copilot/fix-azure-azurite-issue-2394 branch November 5, 2026 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

stageBlock API does not return Content-MD5

3 participants