[Bug 22026] New: Remove `use Modern::Perl` from Koha::REST::classes
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22026 Bug ID: 22026 Summary: Remove `use Modern::Perl` from Koha::REST::classes Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: martin.renvoize@ptfs-europe.com QA Contact: testopia@bugs.koha-community.org Target Milestone: --- The REST api is based on Mojolicious and as such the controllers within this namespace are all based upon `Mojo::Base`, `use Mojo::Base 'Mojolicious::Controller';` to be specific. Mojo::Base enables the following, which are the only useful things achieved by Modern::Perl in our case (as we limit ourselves to supporting perl 5.10, so any and all other features past perl 5.10 are unavailable to use anyway). ``` use strict; use warnings; use utf8; use feature ':5.10'; use mro; use IO::Handle (); require SomeBaseClass; push @ISA, 'SomeBaseClass'; sub has { Mojo::Base::attr(__PACKAGE__, @_) } ``` As such, adding the `use Modern::Perl` statement is just noise and needlessly loads a module. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22026 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #1 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Modern::Perl will be loaded by other packages anyway :) -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22026 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |aleisha@catalyst.net.nz Keywords| |Academy -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22026 Jasmine Amohia <jasmineamohia.student@wegc.school.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22026 --- Comment #2 from Jasmine Amohia <jasmineamohia.student@wegc.school.nz> --- Created attachment 84119 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=84119&action=edit Bug 22026: Removed 'use Modern::Perl;' from Koha::REST::classes Test plan: 1) Check all Koha/REST files and confirm that 'use Modern::Perl;' has been removed. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22026 Jasmine Amohia <jasmineamohia.student@wegc.school.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jasmineamohia.student@wegc. | |school.nz Assignee|koha-bugs@lists.koha-commun |jasmineamohia.student@wegc. |ity.org |school.nz -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22026 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22026 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #84119|0 |1 is obsolete| | --- Comment #3 from David Nind <david@davidnind.com> --- Created attachment 84179 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=84179&action=edit Bug 22026: Removed 'use Modern::Perl;' from Koha::REST::classes Test plan: 1) Check all Koha/REST files and confirm that 'use Modern::Perl;' has been removed. Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22026 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |tomascohen@gmail.com |y.org | CC| |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22026 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22026 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #84179|0 |1 is obsolete| | --- Comment #4 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 84189 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=84189&action=edit Bug 22026: Removed 'use Modern::Perl;' from Koha::REST::classes Test plan: 1) Check all Koha/REST files and confirm that 'use Modern::Perl;' has been removed. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22026 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |julian.maurice@biblibre.com --- Comment #5 from Julian Maurice <julian.maurice@biblibre.com> --- https://wiki.koha-community.org/wiki/Coding_Guidelines#PERL2:_Modern::Perl should probably be updated to mention this special case -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22026 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |nick@bywatersolutions.com --- Comment #6 from Nick Clemens <nick@bywatersolutions.com> --- Awesome work all! Pushed to master for 19.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22026 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Pushed to Master |RESOLVED --- Comment #7 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- This cleanup isn't required for 18.11.x. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22026 --- Comment #8 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- I am not sure this was a good move, compare what it brings with the changes we need to make. Anyway, now we need to update the coding guidelines and update our t/perlcriticrc (I think). Also Jenkins is failing because of that move, see https://jenkins.koha-community.org/job/Koha_Master_D8/163/ I do not understand why it is only failing for D8. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22026 --- Comment #9 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Jonathan Druart from comment #8)
Also Jenkins is failing because of that move, see https://jenkins.koha-community.org/job/Koha_Master_D8/163/ I do not understand why it is only failing for D8.
% more /etc/debian_version 9.6 % perlcritic --version 1.126 % perlcritic Koha/REST/V1.pm Koha/REST/V1.pm source OK % more /etc/debian_version 8.11 % perlcritic --version 1.122 % perlcritic Koha/REST/V1.pm Code before strictures are enabled at line 37, column 1. See page 429 of PBP. (Severity: 5) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22026 --- Comment #10 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- I guess it is: https://github.com/Perl-Critic/Perl-Critic/blob/dev/Changes 1.124 2015-02-27 * The RequireUseStrict and RequireUseWarnings policies now regard Moose, Moo, Mouse, Dancer, Mojolicious, and several other modules as equivalent to the strict and warnings pragma. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22026 --- Comment #11 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Ack, as this would require use packaging a more recent version of perlcritic I don't feel it's a big enough win to warrant the cleanup.. I'm inclined to agree with Jonathan that this point and suggest we revert it until a point in the future. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22026 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|FIXED |--- -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22026 --- Comment #12 from Nick Clemens <nick@bywatersolutions.com> --- Reverted from master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22026 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22026 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|FIXED |WONTFIX -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org