Skip to content

Commit 77a576c

Browse files
authored
Merge branch 'Azure:main' into main
2 parents 13351ff + 93ec31d commit 77a576c

File tree

4,319 files changed

+408947
-157036
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

4,319 files changed

+408947
-157036
lines changed

.github/CODEOWNERS

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -381,19 +381,19 @@
381381
# PRLabel: %Health Deidentification
382382
/sdk/healthdataaiservices/ @alexathomases @Azure/healthdatadeidentification
383383

384-
# AzureSdkOwners: @catalinaperalta
384+
# AzureSdkOwners: @bojunehsu @vkurpad
385385
# ServiceLabel: %Cognitive - Form Recognizer
386386
# ServiceOwners: @bojunehsu @vkurpad
387387

388388
# PRLabel: %Cognitive - Form Recognizer
389-
/sdk/formrecognizer/ @catalinaperalta
389+
/sdk/formrecognizer/ @bojunehsu @vkurpad
390390

391-
# AzureSdkOwners: @YalinLi0312
391+
# AzureSdkOwners: @bojunehsu @vkurpad
392392
# ServiceLabel: %Document Intelligence
393393
# ServiceOwners: @bojunehsu @vkurpad
394394

395395
# PRLabel: %Document Intelligence
396-
/sdk/documentintelligence/ @YalinLi0312
396+
/sdk/documentintelligence/ @bojunehsu @vkurpad
397397

398398
# AzureSdkOwners: @xiangyan99
399399
# ServiceLabel: %Cognitive - Metrics Advisor
@@ -412,7 +412,7 @@
412412
/sdk/translation/azure-ai-translation-text/ @MikeyMCZ
413413

414414
# PRLabel: %Cognitive - Language
415-
/sdk/cognitivelanguage/ @kristapratico @quentinRobinson @wangyuantao
415+
/sdk/cognitivelanguage/ @quentinRobinson @wangyuantao
416416

417417
# PRLabel: %Cognitive - Personalizer
418418
/sdk/personalizer/ @sharathmalladi
@@ -843,13 +843,15 @@
843843

844844
/tools/ @scbedd @mccoyp
845845
/scripts/ @scbedd @mccoyp
846+
/scripts/breaking_changes_checker/ @catalinaperalta
846847
/doc/ @scbedd @mccoyp
847848
/conda/ @scbedd @xiangyan99 @lmazuel
848849

849850
# Add owners for notifications for specific pipelines
850851
/eng/pipelines/templates/jobs/tests-nightly-python.yml @lmazuel @mccoyp
851852
/eng/pipelines/aggregate-reports.yml @lmazuel @mccoyp @YalinLi0312 @kristapratico
852853
/eng/common/pipelines/codeowners-linter.yml @lmazuel @mccoyp
854+
/eng/pipelines/docindex.yml @danieljurek @scbedd @weshaggard @benbp
853855

854856
# Add approvers for typespec-python emitter version updates
855857
/eng/emitter-package.json @mccoyp @catalinaperalta @kristapratico @iscai-msft

.github/copilot-instructions.md

Lines changed: 255 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,264 @@
1-
# Copilot Instructions
1+
# AZURE SDK FOR PYTHON - COPILOT INSTRUCTIONS
22

3-
DO prompt the user to create a virtual environment with `<path_to_python_installation>/python.exe -m venv <environment_name>` and activate it, before running any commands.
3+
---
44

5-
# General Repository Guidelines
6-
- DO check this [website](https://azure.github.io/azure-sdk/python_design.html), and link to pages found there, if possible, when asked about guidelines, or guidance on how to write SDKs. The general guidelines for SDK in this repo are defined there.
5+
## CORE PRINCIPLES
76

8-
# Pylint
7+
### RULE 1: DO NOT REPEAT INSTRUCTIONS
8+
**NEVER repeat instructions when guiding users. Users should follow instructions independently.**
99

10-
## Running Pylint
11-
- When asked how to run pylint, or given a command to run pylint, DO check [this website](https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/pylint_checking.md) and guide the user based on the information you find there.
12-
- DO use a python 3.8 environment that is compatible with the code you are working on. If you are not sure, please ask the user for the python version they are using.
10+
### RULE 2: REFERENCE OFFICIAL DOCUMENTATION
11+
**ALWAYS** reference the [Azure SDK Python Design Guidelines](https://azure.github.io/azure-sdk/python_design.html)
12+
- Link to specific pages when answering guidelines questions
13+
- Use this as the authoritative source for SDK development guidance
1314

15+
### RULE 3: VERIFY ENVIRONMENT FIRST
16+
**BEFORE any commands:**
17+
1. Get path to azure-sdk-for-python repo root, and path to tox.ini file
18+
2. Use `verify_setup` tool from azure-sdk-python-mcp server
19+
3. Ensure Python virtual environment is active
1420

15-
## Fixing Pylint Warnings
21+
**Virtual Environment Setup:**
22+
```bash
23+
# Create new environment
24+
python -m venv <env_name>
1625

17-
### Dos and Don'ts
18-
- DO use the table in https://github.com/Azure/azure-sdk-tools/blob/main/tools/pylint-extensions/azure-pylint-guidelines-checker/README.md and the code examples as a guide on how to fix each rule.
19-
- DO refer to the pylint documentation: https://pylint.readthedocs.io/en/stable/user_guide/checkers/features.html.
26+
# Activate environment
27+
# Linux/macOS:
28+
source <env_name>/bin/activate
29+
# Windows:
30+
<env_name>\Scripts\activate
31+
```
2032

33+
---
2134

22-
- DO NOT solve a pylint warning if you are not 100% confident about the answer. If you think your approach might not be the best, stop trying to fix the warning and leave it as is.
23-
- DO NOT create a new file when solving a pylint error, all solutions must remain in the current file.
24-
- DO NOT import a module or modules that do not exist to solve a pylint warning.
25-
- DO NOT add new dependencies or imports to the project to solve a pylint warning.
26-
- DO NOT make larger changes where a smaller change would fix the issue.
27-
- DO NOT change the code style or formatting of the code unless it is necessary to fix a pylint warning.
28-
- DO NOT delete code or files unless it is necessary to fix a warning.
35+
## TYPESPEC SDK GENERATION - COMPLETE WORKFLOW
36+
37+
### PHASE 1: CONTEXT ASSESSMENT
38+
39+
**ACTION:** Determine TypeSpec project location
40+
```
41+
IF TypeSpec project paths exist in context:
42+
USE local paths to generate SDK from tspconfig.yaml
43+
ELSE:
44+
ASK user for tspconfig.yaml file path
45+
```
46+
47+
### PHASE 2: PREREQUISITES CHECK
48+
49+
**REQUIRED CONDITIONS:**
50+
1. GitHub CLI authenticated: `gh auth login`
51+
2. User on feature branch (NOT main)
52+
```bash
53+
git checkout -b <branch_name>
54+
```
55+
56+
### PHASE 3: TSP-CLIENT RULES
57+
58+
**CRITICAL RULES:**
59+
- **LOCAL REPO:** Do NOT grab commit hash
60+
- **DIRECTORIES:** Let commands auto-create directories
61+
- **PACKAGE GENERATION:** Find tsp-location.yaml in azure-sdk-for-python repo
62+
- **URL REFERENCES:** Use commit hash (NOT branch name) for tspconfig.yaml URLs
63+
64+
**Get latest commit hash:**
65+
```bash
66+
curl -s "https://api.github.com/repos/Azure/azure-rest-api-specs/commits?path=<path_to_tspconfig.yaml>&per_page=1"
67+
```
68+
69+
**DEPENDENCIES:** Verify installation of: node, python, tox
70+
71+
---
72+
73+
## EXECUTION SEQUENCE - 7 MANDATORY STEPS
74+
75+
**ESTIMATED TOTAL TIME: 10-15 minutes**
76+
- SDK Generation: 5-6 minutes
77+
- Static Validation: 3-5 minutes
78+
- Documentation & Commit: 2-4 minutes
79+
80+
**ALWAYS inform users of time expectations before starting any long-running operations.**
81+
82+
### STEP 1: ENVIRONMENT VERIFICATION
83+
```
84+
ACTION: Run verify_setup mcp tool
85+
IF missing dependencies:
86+
STOP and install missing dependencies
87+
THEN proceed to Step 2
88+
```
89+
90+
### STEP 2: SDK GENERATION
91+
```
92+
ACTION: Use azure-sdk-python-mcp sdk generation server tools (init, init_local)
93+
TIMING: ALWAYS inform user before starting: "This SDK generation step will take approximately 5-6 minutes to complete."
94+
IF local path provided:
95+
USE local mcp tools with tspconfig.yaml path
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+
TIMING: Inform user: "Static validation will take approximately 3-5 minutes for each step."
104+
FOR EACH validation step:
105+
RUN validation (tox mcp tool)
106+
IF errors/warnings found:
107+
FIX issues
108+
RERUN same step
109+
ONLY proceed to next step when current step passes
110+
```
111+
112+
**Validation Commands:**
113+
```bash
114+
# Step 3a: Pylint
115+
tox -e pylint -c [path to tox.ini] --root .
116+
117+
# Step 3b: MyPy
118+
tox -e mypy -c [path to tox.ini] --root .
119+
120+
# Step 3c: Pyright
121+
tox -e pyright -c [path to tox.ini] --root .
122+
123+
# Step 3d: Verifytypes
124+
tox -e verifytypes -c [path to tox.ini] --root .
125+
```
126+
127+
**REQUIREMENTS:**
128+
- Provide summary after each validation step
129+
- Edit ONLY files with validation errors/warnings
130+
- Fix each issue before proceeding
131+
132+
### STEP 4: DOCUMENTATION UPDATE
133+
```
134+
REQUIRED ACTIONS:
135+
1. CREATE/UPDATE CHANGELOG.md with changes
136+
2. VERIFY package version matches API spec version
137+
3. IF version incorrect: UPDATE _version.py AND CHANGELOG
138+
4. SET CHANGELOG entry date to TODAY
139+
```
140+
141+
### STEP 5: COMMIT AND PUSH
142+
```
143+
ACTION: Show changed files (ignore .github, .vscode)
144+
IF user confirms:
145+
git add <changed_files>
146+
git commit -m "<commit_message>"
147+
git push -u origin <branch_name>
148+
IF authentication fails:
149+
PROMPT: gh auth login
150+
IF user rejects:
151+
GUIDE to fix issues and revalidate
152+
```
153+
154+
### STEP 6: PULL REQUEST MANAGEMENT
155+
```
156+
CHECK: Does PR exist for current branch?
157+
IF PR exists:
158+
SHOW PR details
159+
IF NO PR exists:
160+
VERIFY branch != "main"
161+
PUSH changes to remote
162+
GENERATE PR title and description
163+
CREATE PR in DRAFT mode
164+
RETURN PR link
165+
ALWAYS: Display PR summary with status, checks, action items
166+
```
167+
168+
### STEP 7: HANDOFF
169+
```
170+
FINAL ACTIONS:
171+
1. RETURN PR URL for review
172+
2. PROMPT user with exact text:
173+
"Use the azure-rest-api-specs agent to handle the rest of the process and provide it the pull request."
174+
```
175+
176+
---
177+
178+
## PYLINT OPERATIONS
179+
180+
### RUNNING PYLINT
181+
182+
**REFERENCE DOCUMENTATION:**
183+
- [Official pylint guide](https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/pylint_checking.md)
184+
- [Tox formatting guide](https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/tests.md#tox)
185+
186+
**COMMAND:**
187+
```bash
188+
tox -e pylint --c <path_to_tox.ini> --root .
189+
```
190+
191+
**DEFAULT PATH:** `azure-sdk-for-python/eng/tox/tox.ini`
192+
193+
### FIXING PYLINT WARNINGS
194+
195+
**REFERENCE SOURCES:**
196+
- [Azure pylint guidelines](https://github.com/Azure/azure-sdk-tools/blob/main/tools/pylint-extensions/azure-pylint-guidelines-checker/README.md)
197+
- [Pylint documentation](https://pylint.readthedocs.io/en/stable/user_guide/checkers/features.html)
198+
199+
**ALLOWED ACTIONS:**
200+
✅ Fix warnings with 100% confidence
201+
✅ Use existing file for all solutions
202+
✅ Reference official guidelines
203+
204+
**FORBIDDEN ACTIONS:**
205+
❌ Fix warnings without complete confidence
206+
❌ Create new files for solutions
207+
❌ Import non-existent modules
208+
❌ Add new dependencies/imports
209+
❌ Make unnecessary large changes
210+
❌ Change code style without reason
211+
❌ Delete code without clear justification
212+
213+
---
214+
215+
## MYPY OPERATIONS
216+
217+
### RUNNING AND FIXING MYPY
218+
219+
**REFERENCE DOCUMENTATION:**
220+
- [Tox guidance](https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/tests.md#tox)
221+
- [MyPy fixing guide](https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/static_type_checking_cheat_sheet.md)
222+
223+
**REQUIREMENTS:**
224+
- Use Python 3.9 compatible environment
225+
- Follow official fixing guidelines
226+
- Use tox mcp tool for running MyPy
227+
228+
---
229+
230+
## Python SDK Health tool
231+
232+
- Use the azure-sdk-python-mcp mcp tool to lookup a library's health status.
233+
- Always include the date of last update based on the Last Refresh date.
234+
- Explanation of statuses can be found here: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/repo_health_status.md
235+
- Release blocking checks are MyPy, Pylint, Sphinx, and Tests - CI. These checks should all PASS. If not PASS, mention that the library is blocked for release.
236+
- If links are available in the table, make the statuses (e.g. PASS, WARNING, etc) you report linked. Avoid telling the user to check the links in the report themselves.
237+
- Don't share information like SDK Owned
238+
239+
### Example
240+
241+
As of <Last Refresh date>, here is the health status for azure-ai-projects:
242+
243+
Overall Status: ⚠️ NEEDS_ACTION
244+
245+
✅ Passing Checks:
246+
247+
Pyright: PASS
248+
Sphinx: PASS
249+
Type Checked Samples: ENABLED
250+
SLA Questions and Bugs: 0
251+
252+
⚠️ Areas Needing Attention:
253+
254+
Pylint: WARNING
255+
Tests - Live: ❓ UNKNOWN
256+
Tests - Samples: ❌ DISABLED
257+
Customer-reported issues: 🔴 5 open issues
258+
259+
❌ Release blocking
260+
261+
Mypy: FAIL
262+
Tests - CI: FAIL
263+
264+
This library is failing two release blocking checks - Mypy and Tests - CI. The library needs attention primarily due to Pylint warnings, disabled sample tests, and open customer-reported issues.

0 commit comments

Comments
 (0)