[Bug 18300] New: Delete missing upload records
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18300 Bug ID: 18300 Summary: Delete missing upload records Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: gmcharlt@gmail.com Reporter: m.de.rooy@rijksmuseum.nl QA Contact: testopia@bugs.koha-community.org On top of bug 17669 (deleting temporary files), we should be able to remove records too for missing upload files. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18300 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|gmcharlt@gmail.com |m.de.rooy@rijksmuseum.nl Status|NEW |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18300 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |17669 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669 [Bug 17669] Add purging temporary uploads to cleanup_database -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18300 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff 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=18300 --- Comment #1 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 61250 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=61250&action=edit Bug 18300: Delete missing upload records If you deleted files from the upload directories manually, or you rebooted with files in the temporary upload folder, or for some other reason have records without a file, you may want to cleanup your records in the uploaded_files table. This patch adds the method delete_missing to Koha::UploadedFiles. It also supports a keep_record parameter to do a dry run (count the missing files first). Also, we add an option --uploads-missing to cleanup_database. If you add the flag 1 after this option, you will delete missing files. If you add the flag 0 or only use the option, you will count missing files. A subtest is added to Upload.t for delete_missing tests. Test plan: [1] Run t/db_dependent/Upload.t [2] Upload a file and delete the file manually. [3] Run cleanup_database.pl --uploads-missing It should report at least one missing file now. Check that the record has not been deleted. [4] Run cleanup_database.pl --uploads-missing 1 It should report that it removed at least one file. Check that the record is gone. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18300 Mirko Tietgen <mirko@abunchofthings.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #61250|0 |1 is obsolete| | --- Comment #2 from Mirko Tietgen <mirko@abunchofthings.net> --- Created attachment 61470 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=61470&action=edit Bug 18300: Delete missing upload records If you deleted files from the upload directories manually, or you rebooted with files in the temporary upload folder, or for some other reason have records without a file, you may want to cleanup your records in the uploaded_files table. This patch adds the method delete_missing to Koha::UploadedFiles. It also supports a keep_record parameter to do a dry run (count the missing files first). Also, we add an option --uploads-missing to cleanup_database. If you add the flag 1 after this option, you will delete missing files. If you add the flag 0 or only use the option, you will count missing files. A subtest is added to Upload.t for delete_missing tests. Test plan: [1] Run t/db_dependent/Upload.t [2] Upload a file and delete the file manually. [3] Run cleanup_database.pl --uploads-missing It should report at least one missing file now. Check that the record has not been deleted. [4] Run cleanup_database.pl --uploads-missing 1 It should report that it removed at least one file. Check that the record is gone. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18300 Mirko Tietgen <mirko@abunchofthings.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mirko@abunchofthings.net Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18300 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #61470|0 |1 is obsolete| | --- Comment #3 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 61778 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=61778&action=edit Bug 18300: Delete missing upload records If you deleted files from the upload directories manually, or you rebooted with files in the temporary upload folder, or for some other reason have records without a file, you may want to cleanup your records in the uploaded_files table. This patch adds the method delete_missing to Koha::UploadedFiles. It also supports a keep_record parameter to do a dry run (count the missing files first). Also, we add an option --uploads-missing to cleanup_database. If you add the flag 1 after this option, you will delete missing files. If you add the flag 0 or only use the option, you will count missing files. A subtest is added to Upload.t for delete_missing tests. Test plan: [1] Run t/db_dependent/Upload.t [2] Upload a file and delete the file manually. [3] Run cleanup_database.pl --uploads-missing It should report at least one missing file now. Check that the record has not been deleted. [4] Run cleanup_database.pl --uploads-missing 1 It should report that it removed at least one file. Check that the record is gone. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18300 --- Comment #4 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Rebased on top of changes in report 17669 (cleanup_database.pl) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18300 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |BLOCKED --- Comment #5 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Temporarily blocked -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18300 --- Comment #6 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 61810 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=61810&action=edit Bug 18300: [QA Follow-up] Fix return value inconsistency As noted on bug report 17669, the return values of delete (both singular and plural), delete_missing and delete_temporary should be consistent. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18300 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #61778|0 |1 is obsolete| | --- Comment #7 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 61821 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=61821&action=edit Bug 18300: Delete missing upload records If you deleted files from the upload directories manually, or you rebooted with files in the temporary upload folder, or for some other reason have records without a file, you may want to cleanup your records in the uploaded_files table. This patch adds the method delete_missing to Koha::UploadedFiles. It also supports a keep_record parameter to do a dry run (count the missing files first). Also, we add an option --uploads-missing to cleanup_database. If you add the flag 1 after this option, you will delete missing files. If you add the flag 0 or only use the option, you will count missing files. A subtest is added to Upload.t for delete_missing tests. Test plan: [1] Run t/db_dependent/Upload.t [2] Upload a file and delete the file manually. [3] Run cleanup_database.pl --uploads-missing It should report at least one missing file now. Check that the record has not been deleted. [4] Run cleanup_database.pl --uploads-missing 1 It should report that it removed at least one file. Check that the record is gone. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18300 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #61810|0 |1 is obsolete| | --- Comment #8 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 61822 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=61822&action=edit Bug 18300: [QA Follow-up] Fix return value inconsistency As noted on bug report 17669, the return values of delete (both singular and plural), delete_missing and delete_temporary should be consistent. Removed the if-construction around full_path. We do not need it; in the very exceptional case that full_path would be empty, we should delete the record since the file is missing. Adjusted POD and unit tests accordingly. Test plan: Run t/db_dependent/Upload.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18300 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|BLOCKED |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18300 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18300 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #61821|0 |1 is obsolete| | Attachment #61822|0 |1 is obsolete| | --- Comment #9 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 62496 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=62496&action=edit Bug 18300: Delete missing upload records If you deleted files from the upload directories manually, or you rebooted with files in the temporary upload folder, or for some other reason have records without a file, you may want to cleanup your records in the uploaded_files table. This patch adds the method delete_missing to Koha::UploadedFiles. It also supports a keep_record parameter to do a dry run (count the missing files first). Also, we add an option --uploads-missing to cleanup_database. If you add the flag 1 after this option, you will delete missing files. If you add the flag 0 or only use the option, you will count missing files. A subtest is added to Upload.t for delete_missing tests. Test plan: [1] Run t/db_dependent/Upload.t [2] Upload a file and delete the file manually. [3] Run cleanup_database.pl --uploads-missing It should report at least one missing file now. Check that the record has not been deleted. [4] Run cleanup_database.pl --uploads-missing 1 It should report that it removed at least one file. Check that the record is gone. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18300 --- Comment #10 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 62497 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=62497&action=edit Bug 18300: [QA Follow-up] Fix return value inconsistency As noted on bug report 17669, the return values of delete (both singular and plural), delete_missing and delete_temporary should be consistent. Removed the if-construction around full_path. We do not need it; in the very exceptional case that full_path would be empty, we should delete the record since the file is missing. Adjusted POD and unit tests accordingly. Test plan: Run t/db_dependent/Upload.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18300 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com Status|Passed QA |Pushed to Master --- Comment #11 from Kyle M Hall <kyle@bywatersolutions.com> --- Pushed to master for 17.05, thanks Marcel! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18300 Bug 18300 depends on bug 17669, which changed state. Bug 17669 Summary: Add purging temporary uploads to cleanup_database https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18300 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED CC| |katrin.fischer@bsz-bw.de Status|Pushed to Master |RESOLVED --- Comment #12 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- This depends on bug 17669 which is not in 16.11.x. This won't get ported back to 16.11.x as it is an enhancement. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org