Allow add-ons to supply version compatibility information in manifests, and use this information to disable incompatible add-ons#8006
Conversation
…ion in an add-on manifest, and use them to block add-ons from loading if desired.
|
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. |
|
In the long-term, is the eventual goal that the disable add-ons not
tested with this version option be on by default?
|
|
@michaelDCurran commented on 16 feb. 2018 11:25 CET:
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. |
|
make sure to update the devGuide before this merges. |
feerrenrut
left a comment
There was a problem hiding this comment.
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?
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. |
|
I forgot about this PR, do re-request review if it seems like this happens.
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. |
|
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. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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? |
|
@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". |
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
left a comment
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
I'm guessing both the call and the actual definition are a typo: _getAutoDeduducedAddonCompat.
Perhaps _getAutoDeducedAddonCompat
There was a problem hiding this comment.
Oh, haha that's a good one. I'll fix this up.
| continueButton.SetDefault() | ||
| if not shouldAskAboutAddons: | ||
| continueButton.SetDefault() | ||
| continueButton.SetFocus() |
There was a problem hiding this comment.
I don't think this is right. The focus should start on the Windows logon checkbox, not the continue button.
There was a problem hiding this comment.
Yep, fair point. I was going for consistency with the other dialogs, but I think you are right.
|
Hi, regarding line endings, see my comment on #6275 – this pull request uses Windows line endings as opposed to Unix-style. Thanks.
|
When choosing installation options, the focused control should be the first checkbox, not the continue button.
|
@michaelDCurran Indeed, the line endings have changed, however, regardless of what I do with line endings, the only way I can get 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?
@josephsl Sorry, I couldn't find a relevant comment? |
|
I probably could have been more explicit, the line endings used to be LF (unix style) now they are CRLF (windows style). |
michaelDCurran
left a comment
There was a problem hiding this comment.
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.
|
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.
|
|
@leonardder commented on 6 Dec 2018, 13:01 CET:
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. |
|
Switching to eSpeak on Windows 10 needs to be fixed I agree. I was under
the impression that it would switch to Onecore as that is now the
default. Clearly there must be another code path.
As for braille displays: There is really nothing that can be done. The
user is warned pretty strongly that add-ons will be disabled. Perhaps we
can bluntly state this may affect speech and braille?
|
|
This pr is causing alpha snapshots to no longer update. This pr assumes that the version string coming from the update server is numeric, however it is not in the case of snapshots. |
|
Some options:
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. |
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 |
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:
This information is acted upon by NVDA as follows:
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.
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:
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
minimumRequiredVersionmanifest 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: