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

N++ compatibility condition attribute in pl*.json #416

Closed
oleg-shilo opened this issue Feb 19, 2022 · 9 comments
Closed

N++ compatibility condition attribute in pl*.json #416

oleg-shilo opened this issue Feb 19, 2022 · 9 comments
Assignees
Labels
accepted This pr/issue is accepted enhancement New feature or request

Comments

@oleg-shilo
Copy link
Contributor

oleg-shilo commented Feb 19, 2022

Problem

With the breaking changes in v8.3 quite a few plugins have been bricked. See notepad-plus-plus/notepad-plus-plus#11198

I am one of the plugin authors (CS-Script). I have prepared the patch release that works on v8.3. However, PLuginAdmin might dispatch it to v8.2.* deployments where it will break. I do not see how it can be solved. Unless I am missing something.

Proposal

Introduce npp-version attribute to indicate the compatible version/version-range for the plugin described in the section:

{
	"folder-name": "MyPlugin",
	"display-name": "My Cool Plugin",
	"version": "1.8.7",
	"npp-version": "8.3",
	"id": "...",
	...
},

Various conventions can be used to indicate version range:

8.3 - exact version 8.3
[8.3,9.4] - from version 8.3 to 9.4 inclusive
[8.3,]- any version from 8.3 and above
[,8.3] - 8.3 and any version before

Such a technique is common for many package managers.
Will be really happy if it is already implemented and I just missed it :)

@chcg
Copy link
Contributor

chcg commented Feb 23, 2022

plugin list is just distributed with a new N++ list, so updates to the current master are just available for the next N++ and not older ones.

See #250 there is still something open to check at least the basic compatibility of existing plugins with new N++ versions.

The previous plugin manager handled that different and downloaded the list from a server and had the option to specify compatible N++ version.

@chcg chcg added the question Further information is requested label Feb 23, 2022
@chcg chcg closed this as completed Feb 23, 2022
@oleg-shilo
Copy link
Contributor Author

Sorry, I do not believe this issue should be closed.

It is not about checking compatibility. Authors already know what version of their plugin is compatible with what version of N++. It is about allowing PluginAdmin to pull the plugin binaries from the alternative URL that contains plugin version compatible with the current N++ installed.

I am afraid the intent of this issue was lost.

@chcg
Copy link
Contributor

chcg commented Feb 23, 2022

Added new compatible version with c7647de.

So you mean that via the version it should be possible to prohibit downloads with newer version of N++ in case of issues. This would require modification to N++ pluginAdmin code.
Currently it is expected that the plugins in the list are compatible with the latest N++ and N++ installer has a manually handled (see e.g. notepad-plus-plus/notepad-plus-plus@de43eca) list of plugins which have problems are incompatible.
Having this information within the pluginlist seems to be a better way.

@chcg chcg reopened this Feb 23, 2022
@chcg chcg added enhancement New feature or request and removed question Further information is requested labels Feb 23, 2022
@oleg-shilo
Copy link
Contributor Author

oleg-shilo commented Feb 24, 2022

So you mean that via the version it should be possible to prohibit downloads with newer version of N++ in case of issues. This would require modification to N++ pluginAdmin code.

Correct.

...it is expected that the plugins in the list are compatible with the latest N++...

I am not sure it is a fully valid assumption. We do have users running some older versions and they may choose or be forced not to upgrade (e.g. IT policies). In such cases, pluginAdmin will still prompt them to update currently working plugin to the latest available version and effectively break it.

I am simply proposing pluginAdminto to filter out all the latest plugins that authors nominated as incompatible with the very version of N++ user is running at the moment. So it does not offer the upgrade for that plugin. That's it.

I am not really in a good position to judge but may be it is a fairly simple change to pluginAdmin.

@donho
Copy link
Member

donho commented Feb 24, 2022

8.3 - exact version 8.3
[8.3,9.4] - from version 8.3 to 9.4 inclusive
[8.3,]- any version from 8.3 and above
[,8.3] - 8.3 and any version before

Make sense. If "npp-compatible-versions" is absent, the plugin is supposed to be compatible with any version of Notepad++.
I will modify the code of Plugin Admin for it.

@donho donho self-assigned this Feb 24, 2022
@donho donho added the accepted This pr/issue is accepted label Feb 24, 2022
@oleg-shilo
Copy link
Contributor Author

oleg-shilo commented Feb 24, 2022

Fantastic, thank you for being open to it

@oleg-shilo
Copy link
Contributor Author

BTW thank you for processing CS-Script plugin update so promptly.

donho added a commit to notepad-plus-plus/notepad-plus-plus that referenced this issue Mar 4, 2022
Implement: notepad-plus-plus/nppPluginList#416

While PluginAdmin loading nppPluginList.dll, it will check an attribute "npp-compatible-versions" (optional),
in order to determinate if plugin is compatible to the current version of Notepad++. If plugin is not compatible,
then this plugin will be ignored, therefore it won't be shown on the PluginAdmin's plugin list.
Note that it's only about pluginsAdmin's plugin list:
it prevent from Notepad++ install/update a plugin non-compatible to current version of Notepad++,
but it still allows Notepad++ load this plugin in question, if it's already installed.

Here is the attribite "npp-compatible-versions" looks like in plugin list json file:
```
{
	"name": "npp-pluginList",
	"version": "1.4.7",
	"arch": "32",
	"npp-plugins": [
		{
			"folder-name": "demoPluginA",
			"display-name": "Demo Plugin A",
			"version": "1.8.7",
			"npp-compatible-versions": "[4.2,6.6.6]",
			"id": "9c566a9083ef66a0ce93a3ce5f55977faea559b5b0993e37a1461b87f4aeb6f0",
			...
		},
		{
			"folder-name": "demoPluginB",
			"display-name": "Demo Plugin B",
			"version": "1.1.8.7",
			"id": "8a6b9dadbf2ec37d5c60a12a5445f0eec2ef00e6eaa80452925789fd73950193",
			...
		},
		...
	}
}
```
It's optional. In the case of its absence, it's considered compatible to all versions of Notepad++.
The format of value for "npp-compatible-versions" is following (no white space is allowed):

"6.9"          : exact version 6.9
"[4.2,6.6.6]"  : from version 4.2 to 6.6.6 inclusive
"[8.3,]"       : any version from 8.3 to the latest one
"[,8.2.1]"     : 8.2.1 and any previous version

Fix #11338, close #11334
@donho
Copy link
Member

donho commented Mar 4, 2022

notepad-plus-plus/notepad-plus-plus@a06b404

@donho donho closed this as completed Mar 4, 2022
@oleg-shilo
Copy link
Contributor Author

Perfect. Thank you for addressing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted This pr/issue is accepted enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants