Skip to content

Commit 5bbf605

Browse files
committed
Merge branch 'main' into lusu/agentserver-1110
2 parents 661ecb3 + b9deb55 commit 5bbf605

File tree

501 files changed

+26974
-9506
lines changed

Some content is hidden

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

501 files changed

+26974
-9506
lines changed

.vscode/cspell.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,7 @@
356356
"nbsp",
357357
"noarch",
358358
"NOPERM",
359+
"norecursedirs",
359360
"northcentralus",
360361
"nspkg",
361362
"OAEP",

doc/dev/mgmt/hybrid_model_migration.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ When migrating to the hybrid model design, expect these breaking changes:
1717
| [Additional Properties](#additional-properties-handling) | `additional_properties` parameter removed | Use direct dictionary syntax: `model["key"] = value` |
1818
| [String Representation](#string-representation-matches-rest-api) | Model key output changed from `snake_case` to `camelCase` | Update any code parsing model strings to expect `camelCase` |
1919
| [Serialization/Deserialization](#serialization-and-deserialization-methods-removed) | `serialize` and `deserialize` methods removed | Use dictionary access for serialization, constructor for deserialization |
20+
| [Reserved Property Names](#reserved-property-name-conflicts) | Conflicting names suffixed with `_property` | Update code to use `_property` suffix: `model.keys``model.keys_property` |
2021

2122
## Detailed Breaking Changes
2223

@@ -273,6 +274,50 @@ serialized_dict = as_attribute_dict(model, exclude_readonly=False)
273274
serialized_dict = as_attribute_dict(model, exclude_readonly=True)
274275
```
275276

277+
### Reserved Property Name Conflicts
278+
279+
**What changed**: Hybrid models now inherit from Python's built-in `dict`. If a REST API property name collides with a `dict` method name (e.g. `keys`, `values`, `items`, `clear`, `update`, `get`, `pop`, `popitem`, `setdefault`, `copy`), the Python emitter appends `_property` to the generated attribute to avoid masking the dictionary method.
280+
281+
**What will break**:
282+
283+
- Constructor calls that pass reserved names as keyword arguments: `Model(keys=...)` will now pass the argument to the underlying `dict` constructor, which means the property value will not be set as expected and may result in a `TypeError` or unexpected behavior.
284+
- Attribute access expecting the property value: `model.keys` now refers to the method; calling it without parentheses will not return the property data.
285+
286+
**Before**:
287+
288+
```python
289+
from azure.mgmt.test.models import Model
290+
291+
model = Model(keys={"a": 1}, values=[1, 2, 3])
292+
print(model.keys) # Property value (old behavior)
293+
print(model.values) # Property value (old behavior)
294+
print(model.as_dict()["keys"]) # REST layer value
295+
```
296+
297+
**After**:
298+
299+
```python
300+
from azure.mgmt.test.models import Model
301+
302+
# Reserved property names receive a `_property` suffix
303+
model = Model(keys_property={"a": 1}, values_property=[1, 2, 3])
304+
305+
print(model.keys_property) # ✅ Property value
306+
print(model.values_property) # ✅ Property value
307+
print(model["keys"]) # REST layer value
308+
309+
# names without suffix are now dict methods
310+
print(list(model.keys())) # ✅ Dict method listing all keys in the model
311+
print(list(model.values())) # ✅ Dict method listing all values
312+
```
313+
314+
**Migration steps:**
315+
316+
1. Search for any usage of reserved names as constructor keywords or attribute accesses.
317+
2. Append `_property` to both initialization and attribute access: `Model(keys=...)``Model(keys_property=...)`; `model.keys``model.keys_property`.
318+
3. Update tests and documentation references accordingly.
319+
4. If you had dynamic code relying on `getattr(model, name)`, ensure you add a rule to transform reserved names to `name + "_property"` first.
320+
276321
---
277322

278323
## Additional Helper Methods

doc/tool_usage_guide.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ This repo is currently migrating all checks from a slower `tox`-based framework,
2727
|`verifysdist`| Verify directories included in sdist and contents in manifest file. Also ensures that py.typed configuration is correct within the setup.py. | `azpysdk verifysdist .` |
2828
|`verify_keywords`| Verify that the keyword 'azure sdk' is present in the targeted package's keywords. | `azpysdk verify_keywords .` |
2929
|`import_all`| Installs the package w/ default dependencies, then attempts to `import *` from the base namespace. Ensures that all imports will resolve after a base install and import. | `azpysdk import_all .` |
30+
|`breaking`| Checks for breaking changes. | `azpysdk breaking .` |
3031

3132
## Common arguments
3233

eng/common/instructions/azsdk-tools/verify-setup.instructions.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,17 @@ description: 'Verify Setup'
33
---
44

55
## Goal
6-
This tool verifies the developer's environment for SDK development and release tasks. It returns what requirements are missing for the specified languages and repo.
6+
This tool verifies the developer's environment for SDK development and release tasks. It returns what requirements are missing for the specified languages and repo, or success if all requirements are satisfied.
77

88
Your goal is to identify the project repo root, and pass in the `packagePath` to the Verify Setup tool. For a language repo, pass in the language of the repo.
99

1010
## Examples
1111
- in `azure-sdk-for-js`, run `azsdk_verify_setup` with `(langs=javascript, packagePath=<path>/azure-sdk-for-js)`.
12-
- in `azure-sdk-for-python`, run `azsdk_verify_setup` with `(langs=python, packagePath=<path>/azure-sdk-for-python, venvPath=<path-to-venv>)`.
1312

1413
## Parameter Requirements
15-
WHENEVER Python is included in `langs`, BEFORE RUNNING `azsdk_verify_setup`, you MUST ASK THE USER TO SPECIFY WHICH virtual environment they want to check. DO NOT ASSUME THE VENV WITHOUT ASKING THE USER. After obtaining the `venvPath`, you can run the tool.
16-
17-
The user can specify multiple languages to check. If the user wants to check all languages, pass in ALL supported languages and STILL ASK for a `venvPath`. Passing in no languages will only check the core requirements.
14+
The user can specify multiple languages to check. If the user wants to check all languages, pass in ALL supported languages. Passing in no languages will only check the core requirements.
1815

1916
## Output
20-
Display results in a user-friendly and concise format, highlighting any missing dependencies that need to be addressed.
17+
Display results in a user-friendly and concise format, highlighting any missing dependencies that need to be addressed and how to resolve them.
18+
19+
WHENEVER Python related requirements fail, ALWAYS ASK the user if they have set the `AZSDKTOOLS_PYTHON_VENV_PATH` system environment variable to their desired virtual environment. This tool can only check requirements in the venv path specified by that environment variable.

0 commit comments

Comments
 (0)