Skip to content

Conversation

@zhiyuanliang-ms
Copy link
Member

Why this PR?

Currently, we put VariantAssignementReason enum in the activity tags. ref

When putting it into app insights telemetry, we call ToString on Enum type, this is not a good practice. Because, code refactoring may cause the value in telemetry changed.

We also call ToString on 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 ref
Related PR: microsoft/FeatureManagement#26

Visible Changes

No behavior change

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.");

@zhiyuanliang-ms zhiyuanliang-ms merged commit 71aa5f2 into main Jan 21, 2025
4 checks passed
@zhiyuanliang-ms zhiyuanliang-ms deleted the zhiyuanliang/avoid-using-enum-name branch January 21, 2025 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants