View Issue Details

IDProjectCategoryView StatusLast Update
0022171mantisbtplug-inspublic2017-01-31 04:02
Reportercproensa 
Assigned Todregad 
PriorityurgentSeverityblockReproducibilityhave not tried
Status closedResolutionfixed 
Product Version2.0.0 
Target Version2.1.0Fixed in Version2.1.0 
Summary0022171: Redefine plugin version requirements
Description

With the new version scheme of major.minor.patch,
plugin requeriments on mantis core version needs to be redefined.
Currently, a plugin requiring 2.0 is only valid for <2.1
Should be defined as valid for <3.0 (less than next major version)

TagsNo tags attached.

Relationships

has duplicate 0022196 closeddregad Changing version to 2.1.0-dev breaks 2.0.0 plugins 

Activities

dregad

dregad

2017-01-11 18:31

developer   ~0055062

You mean changing the logic in plugin API ?

atrol

atrol

2017-01-11 18:40

developer   ~0055064

I assume @cproensa does not want to change the logic but means just replacing the dependency to something like
'MantisCore' => '2.0, < 3.0',

cproensa

cproensa

2017-01-11 19:01

developer   ~0055065

Actually, i mean changing the logic in plugin api
If i recall correctly, requiring "MantisCore => 2.0" will be valid for 2.0.0 through 2.0.999...
With the new version releases, it should be changed to be valid for 2.0 through 2.999...

MantisCore => 2.0, < 3.0

I haven't tested, but i suspect that would not work, if it would resolve to >=2.0 AND <2.1 OR >=2.9 AND <3.0

dregad

dregad

2017-01-11 19:57

developer   ~0055068

If i recall correctly, requiring MantisCore => 2.0 will be valid for 2.0.0 through 2.0.999

@cproensa You are correct, see https://github.com/mantisbt/mantisbt/blob/release-2.0.0/core/plugin_api.php#L558

With the new version releases, it should be changed to be valid for 2.0 through 2.999...

I think it makes sense to change this as you propose. Of course this implies that we'd have to defer any plugin API breaking change to the next major version (which is how it should be IMO).

dregad

dregad

2017-01-12 03:55

developer   ~0055074

Repeating comment posted in response to vboctor's question in https://github.com/mantisbt/mantisbt/pull/991#issuecomment-272107185

Can we have the dependency to be > 2.0.0 rather than exactly 2.0.0?

It is. The problem is that the plugin API silently adds a < x.y+1 so the effective version requirement is (>=) 2.0.0, < 2.1 in this case. This was added due to BC issues between 1.2 and 1.3. As per discussion in in 0022171, we should change the logic so the plugin API does < x+1, reflecting the fact that BC changes should on principle only happen in major releases.

dregad

dregad

2017-01-15 19:03

developer   ~0055138

PR https://github.com/mantisbt/mantisbt/pull/995

Related Changesets

MantisBT: master cab8a96e

2017-01-15 10:48:18

dregad

Details Diff
Add Plugin API tests covering plugin_dependency()

An initial series of test to execute known scenarios, including the case
from issue 0022171.
mod - tests/Mantis/AllTests.php Diff File
add - tests/Mantis/PluginTest.php Diff File

MantisBT: master 574dfa29

2017-01-15 18:33:30

dregad

Details Diff
Fix MantisCore plugin dependencies

In issue 0017360, we introduced setting a default maximum version for
MantisCore to avoid compatibility issues by disabling plugins which have
not been updated for a new Mantis release, with a break on every minor
version (x.Y.z).

With 2.0 and the decision to only introduce breaking changes on major
versions (X.y.z), this code has to be changed.

Fixes 0022171
mod - core/plugin_api.php Diff File

MantisBT: master 1d96c88c

2017-01-25 10:51:10

dregad


Committer: GitHub Details Diff
Merge plugin requirements PR

Prevents plugins getting disabled when bumping MANTIS_VERSION to 2.1.x.
Fixes 0022171

Also contains the following changes and improvements:
- Add PHPUnit tests for plugin_dependency() function
- Refactor plugin_version_check() to use PHP's version_compare()
function instead of custom code
- Reset MANTIS_VERSION to 2.1.0-dev.
- Revert MantisCore version requirements in bundled plugins
- Fix PHP notice when specifying plugin authors as array, fixes 0022205
- align code with documentation
- Improved plugin documentation in Developers guide, fixes 0022206

PR https://github.com/mantisbt/mantisbt/pull/995
mod - core/constant_inc.php Diff File
mod - core/plugin_api.php Diff File
mod - docbook/Developers_Guide/en-US/Plugins_Building.xml Diff File
mod - docbook/Developers_Guide/en-US/Plugins_Building_Source.xml Diff File
mod - manage_plugin_page.php Diff File
mod - plugins/Gravatar/Gravatar.php Diff File
mod - plugins/MantisCoreFormatting/MantisCoreFormatting.php Diff File
mod - plugins/MantisGraph/MantisGraph.php Diff File
mod - plugins/XmlImportExport/XmlImportExport.php Diff File
mod - tests/Mantis/AllTests.php Diff File
add - tests/Mantis/PluginTest.php Diff File

Issue History

Date Modified Username Field Change
2017-01-11 17:35 cproensa New Issue
2017-01-11 18:31 dregad Note Added: 0055062
2017-01-11 18:40 atrol Note Added: 0055064
2017-01-11 19:01 cproensa Note Added: 0055065
2017-01-11 19:57 dregad Note Added: 0055068
2017-01-12 03:55 dregad Note Added: 0055074
2017-01-14 10:21 dregad Relationship added related to 0022196
2017-01-15 18:31 dregad Assigned To => dregad
2017-01-15 18:31 dregad Priority normal => urgent
2017-01-15 18:31 dregad Severity major => block
2017-01-15 18:31 dregad Status new => assigned
2017-01-15 18:31 dregad Summary Redefine plugin version requeriments => Redefine plugin version requirements
2017-01-15 18:32 dregad Relationship replaced has duplicate 0022196
2017-01-15 19:03 dregad Note Added: 0055138
2017-01-25 10:51 dregad Changeset attached => MantisBT master cab8a96e
2017-01-25 10:51 dregad Changeset attached => MantisBT master 574dfa29
2017-01-25 10:51 dregad Changeset attached => MantisBT master 1d96c88c
2017-01-25 10:51 dregad Status assigned => resolved
2017-01-25 10:51 dregad Resolution open => fixed
2017-01-25 10:51 dregad Fixed in Version => 2.1.0
2017-01-31 04:02 vboctor Status resolved => closed