Skip to content

Add asynchronous enclave delegate operations - #4886

Merged
priyankatiwari08 merged 3 commits into
mainfrom
dev/cheena/automation/async-enclave-delegate
Oct 26, 2026
Merged

priyankatiwari08 merged 3 commits into
mainfrom
dev/cheena/automation/async-enclave-delegate

Conversation

@cheenamalhotra

Copy link
Copy Markdown
Member

Description

Add internal async enclave-delegate APIs for session lookup, attestation parameters, session creation, and invalidation. Preserve cancellation, provider errors, session validation, and replay-counter results. Providers retain ownership of async attestation gating; no monitor lock crosses an await. Synchronous methods and public APIs are unchanged.

Layer 1 of a two-PR stack. Command async execution wiring belongs to layer 2. No key-store or enclave-package-generation changes; no overlap with #4585 or #4798.

  • Tests added or updated
  • Public API changes documented (none; internal API summaries added)
  • Verified against customer repro (command wiring follows in layer 2)
  • Ensure no breaking changes introduced

Issues

Part of #3672.

Testing

Added 22 deterministic delegate cases covering incomplete provider tasks, input/result forwarding, cancellation and original errors, cold/warm cache rechecks, validation parity, and synchronous dispatch. Integration coverage is deferred to layer 2 because this foundation has no command call sites.

  • Passed, 58 tests: dotnet test src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft.Data.SqlClient.UnitTests.csproj --framework net10.0 --filter 'FullyQualifiedName~EnclaveDelegateAsyncTests|FullyQualifiedName~SqlColumnEncryptionEnclaveProviderAsyncShould|FullyQualifiedName~EnclaveSessionCacheTest' --no-build --no-restore --verbosity quiet --blame-hang-timeout 1m
  • Passed, 0 warnings/errors: dotnet build src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft.Data.SqlClient.UnitTests.csproj --framework net462 --configuration Release --no-restore --verbosity quiet
  • .NET Framework runtime tests were not run on macOS. No manual database testing.

Guidelines

Please review the contribution guidelines before submitting a pull request:

Connect enclave session lookup, attestation parameters, creation, and invalidation to async provider APIs without changing synchronous dispatch.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 4992e92c-122b-4f55-92c7-0042cd288dee
@cheenamalhotra
cheenamalhotra requested a review from a team as a code owner October 21, 2026 05:51
Copilot AI balanced review requested due to automatic review settings October 21, 2026 05:51
@github-project-automation github-project-automation Bot moved this to To triage in SqlClient Board Oct 21, 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.

🔵 Needs a closer look

Human confirmation is needed because trusted supplementary review guidance, existing PR feedback, and current-head CI remain unverified.

No open issues 🎉

What changed in this PR

Adds internal asynchronous enclave-delegate operations as a foundation for async Always Encrypted support in #3672. Command integration remains deferred to layer 2.

Changes:

  • Adds async session lookup, creation, invalidation, and attestation-parameter methods without changing synchronous or public APIs.
  • Adds 22 deterministic test cases covering forwarding, cancellation, errors, cache rechecks, and sync/async parity.
File Description
src/​Microsoft.Data.SqlClient/​tests/​UnitTests/​Microsoft/​Data/​SqlClient/​AlwaysEncrypted/​EnclaveDelegateAsyncTests.cs Tests async delegation and synchronous compatibility.
src/​Microsoft.Data.SqlClient/​src/​Microsoft/​Data/​SqlClient/​EnclaveDelegate.Crypto.cs Adds four internal async enclave operations.

Review effort: Balanced

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
1 pipeline(s) were filtered out due to trigger conditions.
Some pipeline(s) encountered errors during trigger evaluation.

@codecov

codecov Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.38%. Comparing base (616aeff) to head (1c47054).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4886      +/-   ##
==========================================
+ Coverage   67.58%   70.38%   +2.80%     
==========================================
  Files         310      305       -5     
  Lines       45543    69821   +24278     
==========================================
+ Hits        30779    49143   +18364     
- Misses      14764    20678    +5914     
Flag Coverage Δ
CI-SqlClient ?
PR-SqlClient-Project 70.38% <100.00%> (?)

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

☔ View full report in Codecov by Harness.
📢 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.

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

New methods and tests look good. Just one style suggestion.

@github-project-automation github-project-automation Bot moved this from In review to Waiting for customer in SqlClient Board Oct 21, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 4992e92c-122b-4f55-92c7-0042cd288dee
Copilot AI balanced review requested due to automatic review settings October 21, 2026 17:14

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

Reported current-head cross-target validation remains incomplete, so final approval needs CI confirmation and human review.

No open issues 🎉

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 23, 2026 20:57

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

Current-head cross-target build and test validation remains unconfirmed, so final approval requires human verification.

No open issues 🎉

Review effort: Balanced

@priyankatiwari08
priyankatiwari08 merged commit 7b1184b into main Oct 26, 2026
123 checks passed
@github-project-automation github-project-automation Bot moved this from Waiting for customer to Done in SqlClient Board Oct 26, 2026
@priyankatiwari08
priyankatiwari08 deleted the dev/cheena/automation/async-enclave-delegate branch October 26, 2026 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants