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

Update Environment.OSVersion for browser platform #38790

Merged
merged 2 commits into from
Jul 10, 2020

Conversation

marek-safar
Copy link
Contributor

@marek-safar marek-safar commented Jul 5, 2020

Introduce PlatformID.Unknown for this is "legacy" API to allow returning some sensible value

Gathering quick feedback if this makes sense instead of e.g. PNSE

@lewing

@Dotnet-GitSync-Bot
Copy link
Collaborator

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

@Dotnet-GitSync-Bot
Copy link
Collaborator

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

@@ -3072,6 +3072,7 @@ public enum PlatformID
Unix = 4,
Xbox = 5,
MacOSX = 6,
Unknown = 7,
Copy link
Member

Choose a reason for hiding this comment

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

Was this API reviewed?

Copy link
Contributor Author

@marek-safar marek-safar Jul 5, 2020

Choose a reason for hiding this comment

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

Not yet. Does it make sense to you?

Copy link
Member

Choose a reason for hiding this comment

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

Seems ok.

@stephentoub stephentoub added the NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) label Jul 5, 2020
@marek-safar marek-safar marked this pull request as draft July 5, 2020 12:58
@marek-safar
Copy link
Contributor Author

marek-safar commented Jul 9, 2020

Blocked by #38984

@marek-safar marek-safar removed the NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) label Jul 10, 2020
@marek-safar marek-safar marked this pull request as ready for review July 10, 2020 10:57
@marek-safar marek-safar requested a review from stephentoub July 10, 2020 10:57
@@ -3072,6 +3072,7 @@ public enum PlatformID
Unix = 4,
Xbox = 5,
MacOSX = 6,
Other = 7,
Copy link
Member

Choose a reason for hiding this comment

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

Not related to this PR, but, @terrajobst, I see that the src has EditorBrowsableState.Never on some entries, but the ref doesn't have that. Which is correct?

Copy link
Member

@stephentoub stephentoub Jul 10, 2020

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Fixing in #39065

Copy link
Member

Choose a reason for hiding this comment

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

It was not intentional. I guess I have just hit a GenAPI bug that I did not notice.

{
private static OperatingSystem GetOSVersion()
{
return new OperatingSystem(PlatformID.Other, new Version(1, 0, 0, 0));
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a test for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are tests already which are being fixed/enabled as part of #38996

@marek-safar
Copy link
Contributor Author

marek-safar commented Jul 10, 2020

Reopening - it was closed by other PR

@marek-safar marek-safar reopened this Jul 10, 2020
@marek-safar marek-safar merged commit 26cb166 into dotnet:master Jul 10, 2020
@marek-safar marek-safar deleted the wasm-size branch July 10, 2020 22:07
akoeplinger added a commit to akoeplinger/runtime that referenced this pull request Jul 11, 2020
Creating an OperatingSystem with PlatformID.Other would result in an exception about an unexpected enum value.
dotnet#38790 was missing some tests that verified this behavior.
akoeplinger added a commit that referenced this pull request Jul 11, 2020
Creating an OperatingSystem with PlatformID.Other would result in an exception about an unexpected enum value.
#38790 was missing some tests that verified this behavior.
@ghost ghost locked as resolved and limited conversation to collaborators Dec 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants