Bug 35659 - OAI harvester
Summary: OAI harvester
Status: Needs documenting
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: Main
Hardware: All All
: P5 - low new feature
Assignee: Matthias Meusburger
QA Contact: David Cook
URL:
Keywords: roadmap_24_11
: 10662 (view as bug list)
Depends on:
Blocks: 38491
  Show dependency treegraph
 
Reported: 2023-12-28 15:43 UTC by Matthias Meusburger
Modified: 2024-11-20 10:35 UTC (History)
19 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: Medium patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This change adds the ability for library staff to define OAI repositories in Koha, which are harvested for metadata using a cronjob configured by the system administrator. An email report of the harvest can be shared via using an email address defined in the system preference OAI-PMH:HarvestEmailReport
Version(s) released in:
24.11.00
Circulation function:


Attachments
Bug 35659: OAI Harvester (99.13 KB, patch)
2023-12-28 16:00 UTC, Matthias Meusburger
Details | Diff | Splinter Review
DO NOT PUSH: Bug 35659 DBIC Update (9.11 KB, patch)
2023-12-28 16:00 UTC, Matthias Meusburger
Details | Diff | Splinter Review
Bug 35659: OAI Harvester (99.56 KB, patch)
2024-01-10 09:35 UTC, Matthias Meusburger
Details | Diff | Splinter Review
Bug 35659: OAI Harvester (102.98 KB, patch)
2024-02-07 15:11 UTC, Matthias Meusburger
Details | Diff | Splinter Review
Bug 35659: OAI Harvester (102.95 KB, patch)
2024-02-09 09:20 UTC, Matthias Meusburger
Details | Diff | Splinter Review
DO NOT PUSH: Bug 35659 DBIC Update (9.15 KB, patch)
2024-02-10 20:09 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 35659: OAI Harvester (103.00 KB, patch)
2024-02-10 20:09 UTC, Michal Denar
Details | Diff | Splinter Review
DO NOT PUSH: Bug 35659 DBIC Update (9.15 KB, patch)
2024-02-10 20:10 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 35659: OAI Harvester (103.00 KB, patch)
2024-02-10 20:10 UTC, Michal Denar
Details | Diff | Splinter Review
DO NOT PUSH: Bug 35659 DBIC Update (9.19 KB, patch)
2024-02-10 20:12 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 35659: OAI Harvester (103.04 KB, patch)
2024-02-10 20:12 UTC, Michal Denar
Details | Diff | Splinter Review
DO NOT PUSH: Bug 35659 DBIC Update (9.23 KB, patch)
2024-02-10 20:33 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 35659: OAI Harvester (103.08 KB, patch)
2024-02-10 20:33 UTC, Michal Denar
Details | Diff | Splinter Review
Screenshot - Accented characters in the OPAC (90.94 KB, image/png)
2024-02-28 07:32 UTC, Andreas Roussos
Details
Bug 35659: (follow-up) Better handling of accented characters (2.79 KB, patch)
2024-02-28 07:35 UTC, Andreas Roussos
Details | Diff | Splinter Review
DO NOT PUSH: Bug 35659 DBIC Update (9.28 KB, patch)
2024-03-01 20:24 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 35659: OAI Harvester (103.12 KB, patch)
2024-03-01 20:24 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 35659: (follow-up) Better handling of accented characters (2.84 KB, patch)
2024-03-01 20:24 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 35659: (follow-up) Make OAI repositories edition comply with CSRF (6.98 KB, patch)
2024-03-20 13:37 UTC, Matthias Meusburger
Details | Diff | Splinter Review
Bug 35659: (QA follow-up) (6.21 KB, patch)
2024-04-10 08:36 UTC, Matthias Meusburger
Details | Diff | Splinter Review
Bug 35659: (QA follow-up) (14.81 KB, patch)
2024-04-10 09:12 UTC, Matthias Meusburger
Details | Diff | Splinter Review
DO NOT PUSH: Bug 35659 DBIC Update (9.22 KB, patch)
2024-04-10 11:33 UTC, Julian Maurice
Details | Diff | Splinter Review
Bug 35659: OAI Harvester (103.06 KB, patch)
2024-04-10 11:33 UTC, Julian Maurice
Details | Diff | Splinter Review
Bug 35659: (follow-up) Better handling of accented characters (2.90 KB, patch)
2024-04-10 11:33 UTC, Julian Maurice
Details | Diff | Splinter Review
Bug 35659: (follow-up) Make OAI repositories edition comply with CSRF (7.04 KB, patch)
2024-04-10 11:33 UTC, Julian Maurice
Details | Diff | Splinter Review
Bug 35659: (QA follow-up) (14.87 KB, patch)
2024-04-10 11:33 UTC, Julian Maurice
Details | Diff | Splinter Review
DO NOT PUSH: Bug 35659 DBIC Update (9.28 KB, patch)
2024-04-10 12:31 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35659: OAI Harvester (103.17 KB, patch)
2024-04-10 12:31 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35659: (follow-up) Better handling of accented characters (2.96 KB, patch)
2024-04-10 12:32 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35659: (follow-up) Make OAI repositories edition comply with CSRF (7.10 KB, patch)
2024-04-10 12:32 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35659: (QA follow-up) (14.93 KB, patch)
2024-04-10 12:32 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35659: OAI Harvester (102.96 KB, patch)
2024-04-19 13:42 UTC, Matthias Meusburger
Details | Diff | Splinter Review
DO NOT PUSH: Bug 35659 DBIC Update (9.27 KB, patch)
2024-04-26 04:15 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review
Bug 35659: OAI Harvester (102.96 KB, patch)
2024-04-26 04:15 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review
Bug 35659: (follow-up) Better handling of accented characters (2.95 KB, patch)
2024-04-26 04:16 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review
Bug 35659: (follow-up) Make OAI repositories edition comply with CSRF (7.09 KB, patch)
2024-04-26 04:16 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review
Bug 35659: (QA follow-up) (14.92 KB, patch)
2024-04-26 04:16 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review
DO NOT PUSH: Bug 35659 DBIC Update (9.23 KB, patch)
2024-05-23 12:27 UTC, Matthias Meusburger
Details | Diff | Splinter Review
Bug 35659: (QA follow-up) (35.22 KB, patch)
2024-05-23 12:27 UTC, Matthias Meusburger
Details | Diff | Splinter Review
Bug 35659: OAI Harvester (102.96 KB, patch)
2024-05-24 16:37 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review
Bug 35659: (follow-up) Better handling of accented characters (2.95 KB, patch)
2024-05-24 16:37 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review
Bug 35659: (follow-up) Make OAI repositories edition comply with CSRF (7.09 KB, patch)
2024-05-24 16:37 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review
Bug 35659: (QA follow-up) (14.92 KB, patch)
2024-05-24 16:37 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review
DO NOT PUSH: Bug 35659 DBIC Update (9.23 KB, patch)
2024-05-24 16:37 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review
Bug 35659: (more QA follow-ups) (35.22 KB, patch)
2024-05-24 16:37 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review
Bug 35659: (more QA follow-ups) (35.22 KB, patch)
2024-07-15 12:42 UTC, Matthias Meusburger
Details | Diff | Splinter Review
Bug 35659: (QA follow-up): Auth unit tests & dbrev (21.31 KB, patch)
2024-07-15 12:43 UTC, Matthias Meusburger
Details | Diff | Splinter Review
DO NOT PUSH: Bug 35659 DBIC Update (11.31 KB, patch)
2024-08-01 11:42 UTC, Matthias Meusburger
Details | Diff | Splinter Review
Bug 35659: (QA follow-up): Add init function tests by using Koha's OAI server (4.96 KB, patch)
2024-09-10 15:37 UTC, Matthias Meusburger
Details | Diff | Splinter Review
DO NOT PUSH: Bug 35659 DBIC Update (11.21 KB, patch)
2024-09-10 15:45 UTC, Matthias Meusburger
Details | Diff | Splinter Review
Bug 35659: (QA follow-up): Add koha_object(s)_class functions for OaiServer.pm (980 bytes, patch)
2024-09-10 15:48 UTC, Matthias Meusburger
Details | Diff | Splinter Review
Bug 35659: (QA follow-up): Add init function tests by using Koha's OAI server (4.94 KB, patch)
2024-09-10 16:10 UTC, Matthias Meusburger
Details | Diff | Splinter Review
Bug 35659: (QA follow-up): Add init function tests by using Koha's OAI server (12.56 KB, patch)
2024-09-10 16:11 UTC, Matthias Meusburger
Details | Diff | Splinter Review
Bug 35659: (QA follow-up): Add init function tests by using Koha's OAI server (7.69 KB, patch)
2024-09-10 16:16 UTC, Matthias Meusburger
Details | Diff | Splinter Review
Screenshot - Navigation menu wrongly appears on the right (145.96 KB, image/png)
2024-09-18 14:33 UTC, Andreas Roussos
Details
Screenshot - The label for the "Set:" text input is missing (21.02 KB, image/png)
2024-09-18 14:34 UTC, Andreas Roussos
Details
Bug 35659: (follow-up) Use new column name in cron script (2.29 KB, patch)
2024-09-18 14:36 UTC, Andreas Roussos
Details | Diff | Splinter Review
Bug 35659: (follow-up) Adjust TT code for Bootstrap 5 (4.59 KB, patch)
2024-09-18 14:36 UTC, Andreas Roussos
Details | Diff | Splinter Review
Bug 35659: OAI Harvester (103.01 KB, patch)
2024-09-26 20:27 UTC, David Cook
Details | Diff | Splinter Review
Bug 35659: (follow-up) Better handling of accented characters (3.00 KB, patch)
2024-09-26 20:27 UTC, David Cook
Details | Diff | Splinter Review
Bug 35659: (follow-up) Make OAI repositories edition comply with CSRF (7.15 KB, patch)
2024-09-26 20:27 UTC, David Cook
Details | Diff | Splinter Review
Bug 35659: (QA follow-up) (14.98 KB, patch)
2024-09-26 20:27 UTC, David Cook
Details | Diff | Splinter Review
Bug 35659: (more QA follow-ups) (35.28 KB, patch)
2024-09-26 20:27 UTC, David Cook
Details | Diff | Splinter Review
Bug 35659: (QA follow-up): Auth unit tests & dbrev (21.36 KB, patch)
2024-09-26 20:27 UTC, David Cook
Details | Diff | Splinter Review
DO NOT PUSH: Bug 35659 DBIC Update (11.25 KB, patch)
2024-09-26 20:27 UTC, David Cook
Details | Diff | Splinter Review
Bug 35659: (QA follow-up): Add koha_object(s)_class functions for OaiServer.pm (1.01 KB, patch)
2024-09-26 20:27 UTC, David Cook
Details | Diff | Splinter Review
Bug 35659: (QA follow-up): Add init function tests by using Koha's OAI server (7.74 KB, patch)
2024-09-26 20:27 UTC, David Cook
Details | Diff | Splinter Review
Bug 35659: (follow-up) Use new column name in cron script (2.34 KB, patch)
2024-09-26 20:27 UTC, David Cook
Details | Diff | Splinter Review
Bug 35659: (follow-up) Adjust TT code for Bootstrap 5 (4.64 KB, patch)
2024-09-26 20:27 UTC, David Cook
Details | Diff | Splinter Review
Bug 35659: (follow-up) fix auth oai to MARC21 (1.05 KB, patch)
2024-09-26 20:27 UTC, David Cook
Details | Diff | Splinter Review
Bug 35659: OAI Harvester (103.07 KB, patch)
2024-09-30 02:16 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review
Bug 35659: (follow-up) Better handling of accented characters (3.06 KB, patch)
2024-09-30 02:16 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review
Bug 35659: (follow-up) Make OAI repositories edition comply with CSRF (7.20 KB, patch)
2024-09-30 02:16 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review
Bug 35659: (QA follow-up) (15.03 KB, patch)
2024-09-30 02:16 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review
Bug 35659: (more QA follow-ups) (35.33 KB, patch)
2024-09-30 02:16 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review
Bug 35659: (QA follow-up): Auth unit tests & dbrev (21.42 KB, patch)
2024-09-30 02:16 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review
DO NOT PUSH: Bug 35659 DBIC Update (11.31 KB, patch)
2024-09-30 02:16 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review
Bug 35659: (QA follow-up): Add koha_object(s)_class functions for OaiServer.pm (1.06 KB, patch)
2024-09-30 02:16 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review
Bug 35659: (QA follow-up): Add init function tests by using Koha's OAI server (7.79 KB, patch)
2024-09-30 02:16 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review
Bug 35659: (follow-up) Use new column name in cron script (2.40 KB, patch)
2024-09-30 02:16 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review
Bug 35659: (follow-up) Adjust TT code for Bootstrap 5 (4.70 KB, patch)
2024-09-30 02:17 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review
Bug 35659: (follow-up) fix auth oai to MARC21 (1.10 KB, patch)
2024-09-30 02:17 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review
Bug 35659: OAI Harvester (103.12 KB, patch)
2024-10-22 01:36 UTC, David Cook
Details | Diff | Splinter Review
Bug 35659: (follow-up) Better handling of accented characters (3.12 KB, patch)
2024-10-22 01:36 UTC, David Cook
Details | Diff | Splinter Review
Bug 35659: (follow-up) Make OAI repositories edition comply with CSRF (7.26 KB, patch)
2024-10-22 01:36 UTC, David Cook
Details | Diff | Splinter Review
Bug 35659: (QA follow-up) (15.09 KB, patch)
2024-10-22 01:36 UTC, David Cook
Details | Diff | Splinter Review
Bug 35659: (more QA follow-ups) (35.39 KB, patch)
2024-10-22 01:36 UTC, David Cook
Details | Diff | Splinter Review
Bug 35659: (QA follow-up): Auth unit tests & dbrev (21.47 KB, patch)
2024-10-22 01:36 UTC, David Cook
Details | Diff | Splinter Review
DO NOT PUSH: Bug 35659 DBIC Update (11.36 KB, patch)
2024-10-22 01:36 UTC, David Cook
Details | Diff | Splinter Review
Bug 35659: (QA follow-up): Add koha_object(s)_class functions for OaiServer.pm (1.12 KB, patch)
2024-10-22 01:36 UTC, David Cook
Details | Diff | Splinter Review
Bug 35659: (QA follow-up): Add init function tests by using Koha's OAI server (7.85 KB, patch)
2024-10-22 01:36 UTC, David Cook
Details | Diff | Splinter Review
Bug 35659: (follow-up) Use new column name in cron script (2.45 KB, patch)
2024-10-22 01:36 UTC, David Cook
Details | Diff | Splinter Review
Bug 35659: (follow-up) Adjust TT code for Bootstrap 5 (4.75 KB, patch)
2024-10-22 01:36 UTC, David Cook
Details | Diff | Splinter Review
Bug 35659: (follow-up) fix auth oai to MARC21 (1.16 KB, patch)
2024-10-22 01:36 UTC, David Cook
Details | Diff | Splinter Review
Bug 35659: (QA follow-up) Update syspref description to be a sentence (3.49 KB, patch)
2024-10-22 01:36 UTC, David Cook
Details | Diff | Splinter Review
Bug 35659: (QA follow-up) Fix capitalisation in notice (2.76 KB, patch)
2024-10-22 01:37 UTC, David Cook
Details | Diff | Splinter Review
Bug 35659: Adjust DT's option names (1.83 KB, patch)
2024-10-28 15:35 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 35659: (QA follow-up) fix t/db_dependent/TestBuilder.t (1.38 KB, patch)
2024-10-29 00:36 UTC, David Cook
Details | Diff | Splinter Review
Bug 35659: (QA follow-up) Fix t/db_dependent/Koha/OAIHarvester.t (1.38 KB, patch)
2024-10-29 00:46 UTC, David Cook
Details | Diff | Splinter Review
Bug 35659: (QA follow-up) Fix t/db_dependent/Koha/OAIHarvester.t (1.42 KB, patch)
2024-10-29 00:48 UTC, David Cook
Details | Diff | Splinter Review
Bug 35659: (QA follow-up) Fix t/db_dependent/Koha/OAIHarvester.t (1001 bytes, patch)
2024-10-29 11:02 UTC, Matthias Meusburger
Details | Diff | Splinter Review
Bug 35659: (QA follow-up) Fix DateTime and cronlogaction messages (2.01 KB, patch)
2024-11-19 13:58 UTC, Matthias Meusburger
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Meusburger 2023-12-28 15:43:23 UTC
Koha needs to be able to harvest records from OAI-PMH repositories.

This patch implements a cronjob-based OAI harvester, deliberately kept simple and consistent in its configuration with what we already have in Koha for other data sources, such as Z3950 and SRU.

It is sponsored by KohaLa, its goals and implementation have been previously discussed on the koha and koha-devel mailing-lists, as well as in a presentation at KohaCon'23 in Helsinki: "Let's add an OAI-PMH harvester in Koha" by Sonia Bouis.

Some of the code and ideas are based on a previous implementation of an OAI harvester by David Cook (See BZ 25905 and 10662).
Comment 1 Matthias Meusburger 2023-12-28 16:00:25 UTC
Created attachment 160356 [details] [review]
Bug 35659: OAI Harvester

Test plan:

 - Run updatedatabase.pl

 - Apply the DBIC update patch

 - Setup an OAI repository in Administration -> OAI repositories (admin/oaiservers.pl)

   If the repository dataformat is in oai_dc, you can use the sample XSLT files:
   For Unimarc:
   OAIDCtoUNIMARCXML.xsl for bibliographic records
   AuthOAIDCtoUNIMARCXML.xsl for authorities

   For Marc21:
   OAIDCtoMARC21XML.xsl for bibliographic records
   AuthOAIDCtoMARC21XML.xsl for authorities

   If the repository dataformat is in marc-xml, you can use
   OAIMarcxml2KohaMarcxml.xsl for both Unimarc and Marc21.

 - Some repositories to test with:

   Bibliographic records, oai_dc:
   Endpoint: http://staroai.theses.fr/OAIHandler
   Set: ddc:260
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/OAIDCtoUNIMARCXML.xsl
   or
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/OAIDCtoMARC21XML.xsl

   Authorities, oai_dc:
   Endpoint: https://www.idref.fr/OAI/oai.jsp
   Set: a
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/AuthOAIDCtoUNIMARCXML.xsl
   or
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/AuthOAIDCtoMARC21XML.xsl

   Authorities, marc-xml, Unimarc:
   Endpoint: https://www.idref.fr/OAI/oai.jsp
   Set: a
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/OAIMarcxml2KohaMarcxml.xsl

 - Note: marc-xml harvesting will not work with HTTP::OAI::Harvester version 3.xx
   Version 4.xx is needed.
   See Bug 17704 for updating Koha default version to 4.xx

 - If you want to receive a report email, fill the OAI-PMH:HarvestEmailReport
   syspref. The model used (OAI_HARVEST_REPORT) can be edited in tools -> Notices and slips.

 - start a harvest with the following command:
   misc/cronjobs/harvest_oai.pl

    This script starts an OAI Harvest

    This script has the following parameters :
        -h --help: this message
        -v --verbose (enable output to stdout)
        -r --repository: id of the OAI repository
        -d --days: number of days to harvest from (optional)
        -l --list: list the OAI repositories
        -f --force: force harvesting (ignore records datestamps) (optional)

    Example: misc/cronjobs/harvest_oai.pl -r 1 -d 10 -v -f

 - Check the logs in the Log Viewer (tools/viewlog.pl)
   (CronjobLog syspref must be activated)

Sponsored-by: KohaLa
Comment 2 Matthias Meusburger 2023-12-28 16:00:44 UTC
Created attachment 160357 [details] [review]
DO NOT PUSH: Bug 35659 DBIC Update
Comment 3 David Cook 2024-01-02 01:53:32 UTC
This is great news! Once my January holidays are done, I can look more at these patches!

At a glance, you will need to add unit tests for Koha::OAI::Client::Harvester before this can Pass QA (PERL17 in the coding guidelines), and that might require a bit of refactoring. (Missing unit tests are what ultimately bit me with bug 10662.)

I think that we're not allowing function declarations in .pl scripts anymore either (for admin/oaiservers.pl) so that might need to be refactored. That said, I can't find a reference to it in the coding guidelines and the patches pass the QA scripts, so I could be wrong there. 

But other than that the patches are looking pretty good at a glance I think.
Comment 4 David Cook 2024-01-02 01:54:12 UTC
I'm having some trouble running /kohadevbox/koha/t/db_dependent/Koha/OAIServers.t as part of the QA scripts, but it might be my install. I'm going to try to refresh my ktd...
Comment 5 David Cook 2024-01-02 02:10:49 UTC
I updated my ktd and now I'm getting failures when running the QA tools, although I've got the unit test working.

I notice there is a little typo in the pod in Koha/Import/Oaipmh/Authority.pm where it says "type" instead of "_type". Same with Koha/Import/Oaipmh/Biblio.pm and Koha/OaiServers.pm. 

Koha/OAI/Client/Harvester.pm is missing POD. 

I think the error for Koha/OaiServer.pm is false though. Not sure why that's getting a pod coverage error... 

I think the tidiness can also be ignored for the Schema files...

--

qa -c 2 -v 2
testing 2 commit(s) (applied to ac02c1d 'ad Bug 35405: Remove noise from MARC:')

Processing files before patches
The PO directory has not been found. There is a problem in your Koha installation. at /kohadevbox/koha/Koha/I18N.pm line 197.
|========================>| 27 / 27 (100.00%)
Processing files after patches
|========================>| 27 / 27 (100.00%)

 OK     Koha/Import/Oaipmh/Authorities.pm

 FAIL   Koha/Import/Oaipmh/Authority.pm
   FAIL   pod coverage
                POD coverage was greater before, try perl -MPod::Coverage=PackageName -e666

 FAIL   Koha/Import/Oaipmh/Biblio.pm
   FAIL   pod coverage
                POD coverage was greater before, try perl -MPod::Coverage=PackageName -e666

 OK     Koha/Import/Oaipmh/Biblios.pm

 FAIL   Koha/OAI/Client/Harvester.pm
   FAIL   pod coverage
                POD coverage was greater before, try perl -MPod::Coverage=PackageName -e666

 FAIL   Koha/OaiServer.pm
   FAIL   pod coverage
                POD coverage was greater before, try perl -MPod::Coverage=PackageName -e666

 OK     Koha/OaiServers.pm

 FAIL   Koha/Schema/Result/ImportOaipmhAuthority.pm
   FAIL   pod coverage
                POD coverage was greater before, try perl -MPod::Coverage=PackageName -e666
   WARN   tidiness
                The file is less tidy than before (bad/messy lines before: 0, now: 33)

 FAIL   Koha/Schema/Result/ImportOaipmhBiblio.pm
   FAIL   pod coverage
                POD coverage was greater before, try perl -MPod::Coverage=PackageName -e666
   WARN   tidiness
                The file is less tidy than before (bad/messy lines before: 0, now: 28)

 FAIL   Koha/Schema/Result/Oaiserver.pm
   FAIL   pod coverage
                POD is missing for koha_object_class
                POD is missing for koha_objects_class
   WARN   tidiness
                The file is less tidy than before (bad/messy lines before: 0, now: 24)

 OK     admin/oaiservers.pl

 OK     installer/data/mysql/atomicupdate/Bug-35659.pl

 OK     installer/data/mysql/en/mandatory/sample_notices.yml

 OK     installer/data/mysql/kohastructure.sql

 OK     installer/data/mysql/mandatory/sysprefs.sql

 OK     koha-tmpl/intranet-tmpl/prog/en/includes/admin-menu.inc

 OK     koha-tmpl/intranet-tmpl/prog/en/includes/oai-admin-search.inc

 OK     koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc

 OK     koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt

 OK     koha-tmpl/intranet-tmpl/prog/en/modules/admin/oaiservers.tt

 OK     koha-tmpl/intranet-tmpl/prog/en/xslt/AuthOAIDCtoMARC21XML.xsl

 OK     koha-tmpl/intranet-tmpl/prog/en/xslt/AuthOAIDCtoUNIMARCXML.xsl

 OK     koha-tmpl/intranet-tmpl/prog/en/xslt/OAIDCtoMARC21XML.xsl

 OK     koha-tmpl/intranet-tmpl/prog/en/xslt/OAIDCtoUNIMARCXML.xsl

 OK     koha-tmpl/intranet-tmpl/prog/en/xslt/OAIMarcxml2KohaMarcxml.xsl

 OK     misc/cronjobs/harvest_oai.pl

 OK     t/db_dependent/Koha/OAIServers.t


Processing additional checks

        * Commit title does not start with 'Bug XXXXX: ' - 44b002f8cc

Running tests (1)
        * Proving /kohadevbox/koha/t/db_dependent/Koha/OAIServers.t OK!
Comment 6 Katrin Fischer 2024-01-02 22:18:36 UTC
We are still missing supporters for this in the road map:
https://wiki.koha-community.org/wiki/Road_map_24.05 *hint*
Comment 7 David Cook 2024-01-02 22:25:40 UTC
(In reply to Katrin Fischer from comment #6)
> We are still missing supporters for this in the road map:
> https://wiki.koha-community.org/wiki/Road_map_24.05 *hint*

I've just added myself. Hopefully someone else can jump on board too.
Comment 8 Koha Team University Lyon 3 2024-01-06 11:54:46 UTC
(In reply to Katrin Fischer from comment #6)
> We are still missing supporters for this in the road map:
> https://wiki.koha-community.org/wiki/Road_map_24.05 *hint*

Add myself as supporter :)
Comment 9 Matthias Meusburger 2024-01-10 09:35:36 UTC Comment hidden (obsolete)
Comment 10 Matthias Meusburger 2024-01-10 09:45:34 UTC
Hi David!

The typo in Koha/Import/Oaipmh/Authority.pm, Koha/Import/Oaipmh/Biblio.pm and Koha/OaiServers.pm has been fixed.

POD has been added to Koha/OAI/Client/Harvester.pm

> I think the error for Koha/OaiServer.pm is false though. Not sure why that's getting a pod coverage error... 

About those, ashimema told me on IRC: 

15:07	ashimema	if they're new classes you can safely ignore that..
15:07		there's a bug in the POD detection for new clases

> I think the tidiness can also be ignored for the Schema files...

That's what I thought too, since they are auto-generated.
Comment 11 David Cook 2024-01-22 22:44:53 UTC
I'm in my last week of holiday mode, so I should be more available for this in the coming weeks.

Thanks Matthias for looking at that. I'll take another look soon at the QA tools output another time.

It looks like Koha::OAI::Client::Harvester is still missing unit tests though. I think that's going to be a QA blocker.
Comment 12 David Cook 2024-01-22 22:45:42 UTC
Comment on attachment 160744 [details] [review]
Bug 35659: OAI Harvester

Review of attachment 160744 [details] [review]:
-----------------------------------------------------------------

::: Koha/OAI/Client/Harvester.pm
@@ +127,5 @@
> +        printlog("ListMetadataFormats failed");
> +    };
> +
> +    #my $response = $h->Identify;
> +    #print "Repository supports protocol version ", $response->version, "\n";

