Skip to content

Validate proposed Blob and Container lease IDs - #2812

Open
Akanksha Jain (jainakanksha-msft) with Copilot wants to merge 8 commits into
mainfrom
copilot/fix-azure-azurite-issue-2367
Open

Akanksha Jain (jainakanksha-msft) with Copilot wants to merge 8 commits into
mainfrom
copilot/fix-azure-azurite-issue-2367

Conversation

Copilot AI commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Azurite accepted malformed x-ms-proposed-lease-id values on Blob and Container acquire/change lease paths. Azure Storage rejects these with InvalidHeaderValue and accepts the documented GUID string formats, including X-format GUIDs.

  • Lease ID validation
    • Added shared proposed lease ID validation for Azure-compatible GUID formats.
    • Applied validation to Blob and Container acquireLease and changeLease handlers.
    • Returns InvalidHeaderValue with HeaderName / HeaderValue details for malformed proposed lease IDs.
validateProposedLeaseId(options.proposedLeaseId, context.contextId);
validateProposedLeaseId(proposedLeaseId, context.contextId);
  • Coverage

    • Added Blob and Container API tests for malformed acquire/change proposed lease IDs.
    • Preserved standard GUID behavior.
    • Added explicit X-format GUID acceptance coverage.
    • Added regression coverage rejecting an X-format value with an extra closing brace.
  • Release notes

    • Added an Upcoming Release changelog entry for the Blob lease compatibility fix.
Original prompt

Fix Azure/Azurite issue #2367. Validate proposed lease IDs for Blob and Container acquire/change lease paths using Azure-compatible GUID formats and InvalidHeaderValue behavior. Reuse repository validation/error patterns. Cover all affected paths with malformed ID tests, retain valid standard GUID behavior, and explicitly test valid X-format GUID acceptance plus rejection of an X-format value with an extra closing brace. Be careful that the X-format regex has exactly the correct closing braces; a prior local review caught an extra-brace bug. Add Upcoming Release ChangeLog entry. Run focused blob/container tests, build, lint, diagnostics, and diff check. The validated local version touched BlobHandler.ts, ContainerHandler.ts, blob/utils/utils.ts, blob/container API tests, and ChangeLog.md. Include 'Fixes #2367' 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>

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

Accept uppercase 0X prefixes and add the requested focused tests and changelog entry.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 2 Low severity

Open (2)

Comment thread src/blob/utils/utils.ts
Comment thread src/blob/utils/utils.ts
Copilot AI review requested due to automatic review settings September 24, 2026 08:45
@jainakanksha-msft Akanksha Jain (jainakanksha-msft) changed the title [WIP] Fix Azure/Azurite issue #2367 validate lease IDs Validate proposed lease IDs Sep 24, 2026
@jainakanksha-msft
Akanksha Jain (jainakanksha-msft) marked this pull request as ready for review September 24, 2026 08:45
Copilot AI and others added 2 commits September 24, 2026 08:46
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 Validate proposed lease IDs Validate proposed Blob and Container lease IDs 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

Fix invalid existing lease fixtures and prevent malformed-ID tests from contaminating subsequent tests.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity · 2 Low severity

Open (3)

Comment thread src/blob/utils/utils.ts

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

Add coverage for braced and parenthesized GUID formats and the exact Fixes #2367 PR keyword.

Review effort: Lite
Findings: 1 High severity · 2 Low severity

Open (3)

@jainakanksha-msft

Copy link
Copy Markdown
Member

Copilot Please address all remaining review feedback on this PR. At minimum: (1) replace every existing proposed-lease fixture using "abcdefg" in Block Blob and Append Blob tests with deterministic valid GUIDs so the full Blob suite remains compatible with the new validation; (2) add explicit positive coverage for braced and parenthesized GUID formats, while retaining standard and X-format coverage and the malformed extra-brace case; (3) verify whether Azure/.NET GUID X-format parsing accepts uppercase 0X prefixes and align implementation/tests if so; (4) confirm the Upcoming Release changelog entry and exact Fixes #2367 body keyword remain present. Run the focused tests, full npm run test:blob, build, lint, and git diff --check; commit to this PR branch and report exact results. Do not only update the PR body.

Co-authored-by: jainakanksha-msft <181211853+jainakanksha-msft@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 24, 2026 10:32

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, and the implementation and coverage align with the requested behavior.

Review effort: Lite
Findings: 1 High severity · 2 Low severity

Open (3)

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

Copilot AI commented Sep 24, 2026

Copy link
Copy Markdown
Contributor Author

Copilot Please address all remaining review feedback on this PR. At minimum: (1) replace every existing proposed-lease fixture using "abcdefg" in Block Blob and Append Blob tests with deterministic...

Addressed in 2b13d09 and cleanup commit 785fc8e.

Results:

  • Replaced all remaining "abcdefg" proposed-lease fixtures in Block Blob/Append Blob tests with deterministic valid GUIDs.
  • Added Blob and Container acquire/change positive coverage for braced, parenthesized, X-format, and uppercase 0X X-format proposed lease IDs, while retaining malformed extra-brace coverage.
  • Verified .NET Guid.TryParse accepts uppercase 0X prefixes and aligned the validator/tests.
  • Confirmed the Upcoming Release changelog entry remains present and PR body contains Fixes #2367.
  • Validation: focused lease tests 19 passing; npm run lint passed; npm run build passed; npm run test:blob passed with 626 passing, 3 pending; git diff --check passed; secret scan passed; final parallel validation passed with no review comments and 0 CodeQL alerts.

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 review issues were identified, and all approval assessments are positive.

Review effort: Lite
Findings: 1 High severity · 2 Low severity

Open (3)

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 in the reviewed changes.

Review effort: Lite
Findings: None

Resolved since last review (3)

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.

Missing Lease Id Validation

3 participants