Fix incorrect command hints and telemetry in plugin generate handler#7642
Merged
baywet merged 1 commit intomicrosoft:mainfrom Apr 21, 2026
Merged
Conversation
- Change DisplayCleanHint from "client generate" to "plugin generate" so users see the correct command suggestion - Fix error message from "No client found" to "No plugin found" - Fix telemetry tag from "client_name" to "plugin_name" for correct telemetry categorization Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1fd1bda to
c222bd5
Compare
2 tasks
hobostay
pushed a commit
to hobostay/kiota
that referenced
this pull request
Apr 23, 2026
Remove unrelated CHANGELOG entries (microsoft#7643, microsoft#7642, microsoft#7639) that don't belong to this PR. Add C# and Dart writer tests verifying that union model factory methods skip discriminator branches when the mapping key is null/empty (i.e. an unmapped complex type). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
baywet
added a commit
that referenced
this pull request
Apr 23, 2026
…generation (#7641) * Fix potential NullReferenceException in C# union model discriminator generation When no discriminator mapping is found for a property type, `FirstOrDefault` returns a default KeyValuePair with a null key. Accessing `mappedType.Key` without a null check could generate invalid C# code with empty discriminator strings. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: discriminator null key for other languages * docs: adds changelog entries for the recent fixes * fix: badly structured code after discriminator key fix * Add regression tests for unmapped complex types in union factory methods Remove unrelated CHANGELOG entries (#7643, #7642, #7639) that don't belong to this PR. Add C# and Dart writer tests verifying that union model factory methods skip discriminator branches when the mapping key is null/empty (i.e. an unmapped complex type). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * docs: restores missing changelog entries --------- Co-authored-by: Test User <test@example.com> Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com> Co-authored-by: Vincent Biret <vibiret@microsoft.com>
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.
Summary
DisplayCleanHintshowing "client generate" instead of "plugin generate" when an update is skippedclient_nameinstead ofplugin_name, causing plugin operations to be miscategorized in telemetryProblem
The plugin generate handler (
Handlers/Plugin/GenerateHandler.cs) was copy-pasted from the client generate handler without updating all references. Three places incorrectly referenced "client" instead of "plugin":DisplayCleanHint("client generate", "--refresh")— users see"kiota client generate --refresh"instead of"kiota plugin generate --refresh""No client found with the provided name"— misleading when working with plugins.client_name— plugin operations miscategorized as client operationsTest plan
kiota plugin generatewith a non-existent name, verify error message says "plugin"kiota plugin generatewith--refreshon an unchanged plugin, verify hint says "plugin generate"🤖 Generated with Claude Code