Looks like some debugging code that needs to be removed here
Comment 13 David Cook 2024-01-22 22:58:37 UTC
(In reply to David Cook from comment #11)
> It looks like Koha::OAI::Client::Harvester is still missing unit tests
> though. I think that's going to be a QA blocker.

At a minimum, I think the code handling "$response->next" should be in separate unit tested functions. 

(In theory, the other earlier code within the "new" constructor could probably be moved into an "init" function as well. But that is harder to test since it interacts with a real website. We could create a fake website but I think that would be a bit above and beyond.)
Comment 14 Matthias Meusburger 2024-02-07 15:11:05 UTC
Created attachment 161813 [details] [review]
Bug 35659: OAI Harvester

Test plan:

 - Run updatedatabase.pl

 - Apply the DBIC update patch

 - Setup an OAI repository in Administration -> OAI repositories (admin/oaiservers.pl)

   If the repository dataformat is in oai_dc, you can use the sample XSLT files:
   For Unimarc:
   OAIDCtoUNIMARCXML.xsl for bibliographic records
   AuthOAIDCtoUNIMARCXML.xsl for authorities

   For Marc21:
   OAIDCtoMARC21XML.xsl for bibliographic records
   AuthOAIDCtoMARC21XML.xsl for authorities

   If the repository dataformat is in marc-xml, you can use
   OAIMarcxml2KohaMarcxml.xsl for both Unimarc and Marc21.

 - Some repositories to test with:

   Bibliographic records, oai_dc:
   Endpoint: http://staroai.theses.fr/OAIHandler
   Set: ddc:260
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/OAIDCtoUNIMARCXML.xsl
   or
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/OAIDCtoMARC21XML.xsl

   Authorities, oai_dc:
   Endpoint: https://www.idref.fr/OAI/oai.jsp
   Set: a
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/AuthOAIDCtoUNIMARCXML.xsl
   or
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/AuthOAIDCtoMARC21XML.xsl

   Authorities, marc-xml, Unimarc:
   Endpoint: https://www.idref.fr/OAI/oai.jsp
   Set: a
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/OAIMarcxml2KohaMarcxml.xsl

 - Note: marc-xml harvesting will not work with HTTP::OAI::Harvester version 3.xx
   Version 4.xx is needed.
   See Bug 17704 for updating Koha default version to 4.xx

 - If you want to receive a report email, fill the OAI-PMH:HarvestEmailReport
   syspref. The model used (OAI_HARVEST_REPORT) can be edited in tools -> Notices and slips.

 - start a harvest with the following command:
   misc/cronjobs/harvest_oai.pl

    This script starts an OAI Harvest

    This script has the following parameters :
        -h --help: this message
        -v --verbose (enable output to stdout)
        -r --repository: id of the OAI repository
        -d --days: number of days to harvest from (optional)
        -l --list: list the OAI repositories
        -f --force: force harvesting (ignore records datestamps) (optional)

    Example: misc/cronjobs/harvest_oai.pl -r 1 -d 10 -v -f

 - Check the logs in the Log Viewer (tools/viewlog.pl)
   (CronjobLog syspref must be activated)

Sponsored-by: KohaLa
Comment 15 Matthias Meusburger 2024-02-07 15:12:21 UTC
(In reply to David Cook from comment #13)
> (In reply to David Cook from comment #11)
> > It looks like Koha::OAI::Client::Harvester is still missing unit tests
> > though. I think that's going to be a QA blocker.
> 
> At a minimum, I think the code handling "$response->next" should be in
> separate unit tested functions. 
> 

Hi! I've added unit tests for record processing.
Comment 16 David Cook 2024-02-07 22:38:10 UTC
(In reply to Matthias Meusburger from comment #15)
> Hi! I've added unit tests for record processing.

Thanks, Matthias! I've taken a quick glance at the unit tests and they're looking good! 

I've got a bit on my plate at the moment, but I'll come back to look at this soon! 

I think it would be good to find someone else to Sign Off on it, so that I can QA it.
Comment 17 Michal Denar 2024-02-08 20:38:27 UTC
Hi,
I get an error when I try to apply the patch:

Bug 35659 - OAI Harvester

160357 - DO NOT PUSH: Bug 35659 DBIC Update
161813 - Bug 35659: OAI Harvester

Apply? [(y)es, (n)o, (i)nteractive] y
Applying: DO NOT PUSH: Bug 35659 DBIC Update
Applying: Bug 35659: OAI Harvester
Using index info to reconstruct a base tree...
M	installer/data/mysql/mandatory/sysprefs.sql
M	installer/data/mysql/mandatory/userpermissions.sql
M	koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc
M	koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt
Falling back to patching base and 3-way merge...
Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt
Auto-merging koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc
Auto-merging installer/data/mysql/mandatory/userpermissions.sql
Auto-merging installer/data/mysql/mandatory/sysprefs.sql
CONFLICT (content): Merge conflict in installer/data/mysql/mandatory/sysprefs.sql
error: Failed to merge in the changes.
Comment 18 Matthias Meusburger 2024-02-09 09:20:44 UTC
Created attachment 161960 [details] [review]
Bug 35659: OAI Harvester

Test plan:

 - Run updatedatabase.pl

 - Apply the DBIC update patch

 - Setup an OAI repository in Administration -> OAI repositories (admin/oaiservers.pl)

   If the repository dataformat is in oai_dc, you can use the sample XSLT files:
   For Unimarc:
   OAIDCtoUNIMARCXML.xsl for bibliographic records
   AuthOAIDCtoUNIMARCXML.xsl for authorities

   For Marc21:
   OAIDCtoMARC21XML.xsl for bibliographic records
   AuthOAIDCtoMARC21XML.xsl for authorities

   If the repository dataformat is in marc-xml, you can use
   OAIMarcxml2KohaMarcxml.xsl for both Unimarc and Marc21.

 - Some repositories to test with:

   Bibliographic records, oai_dc:
   Endpoint: http://staroai.theses.fr/OAIHandler
   Set: ddc:260
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/OAIDCtoUNIMARCXML.xsl
   or
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/OAIDCtoMARC21XML.xsl

   Authorities, oai_dc:
   Endpoint: https://www.idref.fr/OAI/oai.jsp
   Set: a
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/AuthOAIDCtoUNIMARCXML.xsl
   or
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/AuthOAIDCtoMARC21XML.xsl

   Authorities, marc-xml, Unimarc:
   Endpoint: https://www.idref.fr/OAI/oai.jsp
   Set: a
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/OAIMarcxml2KohaMarcxml.xsl

 - Note: marc-xml harvesting will not work with HTTP::OAI::Harvester version 3.xx
   Version 4.xx is needed.
   See Bug 17704 for updating Koha default version to 4.xx

 - If you want to receive a report email, fill the OAI-PMH:HarvestEmailReport
   syspref. The model used (OAI_HARVEST_REPORT) can be edited in tools -> Notices and slips.

 - start a harvest with the following command:
   misc/cronjobs/harvest_oai.pl

    This script starts an OAI Harvest

    This script has the following parameters :
        -h --help: this message
        -v --verbose (enable output to stdout)
        -r --repository: id of the OAI repository
        -d --days: number of days to harvest from (optional)
        -l --list: list the OAI repositories
        -f --force: force harvesting (ignore records datestamps) (optional)

    Example: misc/cronjobs/harvest_oai.pl -r 1 -d 10 -v -f

 - Check the logs in the Log Viewer (tools/viewlog.pl)
   (CronjobLog syspref must be activated)

Sponsored-by: KohaLa
Comment 19 Matthias Meusburger 2024-02-09 09:22:17 UTC
(In reply to Michal Denar from comment #17)
> Hi,
> I get an error when I try to apply the patch:
> 

Hi Michal, sorry about that. The patch has been rebased to master, it should be ok now.
Comment 20 Michal Denar 2024-02-09 21:31:42 UTC
Hi,
this patch works for me. I don't know why, but I can't get it to unsign the signed patch and switch to SO. I've tried several times, but without success. Harvester works and it is possible to switch to signed off.
Comment 21 Michal Denar 2024-02-09 21:34:45 UTC
I get error: "Failed to update bug 35659, status=200"
BZ login credentials are correct.
Comment 22 Michal Denar 2024-02-10 20:09:00 UTC
Created attachment 162004 [details] [review]
DO NOT PUSH: Bug 35659 DBIC Update

Signed-off-by: John Doe <you@example.com>
Comment 23 Michal Denar 2024-02-10 20:09:03 UTC
Created attachment 162005 [details] [review]
Bug 35659: OAI Harvester

Test plan:

 - Run updatedatabase.pl

 - Apply the DBIC update patch

 - Setup an OAI repository in Administration -> OAI repositories (admin/oaiservers.pl)

   If the repository dataformat is in oai_dc, you can use the sample XSLT files:
   For Unimarc:
   OAIDCtoUNIMARCXML.xsl for bibliographic records
   AuthOAIDCtoUNIMARCXML.xsl for authorities

   For Marc21:
   OAIDCtoMARC21XML.xsl for bibliographic records
   AuthOAIDCtoMARC21XML.xsl for authorities

   If the repository dataformat is in marc-xml, you can use
   OAIMarcxml2KohaMarcxml.xsl for both Unimarc and Marc21.

 - Some repositories to test with:

   Bibliographic records, oai_dc:
   Endpoint: http://staroai.theses.fr/OAIHandler
   Set: ddc:260
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/OAIDCtoUNIMARCXML.xsl
   or
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/OAIDCtoMARC21XML.xsl

   Authorities, oai_dc:
   Endpoint: https://www.idref.fr/OAI/oai.jsp
   Set: a
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/AuthOAIDCtoUNIMARCXML.xsl
   or
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/AuthOAIDCtoMARC21XML.xsl

   Authorities, marc-xml, Unimarc:
   Endpoint: https://www.idref.fr/OAI/oai.jsp
   Set: a
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/OAIMarcxml2KohaMarcxml.xsl

 - Note: marc-xml harvesting will not work with HTTP::OAI::Harvester version 3.xx
   Version 4.xx is needed.
   See Bug 17704 for updating Koha default version to 4.xx

 - If you want to receive a report email, fill the OAI-PMH:HarvestEmailReport
   syspref. The model used (OAI_HARVEST_REPORT) can be edited in tools -> Notices and slips.

 - start a harvest with the following command:
   misc/cronjobs/harvest_oai.pl

    This script starts an OAI Harvest

    This script has the following parameters :
        -h --help: this message
        -v --verbose (enable output to stdout)
        -r --repository: id of the OAI repository
        -d --days: number of days to harvest from (optional)
        -l --list: list the OAI repositories
        -f --force: force harvesting (ignore records datestamps) (optional)

    Example: misc/cronjobs/harvest_oai.pl -r 1 -d 10 -v -f

 - Check the logs in the Log Viewer (tools/viewlog.pl)
   (CronjobLog syspref must be activated)

Sponsored-by: KohaLa
Signed-off-by: John Doe <you@example.com>
Comment 24 Michal Denar 2024-02-10 20:10:00 UTC
Created attachment 162006 [details] [review]
DO NOT PUSH: Bug 35659 DBIC Update

Signed-off-by: John Doe <you@example.com>
Comment 25 Michal Denar 2024-02-10 20:10:04 UTC
Created attachment 162007 [details] [review]
Bug 35659: OAI Harvester

Test plan:

 - Run updatedatabase.pl

 - Apply the DBIC update patch

 - Setup an OAI repository in Administration -> OAI repositories (admin/oaiservers.pl)

   If the repository dataformat is in oai_dc, you can use the sample XSLT files:
   For Unimarc:
   OAIDCtoUNIMARCXML.xsl for bibliographic records
   AuthOAIDCtoUNIMARCXML.xsl for authorities

   For Marc21:
   OAIDCtoMARC21XML.xsl for bibliographic records
   AuthOAIDCtoMARC21XML.xsl for authorities

   If the repository dataformat is in marc-xml, you can use
   OAIMarcxml2KohaMarcxml.xsl for both Unimarc and Marc21.

 - Some repositories to test with:

   Bibliographic records, oai_dc:
   Endpoint: http://staroai.theses.fr/OAIHandler
   Set: ddc:260
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/OAIDCtoUNIMARCXML.xsl
   or
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/OAIDCtoMARC21XML.xsl

   Authorities, oai_dc:
   Endpoint: https://www.idref.fr/OAI/oai.jsp
   Set: a
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/AuthOAIDCtoUNIMARCXML.xsl
   or
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/AuthOAIDCtoMARC21XML.xsl

   Authorities, marc-xml, Unimarc:
   Endpoint: https://www.idref.fr/OAI/oai.jsp
   Set: a
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/OAIMarcxml2KohaMarcxml.xsl

 - Note: marc-xml harvesting will not work with HTTP::OAI::Harvester version 3.xx
   Version 4.xx is needed.
   See Bug 17704 for updating Koha default version to 4.xx

 - If you want to receive a report email, fill the OAI-PMH:HarvestEmailReport
   syspref. The model used (OAI_HARVEST_REPORT) can be edited in tools -> Notices and slips.

 - start a harvest with the following command:
   misc/cronjobs/harvest_oai.pl

    This script starts an OAI Harvest

    This script has the following parameters :
        -h --help: this message
        -v --verbose (enable output to stdout)
        -r --repository: id of the OAI repository
        -d --days: number of days to harvest from (optional)
        -l --list: list the OAI repositories
        -f --force: force harvesting (ignore records datestamps) (optional)

    Example: misc/cronjobs/harvest_oai.pl -r 1 -d 10 -v -f

 - Check the logs in the Log Viewer (tools/viewlog.pl)
   (CronjobLog syspref must be activated)

Sponsored-by: KohaLa
Signed-off-by: John Doe <you@example.com>
Comment 26 Michal Denar 2024-02-10 20:12:34 UTC
Created attachment 162008 [details] [review]
DO NOT PUSH: Bug 35659 DBIC Update

Signed-off-by: Michal <black232gmail.com>
Comment 27 Michal Denar 2024-02-10 20:12:40 UTC
Created attachment 162009 [details] [review]
Bug 35659: OAI Harvester

Test plan:

 - Run updatedatabase.pl

 - Apply the DBIC update patch

 - Setup an OAI repository in Administration -> OAI repositories (admin/oaiservers.pl)

   If the repository dataformat is in oai_dc, you can use the sample XSLT files:
   For Unimarc:
   OAIDCtoUNIMARCXML.xsl for bibliographic records
   AuthOAIDCtoUNIMARCXML.xsl for authorities

   For Marc21:
   OAIDCtoMARC21XML.xsl for bibliographic records
   AuthOAIDCtoMARC21XML.xsl for authorities

   If the repository dataformat is in marc-xml, you can use
   OAIMarcxml2KohaMarcxml.xsl for both Unimarc and Marc21.

 - Some repositories to test with:

   Bibliographic records, oai_dc:
   Endpoint: http://staroai.theses.fr/OAIHandler
   Set: ddc:260
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/OAIDCtoUNIMARCXML.xsl
   or
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/OAIDCtoMARC21XML.xsl

   Authorities, oai_dc:
   Endpoint: https://www.idref.fr/OAI/oai.jsp
   Set: a
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/AuthOAIDCtoUNIMARCXML.xsl
   or
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/AuthOAIDCtoMARC21XML.xsl

   Authorities, marc-xml, Unimarc:
   Endpoint: https://www.idref.fr/OAI/oai.jsp
   Set: a
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/OAIMarcxml2KohaMarcxml.xsl

 - Note: marc-xml harvesting will not work with HTTP::OAI::Harvester version 3.xx
   Version 4.xx is needed.
   See Bug 17704 for updating Koha default version to 4.xx

 - If you want to receive a report email, fill the OAI-PMH:HarvestEmailReport
   syspref. The model used (OAI_HARVEST_REPORT) can be edited in tools -> Notices and slips.

 - start a harvest with the following command:
   misc/cronjobs/harvest_oai.pl

    This script starts an OAI Harvest

    This script has the following parameters :
        -h --help: this message
        -v --verbose (enable output to stdout)
        -r --repository: id of the OAI repository
        -d --days: number of days to harvest from (optional)
        -l --list: list the OAI repositories
        -f --force: force harvesting (ignore records datestamps) (optional)

    Example: misc/cronjobs/harvest_oai.pl -r 1 -d 10 -v -f

 - Check the logs in the Log Viewer (tools/viewlog.pl)
   (CronjobLog syspref must be activated)

Sponsored-by: KohaLa
Signed-off-by: John Doe <you@example.com>
Signed-off-by: Michal <black232gmail.com>
Comment 28 Michal Denar 2024-02-10 20:33:32 UTC
Created attachment 162010 [details] [review]
DO NOT PUSH: Bug 35659 DBIC Update

Signed-off-by: Michal <black23@gmail.com>
Comment 29 Michal Denar 2024-02-10 20:33:35 UTC
Created attachment 162011 [details] [review]
Bug 35659: OAI Harvester

Test plan:

 - Run updatedatabase.pl

 - Apply the DBIC update patch

 - Setup an OAI repository in Administration -> OAI repositories (admin/oaiservers.pl)

   If the repository dataformat is in oai_dc, you can use the sample XSLT files:
   For Unimarc:
   OAIDCtoUNIMARCXML.xsl for bibliographic records
   AuthOAIDCtoUNIMARCXML.xsl for authorities

   For Marc21:
   OAIDCtoMARC21XML.xsl for bibliographic records
   AuthOAIDCtoMARC21XML.xsl for authorities

   If the repository dataformat is in marc-xml, you can use
   OAIMarcxml2KohaMarcxml.xsl for both Unimarc and Marc21.

 - Some repositories to test with:

   Bibliographic records, oai_dc:
   Endpoint: http://staroai.theses.fr/OAIHandler
   Set: ddc:260
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/OAIDCtoUNIMARCXML.xsl
   or
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/OAIDCtoMARC21XML.xsl

   Authorities, oai_dc:
   Endpoint: https://www.idref.fr/OAI/oai.jsp
   Set: a
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/AuthOAIDCtoUNIMARCXML.xsl
   or
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/AuthOAIDCtoMARC21XML.xsl

   Authorities, marc-xml, Unimarc:
   Endpoint: https://www.idref.fr/OAI/oai.jsp
   Set: a
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/OAIMarcxml2KohaMarcxml.xsl

 - Note: marc-xml harvesting will not work with HTTP::OAI::Harvester version 3.xx
   Version 4.xx is needed.
   See Bug 17704 for updating Koha default version to 4.xx

 - If you want to receive a report email, fill the OAI-PMH:HarvestEmailReport
   syspref. The model used (OAI_HARVEST_REPORT) can be edited in tools -> Notices and slips.

 - start a harvest with the following command:
   misc/cronjobs/harvest_oai.pl

    This script starts an OAI Harvest

    This script has the following parameters :
        -h --help: this message
        -v --verbose (enable output to stdout)
        -r --repository: id of the OAI repository
        -d --days: number of days to harvest from (optional)
        -l --list: list the OAI repositories
        -f --force: force harvesting (ignore records datestamps) (optional)

    Example: misc/cronjobs/harvest_oai.pl -r 1 -d 10 -v -f

 - Check the logs in the Log Viewer (tools/viewlog.pl)
   (CronjobLog syspref must be activated)

Sponsored-by: KohaLa
Signed-off-by: John Doe <you@example.com>
Signed-off-by: Michal <black232gmail.com>
Signed-off-by: John Doe <you@example.com>
Comment 30 Andreas Roussos 2024-02-28 07:32:19 UTC
Created attachment 162527 [details]
Screenshot - Accented characters in the OPAC
Comment 31 Andreas Roussos 2024-02-28 07:34:07 UTC
Just wanted to point out that I tried to harvest bibliographic
records from the first repository suggested in the Test plan
(http://staroai.theses.fr/OAIHandler, oai_dc data format) in a
MARC21 Koha instance (therefore using OAIDCtoMARC21XML.xsl to
transform the records prior to importing), and when I ran the
OAI harvester script in verbose mode I got many lines similar
to the following in the output:

no mapping found for [0xC9] at position 0 in Économie politique g0=ASCII_DEFAULT g1=EXTENDED_LATIN at /usr/share/perl5/MARC/Charset.pm line 308.
no mapping found for [0xC9] at position 0 in Église et société g0=ASCII_DEFAULT g1=EXTENDED_LATIN at /usr/share/perl5/MARC/Charset.pm line 308.

The script did actually finish and managed to add 91 records,
but I noticed that in the biblio details page in the OPAC some
(not all) words containing accented characters did not appear
correctly. I have uploaded a screenshot that illustrates this.

Upon further investigation, it looks like the script *does*
manage to populate database fields such as biblio.title and
biblio.abstract with the correctly accented characters, but
some MARC fields (such as 245 - Title, and 6xx - Subjects)
in the MARCXML representation in biblio_metadata.metadata
still contain weird characters wherever accents exist.

The fix is to apply Franck Theeten's solution from Bug 16488
(https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16488#c24)
and modify the value of the MARC leader's 10th character
to 'a' in the XSLT. Then, the accented characters get imported
properly and the records appear correctly in the OPAC.
Comment 32 Andreas Roussos 2024-02-28 07:35:14 UTC
Created attachment 162528 [details] [review]
Bug 35659: (follow-up) Better handling of accented characters

If you try to harvest bibliographic records from a UNIMARC OAI
repository (using oai_dc data format) in a MARC21 Koha instance
and run the OAI harvester script in verbose mode, you may get
lines similar to the following in the output:

no mapping found for [0xC9] at position 0 in Économie politique g0=ASCII_DEFAULT g1=EXTENDED_LATIN at /usr/share/perl5/MARC/Charset.pm line 308.
no mapping found for [0xC9] at position 0 in Église et société g0=ASCII_DEFAULT g1=EXTENDED_LATIN at /usr/share/perl5/MARC/Charset.pm line 308.

When looking at the imported records' biblio details page in
the OPAC, most words containing accented characters will not
appear correctly.

The fix is to apply Franck Theeten's solution from Bug 16488
(https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16488#c24)
and modify the value of the MARC leader's 10th character
to 'a' in the XSLT that transforms the UNIMARC OAI records
into MARC21 XML. Then, the accented characters get imported
properly and the records appear correctly in the OPAC.

Test plan:

0) Without this patch, running the OAI harvesting script in
   verbose mode produces many warnings, and garbled characters
   appear in the OPAC biblio details page wherever accented
   characters are in use.

1) Apply this patch.

2) Re-run the OAI harvesting script in verbose + force mode
   (force mode is required to ignore record datestamps from
   previous runs):

   misc/cronjobs/harvest_oai.pl -v -r <OAI_REPO_ID> -f

   This time there should be no warnings printed on your
   screen, and any characters with accents in the updated
   records should look OK in the OPAC.

Thanks-to: Franck Theeten <franck.theeten@africamuseum.be>
Comment 33 Matthias Meusburger 2024-03-01 10:27:42 UTC
Thank you Andreas for your feedback!

Not sure if I can sign-off your follow-up myself, since I'm the author of the main patch, but I can confirm that it works as intended: warnings are gone, and encoding is now correct.
Comment 34 Michal Denar 2024-03-01 20:24:36 UTC
Created attachment 162692 [details] [review]
DO NOT PUSH: Bug 35659 DBIC Update

Signed-off-by: Michal Denar <black23@gmail.com>
Comment 35 Michal Denar 2024-03-01 20:24:40 UTC
Created attachment 162693 [details] [review]
Bug 35659: OAI Harvester

Test plan:

 - Run updatedatabase.pl

 - Apply the DBIC update patch

 - Setup an OAI repository in Administration -> OAI repositories (admin/oaiservers.pl)

   If the repository dataformat is in oai_dc, you can use the sample XSLT files:
   For Unimarc:
   OAIDCtoUNIMARCXML.xsl for bibliographic records
   AuthOAIDCtoUNIMARCXML.xsl for authorities

   For Marc21:
   OAIDCtoMARC21XML.xsl for bibliographic records
   AuthOAIDCtoMARC21XML.xsl for authorities

   If the repository dataformat is in marc-xml, you can use
   OAIMarcxml2KohaMarcxml.xsl for both Unimarc and Marc21.

 - Some repositories to test with:

   Bibliographic records, oai_dc:
   Endpoint: http://staroai.theses.fr/OAIHandler
   Set: ddc:260
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/OAIDCtoUNIMARCXML.xsl
   or
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/OAIDCtoMARC21XML.xsl

   Authorities, oai_dc:
   Endpoint: https://www.idref.fr/OAI/oai.jsp
   Set: a
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/AuthOAIDCtoUNIMARCXML.xsl
   or
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/AuthOAIDCtoMARC21XML.xsl

   Authorities, marc-xml, Unimarc:
   Endpoint: https://www.idref.fr/OAI/oai.jsp
   Set: a
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/OAIMarcxml2KohaMarcxml.xsl

 - Note: marc-xml harvesting will not work with HTTP::OAI::Harvester version 3.xx
   Version 4.xx is needed.
   See Bug 17704 for updating Koha default version to 4.xx

 - If you want to receive a report email, fill the OAI-PMH:HarvestEmailReport
   syspref. The model used (OAI_HARVEST_REPORT) can be edited in tools -> Notices and slips.

 - start a harvest with the following command:
   misc/cronjobs/harvest_oai.pl

    This script starts an OAI Harvest

    This script has the following parameters :
        -h --help: this message
        -v --verbose (enable output to stdout)
        -r --repository: id of the OAI repository
        -d --days: number of days to harvest from (optional)
        -l --list: list the OAI repositories
        -f --force: force harvesting (ignore records datestamps) (optional)

    Example: misc/cronjobs/harvest_oai.pl -r 1 -d 10 -v -f

 - Check the logs in the Log Viewer (tools/viewlog.pl)
   (CronjobLog syspref must be activated)

Sponsored-by: KohaLa
Signed-off-by: John Doe <you@example.com>
Signed-off-by: Michal <black232gmail.com>
Signed-off-by: John Doe <you@example.com>
Signed-off-by: Michal Denar <black23@gmail.com>
Comment 36 Michal Denar 2024-03-01 20:24:43 UTC
Created attachment 162694 [details] [review]
Bug 35659: (follow-up) Better handling of accented characters

If you try to harvest bibliographic records from a UNIMARC OAI
repository (using oai_dc data format) in a MARC21 Koha instance
and run the OAI harvester script in verbose mode, you may get
lines similar to the following in the output:

no mapping found for [0xC9] at position 0 in Économie politique g0=ASCII_DEFAULT g1=EXTENDED_LATIN at /usr/share/perl5/MARC/Charset.pm line 308.
no mapping found for [0xC9] at position 0 in Église et société g0=ASCII_DEFAULT g1=EXTENDED_LATIN at /usr/share/perl5/MARC/Charset.pm line 308.

When looking at the imported records' biblio details page in
the OPAC, most words containing accented characters will not
appear correctly.

The fix is to apply Franck Theeten's solution from Bug 16488
(https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16488#c24)
and modify the value of the MARC leader's 10th character
to 'a' in the XSLT that transforms the UNIMARC OAI records
into MARC21 XML. Then, the accented characters get imported
properly and the records appear correctly in the OPAC.

Test plan:

0) Without this patch, running the OAI harvesting script in
   verbose mode produces many warnings, and garbled characters
   appear in the OPAC biblio details page wherever accented
   characters are in use.

1) Apply this patch.

2) Re-run the OAI harvesting script in verbose + force mode
   (force mode is required to ignore record datestamps from
   previous runs):

   misc/cronjobs/harvest_oai.pl -v -r <OAI_REPO_ID> -f

   This time there should be no warnings printed on your
   screen, and any characters with accents in the updated
   records should look OK in the OPAC.

Thanks-to: Franck Theeten <franck.theeten@africamuseum.be>
Signed-off-by: Michal Denar <black23@gmail.com>
Comment 37 Victor Grousset/tuxayo 2024-03-16 01:02:17 UTC
(obsoleted duplicate old version of a patch)
Comment 38 Victor Grousset/tuxayo 2024-03-17 03:21:19 UTC
Adding a server doesn't work due to not complying with CSRF (Bug 34478):

> Programming error - op 'add_validated' must start with 'cud-' for POST http://localhost:8081/intranet/admin/oaiservers.pl (referer: http://localhost:8081/cgi-bin/koha/admin/oaiservers.pl?op=add)

From Koha/Middleware/CSRF.pm
Comment 39 Matthias Meusburger 2024-03-20 13:37:10 UTC
Created attachment 163527 [details] [review]
Bug 35659: (follow-up) Make OAI repositories edition comply with CSRF
Comment 40 Matthias Meusburger 2024-03-20 13:38:04 UTC
Thanks for your feedback Tuxayo!
Comment 41 Julian Maurice 2024-04-08 14:12:12 UTC
Comment on attachment 162693 [details] [review]
Bug 35659: OAI Harvester

Review of attachment 162693 [details] [review]:
-----------------------------------------------------------------

Overall this is working really well. OAI repositories mentioned in the test plan can take some time to respond (or fail with a timeout) but this is handled well.

However, there are some minor things to fix (see the rest of the review).

::: Koha/OAI/Client/Harvester.pm
@@ +79,5 @@
> +C<$force> force harvesting (ignore records datestamps)
> +
> +=cut
> +
> +sub new {

The `new` method doesn't instantiate an object. Instead it sets global variables and returns the class name.
I think it's confusing, as all other `new` methods in Koha instantiate an object.

@@ +142,5 @@
> +
> +    if ($days) {
> +
> +        # Change this to yyyy-mm-dd
> +        my $dt_today = dt_from_string();

This variable is not used anywhere.

@@ +312,5 @@
> +                $imported_record->update(
> +                    {
> +                        datestamp => $imported_record->datestamp,
> +                    }
> +                );

This looks like it does nothing (set "record's datestamp" to "record's datestamp").
Shouldn't it be $oai_record->datestamp (or now if incoming oai record does not have a datestamp) ?
Comment 42 Julian Maurice 2024-04-08 14:16:12 UTC
Side note: Koha::OAI::Client::Harvester uses cronlogaction, which makes it tied to the script using it (misc/cronjobs/harvest_oai.pl).
As this script is the only way to use the harvester, I think it's okay to keep it like that for now, but it will have to be changed if we want to use the harvester elsewhere (a background job for instance)
Comment 43 Julian Maurice 2024-04-08 14:53:00 UTC Comment hidden (obsolete)
Comment 44 Julian Maurice 2024-04-10 08:28:50 UTC
(In reply to Julian Maurice from comment #43)
> It looks like CSRF validation does not work: if I manually change the token
> in the deletion form and then try to delete the corresponding OAI
> repository, the repository is deleted.

Please ignore this comment, it was caused by a bad configuration on my instance
Comment 45 Matthias Meusburger 2024-04-10 08:36:36 UTC
Created attachment 164586 [details] [review]
Bug 35659: (QA follow-up)
Comment 46 Matthias Meusburger 2024-04-10 09:12:44 UTC
Created attachment 164590 [details] [review]
Bug 35659: (QA follow-up)
Comment 47 Julian Maurice 2024-04-10 11:33:02 UTC
Created attachment 164602 [details] [review]
DO NOT PUSH: Bug 35659 DBIC Update

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Comment 48 Julian Maurice 2024-04-10 11:33:06 UTC
Created attachment 164603 [details] [review]
Bug 35659: OAI Harvester

Test plan:

 - Run updatedatabase.pl

 - Apply the DBIC update patch

 - Setup an OAI repository in Administration -> OAI repositories (admin/oaiservers.pl)

   If the repository dataformat is in oai_dc, you can use the sample XSLT files:
   For Unimarc:
   OAIDCtoUNIMARCXML.xsl for bibliographic records
   AuthOAIDCtoUNIMARCXML.xsl for authorities

   For Marc21:
   OAIDCtoMARC21XML.xsl for bibliographic records
   AuthOAIDCtoMARC21XML.xsl for authorities

   If the repository dataformat is in marc-xml, you can use
   OAIMarcxml2KohaMarcxml.xsl for both Unimarc and Marc21.

 - Some repositories to test with:

   Bibliographic records, oai_dc:
   Endpoint: http://staroai.theses.fr/OAIHandler
   Set: ddc:260
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/OAIDCtoUNIMARCXML.xsl
   or
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/OAIDCtoMARC21XML.xsl

   Authorities, oai_dc:
   Endpoint: https://www.idref.fr/OAI/oai.jsp
   Set: a
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/AuthOAIDCtoUNIMARCXML.xsl
   or
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/AuthOAIDCtoMARC21XML.xsl

   Authorities, marc-xml, Unimarc:
   Endpoint: https://www.idref.fr/OAI/oai.jsp
   Set: a
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/OAIMarcxml2KohaMarcxml.xsl

 - Note: marc-xml harvesting will not work with HTTP::OAI::Harvester version 3.xx
   Version 4.xx is needed.
   See Bug 17704 for updating Koha default version to 4.xx

 - If you want to receive a report email, fill the OAI-PMH:HarvestEmailReport
   syspref. The model used (OAI_HARVEST_REPORT) can be edited in tools -> Notices and slips.

 - start a harvest with the following command:
   misc/cronjobs/harvest_oai.pl

    This script starts an OAI Harvest

    This script has the following parameters :
        -h --help: this message
        -v --verbose (enable output to stdout)
        -r --repository: id of the OAI repository
        -d --days: number of days to harvest from (optional)
        -l --list: list the OAI repositories
        -f --force: force harvesting (ignore records datestamps) (optional)

    Example: misc/cronjobs/harvest_oai.pl -r 1 -d 10 -v -f

 - Check the logs in the Log Viewer (tools/viewlog.pl)
   (CronjobLog syspref must be activated)

Sponsored-by: KohaLa
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Comment 49 Julian Maurice 2024-04-10 11:33:10 UTC
Created attachment 164604 [details] [review]
Bug 35659: (follow-up) Better handling of accented characters

If you try to harvest bibliographic records from a UNIMARC OAI
repository (using oai_dc data format) in a MARC21 Koha instance
and run the OAI harvester script in verbose mode, you may get
lines similar to the following in the output:

no mapping found for [0xC9] at position 0 in Économie politique g0=ASCII_DEFAULT g1=EXTENDED_LATIN at /usr/share/perl5/MARC/Charset.pm line 308.
no mapping found for [0xC9] at position 0 in Église et société g0=ASCII_DEFAULT g1=EXTENDED_LATIN at /usr/share/perl5/MARC/Charset.pm line 308.

When looking at the imported records' biblio details page in
the OPAC, most words containing accented characters will not
appear correctly.

The fix is to apply Franck Theeten's solution from Bug 16488
(https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16488#c24)
and modify the value of the MARC leader's 10th character
to 'a' in the XSLT that transforms the UNIMARC OAI records
into MARC21 XML. Then, the accented characters get imported
properly and the records appear correctly in the OPAC.

Test plan:

0) Without this patch, running the OAI harvesting script in
   verbose mode produces many warnings, and garbled characters
   appear in the OPAC biblio details page wherever accented
   characters are in use.

1) Apply this patch.

2) Re-run the OAI harvesting script in verbose + force mode
   (force mode is required to ignore record datestamps from
   previous runs):

   misc/cronjobs/harvest_oai.pl -v -r <OAI_REPO_ID> -f

   This time there should be no warnings printed on your
   screen, and any characters with accents in the updated
   records should look OK in the OPAC.

Thanks-to: Franck Theeten <franck.theeten@africamuseum.be>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Comment 50 Julian Maurice 2024-04-10 11:33:13 UTC
Created attachment 164605 [details] [review]
Bug 35659: (follow-up) Make OAI repositories edition comply with CSRF

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Comment 51 Julian Maurice 2024-04-10 11:33:17 UTC
Created attachment 164606 [details] [review]
Bug 35659: (QA follow-up)

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Comment 52 Pedro Amorim 2024-04-10 12:31:32 UTC
Created attachment 164618 [details] [review]
DO NOT PUSH: Bug 35659 DBIC Update

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Comment 53 Pedro Amorim 2024-04-10 12:31:56 UTC
Created attachment 164619 [details] [review]
Bug 35659: OAI Harvester

Test plan:

 - Run updatedatabase.pl

 - Apply the DBIC update patch

 - Setup an OAI repository in Administration -> OAI repositories (admin/oaiservers.pl)

   If the repository dataformat is in oai_dc, you can use the sample XSLT files:
   For Unimarc:
   OAIDCtoUNIMARCXML.xsl for bibliographic records
   AuthOAIDCtoUNIMARCXML.xsl for authorities

   For Marc21:
   OAIDCtoMARC21XML.xsl for bibliographic records
   AuthOAIDCtoMARC21XML.xsl for authorities

   If the repository dataformat is in marc-xml, you can use
   OAIMarcxml2KohaMarcxml.xsl for both Unimarc and Marc21.

 - Some repositories to test with:

   Bibliographic records, oai_dc:
   Endpoint: http://staroai.theses.fr/OAIHandler
   Set: ddc:260
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/OAIDCtoUNIMARCXML.xsl
   or
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/OAIDCtoMARC21XML.xsl

   Authorities, oai_dc:
   Endpoint: https://www.idref.fr/OAI/oai.jsp
   Set: a
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/AuthOAIDCtoUNIMARCXML.xsl
   or
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/AuthOAIDCtoMARC21XML.xsl

   Authorities, marc-xml, Unimarc:
   Endpoint: https://www.idref.fr/OAI/oai.jsp
   Set: a
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/OAIMarcxml2KohaMarcxml.xsl

 - Note: marc-xml harvesting will not work with HTTP::OAI::Harvester version 3.xx
   Version 4.xx is needed.
   See Bug 17704 for updating Koha default version to 4.xx

 - If you want to receive a report email, fill the OAI-PMH:HarvestEmailReport
   syspref. The model used (OAI_HARVEST_REPORT) can be edited in tools -> Notices and slips.

 - start a harvest with the following command:
   misc/cronjobs/harvest_oai.pl

    This script starts an OAI Harvest

    This script has the following parameters :
        -h --help: this message
        -v --verbose (enable output to stdout)
        -r --repository: id of the OAI repository
        -d --days: number of days to harvest from (optional)
        -l --list: list the OAI repositories
        -f --force: force harvesting (ignore records datestamps) (optional)

    Example: misc/cronjobs/harvest_oai.pl -r 1 -d 10 -v -f

 - Check the logs in the Log Viewer (tools/viewlog.pl)
   (CronjobLog syspref must be activated)

Sponsored-by: KohaLa
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Comment 54 Pedro Amorim 2024-04-10 12:32:06 UTC
Created attachment 164620 [details] [review]
Bug 35659: (follow-up) Better handling of accented characters

If you try to harvest bibliographic records from a UNIMARC OAI
repository (using oai_dc data format) in a MARC21 Koha instance
and run the OAI harvester script in verbose mode, you may get
lines similar to the following in the output:

no mapping found for [0xC9] at position 0 in Économie politique g0=ASCII_DEFAULT g1=EXTENDED_LATIN at /usr/share/perl5/MARC/Charset.pm line 308.
no mapping found for [0xC9] at position 0 in Église et société g0=ASCII_DEFAULT g1=EXTENDED_LATIN at /usr/share/perl5/MARC/Charset.pm line 308.

When looking at the imported records' biblio details page in
the OPAC, most words containing accented characters will not
appear correctly.

The fix is to apply Franck Theeten's solution from Bug 16488
(https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16488#c24)
and modify the value of the MARC leader's 10th character
to 'a' in the XSLT that transforms the UNIMARC OAI records
into MARC21 XML. Then, the accented characters get imported
properly and the records appear correctly in the OPAC.

Test plan:

0) Without this patch, running the OAI harvesting script in
   verbose mode produces many warnings, and garbled characters
   appear in the OPAC biblio details page wherever accented
   characters are in use.

1) Apply this patch.

2) Re-run the OAI harvesting script in verbose + force mode
   (force mode is required to ignore record datestamps from
   previous runs):

   misc/cronjobs/harvest_oai.pl -v -r <OAI_REPO_ID> -f

   This time there should be no warnings printed on your
   screen, and any characters with accents in the updated
   records should look OK in the OPAC.

Thanks-to: Franck Theeten <franck.theeten@africamuseum.be>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Comment 55 Pedro Amorim 2024-04-10 12:32:11 UTC
Created attachment 164621 [details] [review]
Bug 35659: (follow-up) Make OAI repositories edition comply with CSRF

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Comment 56 Pedro Amorim 2024-04-10 12:32:14 UTC
Created attachment 164622 [details] [review]
Bug 35659: (QA follow-up)

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Comment 57 Jonathan Druart 2024-04-17 12:27:44 UTC
+        $dbh->do(q{DROP TABLE IF EXISTS `oaiservers`;});

You shouldn't drop the table but create it only if it does not exist.
Comment 58 Matthias Meusburger 2024-04-19 13:42:00 UTC
Created attachment 165199 [details] [review]
Bug 35659: OAI Harvester

Test plan:

 - Run updatedatabase.pl

 - Apply the DBIC update patch

 - Setup an OAI repository in Administration -> OAI repositories (admin/oaiservers.pl)

   If the repository dataformat is in oai_dc, you can use the sample XSLT files:
   For Unimarc:
   OAIDCtoUNIMARCXML.xsl for bibliographic records
   AuthOAIDCtoUNIMARCXML.xsl for authorities

   For Marc21:
   OAIDCtoMARC21XML.xsl for bibliographic records
   AuthOAIDCtoMARC21XML.xsl for authorities

   If the repository dataformat is in marc-xml, you can use
   OAIMarcxml2KohaMarcxml.xsl for both Unimarc and Marc21.

 - Some repositories to test with:

   Bibliographic records, oai_dc:
   Endpoint: http://staroai.theses.fr/OAIHandler
   Set: ddc:260
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/OAIDCtoUNIMARCXML.xsl
   or
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/OAIDCtoMARC21XML.xsl

   Authorities, oai_dc:
   Endpoint: https://www.idref.fr/OAI/oai.jsp
   Set: a
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/AuthOAIDCtoUNIMARCXML.xsl
   or
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/AuthOAIDCtoMARC21XML.xsl

   Authorities, marc-xml, Unimarc:
   Endpoint: https://www.idref.fr/OAI/oai.jsp
   Set: a
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/OAIMarcxml2KohaMarcxml.xsl

 - Note: marc-xml harvesting will not work with HTTP::OAI::Harvester version 3.xx
   Version 4.xx is needed.
   See Bug 17704 for updating Koha default version to 4.xx

 - If you want to receive a report email, fill the OAI-PMH:HarvestEmailReport
   syspref. The model used (OAI_HARVEST_REPORT) can be edited in tools -> Notices and slips.

 - start a harvest with the following command:
   misc/cronjobs/harvest_oai.pl

    This script starts an OAI Harvest

    This script has the following parameters :
        -h --help: this message
        -v --verbose (enable output to stdout)
        -r --repository: id of the OAI repository
        -d --days: number of days to harvest from (optional)
        -l --list: list the OAI repositories
        -f --force: force harvesting (ignore records datestamps) (optional)

    Example: misc/cronjobs/harvest_oai.pl -r 1 -d 10 -v -f

 - Check the logs in the Log Viewer (tools/viewlog.pl)
   (CronjobLog syspref must be activated)

Sponsored-by: KohaLa
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Comment 59 Matthias Meusburger 2024-04-19 13:42:47 UTC
(In reply to Jonathan Druart from comment #57)
> +        $dbh->do(q{DROP TABLE IF EXISTS `oaiservers`;});
> 
> You shouldn't drop the table but create it only if it does not exist.

Thanks Joubu, this is fixed.
Comment 60 Tomás Cohen Arazi (tcohen) 2024-04-22 13:35:54 UTC
Some comments:

* Why is the `oaiservers` table name used instead of `oai_servers`? (same for oaiservers.{ps|tt})
* Why we sometimes call it `oai` and sometimes `oaipmh`?
* OaiServer should either be OAI::Server or OAIServer.
* Column names look old-school IMHO (`id`vs `oai_server_id`)
* Can we pick names that match biblio_metadata columns for example? Like `format` and `schema` instead of `recordtype`
* Is `datestamp` some OAI-PMH specific naming convention?
* `repository` varchar(255) NOT NULL COMMENT 'OAI repository'? Shouldn't this be a FK on the `oaiservers` table? This feels important as we are also adding 'record sources' on another bug, and we will eventually want to set rules for OAI-PMH imported records.
* Can the OAI harvester be thought as a background job in the mid/long term? In that case, it feels weird that Koha::OAI::Client::Harvester just prints things. It might be better to -for example- accumulate them using Koha::Object->add_message and have the caller decide what to do? (so harvest_oai.pl decides what to do) or it could just be a callback function for dealing with each step's output.
Comment 61 Victor Grousset/tuxayo 2024-04-26 04:15:38 UTC
> * Column names look old-school IMHO (`id`vs `oai_server_id`)

That's a definitely an issue:
https://wiki.koha-community.org/wiki/Coding_Guidelines#SQL7:_Primary_keys
«primary key name must be tablename_id (color_id for example) »

Also it seems for new columns we are now using snake_case:
https://wiki.koha-community.org/wiki/Database_updates#How_to_write_an_atomicupdate_file
«Example 2: Adding a new column»
Except for foreign keys like biblionumber


> * Why is the `oaiservers` table name used instead of `oai_servers`? (same for oaiservers.{ps|tt})

+1 for consistency with how new stuff is usually named.

---

Code:
> sub ServerSearch

This rule should also apply on new all new files outside C4:
https://wiki.koha-community.org/wiki/Coding_Guidelines#PERL9:_Subroutine_naming_conventions
«subroutines in the Koha namespace should be snake case»

---

String changes:

#: installer/data/mysql/en/mandatory/sample_notices.yml:letter:1:row:98:mul:4
msgid "Set: %s"

#: koha-tmpl/intranet-tmpl/prog/en/modules/admin/oaiservers.tt:92
msgid "Set: "

+#: koha-tmpl/intranet-tmpl/prog/en/modules/admin/oaiservers.tt:136
+#, fuzzy, c-format
+msgid "Set"

They need context for translators: https://wiki.koha-community.org/wiki/Internationalization,_plural_forms,_context,_and_more_RFC#More_on_context

And using tp() is an opportunity to deduplicate "Set: " and "Set"


+#: koha-tmpl/intranet-tmpl/prog/en/modules/admin/oaiservers.tt:126
+#, c-format
+msgid "%s You searched for record %s %s You searched for %s %s "

This string should be split. Either via t() or <span>

---

I reattached the patches to fix the order that broke applying.
Comment 62 Victor Grousset/tuxayo 2024-04-26 04:15:52 UTC Comment hidden (obsolete)
Comment 63 Victor Grousset/tuxayo 2024-04-26 04:15:57 UTC Comment hidden (obsolete)
Comment 64 Victor Grousset/tuxayo 2024-04-26 04:16:01 UTC Comment hidden (obsolete)
Comment 65 Victor Grousset/tuxayo 2024-04-26 04:16:05 UTC Comment hidden (obsolete)
Comment 66 Victor Grousset/tuxayo 2024-04-26 04:16:09 UTC Comment hidden (obsolete)
Comment 67 Matthias Meusburger 2024-05-23 12:27:05 UTC Comment hidden (obsolete)
Comment 68 Matthias Meusburger 2024-05-23 12:27:43 UTC Comment hidden (obsolete)
Comment 69 Matthias Meusburger 2024-05-23 12:40:33 UTC
Thanks for your feedback, Tomas and Victor!

Tomas:

* Why is the `oaiservers` table name used instead of `oai_servers`? (same for oaiservers.{ps|tt})
* Why we sometimes call it `oai` and sometimes `oaipmh`?
* OaiServer should either be OAI::Server or OAIServer.
* Column names look old-school IMHO (`id`vs `oai_server_id`)

=> Done

* Can we pick names that match biblio_metadata columns for example? Like `format` and `schema` instead of `recordtype`

=> I'm not sure I understand what you mean by that. In this situation, recordtype is here to tell if the record is a biblio or an authority, while format and schema are not used for this. Can you elaborate on this?

* Is `datestamp` some OAI-PMH specific naming convention?

=> Yes it is, see https://www.openarchives.org/OAI/openarchivesprotocol.html#SelectiveHarvestingandDatestamps for instance.

* `repository` varchar(255) NOT NULL COMMENT 'OAI repository'? Shouldn't this be a FK on the `oaiservers` table? This feels important as we are also adding 'record sources' on another bug, and we will eventually want to set rules for OAI-PMH imported records.

=> Do you mean a FK from import_oai_biblios/import_oai_authorities.repository to oai_servers.endpoint? 

* Can the OAI harvester be thought as a background job in the mid/long term? In that case, it feels weird that Koha::OAI::Client::Harvester just prints things. It might be better to -for example- accumulate them using Koha::Object->add_message and have the caller decide what to do? (so harvest_oai.pl decides what to do) or it could just be a callback function for dealing with each step's output.

=> Done through a callback function.

Victor:

> sub ServerSearch
=> Done

And using tp() is an opportunity to deduplicate "Set: " and "Set"
=> Done

This string should be split. Either via t() or <span>
=> Done
Comment 70 Victor Grousset/tuxayo 2024-05-24 16:34:02 UTC
Comment on attachment 165598 [details] [review]
Bug 35659: (QA follow-up)

It's not obsolete, it's colliding with the second commit of QA follow-ups
Comment 71 Victor Grousset/tuxayo 2024-05-24 16:37:03 UTC
Created attachment 167171 [details] [review]
Bug 35659: OAI Harvester

Test plan:

 - Run updatedatabase.pl

 - Apply the DBIC update patch

 - Setup an OAI repository in Administration -> OAI repositories (admin/oaiservers.pl)

   If the repository dataformat is in oai_dc, you can use the sample XSLT files:
   For Unimarc:
   OAIDCtoUNIMARCXML.xsl for bibliographic records
   AuthOAIDCtoUNIMARCXML.xsl for authorities

   For Marc21:
   OAIDCtoMARC21XML.xsl for bibliographic records
   AuthOAIDCtoMARC21XML.xsl for authorities

   If the repository dataformat is in marc-xml, you can use
   OAIMarcxml2KohaMarcxml.xsl for both Unimarc and Marc21.

 - Some repositories to test with:

   Bibliographic records, oai_dc:
   Endpoint: http://staroai.theses.fr/OAIHandler
   Set: ddc:260
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/OAIDCtoUNIMARCXML.xsl
   or
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/OAIDCtoMARC21XML.xsl

   Authorities, oai_dc:
   Endpoint: https://www.idref.fr/OAI/oai.jsp
   Set: a
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/AuthOAIDCtoUNIMARCXML.xsl
   or
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/AuthOAIDCtoMARC21XML.xsl

   Authorities, marc-xml, Unimarc:
   Endpoint: https://www.idref.fr/OAI/oai.jsp
   Set: a
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/OAIMarcxml2KohaMarcxml.xsl

 - Note: marc-xml harvesting will not work with HTTP::OAI::Harvester version 3.xx
   Version 4.xx is needed.
   See Bug 17704 for updating Koha default version to 4.xx

 - If you want to receive a report email, fill the OAI-PMH:HarvestEmailReport
   syspref. The model used (OAI_HARVEST_REPORT) can be edited in tools -> Notices and slips.

 - start a harvest with the following command:
   misc/cronjobs/harvest_oai.pl

    This script starts an OAI Harvest

    This script has the following parameters :
        -h --help: this message
        -v --verbose (enable output to stdout)
        -r --repository: id of the OAI repository
        -d --days: number of days to harvest from (optional)
        -l --list: list the OAI repositories
        -f --force: force harvesting (ignore records datestamps) (optional)

    Example: misc/cronjobs/harvest_oai.pl -r 1 -d 10 -v -f

 - Check the logs in the Log Viewer (tools/viewlog.pl)
   (CronjobLog syspref must be activated)

Sponsored-by: KohaLa
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Comment 72 Victor Grousset/tuxayo 2024-05-24 16:37:07 UTC
Created attachment 167172 [details] [review]
Bug 35659: (follow-up) Better handling of accented characters

If you try to harvest bibliographic records from a UNIMARC OAI
repository (using oai_dc data format) in a MARC21 Koha instance
and run the OAI harvester script in verbose mode, you may get
lines similar to the following in the output:

no mapping found for [0xC9] at position 0 in Économie politique g0=ASCII_DEFAULT g1=EXTENDED_LATIN at /usr/share/perl5/MARC/Charset.pm line 308.
no mapping found for [0xC9] at position 0 in Église et société g0=ASCII_DEFAULT g1=EXTENDED_LATIN at /usr/share/perl5/MARC/Charset.pm line 308.

When looking at the imported records' biblio details page in
the OPAC, most words containing accented characters will not
appear correctly.

The fix is to apply Franck Theeten's solution from Bug 16488
(https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16488#c24)
and modify the value of the MARC leader's 10th character
to 'a' in the XSLT that transforms the UNIMARC OAI records
into MARC21 XML. Then, the accented characters get imported
properly and the records appear correctly in the OPAC.

Test plan:

0) Without this patch, running the OAI harvesting script in
   verbose mode produces many warnings, and garbled characters
   appear in the OPAC biblio details page wherever accented
   characters are in use.

1) Apply this patch.

2) Re-run the OAI harvesting script in verbose + force mode
   (force mode is required to ignore record datestamps from
   previous runs):

   misc/cronjobs/harvest_oai.pl -v -r <OAI_REPO_ID> -f

   This time there should be no warnings printed on your
   screen, and any characters with accents in the updated
   records should look OK in the OPAC.

Thanks-to: Franck Theeten <franck.theeten@africamuseum.be>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Comment 73 Victor Grousset/tuxayo 2024-05-24 16:37:10 UTC
Created attachment 167173 [details] [review]
Bug 35659: (follow-up) Make OAI repositories edition comply with CSRF

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Comment 74 Victor Grousset/tuxayo 2024-05-24 16:37:14 UTC
Created attachment 167174 [details] [review]
Bug 35659: (QA follow-up)

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Comment 75 Victor Grousset/tuxayo 2024-05-24 16:37:18 UTC
Created attachment 167175 [details] [review]
DO NOT PUSH: Bug 35659 DBIC Update

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Comment 76 Victor Grousset/tuxayo 2024-05-24 16:37:21 UTC
Created attachment 167176 [details] [review]
Bug 35659: (more QA follow-ups)

Rename Oaipmh to OAI
Rename oaiservers to oai_servers
Rename OaiServer to OAIServer
Rename oai_servers.id to oai_servers.oai_server_id
Rename ServerSearch to server_search
Use a callback function for logs
Use context for string "Set"
Split translation string
Comment 77 Victor Grousset/tuxayo 2024-05-24 16:39:52 UTC
> It's not obsolete, it's colliding with the second commit of QA follow-ups

And it was preventing the next patches to apply.
Changed the name of the second follow-up commit.
Comment 78 Victor Grousset/tuxayo 2024-05-24 22:15:43 UTC
Unused import:
use C4::Log             qw( cronlogaction );
in
Koha/OAI/Client/Harvester.pm


---


To doublecheck that it was really unused and there wasn't some weird perl feature at play, I removed it and ran the tests. But that might not be reliable if coverage isn't good enough.
So I removed this which was used in multiple places:
use C4::AuthoritiesMarc qw (AddAuthority GuessAuthTypeCode ModAuthority DelAuthority );
And the tests still passed! ﷐[U+1F631]﷑

Now checking coverage more seriously with Devel::Cover
https://wiki.koha-community.org/wiki/Coding_Guidelines#PERL17:_Unit_tests_are_required

from ./cover_db/coverage.html
file	                     stmt  bran	 cond  sub   total
Koha/OAI/Client/Harvester.pm 55.6  38.1	 66.6  88.8  57.1
That's certainly too low :(

The file is clickable to have a very nice view of it's code and colors to see which are the lines covered or not. And it can give details on which values for conditions aren't covered.
And all the stuff from C4::AuthoritiesMarc was used in these uncovered parts.

Looking at the per files reports showed that these files seem not used in tests vs the biblio one that are:
Koha/Import/OAI/Authority.pm
Koha/Import/OAI/Authorities.pm
Despite their decent scores coming from the imports statements ^^"



----


Found very minor style issues:
#use searchfield only in remaining operations
[...]
#find server(s) by id or name
(need a space after #)
Comment 79 Victor Grousset/tuxayo 2024-05-26 04:56:34 UTC
> (need a space after #)

Some others cases lying around

---

Found discrepancies between dbrev and kohastructure
oai_servers:
`id` int(11) vs `oai_server_id`
import_oai_biblios:
`id` int(11) vs `import_oai_biblio_id` int(11)
Comment 80 Matthias Meusburger 2024-07-15 12:42:09 UTC
Created attachment 168982 [details] [review]
Bug 35659: (more QA follow-ups)

Rename Oaipmh to OAI
Rename oaiservers to oai_servers
Rename OaiServer to OAIServer
Rename oai_servers.id to oai_servers.oai_server_id
Rename ServerSearch to server_search
Use a callback function for logs
Use context for string "Set"
Split translation string
Comment 81 Matthias Meusburger 2024-07-15 12:43:30 UTC
Created attachment 168983 [details] [review]
Bug 35659: (QA follow-up): Auth unit tests & dbrev

Add unit tests for authorities and deletion
Fix dbrev and kohastructure discrepancies
Comment 82 Matthias Meusburger 2024-07-15 12:46:34 UTC
Hi Tuxayo!

Thanks for your feedback.

The last QA follow-up: "Auth unit tests & dbrev" fixes discrepancies between kohastructure and atomic update. 

It also improves coverage by adding unit tests for authorities and record deletion.
Comment 83 Andreas Roussos 2024-07-20 16:00:18 UTC
>  - Note: marc-xml harvesting will not work with HTTP::OAI::Harvester version
> 3.xx
>    Version 4.xx is needed.
>    See Bug 17704 for updating Koha default version to 4.xx
Indeed, version 4.xx is needed to enable marc-xml harvesting. However,
while testing the patches in this Bug report, I realised that once I
upgrade HTTP::OAI::Harvester I can no longer retrieve all records for
a specific oai_dc set.

I'm not sure if marc-xml harvesting suffers from the same problem as
I haven't tested that aspect.

In any case, I have filed a GitHub Issue upstream at:
https://github.com/LibreCat/perl-oai-lib/issues/10
Comment 84 Victor Grousset/tuxayo 2024-07-21 22:31:45 UTC
Tests blow up :o
And it's not because the DBIC patch is out of date.
It is out of date though, I don't know if these DBIC commits are needed anymore now that the sandboxes have the "Refresh schema" action. Maybe they have another use? If not test plan needs minor update to test to refresh DBIC schema.

Back to main issue, even after running `dbic`:

kohadev-koha@kohadevbox:koha(testing-SO-QA)$ prove t/db_dependent/Koha/OAIHarvester.t t/db_dependent/Koha/OAIServers.t
t/db_dependent/Koha/OAIHarvester.t .. 1/24 DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Unknown column 'me.id' in 'field list' at /kohadevbox/koha/Koha/Objects.pm line 95
# Looks like your test exited with 11 just after 1.
t/db_dependent/Koha/OAIHarvester.t .. Dubious, test returned 11 (wstat 2816, 0xb00)
Failed 23/24 subtests 
t/db_dependent/Koha/OAIServers.t ....     # Looks like you planned 4 tests but ran 2.
t/db_dependent/Koha/OAIServers.t .... 1/2 
#   Failed test 'new, find and delete tests'
#   at t/db_dependent/Koha/OAIServers.t line 68.
DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Unknown column 'me.id' in 'field list' at /kohadevbox/koha/Koha/Objects.pm line 95
# Looks like your test exited with 255 just after 1.
t/db_dependent/Koha/OAIServers.t .... Dubious, test returned 255 (wstat 65280, 0xff00)
Comment 85 Matthias Meusburger 2024-08-01 11:42:36 UTC
Created attachment 169941 [details] [review]
DO NOT PUSH: Bug 35659 DBIC Update
Comment 86 Matthias Meusburger 2024-08-01 12:01:18 UTC
Hi Tuxayo!

I updated the DBIC patch. It it still needed for the additional koha_object_class and koha_objects_class functions in Koha/Schema/Result/OaiServer.pm, which are not auto-generated.

After applying the patches on main, I can successfully run:

kohadev-koha@kohadevbox:koha(BZ35659)$ qa -c 7
[...]
Running tests (2)
	* Proving /kohadevbox/koha/t/db_dependent/Koha/OAIHarvester.t OK!
	* Proving /kohadevbox/koha/t/db_dependent/Koha/OAIServers.t OK!

Running 'prove' however shows the following problem:
t/00-check-atomic-updates.t ................. 1/? 
#   Failed test 'check for unhandled atomic updates: Bug-35659.pl'

This is the following test:
unlike( $f, qr/.*pl$/, "check for unhandled atomic updates: $f" );

It checks that the atomic update file ends with .pl, and my file does. What am I missing here?
Comment 87 Matthias Meusburger 2024-08-01 12:07:21 UTC
Oh, my bad, the test checks that the atomic update file does NOT end with .pl

Is this test meant to be run after the atomic update file is integrated (and thus, deleted)?

If this is the case, once the atomic update file deleted, I can run 'prove' successfully:

kohadev-koha@kohadevbox:koha(BZ35659)$ prove
[...]
All tests successful.
Files=77, Tests=5248, 51 wallclock secs
Comment 88 Victor Grousset/tuxayo 2024-08-31 03:45:07 UTC
(In reply to Matthias Meusburger from comment #86)
> I updated the DBIC patch. It it still needed for the additional
> koha_object_class and koha_objects_class functions in
> Koha/Schema/Result/OaiServer.pm, which are not auto-generated.

Then the not auto-generated parts need to be split in their commit. Otherwise they will be lost because "DO NOT PUSH" when merged in main. So the result won't work.

QA note: no relevant issue found with perltidy on the non-auto-generated parts of schema code.
Comment 89 Victor Grousset/tuxayo 2024-08-31 06:21:35 UTC
> Is this test meant to be run after the atomic update
> file is integrated (and thus, deleted)?

It's meant to be ran by the CI to detect a dbrev that wasn't integrated by the RM or RMaint.

So it should fail if ran at this stage of the process. (and it doesn't need to be ran)

No issue there then :)

---------


Thanks for the coverage improvements!
stmt  bran  cond  sub   total
55.6  38.1  66.6  88.8  57.1
↓↓↓↓↓
68.1  64.2  83.3  88.4  70.3

Harvester->init() and it's 120 lines are not covered at all.
I just added $harvester->init(); in the tests and coverage went from
stmt  bran  cond  sub   total
68.1  64.2  83.3  88.4  70.3
to ↓↓↓↓↓
82.9  71.4  83.3  96.1  82.6

There might be a smarter way to test that ^^"
Maybe with a return value of 1 at end we check that? So we can have regression testing of at least it not blowing up ^^
But before that, the execution falls into `if ( $response->is_error )` because I likely forgot some setup. Any idea of what would be missing to have a working run of init()?
Comment 90 David Cook 2024-09-01 23:20:21 UTC
*** Bug 10662 has been marked as a duplicate of this bug. ***
Comment 91 Matthias Meusburger 2024-09-10 15:37:13 UTC
Created attachment 171255 [details] [review]
Bug 35659: (QA follow-up): Add init function tests by using Koha's OAI server
Comment 92 Matthias Meusburger 2024-09-10 15:45:32 UTC
Created attachment 171258 [details] [review]
DO NOT PUSH: Bug 35659 DBIC Update
Comment 93 Matthias Meusburger 2024-09-10 15:48:07 UTC
Created attachment 171260 [details] [review]
Bug 35659: (QA follow-up): Add koha_object(s)_class functions for OaiServer.pm
Comment 94 Matthias Meusburger 2024-09-10 15:51:23 UTC
Thanks again tuxayo for your feedback.

The init function is now tested using Koha's OAI server.

Also, the DBIC patch has been split in two.
Comment 95 Matthias Meusburger 2024-09-10 16:10:21 UTC
Created attachment 171264 [details] [review]
Bug 35659: (QA follow-up): Add init function tests by using Koha's OAI server
Comment 96 Matthias Meusburger 2024-09-10 16:11:03 UTC
Created attachment 171265 [details] [review]
Bug 35659: (QA follow-up): Add init function tests by using Koha's OAI server
Comment 97 Matthias Meusburger 2024-09-10 16:16:37 UTC
Created attachment 171267 [details] [review]
Bug 35659: (QA follow-up): Add init function tests by using Koha's OAI server
Comment 98 Andreas Roussos 2024-09-18 14:33:30 UTC
Created attachment 171675 [details]
Screenshot - Navigation menu wrongly appears on the right

I've noticed a couple of issues, please see the attached screenshots.

1) the main navigation menu appears on the right (instead of the left),
   this is due to the recent changes that upgraded Bootstrap to v5.
2) the label for the "Set:" text input has disappeared, this is due to
   a missing [% USE %] directive in the template file.
3) the command-line cron script cannot fetch/list the repositories due
   to changes in the DB schema (`id` got renamed to `oai_server_id`).

Follow-up patches are on their way... ;-)
Comment 99 Andreas Roussos 2024-09-18 14:34:09 UTC
Created attachment 171676 [details]
Screenshot - The label for the "Set:" text input is missing
Comment 100 Andreas Roussos 2024-09-18 14:36:36 UTC
Created attachment 171678 [details] [review]
Bug 35659: (follow-up) Use new column name in cron script

