Skip to content

Commit e11997b

Browse files
azure-sdkraych1maririos
authored
Sync eng/common directory with azure-sdk-tools for PR 11868 (#25284)
* added instructions for sdk local workflow * fix case * Added missing comma * Update eng/common/instructions/azsdk-tools/local-sdk-workflow.instructions.md Co-authored-by: Mariana Rios Flores <[email protected]> * Update eng/common/instructions/azsdk-tools/local-sdk-workflow.instructions.md Co-authored-by: Mariana Rios Flores <[email protected]> * Update eng/common/instructions/azsdk-tools/local-sdk-workflow.instructions.md Co-authored-by: Mariana Rios Flores <[email protected]> * Update eng/common/instructions/azsdk-tools/local-sdk-workflow.instructions.md Co-authored-by: Mariana Rios Flores <[email protected]> * Replace 'tspconfigPath' by the literal file name * Added routing step to choose workflow * Added goal and action to some steps properly * Specified mcp tool name explicitly * Added back step to choose sdk generation approach * Specified the mcp tool names explicitly * Update eng/common/instructions/azsdk-tools/local-sdk-workflow.instructions.md Co-authored-by: Mariana Rios Flores <[email protected]> --------- Co-authored-by: ray chen <[email protected]> Co-authored-by: Mariana Rios Flores <[email protected]>
1 parent 26d5685 commit e11997b

File tree

3 files changed

+123
-34
lines changed

3 files changed

+123
-34
lines changed

eng/common/instructions/azsdk-tools/create-sdk-locally.instructions.md

Lines changed: 0 additions & 32 deletions
This file was deleted.
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
---
2+
description: "Guide the user to generate and build SDKs locally for a TypeSpec based API spec"
3+
---
4+
5+
# Goal
6+
7+
Help the user generate and build SDKs locally from TypeSpec API specifications using the `azure-sdk-mcp` tools.
8+
9+
---
10+
11+
## Part A: Generate SDK Locally
12+
13+
### Step 1: Outline workflow
14+
15+
**Goal**: Ensure the user understands the overall SDK generation and build process before starting.
16+
**Actions**:
17+
18+
- Present the high-level steps involved in generating and building SDK locally:
19+
1. Select target language
20+
2. Verify SDK repository
21+
3. Validate repository path
22+
4. Identify path to configuration file
23+
5. Generate SDK using `azsdk_package_generate_code` MCP tool
24+
6. Identify SDK project path
25+
7. Build/Compile SDK using `azsdk_package_build_code` MCP tool
26+
- Ask the user to confirm readiness to proceed.
27+
28+
---
29+
30+
### Step 2: Select language
31+
32+
**Goal**: Confirm the target language for SDK generation.
33+
**Actions**:
34+
35+
- Prompt user to choose one of the supported languages:
36+
- .NET
37+
- Java
38+
- JavaScript
39+
- Python
40+
- Go
41+
- Validate input against the allowed list.
42+
43+
---
44+
45+
### Step 3: Verify SDK repository
46+
47+
**Goal**: Ensure the correct Azure SDK language repository is available locally.
48+
**Actions**:
49+
50+
- Prompt user to provide the path to their **locally cloned repository** for the selected language.
51+
- Note: The **local folder name can be arbitrary**, but the repository must have originated from one of the official Azure SDK repositories:
52+
- `azure-sdk-for-net` (.NET)
53+
- `azure-sdk-for-java` (Java)
54+
- `azure-sdk-for-js` (JavaScript)
55+
- `azure-sdk-for-python` (Python)
56+
- `azure-sdk-for-go` (Go)
57+
- If the repository is not cloned → instruct user to clone the appropriate remote repository from GitHub.
58+
- MCP tool will automatically validate the remote origin and repository structure.
59+
60+
---
61+
62+
### Step 4: Validate repository path
63+
64+
**Actions**:
65+
66+
- Check if the provided repository path exists and matches the selected SDK language repository.
67+
- If invalid → prompt user to re-enter a valid path.
68+
69+
---
70+
71+
### Step 5: Identify path to configuration file
72+
73+
**Goal**: Determine the correct path to the TypeSpec configuration file based on the working context.
74+
**Actions**:
75+
76+
- **Scenario A: Working in a repository cloned from `azure-rest-api-specs`**
77+
- Identify the path to `tspconfig.yaml` (local path or HTTPS URL).
78+
- The local folder name can be arbitrary; the MCP tool will validate that the remote origin URL points to the official `azure-rest-api-specs` repository.
79+
- Example paths (pointing directly to tspconfig.yaml):
80+
- `/home/usr/azure-rest-api-specs/specification/contosowidgetmanager/Contoso.Management/tspconfig.yaml`
81+
- `https://github.com/Azure/azure-rest-api-specs/blob/4af373fc5826cf5a2365a20dde01c4b2efde48f0/specification/contosowidgetmanager/Contoso.Management/tspconfig.yaml`
82+
83+
- **Scenario B: Working in one of the official Azure SDK language repositories**
84+
(i.e., originally cloned from `azure-sdk-for-net`, `azure-sdk-for-java`, `azure-sdk-for-js`, `azure-sdk-for-python`, `azure-sdk-for-go`)
85+
- Identify the path to `tsp-location.yaml`.
86+
- The local folder name can be arbitrary; MCP tool will validate the remote origin URL.
87+
- Example path:
88+
`/home/usr/azure-sdk-for-net/sdk/contoso/Azure.ResourceManager.Contoso/tsp-location.yaml`
89+
90+
---
91+
92+
### Step 6: Generate SDK
93+
94+
**Actions**:
95+
96+
- Run `azsdk_package_generate_code` MCP tool to generate the SDK locally.
97+
98+
---
99+
100+
## Part B: Build / Compile SDK Locally
101+
102+
### Step 1: Identify SDK project path
103+
104+
**Goal**: Locate the generated SDK project directory for building/compiling.
105+
**Actions**:
106+
107+
- Find the project directory inside the selected Azure SDK language repository.
108+
- Typical structure:
109+
`sdk/{service-name}/{package-name}/`
110+
- Example:
111+
`/path/to/azure-sdk-for-net/contoso/Azure.ResourceManager.Contoso/`
112+
113+
---
114+
115+
### Step 2: Build/Compile the SDK
116+
117+
**Actions**:
118+
119+
- Run `azsdk_package_build_code` MCP tool to compile the SDK in the identified project directory.

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,12 @@ Wait for the user to respond with a confirmation before proceeding to Step 1. Us
5757
**Goal**: Determine how to generate SDKs
5858
**Actions**:
5959
1. Present options: "How would you like to generate SDKs?"
60-
- Option A: "Generate SDK locally". This is currently supported only for Python. Do not recommend this for other languages.
60+
- Option A: "Generate SDK locally".
6161
- Option B: "Use SDK generation pipeline"
6262
2. Based on selection:
63-
- If Option A: Refer to #file:create-sdk-locally.instructions.md and then proceed to Step 6
63+
- If Option A:
64+
- Follow #file:./local-sdk-workflow.instructions.md to generate and compile the SDK.
65+
- After SDK has been generated, to continue the SDK release, users can create the SDK pull request manually then proceed to Step 9.
6466
- If Option B: Continue to Step 6
6567
**Success Criteria**: SDK generation method selected
6668

0 commit comments

Comments
 (0)