[Bug 28740] New: Delete old ILL requests with cleanup_database
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28740 Bug ID: 28740 Summary: Delete old ILL requests with cleanup_database Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Command-line Utilities Assignee: koha-bugs@lists.koha-community.org Reporter: andrew@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: robin@catalyst.net.nz, tomascohen@gmail.com We should teach cleanup_database to delete old ILL requests after a given period. Over in bug 23391, we introduced a syspref in which one can define statuses for which to hide ILL requests. Following that same idea of allowing whatever statuses a given back-end may use, the cron should take a number of days and a status and delete any request with that status that is more than that many days old. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28740 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28740 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=29109 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28740 Lisette Scheer <lisette.scheer@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lisette.scheer@bywatersolut | |ions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28740 Piia Semenoff <piia.semenoff@ouka.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |piia.semenoff@ouka.fi -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28740 Pedro Amorim <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de --- Comment #1 from Pedro Amorim <pedro.amorim@openfifth.co.uk> --- *** Bug 32629 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28740 Lari Strand <lmstrand@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lmstrand@gmail.com --- Comment #2 from Lari Strand <lmstrand@gmail.com> --- Created attachment 199064 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199064&action=edit Bug 28740: Add option for cleaning up ILL requests This adds two new parameters: --illrequests-status --illrequests-days (optional, defaults to 30 days) These can be repeated to include specific statuses for cleanup. At least one status must be specified. To test: 0 - Apply patch 1 - Create several ILL requests with different statuses (e.g., CANCELLED, REJECTED, COMPLETED, PENDING) 2 - Set some requests to be older than 30 days (update their updated timestamp) 3 - Run cleanup_database.pl with --illrequests-status CANCELLED 4 - CANCELLED requests older than 30 days are removed, others remain 5 - Run cleanup_database.pl with --illrequests-status CANCELLED --illrequests-status REJECTED 6 - Both CANCELLED and REJECTED requests older than 30 days are removed, other statuses remain 7 - Run cleanup_database.pl with --illrequests-days 5 --illrequests-status PENDING 8 - PENDING requests older than 5 days are removed 9 - Verify dry-run mode (no --confirm) correctly counts records that would be deleted without deleting them 10 - Run cleanup_database.pl with --illrequests-days without any --illrequests-status 11 - Error message displayed requiring at least one status to be specified Sponsored-by: Koha-Suomi Oy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28740 Lari Strand <lmstrand@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28740 Irene Tortorella <i.tortorella@arts.ac.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |i.tortorella@arts.ac.uk -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28740 Aude Charillon <aude.charillon@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |aude.charillon@openfifth.co | |.uk -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28740 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|tomascohen@gmail.com |lmstrand@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28740 Chip Halvorsen <Chip.Halvorsen@WestlakeLibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |Chip.Halvorsen@WestlakeLibr | |ary.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28740 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |tomascohen@gmail.com |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28740 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Sponsorship status|--- |Sponsored Comma delimited| |Koha-Suomi Oy list of Sponsors| | Status|Needs Signoff |Signed Off Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28740 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #199064|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28740 --- Comment #3 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 203205 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=203205&action=edit Bug 28740: Add option for cleaning up ILL requests This adds two new parameters: --illrequests-status --illrequests-days (optional, defaults to 30 days) These can be repeated to include specific statuses for cleanup. At least one status must be specified. To test: 0 - Apply patch 1 - Create several ILL requests with different statuses (e.g., CANCELLED, REJECTED, COMPLETED, PENDING) 2 - Set some requests to be older than 30 days (update their updated timestamp) 3 - Run cleanup_database.pl with --illrequests-status CANCELLED 4 - CANCELLED requests older than 30 days are removed, others remain 5 - Run cleanup_database.pl with --illrequests-status CANCELLED --illrequests-status REJECTED 6 - Both CANCELLED and REJECTED requests older than 30 days are removed, other statuses remain 7 - Run cleanup_database.pl with --illrequests-days 5 --illrequests-status PENDING 8 - PENDING requests older than 5 days are removed 9 - Verify dry-run mode (no --confirm) correctly counts records that would be deleted without deleting them 10 - Run cleanup_database.pl with --illrequests-days without any --illrequests-status 11 - Error message displayed requiring at least one status to be specified Sponsored-by: Koha-Suomi Oy Signed-off-by: John Doe <tomascohen@gmail.com> edit: tidied the file (tcohen) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28740 --- Comment #4 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 203206 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=203206&action=edit Bug 28740: (follow-up) Add missing C4::Log import for cronlogaction The patch added cronlogaction() calls but did not import the function. This caused a runtime error: Undefined subroutine &main::cronlogaction. Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ perl misc/cronjobs/cleanup_database.pl --illrequests-days 30 \ --illrequests-status COMP -v => SUCCESS: Dry-run works, reports count of requests that would be removed 3. Run with --confirm to actually purge 4. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28740 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28740 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |43234 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com Text to go in the| |This enhancement adds release notes| |options to the database | |clean up script | |(misc/cronjobs/cleanup_data | |base.pl) for deleting ILL | |requests: | | | |The two new parameters for | |deleting ILL requests are: | |--illrequests-status* | |--illrequests-days | |(optional, defaults to 30 | |days) | | | |* The ILL status codes are | |defined in the backends, | |with additional aliases | |configured using the | |ILL_STATUS_ALIAS authorized | |value category. The | |Standard backend status | |codes are listed in the | |manual | |https://koha-community.org/ | |manual/latest/en/html/ILL_r | |equests.html#request-status | |es Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43234 [Bug 43234] Move ILL request purging logic to Koha::ILL::Requests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28740 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |26.11.00 released in| | Status|Passed QA |Pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28740 --- Comment #5 from Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> --- Thanks everyone! Pushed to main for 26.11! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28740 Michaela Sieber <michaela.sieber@kit.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |michaela.sieber@kit.edu -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28740 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Needs documenting CC| |lucas@bywatersolutions.com --- Comment #6 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Enhancement, no 26.05.x backport -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28740 Kimberly <kimberly.diebolt@edcgov.us> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kimberly.diebolt@edcgov.us -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28740 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the|This enhancement adds |The database cleanup script release notes|options to the database |(misc/cronjobs/cleanup_data |clean up script |base.pl) can now delete old |(misc/cronjobs/cleanup_data |ILL requests. Use |base.pl) for deleting ILL |`--illrequests-status` |requests: |(repeatable) to choose | |which statuses to remove, |The two new parameters for |and `--illrequests-days` to |deleting ILL requests are: |set the age in days |--illrequests-status* |(default: 30). Requests |--illrequests-days |with the chosen statuses |(optional, defaults to 30 |that were last updated more |days) |than that many days ago are | |removed. At least one |* The ILL status codes are |`--illrequests-status` is |defined in the backends, |required. Without |with additional aliases |`--confirm` the script only |configured using the |reports how many requests |ILL_STATUS_ALIAS authorized |would be removed. |value category. The | |Standard backend status |Status codes are the ones |codes are listed in the |defined by the ILL backend. |manual |The Standard backend's |https://koha-community.org/ |statuses are listed in the |manual/latest/en/html/ILL_r |ILL requests section of the |equests.html#request-status |Koha manual. |es | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28740 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the|The database cleanup script |This enhancement adds release notes|(misc/cronjobs/cleanup_data |options to the database |base.pl) can now delete old |clean up script |ILL requests. Use |(misc/cronjobs/cleanup_data |`--illrequests-status` |base.pl) for deleting ILL |(repeatable) to choose |requests: |which statuses to remove, | |and `--illrequests-days` to |The two new parameters for |set the age in days |deleting ILL requests are: |(default: 30). Requests |--illrequests-status* |with the chosen statuses |--illrequests-days |that were last updated more |(optional, defaults to 30 |than that many days ago are |days) |removed. At least one | |`--illrequests-status` is |* The ILL status codes are |required. Without |defined in the backends, |`--confirm` the script only |with additional aliases |reports how many requests |configured using the |would be removed. |ILL_STATUS_ALIAS authorized | |value category. The |Status codes are the ones |Standard backend status |defined by the ILL backend. |codes are listed in the |The Standard backend's |manual |statuses are listed in the |https://koha-community.org/ |ILL requests section of the |manual/latest/en/html/ILL_r |Koha manual. |equests.html#request-status | |es -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28740 --- Comment #7 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Hello, On 18 November I ran a bulk update of the "Text to go in release notes" field on bugs in the 26.11 range, to fill in missing notes using a consistent template. A mistake in that run also overwrote the release note you had written on this bug. That was not intended, and I am sorry for the noise. I have restored your original text from the bug history, so the field is exactly as you wrote it. Nothing else on this bug was changed. Thank you for writing the note. Martin -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org