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

Remove internal usage of deprecated controlTypes constants #12549

Closed
5 tasks done
seanbudd opened this issue Jun 15, 2021 · 3 comments · Fixed by #12836
Closed
5 tasks done

Remove internal usage of deprecated controlTypes constants #12549

seanbudd opened this issue Jun 15, 2021 · 3 comments · Fixed by #12836
Labels
deprecated/2022.1 Label used to track deprecations due for removal in the 2022.1 release p2 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority
Milestone

Comments

@seanbudd
Copy link
Member

seanbudd commented Jun 15, 2021

In #12510 several enums were introduced to replace constants. The usage of those constants was deprecated, the constants will be removed in 2022.1. Before the 2022.1 release process starts, the usages of the constants must be converted to use the enums instead.

@seanbudd seanbudd added the deprecated/2022.1 Label used to track deprecations due for removal in the 2022.1 release label Jun 15, 2021
@seanbudd seanbudd added this to the 2022.1 milestone Jun 15, 2021
@feerrenrut feerrenrut changed the title Deprecations for 2022.1 Remove internal usage of deprecated controlTypes constants Jun 15, 2021
@feerrenrut feerrenrut modified the milestones: 2022.1, 2021.2 Jun 15, 2021
@feerrenrut
Copy link
Contributor

This has to be completed before 2022.1 is started (milestones are usually used to signify "before completion"). These changes should be started early, ideally considering this work for every release until it is complete.

@feerrenrut
Copy link
Contributor

Since this code will become part of the 2021.2 API. It needs to be proved before release. If there are currently no usages of the new enum approach, it is yet to be proved.

@feerrenrut feerrenrut modified the milestones: 2021.2, 2021.3 Jul 13, 2021
feerrenrut pushed a commit that referenced this issue Jul 27, 2021
Part of #12549

# Summary:
controlTypes.ROLE_* are deprecated, to be replaced by controlTypes.ROLE.*

# Description of fix:
Replaced all instances of controlTypes.ROLE_ with controlTypes.Role. across .py files
Search and manually replace final ROLE_ constant usages.

Used regex: 
[^\.]\bROLE_

Because of:
- oleacc.ROLE_* the regex excludes the form <Foo>.ROLE_
- IA2_ROLE_* the regex ensures ROLE_ is the prefix of the symbol.

# Testing:
- Manually inspect regex results.
- Existing unit tests exist for controlTypes
- Unit tests added for DisplayStringEnum, and test_roleLabels to ensure all enum values have a label.
feerrenrut pushed a commit that referenced this issue Aug 10, 2021
Part of #12549

# Summary:
controlTypes.STATE_* are deprecated, to be replaced by controlTypes.State.*

# Description of fix:
Replaced all instances of controlTypes.STATE_ with controlTypes.State. across .py files

Searched and manually replaced final STATE_ constant usages
 - using the regex: [^\.]\bSTATE_
 - which finds STATE_ instances

Because other usages of "STATE_" are common such as:
- oleacc.STATE_*, the regex excludes the form <Foo>.STATE_
- IA2_STATE_*, the regex ensures STATE_ is the prefix of the symbol.

# Testing:
- Manually inspect regex results.
- Existing unit tests exist for controlTypes
- New unit tests are written for displayString and negativeDisplayString, checking the labels of enum members
@feerrenrut feerrenrut modified the milestones: 2021.3, 2022.1 Sep 3, 2021
@feerrenrut
Copy link
Contributor

Bumping this to 2022.1. However it is important to get this done early in the dev cycle, marking as high priority. Additionally, when updating the version, the "auto deprecations" for the remaining work will need be disabled.

@feerrenrut feerrenrut added the p2 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority label Sep 3, 2021
seanbudd added a commit that referenced this issue Sep 13, 2021
…2821)

Part of #12549

Summary of the issue:
controlTypes.stateLabels has been deprecated, usages such as controlTypes.stateLabels[controlTypes.State.*] should be replaced to their equivalent controlTypes.State.*.displayString

Description of how this pull request fixes the issue:
Use displayString and negativeDisplayString instead of stateLabels and negativeStateLabels.
seanbudd added a commit that referenced this issue Sep 13, 2021
… controlTypes helper functions (#12836)

Closes #12549

Summary of the issue:
characterProcessing.SYMLVL_* constants should be replaced using their equivalent SymbolLevel.* before 2022.1.
Unit testing for controlTypes helper functions needed updating for soon to be removed processNegativeStates and processPositiveStates.

Update the usages of these constants and helper functions

Testing strategy:
Search the repo for 2022 usages and noted deprecations in changes for developers.
Ensure all code deprecated for removal in 2022.1 is not used in the codebase.
@seanbudd seanbudd modified the milestones: 2022.1, 2021.3 Oct 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deprecated/2022.1 Label used to track deprecations due for removal in the 2022.1 release p2 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority
Projects
None yet
2 participants