Skip to content

Commit de9f051

Browse files
authored
Sync eng/common directory with azure-sdk-tools for PR 13304 (#47542)
* Update copilot instructions to support both local and pipeline based SDK genb.com>
1 parent a7d6315 commit de9f051

File tree

2 files changed

+57
-3
lines changed

2 files changed

+57
-3
lines changed

eng/common/instructions/azsdk-tools/local-sdk-workflow.instructions.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ description: "Guide the user to generate and build SDKs locally for a TypeSpec b
55
# Goal
66

77
Help the user generate and build SDKs locally from TypeSpec API specifications using the `azure-sdk-mcp` tools.
8+
High level steps involved:
9+
1. Generate SDK locally
10+
2. Build / Compile SDK locally
11+
3. Run package checks
12+
4. Run package tests
13+
5. Update change log, metadata and version
814

915
---
1016

@@ -65,6 +71,7 @@ Help the user generate and build SDKs locally from TypeSpec API specifications u
6571

6672
- Check if the provided repository path exists and matches the selected SDK language repository.
6773
- If invalid → prompt user to re-enter a valid path.
74+
- Verify setup to ensure all required tools are installed for the selected language.
6875

6976
---
7077

@@ -117,3 +124,29 @@ Help the user generate and build SDKs locally from TypeSpec API specifications u
117124
**Actions**:
118125

119126
- Run `azsdk_package_build_code` MCP tool to compile the SDK in the identified project directory.
127+
128+
---
129+
130+
### Step 3: Run package validation
131+
132+
**Actions**:
133+
134+
- Run `azsdk_package_run_check` MCP tool to validate the generated SDK package in the identified project directory.
135+
136+
---
137+
138+
### Step 4: Run package tests
139+
140+
**Actions**:
141+
142+
- Run `azsdk_package_run_tests` MCP tool to run tests on the generated SDK package in the identified project directory.
143+
144+
---
145+
146+
### Step 5: Update change log, metadata and version
147+
148+
**Actions**:
149+
150+
- Run `azsdk_package_update_metadata` MCP tool to update metadata in the identified project directory.
151+
- Run `azsdk_package_update_changelog_content` MCP tool to update change log in the identified project directory.
152+
- Run `azsdk_package_update_version` MCP tool to update version in the identified project directory.

eng/common/instructions/azsdk-tools/typespec-to-sdk.instructions.md

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,28 @@ Pre-requisites:
1717
# SDK generation steps
1818

1919
## Step: Generate SDKs
20-
**Goal**: Generate SDKs
21-
**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."
20+
21+
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.
22+
23+
Generate SDK locally in cases below:
24+
- 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.
25+
- If SDK or client.tsp customizations are needed before creating a pull request.
26+
- If the user wants to add tests, samples or any customization to the generated SDK.
27+
28+
Generate SDK using pipeline:
29+
- 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.
30+
31+
### Generate SDK locally:
32+
33+
**Condition**: If user chooses to generate SDK locally
34+
**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."
35+
**Actions**:
36+
Follow the steps in #file:local-sdk-workflow.instructions.md to generate and build SDKs locally from TypeSpec project.
37+
38+
### Generate SDK using pipeline:
39+
40+
**Condition**: If user chooses to generate the SDK using pipeline or when generating SDK by GitHub coding agent
41+
**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."
2242
**Actions**:
2343
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.
2444
- Execute the SDK generation pipeline with the following required parameters for all languages:
@@ -33,7 +53,8 @@ Pre-requisites:
3353
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.
3454
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.
3555
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.
36-
5. If SDK pull request was created for test purposes, inform user to close the test SDK pull request.
56+
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.
57+
6. If SDK pull request was created for test purposes, inform user to close the test SDK pull request.
3758
**Success Criteria**: SDK generation pipeline initiated and SDKs generated
3859

3960
## Step: SDK release plan

0 commit comments

Comments
 (0)