Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made telemetry data constants true constants #3416

Merged

Conversation

cvpoienaru
Copy link
Member

Made telemetry data constants true constants

Copy link
Member

@Evangelink Evangelink left a comment

Choose a reason for hiding this comment

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

LGTM if we are ok we introducing a "potential" breaking change. We don't expect people to use these but that's public and not currently readonly.

Also, I don't know if we can end up in a situation were we would benefit from having static readonly instead of const (I am thinking about some case were we would have different versions loaded at the same time with the string value being different). cc @nohwnd

Copy link
Member

@Evangelink Evangelink left a comment

Choose a reason for hiding this comment

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

LGTM if we are ok we introducing a "potential" breaking change. We don't expect people to use these but that's public and not currently readonly.

Also, I don't know if we can end up in a situation were we would benefit from having static readonly instead of const (I am thinking about some case were we would have different versions loaded at the same time with the string value being different). cc @nohwnd

@MarcoRossignoli
Copy link
Contributor

MarcoRossignoli commented Feb 25, 2022

If we're potentially breaking why not put internal?

@nohwnd
Copy link
Member

nohwnd commented Mar 1, 2022

@cvpoienaru Do you have any motivation for this change other than not liking the current syntax? Constants will get compiled into the consuming dll. Readonly static strings won't.

@Evangelink
Copy link
Member

@nohwnd The problem with current solution is the missing readonly. Adding it will cause a breaking change, so it might be a good time to also make the change to internal and see if we prefer to go with const or static readonly.

@cvpoienaru
Copy link
Member Author

@nohwnd, @Evangelink pretty much covered the reason for this change. This came up during the telemetry improvements PR review when it was pointed out that it'd be best to make our intention even clearer by making the fields true constants. Whether that means const or static readonly is debatable, however now I'm leaning towards switching to internal static readonly after hearing your arguments. Do we agree on internal static readonly then ?

CC: @MarcoRossignoli

@nohwnd
Copy link
Member

nohwnd commented Mar 3, 2022

The change to internal should be fine .Common. is shipped with runner and host, and uwp provider also does not load it dynamically. So on binary level it should not break anyone.

Microsoft.TestPlatform.17.2.0-dev\tools\net451\Common7\IDE\Extensions\TestPlatform\Microsoft.VisualStudio.TestPlatform.Common.dll
Microsoft.TestPlatform.17.2.0-dev\tools\net451\Common7\IDE\Extensions\TestPlatform\TestHost\Microsoft.VisualStudio.TestPlatform.Common.dll
Microsoft.TestPlatform.CLI.17.2.0-dev\contentFiles\any\netcoreapp2.1\Microsoft.VisualStudio.TestPlatform.Common.dll
Microsoft.TestPlatform.CLI.17.2.0-dev\contentFiles\any\netcoreapp2.1\TestHost\Microsoft.VisualStudio.TestPlatform.Common.dll
Microsoft.TestPlatform.Internal.Uwp.17.2.0-dev\lib\netstandard1.3\Microsoft.VisualStudio.TestPlatform.Common.dll
Microsoft.TestPlatform.Internal.Uwp.17.2.0-dev\lib\netstandard1.3\Microsoft.VisualStudio.TestPlatform.Common.pdb
Microsoft.TestPlatform.Internal.Uwp.17.2.0-dev\lib\uap10.0\Microsoft.VisualStudio.TestPlatform.Common.dll
Microsoft.TestPlatform.Internal.Uwp.17.2.0-dev\lib\uap10.0\Microsoft.VisualStudio.TestPlatform.Common.pdb
Microsoft.TestPlatform.Portable.17.2.0-dev\tools\net451\Microsoft.VisualStudio.TestPlatform.Common.dll
Microsoft.TestPlatform.Portable.17.2.0-dev\tools\netcoreapp2.1\Microsoft.VisualStudio.TestPlatform.Common.dll
Microsoft.TestPlatform.Portable.17.2.0-dev\tools\netcoreapp2.1\TestHost\Microsoft.VisualStudio.TestPlatform.Common.dll
Microsoft.TestPlatform.TestHost.17.2.0-dev\lib\netcoreapp1.0\Microsoft.VisualStudio.TestPlatform.Common.dll
Microsoft.TestPlatform.TestHost.17.2.0-dev\lib\netcoreapp2.1\Microsoft.VisualStudio.TestPlatform.Common.dll
Microsoft.TestPlatform.TestHost.17.2.0-dev\lib\uap10.0\Microsoft.VisualStudio.TestPlatform.Common.dll
Microsoft.TestPlatform.TranslationLayer.17.2.0-dev\lib\net451\Microsoft.VisualStudio.TestPlatform.Common.dll
Microsoft.TestPlatform.TranslationLayer.17.2.0-dev\lib\netstandard2.0\Microsoft.VisualStudio.TestPlatform.Common.dll

@cvpoienaru cvpoienaru merged commit 7e16306 into microsoft:main Mar 3, 2022
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.

4 participants