Skip to content

Allow add-ons to supply version compatibility information in manifests, and use this information to disable incompatible add-ons#8006

Merged
feerrenrut merged 58 commits into
nvaccess:masterfrom
BabbageCom:i6275
Dec 6, 2018
Merged

Allow add-ons to supply version compatibility information in manifests, and use this information to disable incompatible add-ons#8006
feerrenrut merged 58 commits into
nvaccess:masterfrom
BabbageCom:i6275

Conversation

@LeonarddeR

@LeonarddeR LeonarddeR commented Feb 16, 2018

Copy link
Copy Markdown
Collaborator

Link to issue number:

Closes #6275

Summary of the issue:

Add-ons do not supply version compatibility in their manifests. This means that there is no way for NVDA to detect whether an add-on is supported or not.

Description of how this pull request fixes the issue:

This pr allows setting the following properties in an add-ons manifest:

  • minimumNVDAVersion: The minimum required version of NVDA for an add-on to work properly.
  • lastTestedNVDAVersion: The last version of NVDA an add-on has been tested with.

This information is acted upon by NVDA as follows:

  1. Add-ons that have a higher minimumNVDAVersion in their manifest will be force disabled when NVDA starts. There is no means for the end user to enable the add-on again, except for changing the manifest. If add-on authors require a new version, they do it for a reason.

  2. lastTestedNVDAVersion. Users are warned and strongly discouraged from installing / enabling an addon that has not been tested with a version of NVDA equal to or greater than their version.

When one or more add-ons refuse to load due to their incompatible state, the user will receive a warning when NVDA starts. They are able to decide whether to open the add-ons manager to investigate incompatible add-ons and are advised to remove or update them.

GUI warnings are presented:

  • During installation of an addon
  • Before any installation task, regardless of how initiated (except silent command line installs):
    • launcher
    • auto update check
    • manual update check
    • after postponing an update, and initiating it from either the NVDA menu, the Exit NVDA dialog, the check for update option, or the auto update check.
  • After an update of NVDA, if incompatible add-ons are still present. This may occur if a separate windows profile is responsible for the update of NVDA.

Testing performed:

Added the new keys to an add-ons manifest. The add-on refused to load when the minimum NVDA version is newer.

Future considerations

  1. Personally, I"m a great advocate of prohibiting untested add-ons on secure screens by default, but I think we should not do it right from the start. I know many people who are using Vocalizer 2.0 on their logon screens, and they will from one day on another be unable to do this, unless they update their add-on. We should really consider this again when auto updating is there, though.
  2. Add-ons without the minimumRequiredVersion manifest key will be treated as supported by default. Once speech refactor lands or at least when the transition to Python 3 starts, we could start enforcing block add-ons missing this manifest entry. We could also make this dependent on what's in the add-on, whether it only contains appModules or also speech synthesizer drivers.

Known issues with pull request:

Change log entry:

  • Changes
    • Add-on authors now can enforce a minimum required NVDA version for their add-ons. Unsupported add-ons will not load or install. (Allow addons to specify minimum compatible version of NVDA #6275)
    • Add-on authors must now specify the last version of NVDA the add-on has been tested against. Users will be warned against installing or enabling untested add-ons.
  • Changes for developers
    • Add-on authors are now able to provide NVDA version compatibility information in add-on manifests. (Allow addons to specify minimum compatible version of NVDA #6275)
      • minimumNVDAVersion: The minimum required version of NVDA for an add-on to work properly.
      • lastTestedNVDAVersion: The last version of NVDA an add-on has been tested with.

Leonard de Ruijter added 3 commits February 15, 2018 07:16
@LeonarddeR

Copy link
Copy Markdown
Collaborator Author

Forgot to point out that I based this on #7930, which is not yet in master. I belief this should not cause any problems though.

@LeonarddeR LeonarddeR added component/NVDA-GUI Addon/management In NVDA management of addons by users. labels Feb 16, 2018
@michaelDCurran

michaelDCurran commented Feb 16, 2018 via email

Copy link
Copy Markdown
Member

@LeonarddeR

Copy link
Copy Markdown
Collaborator Author

@michaelDCurran commented on 16 feb. 2018 11:25 CET:

In the long-term, is the eventual goal that the disable add-ons not
tested with this version option be on by default?

I think we should be very reluctant to do this, at least not at all before we have auto updating of add-ons. Also, if we enforce this, it might be good to do a compatibility check before updating. This shouldn't be very difficult actually.

@derekriemer

Copy link
Copy Markdown
Collaborator

make sure to update the devGuide before this merges.

@feerrenrut feerrenrut left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this will need further review, but some quick thoughts looking over this now:
Has the idea of using build number rather than release version been considered? As far as I am aware, the build number is guaranteed to be linear and with no duplicates. It would be simpler to compare (because it is not multi part) and it offers a much finer granularity for addon developers. I haven't thought this through carefully. How do next / RC / dev / try builds fit into the current scheme?

Comment thread developerGuide.t2t Outdated
Comment thread source/addonHandler.py Outdated
Comment thread source/addonHandler.py Outdated
@LeonarddeR

Copy link
Copy Markdown
Collaborator Author

Has the idea of using build number rather than release version been considered?

The problem is that one will never know what a build number will be of a release version before it comes out. For example, when version 2018.2 is in development, add-on authors might want to declare their add-ons to be compatible before the actual release comes out.

@feerrenrut

Copy link
Copy Markdown
Contributor

I forgot about this PR, do re-request review if it seems like this happens.

add-on authors might want to declare their add-ons to be compatible before the actual release comes out.

Yes, good point. However, this is only really necessary for the last tested NVDA version. If we were strict, we would say that you can not test have tested against NVDA release x until release x is built and the build number is known. Being pragmatic about this, what we gain by using the release version is ease for the addon-developers to prepare for an upcoming release and for them to be able to guarantee that the addon will be available from day one of the new version. What we lose is the granularity, and ease of comparison.

I think we should stick with the release version.

@feerrenrut feerrenrut self-requested a review May 8, 2018 06:20
@derekriemer

Copy link
Copy Markdown
Collaborator

is there a way we could make it be disabled for next/master then? We need a way to make sure devs don't have their addon disabled unnecessarily.

@LeonarddeR

This comment has been minimized.

@feerrenrut

This comment has been minimized.

@derekriemer

This comment has been minimized.

@LeonarddeR

This comment has been minimized.

@LeonarddeR

This comment has been minimized.

@feerrenrut

This comment has been minimized.

@LeonarddeR

This comment has been minimized.

@feerrenrut

This comment has been minimized.

@LeonarddeR

This comment has been minimized.

@LeonarddeR LeonarddeR mentioned this pull request Jul 3, 2018
@feerrenrut

Copy link
Copy Markdown
Contributor

@michaelDCurran

This includes the launcher's install/update dialog where the 'run NvDA on the windows logon screen" checkbox would normally be focused by default.

I'm a little uncertain about this. It might make it harder to discover these checkboxes? Would it be better for these dialogs to have a new checkbox similar to the addon installation warning ("I understand that this add-on has not been tested with my version of NVDA") and disable the "install" / "continue" button until it is checked?

@michaelDCurran

Copy link
Copy Markdown
Member

@feerrenrut I think a new checkbox would be okay. But the wording would need to be clear. In your example you said "this add-on". In most cases the user is updating NvDA, so it would be more like "Existing add-ons are not compatible with this version of NVDA".

Comment thread user_docs/en/userGuide.t2t Outdated
Comment thread user_docs/en/userGuide.t2t
Comment thread user_docs/en/userGuide.t2t
Comment thread user_docs/en/userGuide.t2t
During install the user must check a box to confirm that they understand
that their nvda installation contains addons that may not have been
tested and will be disabled after the installation of NVDA.

@michaelDCurran michaelDCurran left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There is something wrong with the line endings of source/addonHandler/__init__.py The whole file looks like it has been changed. True it was moved from source/addonHandler.py but git diff knows that 75% of the file is the same. I had to read the diff manually with git diff --ignore-space-at-eol.

]
assert compatibilityStateValue in acceptedUserSetCompatVals

autoDeduced = cls._getAutoDeduducedAddonCompat(addon, NVDAVersion)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm guessing both the call and the actual definition are a typo: _getAutoDeduducedAddonCompat.
Perhaps _getAutoDeducedAddonCompat

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Oh, haha that's a good one. I'll fix this up.

Comment thread source/gui/installerGui.py Outdated
continueButton.SetDefault()
if not shouldAskAboutAddons:
continueButton.SetDefault()
continueButton.SetFocus()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think this is right. The focus should start on the Windows logon checkbox, not the continue button.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yep, fair point. I was going for consistency with the other dialogs, but I think you are right.

@josephsl

josephsl commented Dec 5, 2018 via email

Copy link
Copy Markdown
Contributor

When choosing installation options, the focused control should be the
first checkbox, not the continue button.
@feerrenrut

Copy link
Copy Markdown
Contributor

@michaelDCurran Indeed, the line endings have changed, however, regardless of what I do with line endings, the only way I can get git diff to display a sensible diff is with either -w or with --ignore-space-at-eol. Perhaps the diff on GitHub would be better if I reverted the line endings and pushed.

Correct me if I'm wrong, but I believe most of the files are checked in with windows (CRLF) endings, so I expect that changing the line endings is preferable anyway?

regarding line endings, see my comment on #6275

@josephsl Sorry, I couldn't find a relevant comment?

@feerrenrut

Copy link
Copy Markdown
Contributor

I probably could have been more explicit, the line endings used to be LF (unix style) now they are CRLF (windows style).

@michaelDCurran michaelDCurran left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I was able to clearly read the diff for source/addonHandler/__init__.py with git diff.
That file probably should have windows style line endings. But the quick test I did, Git still thought the entire file had changed. It is probably not that important.

Add-ons can now supply two new manifest values for better control over
the compatibility of add-ons in NVDA.
@feerrenrut feerrenrut merged commit a254551 into nvaccess:master Dec 6, 2018
@nvaccessAuto nvaccessAuto added this to the 2018.4 milestone Dec 6, 2018
@LeonarddeR

LeonarddeR commented Dec 6, 2018

Copy link
Copy Markdown
Collaborator Author

Woops, I intended to have another run over the code, but turns out I didn't make that clear enough. I also think it is clear that it is pretty difficult to test code that is involved in the update process. Note that this is not a request to revert this, but there might be some things to polish.

  1. One major disadvantage of the current state is that untested add-ons are disabled by default. While this makes sense, it can result into behavior one might not expect. For example:

    1. Install NVDA 2018.4
    2. Use the Vocalizer (Expressive) add-on along with a desired voice
    3. Whenever 2019.1 is out, perform an update.
    4. As soon as the update process starts, NVDA switches to espeak, even on Windows 10, where a switch to one core might me more desirable.
    5. One might be unable to understand espeak, in which case one is stuck.

    Also consider the impact this might have for braille display add-ons used by deaf blind users.

  2. First letter navigation does not work in the incompatible add-ons list. That might be because the check mark is the first item in the list, however I do not recall this behavior from the time I tested the AutoWidthCheckableListCtrl.

@LeonarddeR

Copy link
Copy Markdown
Collaborator Author

@leonardder commented on 6 Dec 2018, 13:01 CET:

First letter navigation does not work in the incompatible add-ons list. That might be because the check mark is the first item in the list, however I do not recall this behavior from the time I tested the AutoWidthCheckableListCtrl.

Ugh, and the list control exposes the relevant columns using accDescription. This basically means that disabling object descriptions in NVDA's object presentation settings will only announce the check box, nothing else. Hopefully #8858 can help with this.

@michaelDCurran

michaelDCurran commented Dec 6, 2018 via email

Copy link
Copy Markdown
Member

@michaelDCurran

Copy link
Copy Markdown
Member

This pr is causing alpha snapshots to no longer update.
After downloading and before installing there is the following traceback:

ERROR - unhandled exception (09:21:14.213): 
Traceback (most recent call last): 
  File "gui\__init__.pyc", line 985, in Notify 
  File "updateCheck.pyc", line 578, in _guiExecNotify 
  File "updateCheck.pyc", line 669, in _downloadSuccess 
  File "updateCheck.pyc", line 442, in __init__ 
  File "versionInfo.pyc", line 46, in getNVDAVersionTupleFromString 
ValueError: alpha-16387,0a5c7678 

This pr assumes that the version string coming from the update server is numeric, however it is not in the case of snapshots.
I'm not sure if the server actually gives back a numeric version as well or not.
Should we revert this pr for now, based on this and other discussions going on in parallel to improve this feature?

@michaelDCurran

Copy link
Copy Markdown
Member

Some options:

  • We don't bother checking against snapshots. I.e. we just allow non-numeric versions to accept all add-ons.
  • We prepend snapshot version strings with the version year.major like betas and rcs so we can then grab this for checking.
  • We some how find out the numeric version from scons or the generated launcher file, and send this to the server when publishing snapshots, and have the numeric version be given to clients along with the friendly version string. Then the numeric version can be checked by the client.

The first option is the easiest and perhaps should be the way to go for now, but we still could go with one of the other options at any point.

Note: right now I have disabled further alphas from being picked up by update clients.

@LeonarddeR

Copy link
Copy Markdown
Collaborator Author

Some options:

* We some how find out the numeric version from scons or the generated launcher file, and send this to the server when publishing snapshots, and have the numeric version be  given to clients along with the friendly version string. Then the numeric version can be checked by the client.

I almost have a patch ready that somehow does this. It calculates the version tuple based on the fileVersion info in the executable. This was actually what I intended to do from the start, but it somehow got forgotten in the process of Reef picking this up, for which I'm probably the one to blame.

See #9026

@LeonarddeR LeonarddeR added the BabbageWork Pull requests filed on behalf of Babbage B.V. label Oct 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Addon/management In NVDA management of addons by users. BabbageWork Pull requests filed on behalf of Babbage B.V. component/NVDA-GUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow addons to specify minimum compatible version of NVDA

7 participants