[Bug 14939] New: OAI Server classes must be modularized
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 Bug ID: 14939 Summary: OAI Server classes must be modularized Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Web services Assignee: koha-bugs@lists.koha-community.org Reporter: frederic@tamil.fr QA Contact: testopia@bugs.koha-community.org Koha OAI server has been done in one unique .pl file because there wasn't any object model or rules in the Koha project when it has been coded. Its classes must be modularized : putting each class in a separate file in a Koha::OAI namespace. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 --- Comment #1 from Frédéric Demians <frederic@tamil.fr> --- Created attachment 43045 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=43045&action=edit Bug 14939 Modularize OAI Server existing classes Koha OAI server has been done in one unique .pl file because there wasn't any object model or rules in the Koha project when it has been coded. This patch modularized existing classes, putting each class in a separate file in Koha::OAI namespace. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |frederic@tamil.fr |ity.org | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #43045|0 |1 is obsolete| | --- Comment #2 from Frédéric Demians <frederic@tamil.fr> --- Created attachment 43072 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=43072&action=edit Bug 14939 Modularize OAI Server existing classes Koha OAI server has been done in one unique .pl file because there wasn't any object model or rules in the Koha project when it has been coded. This patch modularized existing classes, putting each class in a separate file in Koha::OAI namespace. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |15108 Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15108 [Bug 15108] OAI-PMH provider improvements -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |olli-antti.kivilahti@jns.fi Status|Needs Signoff |Failed QA --- Comment #3 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Failing QA because of insufficient testing. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff --- Comment #4 from Frédéric Demians <frederic@tamil.fr> --- (In reply to Olli-Antti Kivilahti from comment #3)
Failing QA because of insufficient testing.
I disagree. It's modularizing not refactoring. The existing classes are split from oai.pl into individual .pm files, one per class. It doesn't change a line of code. So coding a full UT for OAI server would be awesome, I can't disagree, but it isn't a requirement for this patch. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 Héctor Eduardo Castro Avalos <hector.hecaxmmx@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hector.hecaxmmx@gmail.com See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=15108 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 Héctor Eduardo Castro Avalos <hector.hecaxmmx@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=10662 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #43072|0 |1 is obsolete| | --- Comment #5 from Frédéric Demians <frederic@tamil.fr> --- Created attachment 44355 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=44355&action=edit Bug 14939 Modularize OAI Server existing classes Koha OAI server has been done in one unique .pl file because there wasn't any object model or rules in the Koha project when it has been coded. This patch modularized existing classes, putting each class in a separate file in Koha::OAI::Server namespace. UT begining. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 --- Comment #6 from Frédéric Demians <frederic@tamil.fr> --- Redefining naming in order not to overlap with bug 10662. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #44355|0 |1 is obsolete| | --- Comment #7 from Frédéric Demians <frederic@tamil.fr> --- Created attachment 44371 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=44371&action=edit Bug 14939 Modularize OAI Server existing classes Koha OAI server has been done in one unique .pl file because there wasn't any object model or rules in the Koha project when it has been coded. This patch modularized existing classes, putting each class in a separate file in Koha::OAI::Server namespace. UT begining. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #44371|0 |1 is obsolete| | --- Comment #8 from Frédéric Demians <frederic@tamil.fr> --- Created attachment 44438 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=44438&action=edit Bug 14939 Modularize OAI Server existing classes Koha OAI server has been done in one unique .pl file because there wasn't any object model or rules in the Koha project when it has been coded. This patch modularized existing classes, putting each class in a separate file in Koha::OAI::Server namespace. UT begining. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 Héctor Eduardo Castro Avalos <hector.hecaxmmx@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |In Discussion --- Comment #9 from Héctor Eduardo Castro Avalos <hector.hecaxmmx@gmail.com> --- Hi Frederick Test Unit fail because module missing Capture::Tiny I think you need to include in C4::Installer::PerlDependencies and debian/control (libcapture-tiny-perl) Regards -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 --- Comment #10 from Frédéric Demians <frederic@tamil.fr> ---
Test Unit fail because module missing Capture::Tiny
Thanks Hector. I add it! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|In Discussion |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #44438|0 |1 is obsolete| | --- Comment #11 from Frédéric Demians <frederic@tamil.fr> --- Created attachment 44866 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=44866&action=edit Bug 14939 Modularize OAI Server existing classes Koha OAI server has been done in one unique .pl file because there wasn't any object model or rules in the Koha project when it has been coded. This patch modularized existing classes, putting each class in a separate file in Koha::OAI::Server namespace. UT begining. Add new dependency: Capture::Tiny -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 Héctor Eduardo Castro Avalos <hector.hecaxmmx@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |In Discussion --- Comment #12 from Héctor Eduardo Castro Avalos <hector.hecaxmmx@gmail.com> --- Sorry Frédéric But I got: # Failed test 'ListMetadataFormats' # at t/db_dependent/OAI/Server.t line 84. # got: '<?xml version="1.0" encoding="UTF-8"?> # # <OAI-PMH xmlns='http://www.openarchives.org/OAI/2.0/' xsi:schemaLocation='http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><responseDate>2015-11-15T00:11:11Z</responseDate><request>http://localhost</request><ListMetadataFormats><metadataFormat><metadataPrefix>oai_dc</metadataPrefix><schema>http://www.openarchives.org/OAI/2.0/oai_dc.xsd</schema><metadataNamespace>http://www.openarchives.org/OAI/2.0/oai_dc/</metadataNamespace></metadataFormat><metadataFormat><metadataPrefix>marcxml</metadataPrefix><schema>http://www.loc.gov/MARC21/slim http://www.loc.gov/ standards/marcxml/schema/MARC21slim.xsd</schema><metadataNamespace>http://www.loc.gov/MARC21/slim http://www.loc.gov/ standards/marcxml/schema/MARC21slim</metadataNamespace></metadataFormat></ListMetadataFormats></OAI-PMH>' # expected: '<?xml version="1.0" encoding="UTF-8"?> # # <OAI-PMH xmlns='http://www.openarchives.org/OAI/2.0/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd'><responseDate>2015-11-15T00:11:11Z</responseDate><request>http://localhost</request><ListMetadataFormats><metadataFormat><metadataPrefix>oai_dc</metadataPrefix><schema>http://www.openarchives.org/OAI/2.0/oai_dc.xsd</schema><metadataNamespace>http://www.openarchives.org/OAI/2.0/oai_dc/</metadataNamespace></metadataFormat><metadataFormat><metadataPrefix>marcxml</metadataPrefix><schema>http://www.loc.gov/MARC21/slim http://www.loc.gov/ standards/marcxml/schema/MARC21slim.xsd</schema><metadataNamespace>http://www.loc.gov/MARC21/slim http://www.loc.gov/ standards/marcxml/schema/MARC21slim</metadataNamespace></metadataFormat></ListMetadataFormats></OAI-PMH>' # Failed test 'ListIdentifiers without metadaPrefix argument' # at t/db_dependent/OAI/Server.t line 96. # got: '<?xml version="1.0" encoding="UTF-8"?> # # <OAI-PMH xsi:schemaLocation='http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd' xmlns='http://www.openarchives.org/OAI/2.0/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><responseDate>2015-11-15T00:11:11Z</responseDate><request>http://localhost</request><error code='badArgument'>Required argument 'metadataPrefix' was undefined</error></OAI-PMH>' # expected: '<?xml version="1.0" encoding="UTF-8"?> # # <OAI-PMH xmlns='http://www.openarchives.org/OAI/2.0/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd'><responseDate>2015-11-15T00:11:11Z</responseDate><request>http://localhost</request><error code='badArgument'>Required argument 'metadataPrefix' was undefined</error></OAI-PMH>' # Looks like you failed 2 tests of 13. Also i noticed that this happen when you got OAI-PMH:AutoUpdateSets to "Disable", if you enable all works succefully. I play with cgi-bin/koha/oai.pl?verb=GetRecord&identifier=KOHA-OAI-TEST:1&metadataPrefix=marcxml And is working succefully -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 --- Comment #13 from Héctor Eduardo Castro Avalos <hector.hecaxmmx@gmail.com> --- Another thing that i could see is: in debian/control when a library is placed, goes in two places and you put it in one. I don't know much about that, tell me if I'm wrong -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 --- Comment #14 from Frédéric Demians <frederic@tamil.fr> --- Thanks Hector for testing. Two responses: (1) UT don't work for you because you may use a MARC21 DB. I've tested with Unimarc. I have to change the UT to be marcflavour agnostic. (2) Debian packaging: I will remove my debian/control modification, and let the packaging manager (Robin Sheat) add the correct info. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 --- Comment #15 from Frédéric Demians <frederic@tamil.fr> --- Failing tests seem to be due to HTTP::OAI version variation. Which version do you use? You can get it with: perl -MHTTP::OAI -e 'print $HTTP::OAI::VERSION, "\n"' -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |dependency CC| |gmc@esilibrary.com, | |katrin.fischer@bsz-bw.de, | |robin@catalyst.net.nz -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 --- Comment #16 from Héctor Eduardo Castro Avalos <hector.hecaxmmx@gmail.com> --- I have 3.27 I don't know why fail me in my laptop with Debian Jessie. In my work does not fail with Dian wheezy, both Distros have the same version (<https://packages.debian.org/jessie/libhttp-oai-perl>) Maybe I did something wrong. Well I will sign-off. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 Héctor Eduardo Castro Avalos <hector.hecaxmmx@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #44866|0 |1 is obsolete| | --- Comment #17 from Héctor Eduardo Castro Avalos <hector.hecaxmmx@gmail.com> --- Created attachment 44875 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=44875&action=edit [SIGNED-OFF]Bug 14939 Modularize OAI Server existing classes Koha OAI server has been done in one unique .pl file because there wasn't any object model or rules in the Koha project when it has been coded. This patch modularized existing classes, putting each class in a separate file in Koha::OAI::Server namespace. UT begining. Add new dependency: Capture::Tiny Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com> OAI server moduralized succefully -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 Héctor Eduardo Castro Avalos <hector.hecaxmmx@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|In Discussion |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #44875|0 |1 is obsolete| | --- Comment #18 from Frédéric Demians <frederic@tamil.fr> --- Created attachment 44904 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=44904&action=edit Bug 14939 Modularize OAI Server existing classes Koha OAI server has been done in one unique .pl file because there wasn't any object model or rules in the Koha project when it has been coded. This patch modularized existing classes, putting each class in a separate file in Koha::OAI::Server namespace. UT begining. Add new dependency: Capture::Tiny Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com> OAI server moduralized succefully -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 --- Comment #19 from Frédéric Demians <frederic@tamil.fr> --- (In reply to Héctor Eduardo Castro Avalos from comment #16)
I don't know why fail me in my laptop with Debian Jessie. In my work does not fail with Dian wheezy, both Distros have the same version (<https://packages.debian.org/jessie/libhttp-oai-perl>)
I've reproduced your UT error on a Jessie box. I've fixed it, and reattached your signed path, with the corrected UT. Please confirm it also works for you on Jessie. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #44904|0 |1 is obsolete| | --- Comment #20 from Frédéric Demians <frederic@tamil.fr> --- Created attachment 44913 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=44913&action=edit Bug 14939 Modularize OAI Server existing classes Koha OAI server has been done in one unique .pl file because there wasn't any object model or rules in the Koha project when it has been coded. This patch modularized existing classes, putting each class in a separate file in Koha::OAI::Server namespace. UT begining. Add new dependency: Capture::Tiny Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com> OAI server moduralized succefully -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 Héctor Eduardo Castro Avalos <hector.hecaxmmx@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #44913|0 |1 is obsolete| | --- Comment #21 from Héctor Eduardo Castro Avalos <hector.hecaxmmx@gmail.com> --- Created attachment 44914 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=44914&action=edit Bug 14939 Modularize OAI Server existing classes Koha OAI server has been done in one unique .pl file because there wasn't any object model or rules in the Koha project when it has been coded. This patch modularized existing classes, putting each class in a separate file in Koha::OAI::Server namespace. UT begining. Add new dependency: Capture::Tiny Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com> OAI server moduralized succefully -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 Héctor Eduardo Castro Avalos <hector.hecaxmmx@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #44914|0 |1 is obsolete| | --- Comment #22 from Héctor Eduardo Castro Avalos <hector.hecaxmmx@gmail.com> --- Created attachment 44915 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=44915&action=edit [SIGNED-OFF]Bug 14939: Modularize OAI Server existing classes Koha OAI server has been done in one unique .pl file because there wasn't any object model or rules in the Koha project when it has been coded. This patch modularized existing classes, putting each class in a separate file in Koha::OAI::Server namespace. UT begining. Add new dependency: Capture::Tiny Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com> OAI server moduralized succefully Works for Debian Jessie -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 --- Comment #23 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Comment on attachment 44915 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=44915 [SIGNED-OFF]Bug 14939: Modularize OAI Server existing classes Review of attachment 44915: --> (http://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=14939&attachment=44915) ----------------------------------------------------------------- ::: C4/Installer/PerlDependencies.pm @@ +777,4 @@
'required' => '0', 'min_ver' => '0.28', }, + 'Capture::Tiny' => {
Is this really mandatory? The module has some known bugs (https://github.com/dagolden/Capture-Tiny/issues). One is "Capture::Tiny breaks under FCGI" and is not comforting. ::: opac/oai.pl @@ +1,3 @@
#!/usr/bin/perl
+# Copyright Tamil s.a.r.l. 2008-2015
Why did you remove BibLibre's copyright? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #24 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- FAIL Koha/OAI/Server/Identify.pm FAIL critic Package declaration must match filename at line 18, column 1. Correct the filename or package statement. FAIL Koha/OAI/Server/Repository.pm FAIL critic Code before strictures are enabled at line 20, column 11. See page 429 of PBP. FAIL spelling tranformed ==> transformed choosed ==> chose, chosen FAIL valid Can't locate package HTTP::OAI::Encapsulation for @HTTP::OAI::Error::ISA FAIL opac/oai.pl FAIL valid Can't locate package HTTP::OAI::Encapsulation for @HTTP::OAI::Error::ISA Should I install libhttp-oai-perl? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 --- Comment #25 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- After installing libhttp-oai-perl: FAIL opac/oai.pl FAIL valid Can't locate package HTTP::OAI::SAX::Base for @HTTP::OAI::Error::ISA Can't locate package HTTP::OAI::MemberMixin for @HTTP::OAI::Error::ISA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 --- Comment #26 from Frédéric Demians <frederic@tamil.fr> --- (In reply to Jonathan Druart from comment #23)
Comment on attachment 44915 [details] [review] [SIGNED-OFF]Bug 14939: Modularize OAI Server existing classes
Review of attachment 44915 [details] [review]: -----------------------------------------------------------------
::: C4/Installer/PerlDependencies.pm @@ +777,4 @@
'required' => '0', 'min_ver' => '0.28', }, + 'Capture::Tiny' => {
Is this really mandatory?
Is is used in tests to capture STDOUT. Do you have something to suggest to do the same thing without this module?
::: opac/oai.pl @@ +1,3 @@
#!/usr/bin/perl
+# Copyright Tamil s.a.r.l. 2008-2015
Why did you remove BibLibre's copyright?
Not intentional, even if Tamil copyright on this code deserves to come back. I wrote OAI server back in time, and Tamil copyright disappeared without being noticed by sharp eyes as yours. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #44915|0 |1 is obsolete| | --- Comment #27 from Frédéric Demians <frederic@tamil.fr> --- Created attachment 45320 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=45320&action=edit Bug 14939 Modularize OAI Server existing classes Koha OAI server has been done in one unique .pl file because there wasn't any object model or rules in the Koha project when it has been coded. This patch modularized existing classes, putting each class in a separate file in Koha::OAI::Server namespace. UT begining. Add new dependency: Capture::Tiny -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 --- Comment #28 from Frédéric Demians <frederic@tamil.fr> --- Jonathan, I've rebased the patch on master, and fixed perlcritic test errors, and copyright stuff. I'm open to any proposal to replace Tiny::Capture. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 --- Comment #29 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- The tests does not pass: t/db_dependent/OAI/Server.t .. 1/13 Can't call method "start_element" on an undefined value at /usr/share/perl5/HTTP/OAI/Verb.pm line 53. (In reply to Frédéric Demians from comment #26)
+# Copyright Tamil s.a.r.l. 2008-2015
Why did you remove BibLibre's copyright?
Not intentional, even if Tamil copyright on this code deserves to come back. I wrote OAI server back in time, and Tamil copyright disappeared without being noticed by sharp eyes as yours.
The idea wasn't to remove the Tamil copyright line, but reintroduce BibLibre one's :) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 --- Comment #30 from Frédéric Demians <frederic@tamil.fr> ---
The tests does not pass: t/db_dependent/OAI/Server.t .. 1/13 Can't call method "start_element" on an undefined value at /usr/share/perl5/HTTP/OAI/Verb.pm line 53.
I don't get this? What is you test environment? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 --- Comment #31 from Héctor Eduardo Castro Avalos <hector.hecaxmmx@gmail.com> --- (In reply to Jonathan Druart from comment #29)
The tests does not pass: t/db_dependent/OAI/Server.t .. 1/13 Can't call method "start_element" on an undefined value at /usr/share/perl5/HTTP/OAI/Verb.pm line 53.
In Debian this doesn't fail prove -v t/db_dependent/OAI/Server.t t/db_dependent/OAI/Server.t .. 1..13 ok 1 - use Koha::OAI::Server::DeletedRecord; ok 2 - use Koha::OAI::Server::Description; ok 3 - use Koha::OAI::Server::GetRecord; ok 4 - use Koha::OAI::Server::Identify; ok 5 - use Koha::OAI::Server::ListIdentifiers; ok 6 - use Koha::OAI::Server::ListMetadataFormats; ok 7 - use Koha::OAI::Server::ListRecords; ok 8 - use Koha::OAI::Server::ListSets; ok 9 - use Koha::OAI::Server::Record; ok 10 - use Koha::OAI::Server::Repository; ok 11 - use Koha::OAI::Server::ResumptionToken; ok 12 - ListMetadataFormats ok 13 - ListIdentifiers without metadaPrefix argument ok All tests successful. Files=1, Tests=13, 8 wallclock secs ( 0.03 usr 0.01 sys + 1.06 cusr 0.08 csys = 1.18 CPU) Result: PASS -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 --- Comment #32 from Frédéric Demians <frederic@tamil.fr> --- (In reply to Jonathan Druart from comment #29)
The tests does not pass: t/db_dependent/OAI/Server.t .. 1/13 Can't call method "start_element" on an undefined value at /usr/share/perl5/HTTP/OAI/Verb.pm line 53.
See: https://rt.cpan.org/Public/Bug/Display.html?id=102010 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 --- Comment #33 from David Cook <dcook@prosentient.com.au> --- (In reply to Frédéric Demians from comment #32)
(In reply to Jonathan Druart from comment #29)
The tests does not pass: t/db_dependent/OAI/Server.t .. 1/13 Can't call method "start_element" on an undefined value at /usr/share/perl5/HTTP/OAI/Verb.pm line 53.
See:
Are you sure about that? As Héctor pointed out, it looks like the version in Wheezy and Jessie is the same: https://packages.debian.org/wheezy/libhttp-oai-perl https://packages.debian.org/jessie/libhttp-oai-perl As I pointed out on https://rt.cpan.org/Public/Bug/Display.html?id=102010, someone had force installed 4.03 on the openSUSE machine I was on, and it failed miserably. It worked fine when I downgraded back to 3.28, but Debian should be using 3.27-1 for both Wheezy and Jessie which should be fine... It does appear that someone has recently done some work to add 4.03 into Debian: https://anonscm.debian.org/cgit/pkg-perl/packages/libhttp-oai-perl.git/ Both Debian Stretch (ie testing) and Debian Sid (ie unstable) are using 4.03-1 which at a glance looks like it doesn't include any fix for that CPAN ticket, so all use of HTTP::OAI would break...: https://packages.debian.org/stretch/libhttp-oai-perl https://packages.debian.org/sid/libhttp-oai-perl -- Héctor: What version of Debian are you using? Jonathan: What version of Debian are you using? Frédéric: What OS/version are you using? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 --- Comment #34 from David Cook <dcook@prosentient.com.au> --- Frédéric: I noticed on https://rt.cpan.org/Public/Bug/Display.html?id=102010 that you asked if there was anything you could do to fix the problem. I'm guessing that HTTP::OAI itself isn't maintained so well anymore on CPAN, but you could report a bug in Debian perhaps: https://www.debian.org/Bugs/ Robin reported a bug in the idzebra-2.0 package earlier in the year but didn't have much success: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=777515. Although I think that's because the package maintainer didn't see it or isn't active anymore. In the case of HTTP::OAI, it seems that the maintainer gregor herrmann is fairly active: https://anonscm.debian.org/cgit/pkg-perl/packages/libhttp-oai-perl.git/, so it might be worth contacting him as well, even if the problems are just in Debian Testing and Debian Unstable... It would be great if someone could confirm for sure that there are problems in Debian Jessie, although I think Robin has been using Jessie for a while and he was doing quite a bit with HTTP::OAI this year so I would've thought he'd notice an issue during that time... -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 --- Comment #35 from Héctor Eduardo Castro Avalos <hector.hecaxmmx@gmail.com> --- (In reply to David Cook from comment #33)
Héctor: What version of Debian are you using? Jonathan: What version of Debian are you using? Frédéric: What OS/version are you using?
Hi David I applied the patch in both Jessie and Wheezy and test passed successfully, maybe fail with Ubuntu. I Enabled OAI-PMH and play with: cgi-bin/koha/oai.pl?verb=GetRecord&identifier=KOHA-OAI-TEST:1&metadataPrefix=marcxml cgi-bin/koha/oai.pl?verb=GetRecord&identifier=KOHA-OAI-TEST:1&metadataPrefix=oai_dc And works well. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 --- Comment #36 from David Cook <dcook@prosentient.com.au> --- (In reply to Héctor Eduardo Castro Avalos from comment #35)
(In reply to David Cook from comment #33)
Héctor: What version of Debian are you using? Jonathan: What version of Debian are you using? Frédéric: What OS/version are you using?
Hi David
I applied the patch in both Jessie and Wheezy and test passed successfully, maybe fail with Ubuntu.
It looks like Ubuntu 15.10 Wily has the 4.03-1 version, but 14.04 has 3.27-1. http://packages.ubuntu.com/wily/libhttp-oai-perl -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 --- Comment #37 from Frédéric Demians <frederic@tamil.fr> --- I confirm that Jessie/Wheezy package 3.2x version. Jonathan who reported the issue should use a CPAN installed version of HTTP::OAI. I've also have reported the bug on Github: https://github.com/timbrody/perl-oai-lib But no response yet. We may give a phone call to Tim Brody... -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 --- Comment #38 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Frédéric Demians from comment #37)
I confirm that Jessie/Wheezy package 3.2x version. Jonathan who reported the issue should use a CPAN installed version of HTTP::OAI.
I've also have reported the bug on Github:
https://github.com/timbrody/perl-oai-lib
But no response yet. We may give a phone call to Tim Brody...
So sorry, I was using testing! Indeed it's 3.27 on my Jessie box. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 --- Comment #39 from Frédéric Demians <frederic@tamil.fr> --- (In reply to Jonathan Druart from comment #38)
So sorry, I was using testing! Indeed it's 3.27 on my Jessie box.
And does it work? Are tests passing? If so, Héctor could re-sign-off the attached patch, which is supposed to fix test failings you pointed out. It remains that HTTP::OAI v4 is a time bomb... -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 --- Comment #40 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Frédéric Demians from comment #39)
(In reply to Jonathan Druart from comment #38)
So sorry, I was using testing! Indeed it's 3.27 on my Jessie box.
And does it work? Are tests passing? If so, Héctor could re-sign-off the attached patch, which is supposed to fix test failings you pointed out.
Yes, all tests pass. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 Héctor Eduardo Castro Avalos <hector.hecaxmmx@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #45320|0 |1 is obsolete| | --- Comment #41 from Héctor Eduardo Castro Avalos <hector.hecaxmmx@gmail.com> --- Created attachment 45386 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=45386&action=edit [SIGNED-OFF]Bug 14939: Modularize OAI Server existing classes Koha OAI server has been done in one unique .pl file because there wasn't any object model or rules in the Koha project when it has been coded. This patch modularized existing classes, putting each class in a separate file in Koha::OAI::Server namespace. UT begining. Add new dependency: Capture::Tiny Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com> OAI server moduralized succefully. Works for Debian Jessie and Wheezy. Test pass successfully -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 Héctor Eduardo Castro Avalos <hector.hecaxmmx@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 --- Comment #42 from David Cook <dcook@prosentient.com.au> --- (In reply to Frédéric Demians from comment #39)
It remains that HTTP::OAI v4 is a time bomb...
Indeed it does. I would hope that it wouldn't get into the next stable release of Debian... that they'd notice it fails in Debian Testing and thus continue with the existing stable version, but you never know... Ubuntu 15.10 Wily was released in October, and it has 4.x, so there is a popular Debian-based OS there with a bad HTTP::OAI package it seems http://packages.ubuntu.com/wily/libhttp-oai-perl. I haven't tested it though as I don't have a Ubuntu 15.10 install at hand... (Interesting that Robin Sheat is listed as a maintainer... also listed as a maintainer at https://packages.debian.org/source/jessie/libhttp-oai-perl although he's no longer involved with Koha...) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 --- Comment #43 from David Cook <dcook@prosentient.com.au> --- (In reply to Frédéric Demians from comment #37)
But no response yet. We may give a phone call to Tim Brody...
That would be great. I'd love to know if he's still maintaining the project, or if he's open to someone taking it over. Not that I'm necessarily volunteering but it would be good to know. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 --- Comment #44 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 45567 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=45567&action=edit Bug 14939: Remove the Capture::Tiny dependency It's possible to redirect the std output to a variable, it will avoid to add this new dependency. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 --- Comment #45 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Frédéric Demians from comment #28)
I'm open to any proposal to replace Tiny::Capture.
What about this last patch? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #45567|0 |1 is obsolete| | --- Comment #46 from Frédéric Demians <frederic@tamil.fr> --- Created attachment 45577 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=45577&action=edit Bug 14939: Remove the Capture::Tiny dependency It's possible to redirect the std output to a variable, it will avoid to add this new dependency. Signed-off-by: Frédéric Demians <f.demians@tamil.fr> OK. + code factorisation with a function call. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 --- Comment #47 from Frédéric Demians <frederic@tamil.fr> --- Thanks for the solution. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #45386|0 |1 is obsolete| | Attachment #45577|0 |1 is obsolete| | --- Comment #48 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 45602 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=45602&action=edit Bug 14939: Modularize OAI Server existing classes Koha OAI server has been done in one unique .pl file because there wasn't any object model or rules in the Koha project when it has been coded. This patch modularized existing classes, putting each class in a separate file in Koha::OAI::Server namespace. UT begining. Add new dependency: Capture::Tiny Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com> OAI server moduralized succefully. Works for Debian Jessie and Wheezy. Test pass successfully Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 --- Comment #49 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 45603 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=45603&action=edit Bug 14939: Remove the Capture::Tiny dependency It's possible to redirect the std output to a variable, it will avoid to add this new dependency. Signed-off-by: Frédéric Demians <f.demians@tamil.fr> OK. + code factorisation with a function call. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on|15108 | Keywords|dependency | --- Comment #50 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Nice job Frédéric! Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15108 [Bug 15108] OAI-PMH provider improvements -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14939 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com Status|Passed QA |Pushed to Master --- Comment #51 from Kyle M Hall <kyle@bywatersolutions.com> --- Pushed to master, thanks Frédéric! -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org