From 994cc7bb26d6fceb37a3a6fd1803b617b15e49ef Mon Sep 17 00:00:00 2001 From: Praveen Kuttappan Date: Wed, 10 Dec 2025 13:51:08 -0500 Subject: [PATCH 1/6] Update copilot instructions to support both local and pipeline based SDK gen --- .../local-sdk-workflow.instructions.md | 32 +++++++++++++++++++ .../typespec-to-sdk.instructions.md | 24 ++++++++++++-- 2 files changed, 54 insertions(+), 2 deletions(-) diff --git a/eng/common/instructions/azsdk-tools/local-sdk-workflow.instructions.md b/eng/common/instructions/azsdk-tools/local-sdk-workflow.instructions.md index 0edadd191604..6fb6fa41a8fa 100644 --- a/eng/common/instructions/azsdk-tools/local-sdk-workflow.instructions.md +++ b/eng/common/instructions/azsdk-tools/local-sdk-workflow.instructions.md @@ -5,6 +5,12 @@ description: "Guide the user to generate and build SDKs locally for a TypeSpec b # Goal Help the user generate and build SDKs locally from TypeSpec API specifications using the `azure-sdk-mcp` tools. +High level steps involved: +1. Generate SDK locally +2. Build / Compile SDK locally +3. Run package checks +4. Run package tests +5. Update change log, metadata and version --- @@ -117,3 +123,29 @@ Help the user generate and build SDKs locally from TypeSpec API specifications u **Actions**: - Run `azsdk_package_build_code` MCP tool to compile the SDK in the identified project directory. + +--- + +### Step 3: Run package validation + +**Actions**: + +- Run `azsdk_package_run_check` MCP tool to validate the generated SDK package in the identified project directory. + +--- + +### Step 3: Run package tests + +**Actions**: + +- Run `azsdk_package_run_tests` MCP tool to run tests on the generated SDK package in the identified project directory. + +--- + +### Step 3: Update change log, metadata and version + +**Actions**: + +- Run `azsdk_package_update_metadata` MCP tool to update metadata in the identified project directory. +- Run `azsdk_package_update_changelog_content` MCP tool to update change log in the identified project directory. +- Run `azsdk_package_update_version` MCP tool to update version in the identified project directory. \ No newline at end of file diff --git a/eng/common/instructions/azsdk-tools/typespec-to-sdk.instructions.md b/eng/common/instructions/azsdk-tools/typespec-to-sdk.instructions.md index 042dd657a7d4..324fa687dbef 100644 --- a/eng/common/instructions/azsdk-tools/typespec-to-sdk.instructions.md +++ b/eng/common/instructions/azsdk-tools/typespec-to-sdk.instructions.md @@ -17,8 +17,28 @@ Pre-requisites: # SDK generation steps ## Step: Generate SDKs -**Goal**: Generate SDKs -**Message to user**: "SDK generation will take approximately 15-20 minutes. Currently, SDKs are generated using the Azure DevOps pipeline. SDK generation is supported only from a merged API spec or from an API spec pull request in the https://github.com/Azure/azure-rest-api-specs repository." + +As a first step, you must prompt the user to understand the intention of SDK generation. Based on the user input, you can either run SDK generation locally or use SDK generation pipeline. + +Generate SDK locally in cases below: +- If user wants to walk through each SDK generation step locally. This approach requires user to have the setup for each language to generate SDK locally. User can create a pull request for each language after completing all the steps in SDK generation successfully to get the generated SDK reviewed and merged. +- If user wants troubleshoot a failed SDK generation by the pipeline. +- If SDK or client.tsp customization are needed before creating a pull request. + +Generate SDK using pipeline: +- If user wants to generate SDK and get a PR automatically created in Azure SDK language repositories. This approach can be followed if user does not want to setup local environment for each language. + +### Generate SDK locally: + +**Condition**: If user chooses to generate SDK locally +**Message to user**: "Generating SDKs locally requires you to have the development environment setup for each language. Prompt the user to create a pull request for each language after completing the following steps successfully: generation, validation, build, test and update of metadata, change log, and version." +**Actions**: +Follow the steps in #file:local-sdk-workflow.instructions.md to generate and build SDKs locally from TypeSpec project. + +### Generate SDK using pipeline: + +**Condition**: If user chooses to generate the SDK using pipeline or when generating SDK by GitHub coding agent +**Message to user**: "SDK generation will take approximately 15-20 minutes. SDKs are generated using the Azure DevOps pipeline. SDK generation is supported only from a merged API spec or from an API spec pull request in the https://github.com/Azure/azure-rest-api-specs repository." **Actions**: 1. Identify whether TypeSpec is for Management Plane or Data Plane based on project structure and files. tspconfig.yaml file contains `resource-manager` for management plane and `data-plane` for data plane as resource provider. - Execute the SDK generation pipeline with the following required parameters for all languages: From 9aed623eb35f42806d6a2d6c44fd51ed1adcadfb Mon Sep 17 00:00:00 2001 From: Praveen Kuttappan Date: Wed, 10 Dec 2025 13:59:07 -0500 Subject: [PATCH 2/6] Update instructions --- .../azsdk-tools/typespec-to-sdk.instructions.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/common/instructions/azsdk-tools/typespec-to-sdk.instructions.md b/eng/common/instructions/azsdk-tools/typespec-to-sdk.instructions.md index 324fa687dbef..01aece48efc5 100644 --- a/eng/common/instructions/azsdk-tools/typespec-to-sdk.instructions.md +++ b/eng/common/instructions/azsdk-tools/typespec-to-sdk.instructions.md @@ -21,12 +21,12 @@ Pre-requisites: As a first step, you must prompt the user to understand the intention of SDK generation. Based on the user input, you can either run SDK generation locally or use SDK generation pipeline. Generate SDK locally in cases below: -- If user wants to walk through each SDK generation step locally. This approach requires user to have the setup for each language to generate SDK locally. User can create a pull request for each language after completing all the steps in SDK generation successfully to get the generated SDK reviewed and merged. -- If user wants troubleshoot a failed SDK generation by the pipeline. +- If the user wants to walk through each SDK generation step locally. This approach requires user to have the setup for each language to generate SDK locally. User can create a pull request for each language after completing all the steps in SDK generation successfully to get the generated SDK reviewed and merged. +- If the user wants to troubleshoot a failed SDK generation by the pipeline. - If SDK or client.tsp customization are needed before creating a pull request. Generate SDK using pipeline: -- If user wants to generate SDK and get a PR automatically created in Azure SDK language repositories. This approach can be followed if user does not want to setup local environment for each language. +- If the user wants to generate SDK and get a PR automatically created in Azure SDK language repositories. This approach can be followed if the user does not want to setup local environment for each language. ### Generate SDK locally: From 1ad2c1a808e9f6dd835f327f8465243a85b71295 Mon Sep 17 00:00:00 2001 From: Praveen Kuttappan Date: Wed, 10 Dec 2025 14:00:54 -0500 Subject: [PATCH 3/6] fixed the grammatical error --- .../instructions/azsdk-tools/typespec-to-sdk.instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/common/instructions/azsdk-tools/typespec-to-sdk.instructions.md b/eng/common/instructions/azsdk-tools/typespec-to-sdk.instructions.md index 01aece48efc5..05446ddca221 100644 --- a/eng/common/instructions/azsdk-tools/typespec-to-sdk.instructions.md +++ b/eng/common/instructions/azsdk-tools/typespec-to-sdk.instructions.md @@ -23,7 +23,7 @@ As a first step, you must prompt the user to understand the intention of SDK gen Generate SDK locally in cases below: - If the user wants to walk through each SDK generation step locally. This approach requires user to have the setup for each language to generate SDK locally. User can create a pull request for each language after completing all the steps in SDK generation successfully to get the generated SDK reviewed and merged. - If the user wants to troubleshoot a failed SDK generation by the pipeline. -- If SDK or client.tsp customization are needed before creating a pull request. +- If SDK or client.tsp customizations are needed before creating a pull request. Generate SDK using pipeline: - If the user wants to generate SDK and get a PR automatically created in Azure SDK language repositories. This approach can be followed if the user does not want to setup local environment for each language. From c3bf546ef316bbdd5754b6aba577f0b1b5e0318e Mon Sep 17 00:00:00 2001 From: Praveen Kuttappan Date: Wed, 10 Dec 2025 14:08:17 -0500 Subject: [PATCH 4/6] Fixed step number issues --- .../azsdk-tools/local-sdk-workflow.instructions.md | 4 ++-- .../instructions/azsdk-tools/typespec-to-sdk.instructions.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/common/instructions/azsdk-tools/local-sdk-workflow.instructions.md b/eng/common/instructions/azsdk-tools/local-sdk-workflow.instructions.md index 6fb6fa41a8fa..abd6b4020adb 100644 --- a/eng/common/instructions/azsdk-tools/local-sdk-workflow.instructions.md +++ b/eng/common/instructions/azsdk-tools/local-sdk-workflow.instructions.md @@ -134,7 +134,7 @@ High level steps involved: --- -### Step 3: Run package tests +### Step 4: Run package tests **Actions**: @@ -142,7 +142,7 @@ High level steps involved: --- -### Step 3: Update change log, metadata and version +### Step 5: Update change log, metadata and version **Actions**: diff --git a/eng/common/instructions/azsdk-tools/typespec-to-sdk.instructions.md b/eng/common/instructions/azsdk-tools/typespec-to-sdk.instructions.md index 05446ddca221..55b3802499a5 100644 --- a/eng/common/instructions/azsdk-tools/typespec-to-sdk.instructions.md +++ b/eng/common/instructions/azsdk-tools/typespec-to-sdk.instructions.md @@ -31,7 +31,7 @@ Generate SDK using pipeline: ### Generate SDK locally: **Condition**: If user chooses to generate SDK locally -**Message to user**: "Generating SDKs locally requires you to have the development environment setup for each language. Prompt the user to create a pull request for each language after completing the following steps successfully: generation, validation, build, test and update of metadata, change log, and version." +**Message to user**: "Generating SDKs locally requires you to have the development environment set up for each language. Prompt the user to create a pull request for each language after completing the following steps successfully: generation, validation, build, test and update of metadata, change log, and version." **Actions**: Follow the steps in #file:local-sdk-workflow.instructions.md to generate and build SDKs locally from TypeSpec project. From 27e3645a806d9144b57953c085d2dad1b98ea835 Mon Sep 17 00:00:00 2001 From: Praveen Kuttappan Date: Wed, 10 Dec 2025 19:07:39 -0500 Subject: [PATCH 5/6] Update instructions as per review suggestions --- .../instructions/azsdk-tools/typespec-to-sdk.instructions.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/eng/common/instructions/azsdk-tools/typespec-to-sdk.instructions.md b/eng/common/instructions/azsdk-tools/typespec-to-sdk.instructions.md index 55b3802499a5..15d8b22acf06 100644 --- a/eng/common/instructions/azsdk-tools/typespec-to-sdk.instructions.md +++ b/eng/common/instructions/azsdk-tools/typespec-to-sdk.instructions.md @@ -22,8 +22,8 @@ As a first step, you must prompt the user to understand the intention of SDK gen Generate SDK locally in cases below: - If the user wants to walk through each SDK generation step locally. This approach requires user to have the setup for each language to generate SDK locally. User can create a pull request for each language after completing all the steps in SDK generation successfully to get the generated SDK reviewed and merged. -- If the user wants to troubleshoot a failed SDK generation by the pipeline. - If SDK or client.tsp customizations are needed before creating a pull request. +- If the user wants to add tests, samples or any customization to the generated SDK. Generate SDK using pipeline: - If the user wants to generate SDK and get a PR automatically created in Azure SDK language repositories. This approach can be followed if the user does not want to setup local environment for each language. @@ -53,7 +53,8 @@ Follow the steps in #file:local-sdk-workflow.instructions.md to generate and bui 2. Monitor pipeline status after 15 minutes and provide updates. If pipeline is in progress, inform user that it may take additional time and check the status later. 3. Display generated SDK PR links when available. If pipeline fails, inform user with error details and suggest to check pipeline logs for more information. 4. If SDK pull request is available for all languages, ask user to review generated SDK pull request and mark them as ready for review when they are ready to get them reviewed and merged. -5. If SDK pull request was created for test purposes, inform user to close the test SDK pull request. +5. Inform the user that they can checkout generated SDK pull request locally and add more tests, samples or code customizations if needed using local SDK generation tools. +6. If SDK pull request was created for test purposes, inform user to close the test SDK pull request. **Success Criteria**: SDK generation pipeline initiated and SDKs generated ## Step: SDK release plan From 189d91dc0d14c6e26ecc3ee3ebbaa2050e505049 Mon Sep 17 00:00:00 2001 From: Praveen Kuttappan Date: Thu, 11 Dec 2025 12:14:37 -0500 Subject: [PATCH 6/6] Add verify setup instruction in local SDK generation workflow --- .../instructions/azsdk-tools/local-sdk-workflow.instructions.md | 1 + 1 file changed, 1 insertion(+) diff --git a/eng/common/instructions/azsdk-tools/local-sdk-workflow.instructions.md b/eng/common/instructions/azsdk-tools/local-sdk-workflow.instructions.md index abd6b4020adb..756c478f1282 100644 --- a/eng/common/instructions/azsdk-tools/local-sdk-workflow.instructions.md +++ b/eng/common/instructions/azsdk-tools/local-sdk-workflow.instructions.md @@ -71,6 +71,7 @@ High level steps involved: - Check if the provided repository path exists and matches the selected SDK language repository. - If invalid → prompt user to re-enter a valid path. +- Verify setup to ensure all required tools are installed for the selected language. ---