Avoid using boolean.ToString and enum.ToString#525
Merged
zhiyuanliang-ms merged 3 commits intomainfrom Jan 21, 2025
Merged
Conversation
There was a problem hiding this comment.
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
src/Microsoft.FeatureManagement.Telemetry.ApplicationInsights/ApplicationInsightsEventPublisher.cs:78
- [nitpick] The error message could be more descriptive. Suggestion: "The variant assignment reason '{reason}' is unrecognizable."
throw new ArgumentOutOfRangeException(nameof(activityEvent), "The variant assignment reason is unrecognizable.");
...crosoft.FeatureManagement.Telemetry.ApplicationInsights/ApplicationInsightsEventPublisher.cs
Outdated
Show resolved
Hide resolved
jimmyca15
reviewed
Jan 15, 2025
...crosoft.FeatureManagement.Telemetry.ApplicationInsights/ApplicationInsightsEventPublisher.cs
Outdated
Show resolved
Hide resolved
jimmyca15
reviewed
Jan 15, 2025
...crosoft.FeatureManagement.Telemetry.ApplicationInsights/ApplicationInsightsEventPublisher.cs
Outdated
Show resolved
Hide resolved
jimmyca15
approved these changes
Jan 15, 2025
jimmyca15
approved these changes
Jan 17, 2025
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.
Why this PR?
Currently, we put
VariantAssignementReasonenum in the activity tags. refWhen putting it into app insights telemetry, we call
ToStringon Enum type, this is not a good practice. Because, code refactoring may cause the value in telemetry changed.We also call
ToStringon boolean, which will produce "True" instead of "true". Since all of our released packages have the same behavior, we should keep it. But it should be hard-coded. Like JS FM does ref and refRelated PR: microsoft/FeatureManagement#26
Visible Changes
No behavior change