Our code assumes that plugin version will be purely numeric ( e.g. 1.2.3 ) but many plugin authors ( including myself ) use the format "v1.2.3". This causes warnings as we use a numeric comparison on the version numbers. It could make sense to check for and strip any v's from the beginning of the version.
Created attachment 141379 [details] [review] Bug 31684: Set Koha::Plugin::Test version to 'v1.01'
Created attachment 141380 [details] [review] Bug 31684: Plugin versions starting with a "v" cause unnecessary warnings Our code assumes that plugin version will be purely numeric ( e.g. 1.2.3 ) but many plugin authors ( including myself ) use the format "v1.2.3". This causes warnings as we use a numeric comparison on the version numbers. It could make sense to check for and strip any v's from the beginning of the version. Test Plan: 1) Apply the first patch to set the test plugin's version to v1.01 2) prove t/db_dependent/Koha/Plugins/Plugins.t 3) Note the warnings and test failures 4) Apply this patch 5) prove t/db_dependent/Koha/Plugins/Plugins.t 6) All tests pass!
Created attachment 141589 [details] [review] Bug 31684: Set Koha::Plugin::Test version to 'v1.01' Signed-off-by: David Nind <david@davidnind.com>
Created attachment 141590 [details] [review] Bug 31684: Plugin versions starting with a "v" cause unnecessary warnings Our code assumes that plugin version will be purely numeric ( e.g. 1.2.3 ) but many plugin authors ( including myself ) use the format "v1.2.3". This causes warnings as we use a numeric comparison on the version numbers. It could make sense to check for and strip any v's from the beginning of the version. Test Plan: 1) Apply the first patch to set the test plugin's version to v1.01 2) prove t/db_dependent/Koha/Plugins/Plugins.t 3) Note the warnings and test failures 4) Apply this patch 5) prove t/db_dependent/Koha/Plugins/Plugins.t 6) All tests pass! Signed-off-by: David Nind <david@davidnind.com>
Please don't forget to set Assignee!
(In reply to Katrin Fischer from comment #5) > Please don't forget to set Assignee! Ack! Thanks again!
Created attachment 142292 [details] [review] Bug 31684: Set Koha::Plugin::Test version to 'v1.01' Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 142293 [details] [review] Bug 31684: Plugin versions starting with a "v" cause unnecessary warnings Our code assumes that plugin version will be purely numeric ( e.g. 1.2.3 ) but many plugin authors ( including myself ) use the format "v1.2.3". This causes warnings as we use a numeric comparison on the version numbers. It could make sense to check for and strip any v's from the beginning of the version. Test Plan: 1) Apply the first patch to set the test plugin's version to v1.01 2) prove t/db_dependent/Koha/Plugins/Plugins.t 3) Note the warnings and test failures 4) Apply this patch 5) prove t/db_dependent/Koha/Plugins/Plugins.t 6) All tests pass! Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Why don't we force some coding line to align plugin authors about verisoning instead? Plugins could just be forced to use semvers?
Pushed to master for 22.11. Nice work everyone, thanks!
Backported to 22.05.x for upcoming 22.05.08
applied to 21.11 for 21.11.15
Not backported to 21.05.x