Skip to content

winVersion.WinVersion: return "Windows 11 unknown" if an unknown build above 10.0.22000 is seen when instantiating#15993

Merged
seanbudd merged 6 commits intonvaccess:masterfrom
josephsl:i15992winVersionReturnWin11Unknown
Jan 2, 2024
Merged

winVersion.WinVersion: return "Windows 11 unknown" if an unknown build above 10.0.22000 is seen when instantiating#15993
seanbudd merged 6 commits intonvaccess:masterfrom
josephsl:i15992winVersionReturnWin11Unknown

Conversation

@josephsl
Copy link
Contributor

@josephsl josephsl commented Jan 1, 2024

Link to issue number:

Closes #15992

Summary of the issue:

When an unknown build above 10.0.22000 is instantiated, winVersion.WinVersion says "Windows 10 unknown".

Description of user facing changes

None

Description of development approach

Using structural pattern matching, say "Windows 11 unknown" if major == 10, minor == 0, build >= 22000 and the build is not recorded in builds to release names private map. This PR also includes modernized type hints and a unit test for this issue.

Testing strategy:

Manual and unit tests:

  • Manual: instantiate winVersion.WinVersion class with major = 10, minor = 0, and a build that is not a public build (21390, 22635, 25398, for instance) and observe that "Windows 11 unknown" is returned as release name if build is 22000 or above.
  • Unit test: an example of a build that is meant for specialized workloads such as Windows Server 23H2 annual container release (build 25398) with no PC version is provided.

Known issues with pull request:

None

Code Review Checklist:

  • Documentation:
    • Change log entry
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • API is compatible with existing add-ons.
  • Security precautions taken.

Note:

Changelog for this PR is listed under "changes for developers" section.

Thanks.

… unknown'. Re nvaccess#15992.

Use structural pattern matching (match/case) when filling out Windows release names. For unknown builds above 10.0.22000, the  uild is named 'Windows 11 unknoww'. The overall structural patern matching proceeds as follows:

match (major, minor):
* 6.3: Windows 8.1
* 10.0 and is a known build: retrieve release name from the private builds to release names map
* 10.0 with unkonwn build >= 22000: Windows 11 unknown
* 10.0: Windows 10 unknown
* Everything else: Windows unknown release
Modernize type hints:
* typing.Optional: type | None
* typin.Dict: just use 'dict'
…own' test. Re nvaccess#15992.

To test 'Windows 11 unknown' release name, use 10.0.25398 (Windows 11 Zinc/Server 23H2 (annual container release)) which is unkonwn to NVDA.
Minimum Windows version = 8.1, emoji panel introduced = Windows 10 Fall Creators Update (1709), done to avoid use of deprecated attributes.
@josephsl josephsl requested a review from a team as a code owner January 1, 2024 02:48
@josephsl josephsl requested a review from gerald-hartig January 1, 2024 02:48
@AppVeyorBot
Copy link

See test results for failed build of commit 2efa7d0c09

return "Windows 8.1"
elif self.major == 10:
# From Version 1511 (build 10586), release Id/display version comes from Windows Registry.
match (self.major, self.minor):
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice to see this new structural pattern, and I agree with its use.

However, I remind here that the computation of the complexity of a function does not take it into account unfortunately with our tools; it becomes always more urgent to move to a new linting tool (or version) if we want to continue to check complexity correctly.

@seanbudd seanbudd added the conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review. label Jan 1, 2024
@seanbudd seanbudd merged commit 5601830 into nvaccess:master Jan 2, 2024
@nvaccessAuto nvaccessAuto added this to the 2024.2 milestone Jan 2, 2024
@josephsl josephsl deleted the i15992winVersionReturnWin11Unknown branch January 3, 2024 18:49
Nael-Sayegh pushed a commit to Nael-Sayegh/nvda that referenced this pull request Feb 15, 2024
…d above 10.0.22000 is seen when instantiating (nvaccess#15993)

Closes nvaccess#15992

Summary of the issue:
When an unknown build above 10.0.22000 is instantiated, winVersion.WinVersion says "Windows 10 unknown".

Description of user facing changes
None

Description of development approach
Using structural pattern matching, say "Windows 11 unknown" if major == 10, minor == 0, build >= 22000 and the build is not recorded in builds to release names private map. This PR also includes modernized type hints and a unit test for this issue.
SaschaCowley pushed a commit to SaschaCowley/nvda that referenced this pull request Feb 27, 2024
…d above 10.0.22000 is seen when instantiating (nvaccess#15993)

Closes nvaccess#15992

Summary of the issue:
When an unknown build above 10.0.22000 is instantiated, winVersion.WinVersion says "Windows 10 unknown".

Description of user facing changes
None

Description of development approach
Using structural pattern matching, say "Windows 11 unknown" if major == 10, minor == 0, build >= 22000 and the build is not recorded in builds to release names private map. This PR also includes modernized type hints and a unit test for this issue.
Adriani90 pushed a commit to Adriani90/nvda that referenced this pull request Mar 13, 2024
…d above 10.0.22000 is seen when instantiating (nvaccess#15993)

Closes nvaccess#15992

Summary of the issue:
When an unknown build above 10.0.22000 is instantiated, winVersion.WinVersion says "Windows 10 unknown".

Description of user facing changes
None

Description of development approach
Using structural pattern matching, say "Windows 11 unknown" if major == 10, minor == 0, build >= 22000 and the build is not recorded in builds to release names private map. This PR also includes modernized type hints and a unit test for this issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows version classes: return "Windows 11 unknown" if running on 10.0.22000 or later and the build is unknown to NVDA

5 participants