Bug 31684 - Plugin versions starting with a "v" cause unnecessary warnings
Summary: Plugin versions starting with a "v" cause unnecessary warnings
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Plugin architecture (show other bugs)
Version: Main
Hardware: All All
: P5 - low trivial (vote)
Assignee: Kyle M Hall
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on:
Blocks: 31909
  Show dependency treegraph
 
Reported: 2022-10-05 11:04 UTC by Kyle M Hall
Modified: 2023-12-28 20:44 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.11.00, 22.05.08, 21.11.15


Attachments
Bug 31684: Set Koha::Plugin::Test version to 'v1.01' (790 bytes, patch)
2022-10-05 12:49 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 31684: Plugin versions starting with a "v" cause unnecessary warnings (1.42 KB, patch)
2022-10-05 12:49 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 31684: Set Koha::Plugin::Test version to 'v1.01' (838 bytes, patch)
2022-10-10 20:47 UTC, David Nind
Details | Diff | Splinter Review
Bug 31684: Plugin versions starting with a "v" cause unnecessary warnings (1.47 KB, patch)
2022-10-10 20:47 UTC, David Nind
Details | Diff | Splinter Review
Bug 31684: Set Koha::Plugin::Test version to 'v1.01' (936 bytes, patch)
2022-10-21 06:48 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 31684: Plugin versions starting with a "v" cause unnecessary warnings (1.56 KB, patch)
2022-10-21 06:48 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle M Hall 2022-10-05 11:04:10 UTC
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.
Comment 1 Kyle M Hall 2022-10-05 12:49:10 UTC
Created attachment 141379 [details] [review]
Bug 31684: Set Koha::Plugin::Test version to 'v1.01'
Comment 2 Kyle M Hall 2022-10-05 12:49:23 UTC
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!
Comment 3 David Nind 2022-10-10 20:47:05 UTC
Created attachment 141589 [details] [review]
Bug 31684: Set Koha::Plugin::Test version to 'v1.01'

Signed-off-by: David Nind <david@davidnind.com>
Comment 4 David Nind 2022-10-10 20:47:11 UTC
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>
Comment 5 Katrin Fischer 2022-10-17 10:37:45 UTC
Please don't forget to set Assignee!
Comment 6 Kyle M Hall 2022-10-17 10:47:04 UTC
(In reply to Katrin Fischer from comment #5)
> Please don't forget to set Assignee!

Ack! Thanks again!
Comment 7 Marcel de Rooy 2022-10-21 06:48:39 UTC
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>
Comment 8 Marcel de Rooy 2022-10-21 06:48:43 UTC
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>
Comment 9 Tomás Cohen Arazi 2022-10-21 11:52:09 UTC
Why don't we force some coding line to align plugin authors about verisoning instead? Plugins could just be forced to use semvers?
Comment 10 Tomás Cohen Arazi 2022-10-21 13:02:06 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 11 Lucas Gass 2022-12-05 21:12:32 UTC
Backported to 22.05.x for upcoming 22.05.08
Comment 12 Arthur Suzuki 2022-12-16 13:34:08 UTC
applied to 21.11 for 21.11.15
Comment 13 wainuiwitikapark 2023-03-15 00:58:05 UTC
Not backported to 21.05.x