|
16 | 16 | **REQUIRED CONDITIONS:** |
17 | 17 | - To use Azure MCP tool calls, users must have PowerShell installed. Provide [PowerShell installation instructions](https://learn.microsoft.com/powershell/scripting/install/installing-powershell) if not installed, and recommend restarting the IDE to start the MCP server. |
18 | 18 |
|
19 | | -**BEFORE any commands:** |
20 | | -1. Get path to azure-sdk-for-python repo root, and path to tox.ini file |
21 | | -2. Use `verify_setup` tool from azure-sdk-python-mcp server |
22 | | -3. Ensure Python virtual environment is active |
23 | | - |
24 | | -**Virtual Environment Setup:** |
25 | | -```bash |
26 | | -# Create new environment |
27 | | -python -m venv <env_name> |
28 | | - |
29 | | -# Activate environment |
30 | | -# Linux/macOS: |
31 | | -source <env_name>/bin/activate |
32 | | -# Windows: |
33 | | -<env_name>\Scripts\activate |
34 | | -``` |
35 | | - |
36 | | ---- |
37 | | - |
38 | | -## TYPESPEC SDK GENERATION - COMPLETE WORKFLOW |
39 | | - |
40 | | -### PHASE 1: CONTEXT ASSESSMENT |
41 | | - |
42 | | -**ACTION:** Determine TypeSpec project location |
43 | | -``` |
44 | | -IF TypeSpec project paths exist in context: |
45 | | - USE local paths to generate SDK from tspconfig.yaml |
46 | | -ELSE: |
47 | | - ASK user for tspconfig.yaml file path |
48 | | -``` |
49 | | - |
50 | | -### PHASE 2: PREREQUISITES CHECK |
51 | | - |
52 | | -**REQUIRED CONDITIONS:** |
53 | | -1. GitHub CLI authenticated: `gh auth login` |
54 | | -2. User on feature branch (NOT main) |
55 | | - ```bash |
56 | | - git checkout -b <branch_name> |
57 | | - ``` |
58 | | - |
59 | | -### PHASE 3: TSP-CLIENT RULES |
60 | | - |
61 | | -**CRITICAL RULES:** |
62 | | -- **LOCAL REPO:** Do NOT grab commit hash |
63 | | -- **DIRECTORIES:** Let commands auto-create directories |
64 | | -- **PACKAGE GENERATION:** Find tsp-location.yaml in azure-sdk-for-python repo |
65 | | -- **URL REFERENCES:** Use commit hash (NOT branch name) for tspconfig.yaml URLs |
66 | | - |
67 | | -**Get latest commit hash:** |
68 | | -```bash |
69 | | -curl -s "https://api.github.com/repos/Azure/azure-rest-api-specs/commits?path=<path_to_tspconfig.yaml>&per_page=1" |
70 | | -``` |
71 | | - |
72 | | -**DEPENDENCIES:** Verify installation of: node, python, tox |
73 | | - |
74 | | ---- |
75 | | - |
76 | | -## EXECUTION SEQUENCE - 7 MANDATORY STEPS |
77 | | - |
78 | | -**ESTIMATED TOTAL TIME: 10-15 minutes** |
79 | | -- SDK Generation: ~2 minutes |
80 | | -- Static Validation: ~3-5 minutes |
81 | | -- Documentation & Commit: ~2-4 minutes |
82 | | - |
83 | | -**ALWAYS inform users of time expectations before starting any long-running operations.** |
84 | | - |
85 | | -### STEP 1: ENVIRONMENT VERIFICATION |
86 | | -``` |
87 | | -ACTION: Run verify_setup mcp tool |
88 | | -IF missing dependencies: |
89 | | - STOP and install missing dependencies |
90 | | - THEN proceed to Step 2 |
91 | | -``` |
92 | | - |
93 | | -### STEP 2: SDK GENERATION |
94 | | -``` |
95 | | -ACTION: Use azure-sdk-python-mcp sdk generation server tools (init for new packages, update for existing packages) |
96 | | -IF commands fail: |
97 | | - ANALYZE error messages |
98 | | - DIRECT user to fix TypeSpec errors in source repo |
99 | | -``` |
100 | | - |
101 | | -### STEP 3: STATIC VALIDATION (SEQUENTIAL) |
102 | | -``` |
103 | | -FOR EACH validation step: |
104 | | - RUN validation (tox mcp tool) |
105 | | - IF errors/warnings found: |
106 | | - FIX issues |
107 | | - RERUN same step |
108 | | - ONLY proceed to next step when current step passes |
109 | | -``` |
110 | | - |
111 | | -**Validation Commands:** |
112 | | -```bash |
113 | | -# Step 3a: Pylint |
114 | | -tox -e pylint -c [path to tox.ini] --root . |
115 | | - |
116 | | -# Step 3b: MyPy |
117 | | -tox -e mypy -c [path to tox.ini] --root . |
118 | | - |
119 | | -# Step 3c: Pyright |
120 | | -tox -e pyright -c [path to tox.ini] --root . |
121 | | - |
122 | | -# Step 3d: Verifytypes |
123 | | -tox -e verifytypes -c [path to tox.ini] --root . |
124 | | - |
125 | | -# Step 3e: Sphinx |
126 | | -tox -e sphinx -c [path to tox.ini] --root . |
127 | | - |
128 | | -# Step 3f: Mindependency |
129 | | -tox -e mindependency -c [path to tox.ini] --root . |
130 | | - |
131 | | -# Step 3g: Bandit |
132 | | -tox -e bandit -c [path to tox.ini] --root . |
133 | | - |
134 | | -# Step 3h: Black |
135 | | -tox -e black -c [path to tox.ini] --root . |
136 | | - |
137 | | -# Step 3i: Samples |
138 | | -tox -e samples -c [path to tox.ini] --root . |
139 | | - |
140 | | -# Step 3j: Breaking |
141 | | -tox -e breaking -c [path to tox.ini] --root . |
142 | | -``` |
143 | | - |
144 | | -**REQUIREMENTS:** |
145 | | -- Provide summary after each validation step |
146 | | -- Edit ONLY files with validation errors/warnings |
147 | | -- Fix each issue before proceeding |
148 | | - |
149 | | -### STEP 4: DOCUMENTATION UPDATE |
150 | | -``` |
151 | | -REQUIRED ACTIONS: |
152 | | -1. CREATE/UPDATE CHANGELOG.md with changes |
153 | | -2. VERIFY package version matches API spec version |
154 | | -3. IF version incorrect: UPDATE _version.py AND CHANGELOG |
155 | | -4. SET CHANGELOG entry date to TODAY |
156 | | -``` |
157 | | - |
158 | | -### STEP 5: COMMIT AND PUSH |
159 | | -``` |
160 | | -ACTION: Show changed files (ignore .github, .vscode) |
161 | | -IF user confirms: |
162 | | - git add <changed_files> |
163 | | - git commit -m "<commit_message>" |
164 | | - git push -u origin <branch_name> |
165 | | -IF authentication fails: |
166 | | - PROMPT: gh auth login |
167 | | -IF user rejects: |
168 | | - GUIDE to fix issues and revalidate |
169 | | -``` |
170 | | - |
171 | | -### STEP 6: PULL REQUEST MANAGEMENT |
172 | | -``` |
173 | | -CHECK: Does PR exist for current branch? |
174 | | -IF PR exists: |
175 | | - SHOW PR details |
176 | | -IF NO PR exists: |
177 | | - VERIFY branch != "main" |
178 | | - PUSH changes to remote |
179 | | - GENERATE PR title and description |
180 | | - CREATE PR in DRAFT mode |
181 | | - RETURN PR link |
182 | | -ALWAYS: Display PR summary with status, checks, action items |
183 | | -``` |
184 | | - |
185 | | -### STEP 7: HANDOFF |
186 | | -``` |
187 | | -FINAL ACTIONS: |
188 | | -1. RETURN PR URL for review |
189 | | -2. PROMPT user with exact text: |
190 | | - "Use the azure-rest-api-specs agent to handle the rest of the process and provide it the pull request." |
191 | | -``` |
192 | | - |
193 | 19 | --- |
194 | 20 |
|
195 | 21 | ## PYLINT OPERATIONS |
@@ -284,20 +110,4 @@ This library is failing two release blocking checks - Mypy and Tests - CI. The l |
284 | 110 |
|
285 | 111 | ## SDK release |
286 | 112 |
|
287 | | -There are two tools to help with SDK releases: |
288 | | -- Check SDK release readiness |
289 | | -- Release SDK |
290 | | - |
291 | | -### Check SDK Release Readiness |
292 | | -Run `CheckPackageReleaseReadiness` to verify if the package is ready for release. This tool checks: |
293 | | -- API review status |
294 | | -- Change log status |
295 | | -- Package name approval(If package is new and releasing a preview version) |
296 | | -- Release date is set in release tracker |
297 | | - |
298 | | -### Release SDK |
299 | | -Run `ReleasePackage` to release the package. This tool requires package name and language as inputs. It will: |
300 | | -- Check if the package is ready for release |
301 | | -- Identify the release pipeline |
302 | | -- Trigger the release pipeline. |
303 | | -User needs to approve the release stage in the pipeline after it is triggered. |
| 113 | +For detailed workflow instructions, see [SDK Release](https://github.com/Azure/azure-sdk-for-python/blob/main/eng/common/instructions/copilot/sdk-release.instructions.md). |
0 commit comments