In an earlier patch, the `id` column of the `oai_servers`
table was renamed to `oai_server_id`. However, the code
in misc/cronjobs/harvest_oai.pl still uses the old column
name, which results in the following error:

$ misc/cronjobs/harvest_oai.pl --list
DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Unknown column 'id' in 'order clause' at /kohadevbox/koha/Koha/Objects.pm line 403

This patch fixes that.

Test plan:

1) $ misc/cronjobs/harvest_oai.pl --list
   [...you get the DBI Exception...]
2) Apply the patch.
3) $ misc/cronjobs/harvest_oai.pl --list
   [...list of OAI repositories...]
Comment 101 Andreas Roussos 2024-09-18 14:36:39 UTC
Created attachment 171679 [details] [review]
Bug 35659: (follow-up) Adjust TT code for Bootstrap 5

In Bug 35402 the Bootstrap CSS framework was upgraded
to version 5.

This patch adjusts the relevant TT code for the OAI
repositories administration page, and also adds a
missing [% USE %] directive.
Comment 102 David Cook 2024-09-26 20:27:12 UTC
Created attachment 172072 [details] [review]
Bug 35659: OAI Harvester

Test plan:

 - Run updatedatabase.pl

 - Apply the DBIC update patch

 - Setup an OAI repository in Administration -> OAI repositories (admin/oaiservers.pl)

   If the repository dataformat is in oai_dc, you can use the sample XSLT files:
   For Unimarc:
   OAIDCtoUNIMARCXML.xsl for bibliographic records
   AuthOAIDCtoUNIMARCXML.xsl for authorities

   For Marc21:
   OAIDCtoMARC21XML.xsl for bibliographic records
   AuthOAIDCtoMARC21XML.xsl for authorities

   If the repository dataformat is in marc-xml, you can use
   OAIMarcxml2KohaMarcxml.xsl for both Unimarc and Marc21.

 - Some repositories to test with:

   Bibliographic records, oai_dc:
   Endpoint: http://staroai.theses.fr/OAIHandler
   Set: ddc:260
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/OAIDCtoUNIMARCXML.xsl
   or
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/OAIDCtoMARC21XML.xsl

   Authorities, oai_dc:
   Endpoint: https://www.idref.fr/OAI/oai.jsp
   Set: a
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/AuthOAIDCtoUNIMARCXML.xsl
   or
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/AuthOAIDCtoMARC21XML.xsl

   Authorities, marc-xml, Unimarc:
   Endpoint: https://www.idref.fr/OAI/oai.jsp
   Set: a
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/OAIMarcxml2KohaMarcxml.xsl

 - Note: marc-xml harvesting will not work with HTTP::OAI::Harvester version 3.xx
   Version 4.xx is needed.
   See Bug 17704 for updating Koha default version to 4.xx

 - If you want to receive a report email, fill the OAI-PMH:HarvestEmailReport
   syspref. The model used (OAI_HARVEST_REPORT) can be edited in tools -> Notices and slips.

 - start a harvest with the following command:
   misc/cronjobs/harvest_oai.pl

    This script starts an OAI Harvest

    This script has the following parameters :
        -h --help: this message
        -v --verbose (enable output to stdout)
        -r --repository: id of the OAI repository
        -d --days: number of days to harvest from (optional)
        -l --list: list the OAI repositories
        -f --force: force harvesting (ignore records datestamps) (optional)

    Example: misc/cronjobs/harvest_oai.pl -r 1 -d 10 -v -f

 - Check the logs in the Log Viewer (tools/viewlog.pl)
   (CronjobLog syspref must be activated)

