Expand back-compat property type preservation to all public model properties#10413
Expand back-compat property type preservation to all public model properties#10413jorgerangel-msft merged 24 commits intomainfrom
Conversation
Agent-Logs-Url: https://github.com/microsoft/typespec/sessions/33d000a2-d811-4f6c-a72b-359b57cee1a2 Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
commit: |
Agent-Logs-Url: https://github.com/microsoft/typespec/sessions/e014a173-0713-44e4-a0b5-4ce8f896d407 Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
…n back-compat) Agent-Logs-Url: https://github.com/microsoft/typespec/sessions/1cb571b4-94fe-450a-bda0-73a4c98e8f9f Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com>
…ompat-support # Conflicts: # packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/EmitterRpc/BackCompatibilityChangeCategory.cs # packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/EmitterRpc/Emitter.cs # packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/ModelProvider.cs Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
|
@copilot an example of the ROM regression is https://github.com/Azure/azure-sdk-for-net/blob/295d15504609244e1dc78bc5c482c8d8e3818ea6/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorizedQuery.cs. Vector was previously ReadOnlyMemory. |
Thanks for the concrete example — that changes my earlier hypothesis. Root cause: the Azure ROM visitor sets Two options to fix it here:
(1) is the right long-term fix since any current/future visitor that mutates |
This is not true. Before this PR, the Vector property was ROM and the internal ctor param was also ROM |
You're right, I was wrong about that — apologies. If the prior binary had both public My updated theory: the ROM visitor rewrites If that's right, the fix I proposed as option (1) — unconditionally cascade
Pushed option (1) in f671e08 — the cascade from |
…t pass Agent-Logs-Url: https://github.com/microsoft/typespec/sessions/feffcf68-840b-4dd5-8361-53035eddf36b Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
…e helper Agent-Logs-Url: https://github.com/microsoft/typespec/sessions/b7e2745a-474f-4b63-876f-d8cb936feb70 Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
|
@copilot there's still a handful of issues in the latest regen: |
Looked at all 4:
Proposed next step: revert f671e08 (unconditional cascade) and keep 2c0f1f7 (override-only cascade). That addresses #1, #2, #4 as a set. #3 I'd like to confirm is pre-existing before acting. LMK if you want me to push the revert. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot lets revert the unconditional cascade but also fix the stale |
…meterProvider.Update Agent-Logs-Url: https://github.com/microsoft/typespec/sessions/e4177a1f-cc04-4b19-b625-12c5c0180923 Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
Done in 3df9c80. Scoped |
Agent-Logs-Url: https://github.com/microsoft/typespec/sessions/ff896649-1e81-4fe0-b600-4648e62a3ac0 Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
|
No changes needing a change description found. |
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
…ilot/expand-back-compat-support
Agent-Logs-Url: https://github.com/microsoft/typespec/sessions/06ff2058-285f-4b8a-aff7-d1d73b545ad8 Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
BuildPropertiesForBackCompatibilityvirtual hook onTypeProviderModelProviderback-compat property logic into the new hookBuildPropertiesForBackCompatibilityfromProcessTypeForBackCompatibilityso it runs after all visitorsProcessTypeForBackCompatibilityto trigger property back-compatbackward-compatibility.mdModel Properties section