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

[BUG] CI ADO Task "Verify Type Spec Code Generation" does not insert code-snippets into Java code, when emitting an SDK for comparison #38337

Open dargilco opened 10 months ago

dargilco commented 10 months ago

Describe the bug The Image Analysis SDK is emitted from TypeSpec files (with some hand-customization). When you build the Image Analysis SDK (\sdk\vision\azure-ai-vision-imageanalysis), it inserts several code-snippets into the client Java source code, such that they show up in JavaDocs. However, when I run the CI pipeline, this results in the task "Verify Type Spec Code Generation" failing, and the diff shown is the inserted code-snippets. Looks like the tool that is emitting the SDK for comparison, is not running code-snippet insertion. This may be related to the fact that the operation methods ("analyze"), where the code-snippet were inserted, are both hand-written.

To overcome this and unblock PR merge, I added the pipeline variable EnableVerifyTypeSpecCodeGeneration, which is true by default, but set to false in \sdk\vision\ci.yml. So the task "Verify Type Spec Code Generation" is skipped when building the Image Analysis SDK. See relevant PR: https://github.com/Azure/azure-sdk-for-java/pull/38307

Related issue in the autorest repo: https://github.com/Azure/autorest.java/issues/2492

dargilco commented 10 months ago

FYI @srnagar @weidongxu-microsoft