Sponsored-by: KohaLa
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Comment 103 David Cook 2024-09-26 20:27:15 UTC
Created attachment 172073 [details] [review]
Bug 35659: (follow-up) Better handling of accented characters

If you try to harvest bibliographic records from a UNIMARC OAI
repository (using oai_dc data format) in a MARC21 Koha instance
and run the OAI harvester script in verbose mode, you may get
lines similar to the following in the output:

no mapping found for [0xC9] at position 0 in Économie politique g0=ASCII_DEFAULT g1=EXTENDED_LATIN at /usr/share/perl5/MARC/Charset.pm line 308.
no mapping found for [0xC9] at position 0 in Église et société g0=ASCII_DEFAULT g1=EXTENDED_LATIN at /usr/share/perl5/MARC/Charset.pm line 308.

When looking at the imported records' biblio details page in
the OPAC, most words containing accented characters will not
appear correctly.

The fix is to apply Franck Theeten's solution from Bug 16488
(https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16488#c24)
and modify the value of the MARC leader's 10th character
to 'a' in the XSLT that transforms the UNIMARC OAI records
into MARC21 XML. Then, the accented characters get imported
properly and the records appear correctly in the OPAC.

Test plan:

0) Without this patch, running the OAI harvesting script in
   verbose mode produces many warnings, and garbled characters
   appear in the OPAC biblio details page wherever accented
   characters are in use.

1) Apply this patch.

2) Re-run the OAI harvesting script in verbose + force mode
   (force mode is required to ignore record datestamps from
   previous runs):

   misc/cronjobs/harvest_oai.pl -v -r <OAI_REPO_ID> -f

   This time there should be no warnings printed on your
   screen, and any characters with accents in the updated
   records should look OK in the OPAC.

Thanks-to: Franck Theeten <franck.theeten@africamuseum.be>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Comment 104 David Cook 2024-09-26 20:27:19 UTC
Created attachment 172074 [details] [review]
Bug 35659: (follow-up) Make OAI repositories edition comply with CSRF

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Comment 105 David Cook 2024-09-26 20:27:22 UTC
Created attachment 172075 [details] [review]
Bug 35659: (QA follow-up)

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Comment 106 David Cook 2024-09-26 20:27:26 UTC
Created attachment 172076 [details] [review]
Bug 35659: (more QA follow-ups)

Rename Oaipmh to OAI
Rename oaiservers to oai_servers
Rename OaiServer to OAIServer
Rename oai_servers.id to oai_servers.oai_server_id
Rename ServerSearch to server_search
Use a callback function for logs
Use context for string "Set"
Split translation string

Signed-off-by: David Cook <dcook@prosentient.com.au>
Comment 107 David Cook 2024-09-26 20:27:29 UTC
Created attachment 172077 [details] [review]
Bug 35659: (QA follow-up): Auth unit tests & dbrev

