[http-client-csharp] Handling types that are both experimental and obsolete, including omitting unused types
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- csharp
- Ambito
- developer-experience, tooling
Direzione di ricerca
Start with the C# generator changes in Azure/azure-sdk-for-net#64227 and inspect how it emits [Obsolete] and [Experimental] attributes, then trace model reachability and type suppression customization. The issue asks for a safe policy covering backward compatibility, retained SDK references, serialization, custom code, and generated suppressions. Done means proposing and implementing a policy or opt-in mechanism that handles these cases without breaking generated or custom code.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Context
While updating the C# generator in Azure/azure-sdk-for-net#64227 to @typespec/http-client-csharp 1.0.0-alpha.20261026.4, regeneration added [Obsolete] to three types that already have [Experimental("AAIP001")]:
Azure.AI.Extensions.OpenAI.BrowserAutomationPreviewToolAzure.AI.Projects.Agents.BrowserAutomationPreviewToolboxToolAzure.AI.Projects.Agents.WorkflowAgentDefinition
This produces obsolete diagnostics at existing use sites. It also exposes a compiler interaction: adding [Obsolete] to an experimental type causes references inside that type to other experimental APIs to start reporting their diagnostics. For example, BrowserAutomationPreviewTool derives from OpenAI's experimental ResponseTool, so both generated and custom partial declarations start reporting OPENAI001.
Minimal reproduction
Verified with .NET SDK 10.0.401:
using System;
using System.Diagnostics.CodeAnalysis;
[Experimental("OPENAI001")]
public class ExperimentalBase { }
[Experimental("AAIP001")]
[Obsolete("Legacy")]
public class Derived : ExperimentalBase { }
The base-class reference reports OPENAI001. Removing only [Obsolete("Legacy")] makes the example compile without diagnostics.
Desired direction / questions
What should the generator's policy be for types that are both experimental and deprecated?
Ideally, we would not generate the type when it is not required for backward compatibility and is not otherwise used. Could we consider:
- Omitting these types when the configured backward-compatibility baseline does not require them and no retained SDK surface depends on them, or providing an explicit opt-in policy for this behavior.
- Defining the reachability rules carefully: client signatures, other models, polymorphic serialization/deserialization, and custom code may still require a type. Generator-created model factories or model-reader/writer context registrations should not accidentally make an otherwise unused type impossible to omit.
- Providing a supported per-type exclusion customization when automatic omission cannot be determined safely. The current C#
CodeGenSuppressattribute suppresses members, not top-level types. - When the type must remain, generating the necessary narrowly scoped suppressions for experimental dependencies so that adding
[Obsolete]does not break generated code. Custom-code references may still need explicit acknowledgement.
The types above are examples of the attribute interaction, not a claim that they can all be removed as-is: there are existing custom dispatch, telemetry, test, and sample references that must be accounted for. The goal is to discuss a safe policy and customization mechanism rather than dropping every deprecated experimental type unconditionally.
- Lingua principale
- Java
- Stelle
- 5.9k
- Fork
- 421
- Merge medio
- 2g 3h
- PR unite (30g)
- 176
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di microsoft/typespec
-
bug emitter:client:csharp
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
microsoft/typespec#12572 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Make website build cross-platform compatibleForse già presa @pcbeingused333 l’ha presa oggi. Apertabug meta:website
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
microsoft/typespec#12550 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Emitter framework: make the language-specific Alloy peer dependencies optionalForse già presa @timotheeguerin l’ha presa 8 giorni fa. Apertaemitter-framework feature triaged:core
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 62/100
microsoft/typespec#12476 · 1 commento · 2 reazioni · 2 assegnatari ·
I maintainer di solito rispondono entro 1 giorno
-
Upgrade C# generator Roslyn to 5.9.0Forse già presa @ArthurMa1978 l’ha presa 7 giorni fa. Apertaemitter:client:csharp feature
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
microsoft/typespec#12445 · 2 commenti · 1 reazione · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
bug emitter:client:python
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
microsoft/typespec#12360 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di microsoft/typespec
Issue simili
-
GCC 15.2: -Wcast-qual warning - cast discards const qualifier from pointer target type (H5trace.c)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
I maintainer di solito rispondono entro 1 giorno
-
[Bug] RemotingHelper.connect swaps the socket send and receive buffer configurationForse già presa @amalsaidov l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
needs-area-label
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 2 giorni
-
area/ai area/backend component/zeebe kind/task
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
spAnser/reacharound#38 ·