Add debug-level summary log of back-compatibility changes in http-client-csharp generator#10415
Open
Add debug-level summary log of back-compatibility changes in http-client-csharp generator#10415
Conversation
…y changes Agent-Logs-Url: https://github.com/microsoft/typespec/sessions/b2456212-73e8-4f37-b9e5-de37fa8f42d5 Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/typespec/sessions/b2456212-73e8-4f37-b9e5-de37fa8f42d5 Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add debug level summary logs for back compatibility changes
Add debug-level summary log of back-compatibility changes in http-client-csharp generator
Apr 17, 2026
Agent-Logs-Url: https://github.com/microsoft/typespec/sessions/357d37d4-17ca-47cc-aeb3-f6585651cbe9 Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/typespec/sessions/67866439-1d0c-40a7-924d-f83a39135c1c Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com>
commit: |
Agent-Logs-Url: https://github.com/microsoft/typespec/sessions/7c6d8338-34c2-426d-bf0a-8503bfc13355 Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/typespec/sessions/3ef978ca-05c9-4720-b536-e9b068a289d8 Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/typespec/sessions/1cb1f965-9936-49a9-8b75-7e402188b812 Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com>
JoshLove-msft
approved these changes
Apr 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Back-compatibility adjustments driven by a library's
LastContractView(parameter reorders, renamed/preserved params, collection type preservation, constructor promotions, enum reorders, added api-version members, model-factory shims, etc.) were hard to spot in generator run logs. This adds a single human-readable summary listing every such change at the end of generation, emitted through the existing logging pipeline.Changes
Emitter(Microsoft.TypeSpec.Generator.EmitterRpc) with categorized, buffered logging:Info(string, BackCompatibilityChangeCategory),Debug(string, BackCompatibilityChangeCategory),Verbose(string, BackCompatibilityChangeCategory)that buffer messages and dedup them per(level, category).WriteBufferedMessages()API that emits a single grouped trace per level via the existing JSON-RPC channel.Emitter.Disposeas a safety net.1 message across 1 categoryvsN messages across M categories).BackCompatibilityChangeCategoryenum (Microsoft.TypeSpec.Generator.EmitterRpc): strongly-typed set of categories used by the buffered overloads; display names are mapped centrally insideEmitter.CSharpGen.ExecuteAsync: callsEmitter.WriteBufferedMessages()after allProcessTypeForBackCompatibilityruns.Emitter.Debug/Infowith aBackCompatibilityChangeCategoryvalue):ClientProvider— method parameter reorderingRestClientProvider— paging param name preservation (top,maxPageSizecasing)ScmModelProvider—AdditionalPropertiesshape preservationModelProvider— collection property type preservation; abstract-model ctor modifier promotionModelFactoryProvider— back-compat method add / replace / skipFixedEnumProvider— enum member reorderingApiVersionEnumProvider— api version members carried over from last contractEmitterTestscovering buffering, dedup, null/empty handling, level separation, and reset.Example output
Back-compat summaries are emitted at
debuglevel, so they are surfaced only whenlogLevel: debug(orverbose) is set on the emitter.