Add unit tests for authorities and deletion
Fix dbrev and kohastructure discrepancies

Signed-off-by: David Cook <dcook@prosentient.com.au>
Comment 108 David Cook 2024-09-26 20:27:32 UTC
Created attachment 172078 [details] [review]
DO NOT PUSH: Bug 35659 DBIC Update

Signed-off-by: David Cook <dcook@prosentient.com.au>
Comment 109 David Cook 2024-09-26 20:27:36 UTC
Created attachment 172079 [details] [review]
Bug 35659: (QA follow-up): Add koha_object(s)_class functions for OaiServer.pm

Signed-off-by: David Cook <dcook@prosentient.com.au>
Comment 110 David Cook 2024-09-26 20:27:39 UTC
Created attachment 172080 [details] [review]
Bug 35659: (QA follow-up): Add init function tests by using Koha's OAI server

Signed-off-by: David Cook <dcook@prosentient.com.au>
Comment 111 David Cook 2024-09-26 20:27:42 UTC
Created attachment 172081 [details] [review]
Bug 35659: (follow-up) Use new column name in cron script

In an earlier patch, the `id` column of the `oai_servers`
table was renamed to `oai_server_id`. However, the code
in misc/cronjobs/harvest_oai.pl still uses the old column
name, which results in the following error:

$ misc/cronjobs/harvest_oai.pl --list
DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Unknown column 'id' in 'order clause' at /kohadevbox/koha/Koha/Objects.pm line 403

This patch fixes that.

Test plan:

1) $ misc/cronjobs/harvest_oai.pl --list
   [...you get the DBI Exception...]
2) Apply the patch.
3) $ misc/cronjobs/harvest_oai.pl --list
   [...list of OAI repositories...]

Signed-off-by: David Cook <dcook@prosentient.com.au>
Comment 112 David Cook 2024-09-26 20:27:46 UTC
Created attachment 172082 [details] [review]
Bug 35659: (follow-up) Adjust TT code for Bootstrap 5

In Bug 35402 the Bootstrap CSS framework was upgraded
to version 5.

This patch adjusts the relevant TT code for the OAI
repositories administration page, and also adds a
missing [% USE %] directive.

Signed-off-by: David Cook <dcook@prosentient.com.au>
Comment 113 David Cook 2024-09-26 20:27:49 UTC
Created attachment 172083 [details] [review]
Bug 35659: (follow-up) fix auth oai to MARC21

Signed-off-by: David Cook <dcook@prosentient.com.au>
Comment 114 David Cook 2024-09-26 20:32:15 UTC
Passed QA!

I sat with Matthias at Kohacon2024 hackfest and we chatted about it, and tested it side by side.

I found a little issue with the provided XSLT for authority oai_dc to marc21, but I've provided a patch for that.

I haven't verified the UNIMARC XSLTs, but technically you can provide any XSLT you like, so each instance can do any XSLT they like. 

I've verified that the OAI harvest mechanism works as intended, and it's all looking good to me. 

There are probably some additional tweaks I'd like to make in the long-term, but those can be done in the future as follow-ups, if they're really required. The perfect is the enemy of the good, and I think that this is a good change for us to make.

Let's get this in, and then we can always polish more as we go. 

Hurray!
Comment 115 David Cook 2024-09-27 15:17:30 UTC
Just noting that the QA tool warnings should all be irrelevant.

The ones about tidiness and POD coverage are for generated files or for Koha::Object subclasses which appear to be correct. I recall the POD coverage sometimes being wrong for those.

There are some complaints about commit title wording, but I think those are ignorable as well.
Comment 116 Victor Grousset/tuxayo 2024-09-30 02:16:00 UTC
Created attachment 172202 [details] [review]
Bug 35659: OAI Harvester

Test plan:

 - Run updatedatabase.pl

 - Apply the DBIC update patch

 - Setup an OAI repository in Administration -> OAI repositories (admin/oaiservers.pl)

   If the repository dataformat is in oai_dc, you can use the sample XSLT files:
   For Unimarc:
   OAIDCtoUNIMARCXML.xsl for bibliographic records
   AuthOAIDCtoUNIMARCXML.xsl for authorities

   For Marc21:
   OAIDCtoMARC21XML.xsl for bibliographic records
   AuthOAIDCtoMARC21XML.xsl for authorities

   If the repository dataformat is in marc-xml, you can use
   OAIMarcxml2KohaMarcxml.xsl for both Unimarc and Marc21.

 - Some repositories to test with:

   Bibliographic records, oai_dc:
   Endpoint: http://staroai.theses.fr/OAIHandler
   Set: ddc:260
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/OAIDCtoUNIMARCXML.xsl
   or
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/OAIDCtoMARC21XML.xsl

   Authorities, oai_dc:
   Endpoint: https://www.idref.fr/OAI/oai.jsp
   Set: a
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/AuthOAIDCtoUNIMARCXML.xsl
   or
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/AuthOAIDCtoMARC21XML.xsl

   Authorities, marc-xml, Unimarc:
   Endpoint: https://www.idref.fr/OAI/oai.jsp
   Set: a
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/OAIMarcxml2KohaMarcxml.xsl

 - Note: marc-xml harvesting will not work with HTTP::OAI::Harvester version 3.xx
   Version 4.xx is needed.
   See Bug 17704 for updating Koha default version to 4.xx

 - If you want to receive a report email, fill the OAI-PMH:HarvestEmailReport
   syspref. The model used (OAI_HARVEST_REPORT) can be edited in tools -> Notices and slips.

 - start a harvest with the following command:
   misc/cronjobs/harvest_oai.pl

    This script starts an OAI Harvest

    This script has the following parameters :
        -h --help: this message
        -v --verbose (enable output to stdout)
        -r --repository: id of the OAI repository
        -d --days: number of days to harvest from (optional)
        -l --list: list the OAI repositories
        -f --force: force harvesting (ignore records datestamps) (optional)

    Example: misc/cronjobs/harvest_oai.pl -r 1 -d 10 -v -f

 - Check the logs in the Log Viewer (tools/viewlog.pl)
   (CronjobLog syspref must be activated)

Sponsored-by: KohaLa
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Comment 117 Victor Grousset/tuxayo 2024-09-30 02:16:07 UTC
Created attachment 172203 [details] [review]
Bug 35659: (follow-up) Better handling of accented characters

If you try to harvest bibliographic records from a UNIMARC OAI
repository (using oai_dc data format) in a MARC21 Koha instance
and run the OAI harvester script in verbose mode, you may get
lines similar to the following in the output:

no mapping found for [0xC9] at position 0 in Économie politique g0=ASCII_DEFAULT g1=EXTENDED_LATIN at /usr/share/perl5/MARC/Charset.pm line 308.
no mapping found for [0xC9] at position 0 in Église et société g0=ASCII_DEFAULT g1=EXTENDED_LATIN at /usr/share/perl5/MARC/Charset.pm line 308.

When looking at the imported records' biblio details page in
the OPAC, most words containing accented characters will not
appear correctly.

The fix is to apply Franck Theeten's solution from Bug 16488
(https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16488#c24)
and modify the value of the MARC leader's 10th character
to 'a' in the XSLT that transforms the UNIMARC OAI records
into MARC21 XML. Then, the accented characters get imported
properly and the records appear correctly in the OPAC.

Test plan:

0) Without this patch, running the OAI harvesting script in
   verbose mode produces many warnings, and garbled characters
   appear in the OPAC biblio details page wherever accented
   characters are in use.

1) Apply this patch.

2) Re-run the OAI harvesting script in verbose + force mode
   (force mode is required to ignore record datestamps from
   previous runs):

   misc/cronjobs/harvest_oai.pl -v -r <OAI_REPO_ID> -f

   This time there should be no warnings printed on your
   screen, and any characters with accents in the updated
   records should look OK in the OPAC.

Thanks-to: Franck Theeten <franck.theeten@africamuseum.be>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Comment 118 Victor Grousset/tuxayo 2024-09-30 02:16:12 UTC
Created attachment 172204 [details] [review]
Bug 35659: (follow-up) Make OAI repositories edition comply with CSRF

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Comment 119 Victor Grousset/tuxayo 2024-09-30 02:16:18 UTC
Created attachment 172205 [details] [review]
Bug 35659: (QA follow-up)

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Comment 120 Victor Grousset/tuxayo 2024-09-30 02:16:24 UTC
Created attachment 172206 [details] [review]
Bug 35659: (more QA follow-ups)

Rename Oaipmh to OAI
Rename oaiservers to oai_servers
Rename OaiServer to OAIServer
Rename oai_servers.id to oai_servers.oai_server_id
Rename ServerSearch to server_search
Use a callback function for logs
Use context for string "Set"
Split translation string

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Comment 121 Victor Grousset/tuxayo 2024-09-30 02:16:31 UTC
Created attachment 172207 [details] [review]
Bug 35659: (QA follow-up): Auth unit tests & dbrev

Add unit tests for authorities and deletion
Fix dbrev and kohastructure discrepancies

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Comment 122 Victor Grousset/tuxayo 2024-09-30 02:16:40 UTC
Created attachment 172208 [details] [review]
DO NOT PUSH: Bug 35659 DBIC Update

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Comment 123 Victor Grousset/tuxayo 2024-09-30 02:16:45 UTC
Created attachment 172209 [details] [review]
Bug 35659: (QA follow-up): Add koha_object(s)_class functions for OaiServer.pm

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Comment 124 Victor Grousset/tuxayo 2024-09-30 02:16:50 UTC
Created attachment 172210 [details] [review]
Bug 35659: (QA follow-up): Add init function tests by using Koha's OAI server

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Comment 125 Victor Grousset/tuxayo 2024-09-30 02:16:56 UTC
Created attachment 172211 [details] [review]
Bug 35659: (follow-up) Use new column name in cron script

In an earlier patch, the `id` column of the `oai_servers`
table was renamed to `oai_server_id`. However, the code
in misc/cronjobs/harvest_oai.pl still uses the old column
name, which results in the following error:

$ misc/cronjobs/harvest_oai.pl --list
DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Unknown column 'id' in 'order clause' at /kohadevbox/koha/Koha/Objects.pm line 403

This patch fixes that.

Test plan:

1) $ misc/cronjobs/harvest_oai.pl --list
   [...you get the DBI Exception...]
2) Apply the patch.
3) $ misc/cronjobs/harvest_oai.pl --list
   [...list of OAI repositories...]

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Comment 126 Victor Grousset/tuxayo 2024-09-30 02:17:00 UTC
Created attachment 172212 [details] [review]
Bug 35659: (follow-up) Adjust TT code for Bootstrap 5

In Bug 35402 the Bootstrap CSS framework was upgraded
to version 5.

This patch adjusts the relevant TT code for the OAI
repositories administration page, and also adds a
missing [% USE %] directive.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Comment 127 Victor Grousset/tuxayo 2024-09-30 02:17:05 UTC
Created attachment 172213 [details] [review]
Bug 35659: (follow-up) fix auth oai to MARC21

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Comment 128 Victor Grousset/tuxayo 2024-09-30 02:44:42 UTC
Koha/OAI/Client/Harvester.pm
stmt  bran  cond  sub   total
68.1  64.2  83.3  88.4  70.3
↓↓↓↓↓
93.0  78.5  83.3  96.1  90.9

Thanks a lot, the improvement is great !
Coverage of changes is good 👍

As a bonus, there is even a bit more coverage in the server.

As far as I can tell, all good with the coding guidelines.

----

Thanks David for the second look on the technical stuff and a look at the functional side that I couldn't have done.


(In reply to David Cook from comment #115)
> Just noting that the QA tool warnings should all be irrelevant.

Confirmed.


----


Any sponsor for this BTW?
Comment 129 David Cook 2024-09-30 03:30:31 UTC
(In reply to Victor Grousset/tuxayo from comment #128)
> Any sponsor for this BTW?

I think KohaLa sponsored this one.
Comment 130 Mathieu Saby 2024-09-30 16:09:02 UTC
Yes, sponsored by Kohala association
Comment 131 Katrin Fischer 2024-10-18 14:42:28 UTC
(In reply to Mathieu Saby from comment #130)
> Yes, sponsored by Kohala association

Matts, I had started on this, but then got distracted and lost my first batch of notes. :(

I will come back to this, but could you already do some smaller fixes maybe?

1) Add the sponsorship lines into the commits? Sponsored-by: ...
2) Fix OAI Harvest/OAI Harvesting to OAI harvest? (capitalization)
3) Check the system preference description so that it forms a proper sentence.

That's what I remembered, but I'll be back soon!
Comment 132 David Cook 2024-10-22 01:36:05 UTC
Created attachment 173088 [details] [review]
Bug 35659: OAI Harvester

Test plan:

 - Run updatedatabase.pl

 - Apply the DBIC update patch

 - Setup an OAI repository in Administration -> OAI repositories (admin/oaiservers.pl)

   If the repository dataformat is in oai_dc, you can use the sample XSLT files:
   For Unimarc:
   OAIDCtoUNIMARCXML.xsl for bibliographic records
   AuthOAIDCtoUNIMARCXML.xsl for authorities

   For Marc21:
   OAIDCtoMARC21XML.xsl for bibliographic records
   AuthOAIDCtoMARC21XML.xsl for authorities

   If the repository dataformat is in marc-xml, you can use
   OAIMarcxml2KohaMarcxml.xsl for both Unimarc and Marc21.

 - Some repositories to test with:

   Bibliographic records, oai_dc:
   Endpoint: http://staroai.theses.fr/OAIHandler
   Set: ddc:260
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/OAIDCtoUNIMARCXML.xsl
   or
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/OAIDCtoMARC21XML.xsl

   Authorities, oai_dc:
   Endpoint: https://www.idref.fr/OAI/oai.jsp
   Set: a
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/AuthOAIDCtoUNIMARCXML.xsl
   or
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/AuthOAIDCtoMARC21XML.xsl

   Authorities, marc-xml, Unimarc:
   Endpoint: https://www.idref.fr/OAI/oai.jsp
   Set: a
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/OAIMarcxml2KohaMarcxml.xsl

 - Note: marc-xml harvesting will not work with HTTP::OAI::Harvester version 3.xx
   Version 4.xx is needed.
   See Bug 17704 for updating Koha default version to 4.xx

 - If you want to receive a report email, fill the OAI-PMH:HarvestEmailReport
   syspref. The model used (OAI_HARVEST_REPORT) can be edited in tools -> Notices and slips.

 - start a harvest with the following command:
   misc/cronjobs/harvest_oai.pl

    This script starts an OAI Harvest

    This script has the following parameters :
        -h --help: this message
        -v --verbose (enable output to stdout)
        -r --repository: id of the OAI repository
        -d --days: number of days to harvest from (optional)
        -l --list: list the OAI repositories
        -f --force: force harvesting (ignore records datestamps) (optional)

    Example: misc/cronjobs/harvest_oai.pl -r 1 -d 10 -v -f

 - Check the logs in the Log Viewer (tools/viewlog.pl)
   (CronjobLog syspref must be activated)

Sponsored-by: KohaLa
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Sponsored-by: Association KohaLa - https://koha-fr.org/
Comment 133 David Cook 2024-10-22 01:36:09 UTC
Created attachment 173089 [details] [review]
Bug 35659: (follow-up) Better handling of accented characters

If you try to harvest bibliographic records from a UNIMARC OAI
repository (using oai_dc data format) in a MARC21 Koha instance
and run the OAI harvester script in verbose mode, you may get
lines similar to the following in the output:

no mapping found for [0xC9] at position 0 in Économie politique g0=ASCII_DEFAULT g1=EXTENDED_LATIN at /usr/share/perl5/MARC/Charset.pm line 308.
no mapping found for [0xC9] at position 0 in Église et société g0=ASCII_DEFAULT g1=EXTENDED_LATIN at /usr/share/perl5/MARC/Charset.pm line 308.

When looking at the imported records' biblio details page in
the OPAC, most words containing accented characters will not
appear correctly.

The fix is to apply Franck Theeten's solution from Bug 16488
(https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16488#c24)
and modify the value of the MARC leader's 10th character
to 'a' in the XSLT that transforms the UNIMARC OAI records
into MARC21 XML. Then, the accented characters get imported
properly and the records appear correctly in the OPAC.

Test plan:

0) Without this patch, running the OAI harvesting script in
   verbose mode produces many warnings, and garbled characters
   appear in the OPAC biblio details page wherever accented
   characters are in use.

1) Apply this patch.

2) Re-run the OAI harvesting script in verbose + force mode
   (force mode is required to ignore record datestamps from
   previous runs):

   misc/cronjobs/harvest_oai.pl -v -r <OAI_REPO_ID> -f

   This time there should be no warnings printed on your
   screen, and any characters with accents in the updated
   records should look OK in the OPAC.

Thanks-to: Franck Theeten <franck.theeten@africamuseum.be>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Sponsored-by: Association KohaLa - https://koha-fr.org/
Comment 134 David Cook 2024-10-22 01:36:14 UTC
Created attachment 173090 [details] [review]
Bug 35659: (follow-up) Make OAI repositories edition comply with CSRF

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Sponsored-by: Association KohaLa - https://koha-fr.org/
Comment 135 David Cook 2024-10-22 01:36:19 UTC
Created attachment 173091 [details] [review]
Bug 35659: (QA follow-up)

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Sponsored-by: Association KohaLa - https://koha-fr.org/
Comment 136 David Cook 2024-10-22 01:36:23 UTC
Created attachment 173092 [details] [review]
Bug 35659: (more QA follow-ups)

Rename Oaipmh to OAI
Rename oaiservers to oai_servers
Rename OaiServer to OAIServer
Rename oai_servers.id to oai_servers.oai_server_id
Rename ServerSearch to server_search
Use a callback function for logs
Use context for string "Set"
Split translation string

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Sponsored-by: Association KohaLa - https://koha-fr.org/
Comment 137 David Cook 2024-10-22 01:36:28 UTC
Created attachment 173093 [details] [review]
Bug 35659: (QA follow-up): Auth unit tests & dbrev

Add unit tests for authorities and deletion
Fix dbrev and kohastructure discrepancies

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Sponsored-by: Association KohaLa - https://koha-fr.org/
Comment 138 David Cook 2024-10-22 01:36:32 UTC
Created attachment 173094 [details] [review]
DO NOT PUSH: Bug 35659 DBIC Update

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Sponsored-by: Association KohaLa - https://koha-fr.org/
Comment 139 David Cook 2024-10-22 01:36:37 UTC
Created attachment 173095 [details] [review]
Bug 35659: (QA follow-up): Add koha_object(s)_class functions for OaiServer.pm

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Sponsored-by: Association KohaLa - https://koha-fr.org/
Comment 140 David Cook 2024-10-22 01:36:41 UTC
Created attachment 173096 [details] [review]
Bug 35659: (QA follow-up): Add init function tests by using Koha's OAI server

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Sponsored-by: Association KohaLa - https://koha-fr.org/
Comment 141 David Cook 2024-10-22 01:36:46 UTC
Created attachment 173097 [details] [review]
Bug 35659: (follow-up) Use new column name in cron script

In an earlier patch, the `id` column of the `oai_servers`
table was renamed to `oai_server_id`. However, the code
in misc/cronjobs/harvest_oai.pl still uses the old column
name, which results in the following error:

$ misc/cronjobs/harvest_oai.pl --list
DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Unknown column 'id' in 'order clause' at /kohadevbox/koha/Koha/Objects.pm line 403

This patch fixes that.

Test plan:

1) $ misc/cronjobs/harvest_oai.pl --list
   [...you get the DBI Exception...]
2) Apply the patch.
3) $ misc/cronjobs/harvest_oai.pl --list
   [...list of OAI repositories...]

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Sponsored-by: Association KohaLa - https://koha-fr.org/
Comment 142 David Cook 2024-10-22 01:36:50 UTC
Created attachment 173098 [details] [review]
Bug 35659: (follow-up) Adjust TT code for Bootstrap 5

In Bug 35402 the Bootstrap CSS framework was upgraded
to version 5.

This patch adjusts the relevant TT code for the OAI
repositories administration page, and also adds a
missing [% USE %] directive.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Sponsored-by: Association KohaLa - https://koha-fr.org/
Comment 143 David Cook 2024-10-22 01:36:55 UTC
Created attachment 173099 [details] [review]
Bug 35659: (follow-up) fix auth oai to MARC21

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Sponsored-by: Association KohaLa - https://koha-fr.org/
Comment 144 David Cook 2024-10-22 01:36:59 UTC
Created attachment 173100 [details] [review]
Bug 35659: (QA follow-up) Update syspref description to be a sentence

Sponsored-by: Association KohaLa - https://koha-fr.org/
Comment 145 David Cook 2024-10-22 01:37:04 UTC
Created attachment 173101 [details] [review]
Bug 35659: (QA follow-up) Fix capitalisation in notice

Sponsored-by: Association KohaLa - https://koha-fr.org/
Comment 146 David Cook 2024-10-22 01:38:08 UTC
(In reply to Katrin Fischer from comment #131)
> 1) Add the sponsorship lines into the commits? Sponsored-by: ...

git rebase --exec 'git commit --amend --trailer "Sponsored-by: Association KohaLa - https://koha-fr.org/" --no-edit' HEAD~12

Boom!

(I'm going to add that one to the wiki...)

> 2) Fix OAI Harvest/OAI Harvesting to OAI harvest? (capitalization)

Whereabouts? In the notice? I've updated the following:

installer/data/mysql/en/mandatory/sample_notices.yml
installer/data/mysql/atomicupdate/Bug-35659.pl

> 3) Check the system preference description so that it forms a proper
> sentence.

I think I understand. I've updated the following:

koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/web_services.pref
installer/data/mysql/mandatory/sysprefs.sql
installer/data/mysql/atomicupdate/Bug-35659.pl
Comment 147 David Cook 2024-10-22 01:43:49 UTC
Also, since some of these follow-ups are pretty trivial, could we do them as a follow-up bug instead?
Comment 148 Katrin Fischer 2024-10-22 07:11:01 UTC
(In reply to David Cook from comment #147)
> Also, since some of these follow-ups are pretty trivial, could we do them as
> a follow-up bug instead?

As they are so trivial I think follow-ups here should be enough.

I didn't stop testing here, it's just a big piece that I need some extra big time slot for.

For the capitalization: git grep "OAI-PMH H" or git grep "OAI Harv" is what I would usually do. There were a few occurences.

Thanks for the follow-up and the wiki update!
Comment 149 Katrin Fischer 2024-10-28 13:02:42 UTC
Hi all, 

thanks for the hard work on this!

1) Position on admin start page (non blocker)

Right now the OAI repositories live under "Additional parameters" instead of catalog like the OAI sets. I wonder if we should move them up since this also concerns the catalog :). If we do, let's not forget the module navigation as well.

2) Empty column heading (please follow-up)

For some unknown to me reason, this doesn't appear to work as expected:

        <thead><tr><th>ID</th><th>Repository name</th><th>Endpoint</th><th>[% tp('OAI', 'Set') | html %]</th><th>Data format</th><th>Record type</th><th class="noExport">Actions</th>

The column header for Set remains empty in my testing.
Comment 150 Katrin Fischer 2024-10-28 13:03:51 UTC
Pushed for 24.11!

Well done everyone, thank you!
Comment 151 Katrin Fischer 2024-10-28 13:20:34 UTC
(In reply to Katrin Fischer from comment #149)
> Hi all, 
> 
> thanks for the hard work on this!
> 
> 1) Position on admin start page (non blocker)
> 
> Right now the OAI repositories live under "Additional parameters" instead of
> catalog like the OAI sets. I wonder if we should move them up since this
> also concerns the catalog :). If we do, let's not forget the module
> navigation as well.
> 
> 2) Empty column heading (please follow-up)
> 
> For some unknown to me reason, this doesn't appear to work as expected:
> 
>         <thead><tr><th>ID</th><th>Repository
> name</th><th>Endpoint</th><th>[% tp('OAI', 'Set') | html %]</th><th>Data
> format</th><th>Record type</th><th class="noExport">Actions</th>
> 
> The column header for Set remains empty in my testing.

I solved 2 with [% PROCESS 'i18n.inc' %] after a hint from Joubu. Just 1) to check into :)
Comment 152 Matthias Meusburger 2024-10-28 13:27:26 UTC
Hi!

It made sense to me that the OAI repositories should be in the same category as "Z39.50/SRU servers", since they do the same thing: tell Koha where to connect to retrieve records. Hence "Additional parameters".
Comment 153 Katrin Fischer 2024-10-28 13:28:45 UTC
(In reply to Matthias Meusburger from comment #152)
> Hi!
> 
> It made sense to me that the OAI repositories should be in the same category
> as "Z39.50/SRU servers", since they do the same thing: tell Koha where to
> connect to retrieve records. Hence "Additional parameters".

Maybe both should be in catalog :D But I am OK with that explanation, we will see if it comes up again.
Comment 154 Jonathan Druart 2024-10-28 15:19:51 UTC
This patchset broke t/db_dependent/TestBuilder.t. And t/db_dependent/Koha/OAIHarvester.t is failing on Jenkins

Koha_Main/3076
Comment 155 Jonathan Druart 2024-10-28 15:30:00 UTC
admin/oai_servers.pl and .tt are really old style written, could have been nice to see them follow the current standard.

1. msg_added => should use a @messages array
2. add_form and op => Why 2 variables for the same purpose?
3. No try-catch!
4. type => $op eq 'add' ? lc $type : '' 
What is "type"? Is not used in template.
Comment 156 Katrin Fischer 2024-10-28 15:33:43 UTC
(In reply to Jonathan Druart from comment #154)
> This patchset broke t/db_dependent/TestBuilder.t. And
> t/db_dependent/Koha/OAIHarvester.t is failing on Jenkins
> 
> Koha_Main/3076

Joubu beat me to it, please fix urgently.
Comment 157 Jonathan Druart 2024-10-28 15:35:16 UTC
Created attachment 173561 [details] [review]
Bug 35659: Adjust DT's option names

See bug 34913
Comment 158 David Cook 2024-10-29 00:04:49 UTC
(In reply to Jonathan Druart from comment #154)
> t/db_dependent/Koha/OAIHarvester.t

I think I see the problem here. I'll look more at this one in a moment. 

> t/db_dependent/TestBuilder.t

Looking at this one now...
Comment 159 David Cook 2024-10-29 00:36:34 UTC
Created attachment 173599 [details] [review]
Bug 35659: (QA follow-up) fix t/db_dependent/TestBuilder.t
Comment 160 David Cook 2024-10-29 00:46:29 UTC
Created attachment 173600 [details] [review]
Bug 35659: (QA follow-up) Fix t/db_dependent/Koha/OAIHarvester.t

Previously, this test just checked the last 1 day of bib activity,
but on a fresh test system there will be no activity, so it will always
fail.

Instead, let's just check that a number is returned for the total,
even if that total number is 0, since 0 is a valid response too.
Comment 161 David Cook 2024-10-29 00:48:52 UTC
Created attachment 173601 [details] [review]
Bug 35659: (QA follow-up) Fix t/db_dependent/Koha/OAIHarvester.t

Previously, this test just checked the last 1 day of bib activity,
but on a fresh test system there will be no activity, so it will always
fail.

Instead, let's just check that a number is returned for the total,
even if that total number is 0, since 0 is a valid response too.
Comment 162 David Cook 2024-10-29 00:49:46 UTC
(In reply to Katrin Fischer from comment #156)
> (In reply to Jonathan Druart from comment #154)
> > This patchset broke t/db_dependent/TestBuilder.t. And
> > t/db_dependent/Koha/OAIHarvester.t is failing on Jenkins
> > 
> > Koha_Main/3076
> 
> Joubu beat me to it, please fix urgently.

OK. These should be fixed now. Please see last 2 patches attached
Comment 163 Katrin Fischer 2024-10-29 10:09:03 UTC
I am sorry, we now have the situation where prove t/db_dependent/Koha/OAIHarvester.t passes for me locally, but fails on Jenkins main/D12 (on dashboard). 

Can you have another go please?
Comment 164 Jonathan Druart 2024-10-29 10:48:57 UTC
* 55 my $strp = DateTime::Format::Strptime->new(

Not used?

* 139         my $dt_start = DateTime->new( year => $date[0], month => $date[1], day => $date[2] );

You are supposed to use dt_from_string, not DateTime directly.
Comment 165 Matthias Meusburger 2024-10-29 11:02:24 UTC
Created attachment 173614 [details] [review]
Bug 35659: (QA follow-up) Fix t/db_dependent/Koha/OAIHarvester.t

 - OPACBaseURL must be set correctly.
Comment 166 Katrin Fischer 2024-10-29 15:16:35 UTC
Bug 35659: (QA follow-up) Fix t/db_dependent/Koha/OAIHarvester.t pushed to main.
Comment 167 Jonathan Druart 2024-11-14 20:40:12 UTC
Still 2 important comments here.
Comment 168 Katrin Fischer 2024-11-18 16:39:23 UTC
This doesn't look quite right to me and will be untranslatable/cannot be searched for:

misc/cronjobs/harvest_oai.pl:cronlogaction( { action => 'Start', info => "Starting OAI Harvest" } );
misc/cronjobs/harvest_oai.pl:cronlogaction( { info   => "Command line: $command_line_options" } );
misc/cronjobs/harvest_oai.pl:cronlogaction( { action => 'End', info => "Ending OAI Harvest" } );

For comparison: 

misc/cronjobs/batch_anonymise.pl:use C4::Log qw( cronlogaction );
misc/cronjobs/batch_anonymise.pl:cronlogaction({ info => $command_line_options });
misc/cronjobs/batch_anonymise.pl:cronlogaction({ action => 'End', info => "COMPLETED" });
misc/cronjobs/build_browser_and_cloud.pl:cronlogaction({ info => $command_line_options });
misc/cronjobs/build_browser_and_cloud.pl:cronlogaction({ action => 'End', info => "COMPLETED" });
misc/cronjobs/cart_to_shelf.pl:use C4::Log qw( cronlogaction );
misc/cronjobs/cart_to_shelf.pl:cronlogaction({ info => $command_line_options });
misc/cronjobs/cart_to_shelf.pl:cronlogaction({ action => 'End', info => "COMPLETED" });
misc/cronjobs/cleanup_database.pl:use C4::Log qw( cronlogaction );
misc/cronjobs/cleanup_database.pl:cronlogaction( { info => $command_line_options } );
misc/cronjobs/cleanup_database.pl:cronlogaction( { action => 'End', info => "COMPLETED" } );
Comment 169 Lucas Gass (lukeg) 2024-11-18 23:09:04 UTC
New feature, no 24.05.x backport
Comment 170 Matthias Meusburger 2024-11-19 13:58:00 UTC
Created attachment 174790 [details] [review]
Bug 35659: (QA follow-up) Fix DateTime and cronlogaction messages
Comment 171 Katrin Fischer 2024-11-19 15:45:57 UTC
Follow-up "(QA follow-up) Fix DateTime and cronlogaction messages" picked for main.
Comment 172 Jonathan Druart 2024-11-20 08:36:46 UTC
There is still comment 155 that has been ignored but I am going to stop fighting here...
Comment 173 Katrin Fischer 2024-11-20 10:32:08 UTC
(In reply to Jonathan Druart from comment #172)
> There is still comment 155 that has been ignored but I am going to stop
> fighting here...

I am moving them into a separate bug because of closeness to release.