Bug 31203 adding logging of the start and end of a run to cronjobs. When running the plugins_nightly.pl cronjob, we should record the plugins that have a nightly method, logging the start and end of each plugins routine
Created attachment 159560 [details] [review] Bug 35479: Log start, end, and any failures for each plugin's nightly cronjob When running the plugins_nightly.pl cronjob, we should record the plugins that have a nightly method, logging the start and end of each plugins routine Test Plan: 1) Enable CronjobLog 2) Install a plugin with a nightly cronjob ( e.g. https://github.com/bywatersolutions/koha-plugin-book-list-printer ) 3) Run plugins_nightly.pl 4) Note new entries in the cronjob viewer for the start and end of the plugin's nightly cronjob run 5) Edit the plugin, add a line like "die 'this is a test';" to the plugin's nightly cronjob 6) Run plugins_nightly.pl 7) View the action logs, not the log for the error you added!
Created attachment 159581 [details] [review] Bug 35479: (follow-up) Match formatting for other cronjob logs To test: 1 - Install the Kitchen Sink plugin 2 - Restart all 3 - Enable 'CronjobLog' system preference 4 - perl misc/cronjobs/plugins_nightly.pl 5 - Note you see on the command line 'Remember to clean the kitchen' - this indicates the plugin cron ran 6 - Tools->log viewer, select 'cronjob' and view 7 - Note you only see 'plugins_nightly.pl' Run and End lines 8 - Apply patches 9 - perl misc/cronjobs/plugins_nightly.pl 10 - View logs agian 11 - Note you now see Run and End lines for 'Koha::Plugin::Com::ByWaterSolutions::KitchenSink' 12 - Confirm they look like the other lines 13 - Edit KitchenSink.pm and add 'die "Kittens";' to the cronjob nightly 14 - perl misc/cronjobs/plugins_nightly.pl 15 - View logs, confirm there is a FAILED error message for the KitchenSink cron
Created attachment 159958 [details] [review] Bug 35479: Log start, end, and any failures for each plugin's nightly cronjob When running the plugins_nightly.pl cronjob, we should record the plugins that have a nightly method, logging the start and end of each plugins routine Test Plan: 1) Enable CronjobLog 2) Install a plugin with a nightly cronjob ( e.g. https://github.com/bywatersolutions/koha-plugin-book-list-printer ) 3) Run plugins_nightly.pl 4) Note new entries in the cronjob viewer for the start and end of the plugin's nightly cronjob run 5) Edit the plugin, add a line like "die 'this is a test';" to the plugin's nightly cronjob 6) Run plugins_nightly.pl 7) View the action logs, not the log for the error you added! Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Created attachment 159959 [details] [review] Bug 35479: (follow-up) Match formatting for other cronjob logs To test: 1 - Install the Kitchen Sink plugin 2 - Restart all 3 - Enable 'CronjobLog' system preference 4 - perl misc/cronjobs/plugins_nightly.pl 5 - Note you see on the command line 'Remember to clean the kitchen' - this indicates the plugin cron ran 6 - Tools->log viewer, select 'cronjob' and view 7 - Note you only see 'plugins_nightly.pl' Run and End lines 8 - Apply patches 9 - perl misc/cronjobs/plugins_nightly.pl 10 - View logs agian 11 - Note you now see Run and End lines for 'Koha::Plugin::Com::ByWaterSolutions::KitchenSink' 12 - Confirm they look like the other lines 13 - Edit KitchenSink.pm and add 'die "Kittens";' to the cronjob nightly 14 - perl misc/cronjobs/plugins_nightly.pl 15 - View logs, confirm there is a FAILED error message for the KitchenSink cron Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Created attachment 159960 [details] [review] Bug 35479: (QA follow-up): Tidy Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Created attachment 159966 [details] [review] Bug 35479: Log start, end, and any failures for each plugin's nightly cronjob When running the plugins_nightly.pl cronjob, we should record the plugins that have a nightly method, logging the start and end of each plugins routine Test Plan: 1) Enable CronjobLog 2) Install a plugin with a nightly cronjob ( e.g. https://github.com/bywatersolutions/koha-plugin-book-list-printer ) 3) Run plugins_nightly.pl 4) Note new entries in the cronjob viewer for the start and end of the plugin's nightly cronjob run 5) Edit the plugin, add a line like "die 'this is a test';" to the plugin's nightly cronjob 6) Run plugins_nightly.pl 7) View the action logs, not the log for the error you added! Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 159967 [details] [review] Bug 35479: (follow-up) Match formatting for other cronjob logs To test: 1 - Install the Kitchen Sink plugin 2 - Restart all 3 - Enable 'CronjobLog' system preference 4 - perl misc/cronjobs/plugins_nightly.pl 5 - Note you see on the command line 'Remember to clean the kitchen' - this indicates the plugin cron ran 6 - Tools->log viewer, select 'cronjob' and view 7 - Note you only see 'plugins_nightly.pl' Run and End lines 8 - Apply patches 9 - perl misc/cronjobs/plugins_nightly.pl 10 - View logs agian 11 - Note you now see Run and End lines for 'Koha::Plugin::Com::ByWaterSolutions::KitchenSink' 12 - Confirm they look like the other lines 13 - Edit KitchenSink.pm and add 'die "Kittens";' to the cronjob nightly 14 - perl misc/cronjobs/plugins_nightly.pl 15 - View logs, confirm there is a FAILED error message for the KitchenSink cron Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 159968 [details] [review] Bug 35479: (QA follow-up): Tidy Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Looks good. Didn't test the failure use case, but it makes sense. QA checks happy.
Pushed for 24.05! Well done everyone, thank you!
Small enhancement, I backport Pushed to 23.11.x for 23.11.03