Skip to content

Commit 16e11a3

Browse files
Update copilot instructions for SDK workflow (Azure#35573)
* Update copilot instructions for SDK workflow
1 parent bf04182 commit 16e11a3

5 files changed

Lines changed: 55 additions & 43 deletions

File tree

.github/copilot-instructions.md

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -169,34 +169,24 @@ from the list of paths. If user does not have a TypeSpec project, then prompt us
169169
- Use the path of the `tspconfig.yaml` file already open in the editor or the `.tsp` file path as the project root.
170170
- If no `.tsp` file or folder is in the current context, prompt the user to select a valid TypeSpec project root path.
171171

172-
3. **Pull Request Management**:
173-
- Always start by checking if a pull request exists for spec changes before proceeding with validation or SDK
174-
generation.
175-
- Use `GetPullRequestForCurrentBranch` to query pull requests instead of the `gh` CLI.
176-
- Provide a detailed pull request summary, including:
177-
- Title, link, author, assignee, status (open, closed, merged), and mergeability.
178-
- Check statuses (success or failure) with links and detailed failure reasons.
179-
- API views for generated SDKs under the heading `API View for Generated SDK APIs`.
180-
- Comments and action items for the user.
181-
182-
4. **Process Visibility**:
172+
3. **Process Visibility**:
183173
- Highlight all steps in the SDK generation process, showing completed and remaining steps.
184174
- Do not skip any main steps. Ensure all steps are completed before moving to the next.
185175

186-
5. **Git Operations**:
176+
4. **Git Operations**:
187177
- Avoid using the `main` branch for pull requests. Prompt the user to create or switch to a new branch if necessary.
188178
- Display git commands (e.g., `git checkout`, `git add`, `git commit`, `git push`) with a "Run" button instead of
189179
asking the user to copy and paste.
190180
- Do not run `git diff`
191181

192-
6. **Azure-Specific Rules**:
182+
5. **Azure-Specific Rules**:
193183
- Always use `Azure` as the repo owner in MCP tool calls.
194184
- Confirm with the user if they want to change the repo owner or target branch, and prompt for new values if needed.
195185

196-
7. **Exclusions**:
186+
6. **Exclusions**:
197187
- Exclude changes in `.github` and `.vscode` folders from API spec and SDK pull requests.
198188

199-
8. **Working Branch Rule**:
189+
7. **Working Branch Rule**:
200190
- Ensure the TypeSpec project repository and the current working repository are not on the `main` branch:
201191
- Check the current branch name for the cloned GitHub repository:
202192
- If the current branch is `main`, prompt the user to create a new branch using
@@ -214,5 +204,18 @@ By following these rules, the SDK release process will remain clear, structured,
214204
Follow `/typespec-to-sdk` prompt to generate and release SDK from TypeSpec API specification. The process is divided into several steps, each with specific actions to ensure a smooth SDK generation and release process.
215205
Do not skip the step that choose SDK generation method to ensure the user selects the appropriate method for SDK generation, either locally or using the SDK generation pipeline. Do not repeat the steps.
216206

207+
1. **Identify TypeSpec Project**: Locate the TypeSpec project root path by checking for `tspconfig.yaml` or `main.tsp` files.
208+
2. **Validate TypeSpec Specification**: Ensure the TypeSpec specification compiles without errors.
209+
3. **Verify Authentication and Repository Status**: Ensure user is authenticated and working in the correct public Azure repository.
210+
4. **Review and Commit Changes**: Stage and commit TypeSpec modifications, ensuring the current branch is not "main". Do not create pull request yet.
211+
5. **Create Specification Pull Request**: Create a pull request for TypeSpec changes if not already created. This is required only if there are TypeSpec changes in current branch.
212+
6. **Choose SDK Generation Method**: Determine how to generate SDKs (locally or via pipeline). Only Python is supported for local SDK generation at this time.
213+
7. **Generate SDKs via Pipeline**: Generate SDKs using `/run-sdk-gen-pipeline` prompt, monitor the pipeline status and displaying generated SDK PR links.
214+
8. **Show generated SDK PR**: Display the generated SDK pull request links for review.
215+
9. **Create a release plan**: Create a release plan for the generated SDKs using spec pull request.
216+
10. **Prompt user to change spec pull request to ready for review from draft status**: Update spec pull request to change it to ready for review.
217+
11. **Release package**: Release the SDK package using `ReleaseSdkPackage` tool.
218+
219+
217220
## Release readiness of SDK and information about the release pipeline
218221
Run `/check-package-readiness` prompt to check the release readiness of an SDK package. This prompt will collect the required information from the user, execute the readiness check, and present the results.

.github/prompts/create-release-plan.prompt.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Follow these steps in order to create or manage a release plan for an API specif
2020
- If no release plan exists, proceed to Step 3
2121

2222
## Step 3: Gather Release Plan Information
23-
Collect the following required information from the user. Do not use non GUID valid for product and service tree Id.
23+
Collect the following required information from the user. Do not use non GUID valid for product and service tree Id. Do not create release plan with temporary values.
2424
Do not assume or use default for service tree Id and product service tree Id. Always show the values to user and ask them to confirm it's a valid value in service tree.
2525
If any details are missing, prompt the user accordingly:
2626

@@ -41,15 +41,20 @@ If any details are missing, prompt the user accordingly:
4141
- Provide this resource: [Release Plan Creation Guide](https://eng.ms/docs/products/azure-developer-experience/plan/release-plan-create)
4242
- Once all information is gathered, use `CreateReleasePlan` to create the release plan
4343
- Display the newly created release plan details to the user for confirmation
44+
- Run `/sdk-details-in-release-plan` to identify languages configured in the TypeSpec project and add them to the release plan
4445

45-
## Step 5: Link SDK Pull Requests (if applicable)
46+
## Step 5: Update SDK Details in Release Plan
47+
- Run `/sdk-details-in-release-plan.prompt.md` to add languages and package names to the release plan
48+
- If the TypeSpec project is for a management plane, run `/verify-namespace-approval` if this is first release of SDK.
49+
50+
## Step 6: Link SDK Pull Requests (if applicable)
4651
- Ask the user if they have already created SDK pull requests locally for any programming language
4752
- If SDK pull requests exist:
4853
- Collect the pull request links from the user
4954
- Use `LinkSdkPullRequestToReleasePlan` to link each SDK pull request to the release plan
5055
- Confirm successful linking for each SDK pull request
5156

52-
## Step 6: Summary
57+
## Step 7: Summary
5358
- Display a summary of the completed actions:
5459
- Release plan status (created or existing)
5560
- Linked SDK pull requests (if any)

.github/prompts/typespec-to-sdk.prompt.md

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,6 @@ mode: 'agent'
33
description: 'Generate SDKs from TypeSpec'
44
---
55
Your goal is to guide user through the process of generating SDKs from TypeSpec projects. Show all the high level steps to the user to ensure they understand the flow. Use the provided tools to perform actions and gather information as needed.
6-
## TypeSpec to SDK Generation Process
7-
1. **Pre-Flight Check**: Ensure user is not on main branch and prompt to create a new branch if necessary.
8-
2. **Identify TypeSpec Project**: Locate the TypeSpec project root path by checking for `tspconfig.yaml` or `main.tsp` files.
9-
3. **Validate TypeSpec Specification**: Ensure the TypeSpec specification compiles without errors.
10-
4. **Verify Authentication and Repository Status**: Ensure user is authenticated and working in the correct public Azure repository.
11-
5. **Review and Commit Changes**: Stage and commit TypeSpec modifications, ensuring the current branch is not "main".
12-
6. **Choose SDK Generation Method**: Determine how to generate SDKs (locally or via pipeline).
13-
7. **Create Specification Pull Request**: Create a pull request for TypeSpec changes if not already created.
14-
8. **Verify API Readiness**: Ensure the API specification pull request is ready for SDK generation.
15-
9. **Generate SDKs via Pipeline**: Create a release plan and generate SDKs, monitoring the pipeline status and displaying generated SDK PR links.
166

177
## Pre-Flight Check
188
- Verify ${workspaceFolder} is not on main branch
@@ -86,18 +76,7 @@ Your goal is to guide user through the process of generating SDKs from TypeSpec
8676
- Display created PR details
8777
**Success Criteria**: Specification pull request exists
8878

89-
## Step 7: Verify API Readiness
90-
**Goal**: Ensure API specification PR is ready for SDK generation
91-
**Actions**:
92-
1. Run `/check-api-readiness` on the spec PR
93-
2. If ready, proceed to Step 8
94-
3. If not ready:
95-
- Display specific readiness issues
96-
- Inform user: "The following actions are required before SDK generation: [list issues]"
97-
- Wait for user to address issues
98-
**Success Criteria**: API specification PR passes readiness checks
99-
100-
## Step 8: Generate SDKs via Pipeline
79+
## Step 7: Generate SDKs via Pipeline
10180
**Goal**: Create release plan and generate SDKs
10281
**Actions**:
10382
1. Run `/create-release-plan`
@@ -110,5 +89,28 @@ This step should not check package readiness to verify namespace approval for ma
11089
7. Display generated SDK PR links when available
11190
**Success Criteria**: SDK generation pipeline initiated and SDKs generated
11291

92+
## Step 8: Show Generated SDK PRs
93+
**Goal**: Display all created SDK pull requests
94+
**Actions**:
95+
1. Run `GetSDKPullRequestDetails` to fetch generated SDK PR info.
96+
97+
## Step 9: Create release plan
98+
**Goal**: Create a release plan for the generated SDKs
99+
**Actions**:
100+
1. Run `/create-release-plan` to create a release plan using the spec pull request.
101+
2. If the release plan already exists, display the existing plan details.
102+
103+
## Step 10: Mark Spec PR as Ready for Review
104+
**Goal**: Update spec PR to ready for review status
105+
**Actions**:
106+
1. Prompt user to change spec PR to ready for review: "Please change the spec pull request to ready for review status"
107+
2. Get approval and merge the spec PR
108+
109+
## Step 11: Release SDK Package
110+
**Goal**: Release the SDK package using the release plan
111+
**Actions**:
112+
1. Run `ReleaseSdkPackage` to release the SDK package.
113+
2. Inform user to approve the package release using release pipeline.
114+
113115
## Process Complete
114116
Display summary of all created PRs and next steps for user.

.github/prompts/verify-namespace-approval.prompt.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,21 @@ description: 'Verify SDK namespace approval for management plane'
44
tools: ['GetReleasePlan', 'GetReleasePlanForPullRequest', 'LinkNameSpaceApprovalIssue']
55
---
66
This task is required only for management plan API spec and only if a release plan exists for the API spec pull request.
7+
78
## Step 1: Check if release plan exists and it is for management plane SDK
89
**Goal**: Determine if a release plan exists for the API spec pull request or work item Id or release plan Id in current context.
910
**Actions**:
1011
1. Get release plan and check if it is for management plane SDK
1112
2. If not, inform user: "This task is only applicable for management plane SDKs. No action required."
12-
3. Check if release plan already has namespace approval issue.
13+
3. Check if release plan already has namespace approval issue. Also prompt user to check if this is the first release of SDK.
1314
4. If namespace approval issue exists, inform user: "Namespace approval issue already exists for this release plan.". Prompt user to
1415
check if they want to link a different namespace approval issue to the release plan. Show namespace approval status.
1516
5. Move to Step 2 if namespace approval issue does not exist or user wants to link a different namespace approval issue.
17+
1618
## Step 2: Gather Namespace Approval Information
1719
**Goal**: Link namespace approval issue to the release plan.
1820
**Actions**:
19-
1. Collect GitHub issue created in Azure/azure-sdk repo for namespace approval.
21+
1. Collect GitHub issue created in Azure/azure-sdk repo for namespace approval. Do not use any other repo name.
2022
2. Run `LinkNameSpaceApprovalIssue` to link the issue to the release plan work item id.
2123
3. Confirm successful linking of the namespace approval issue to the release plan.
2224
**Success Criteria**: Namespace approval issue linked to the release plan or confirmed as already linked.

.vscode/mcp.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"azure-sdk-mcp": {
44
"type": "stdio",
55
"command": "pwsh",
6-
"args": ["${workspaceFolder}/eng/common/mcp/azure-sdk-mcp.ps1", "-Run", "-Version", "1.0.0-dev.20250618.1"]
6+
"args": ["${workspaceFolder}/eng/common/mcp/azure-sdk-mcp.ps1", "-Run", "-Version", "1.0.0-dev.20250702.1"]
77
},
88
}
99
}

0 commit comments

Comments
 (0)