Azure / azure-sdk-for-java

This repository is for active development of the Azure SDK for Java. For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/java/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-java.
MIT License
2.36k stars 2k forks source link

Onboard DPG Libraries with sync stack integration #33249

Closed samvaity closed 3 weeks ago

samvaity commented 1 year ago

Sync stack - Partner team onboarding

Steps to onboard sync stack workflow for SDK's:

  1. Add enable-sync-stack: true to Code generation settings in respective swagger/autorest.md Using this generation setting, autorest should generate sync equivalent overloads for all the API's.

  2. Enable AssertingClient Testing, this makes sure sync call API's are running in completely synchronous call stack.

  3. Validate the changes by running the LIVE test pipeline on the PR.

  4. Run Perf analysis and compare data to understand the impact of the changes.

Update the context for service API's that cannot be onboarded sync stack workflow as follows: private static final String HTTP_REST_PROXY_SYNC_PROXY_ENABLE = "com.azure.core.http.restproxy.syncproxy.enable"; context.addData(HTTP_REST_PROXY_SYNC_PROXY_ENABLE, false)

Known Issues when generating with the latest Autorest:

  • Make sure to use the latest locally compiled autorest version. autorest --java --use=C:\~\Autorest\autorest.java --use:@autorest/modelerfour@4.23.7
  • Change fromMono<StreamResponse> to Mono<SomeObjectResponse> is intended.

DPG SDK's to be onboarded:

Service Library Driver Status
Web Pub Sub azure-webpubsub @samvaity In Progress
Anomaly Detector azure-ai-anomalydetector - Not Started
Document Translator azure-ai-documenttranslator
Device Update for IoT Hub azure-iot-deviceupdate @chejiang-msft
Dev Center azure-developer-devcenter - In Progress
Synapse azure-analytics-synapse-artifacts - Not started
Synapse azure-analytics-synapse-accesscontrol - Not started
Synapse azure-analytics-synapse-managedprivateendpoints - Not started
Synapse azure-analytics-synapse-monitoring - Not started
weidongxu-microsoft commented 1 year ago

@srnagar Let us know if plan to switch DPG/Cadl to sync stack. (<-- OK, Cadl probably later, there is some complicities in the case of convenienceAPI call protocolAPI)

Sync stack could have some downside for client customization. Previously they can customize in async client, and add one line in sync client to call e.g. client.doLro().getSyncPoller(). <-- currently I guess only loadtesting did this kind of customization, so likely not having big impact if we switch by default

samvaity commented 3 weeks ago

Done for all SDKs.