Bugzilla – Attachment 169741 Details for
Bug 37495
Add ability to use metadata to filter plugins to run for plugins_nightly.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37495: Add ability to use metadata to filter plugins to run for plugins_nightly.pl
Bug-37495-Add-ability-to-use-metadata-to-filter-pl.patch (text/plain), 2.34 KB, created by
Kyle M Hall
on 2024-07-26 14:54:26 UTC
(
hide
)
Description:
Bug 37495: Add ability to use metadata to filter plugins to run for plugins_nightly.pl
Filename:
MIME Type:
Creator:
Kyle M Hall
Created:
2024-07-26 14:54:26 UTC
Size:
2.34 KB
patch
obsolete
>From 4f616f1d3525c5fb78e49b719fdac4ad17e68439 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Fri, 26 Jul 2024 10:48:17 -0400 >Subject: [PATCH] Bug 37495: Add ability to use metadata to filter plugins to > run for plugins_nightly.pl > >It would be nice to be able to filter the plugins run by plugins >nightly for development and testing, and for added flexibility >as to when to run cronjob_nightly for different plugins if need be. > >Test Plan: >1) Apply this patch >2) Check the metadata for an installed plugin, copy the name or another > metadata value. >3) Run plugins_nightly.pl with a filter that does not match > e.g. plugins_nightly.pl -m name="No plugin has this name" >4) Note no plugins cronjob methods are run >5) Run plugins_nightly.pl with a filter that *does* match > e.g. plugins_nightly.pl -m name="Example Kitchen-Sink Plugin" >6) Not only the matching plugin runs! >7) Run plugins_nightly with no filter > e.g. plugins_nightly.pl >8) Note all plugins with nightly cronjobs are run! >--- > misc/cronjobs/plugins_nightly.pl | 15 +++++++++++++-- > 1 file changed, 13 insertions(+), 2 deletions(-) > >diff --git a/misc/cronjobs/plugins_nightly.pl b/misc/cronjobs/plugins_nightly.pl >index f30633ff074..7d5c5188791 100755 >--- a/misc/cronjobs/plugins_nightly.pl >+++ b/misc/cronjobs/plugins_nightly.pl >@@ -2,6 +2,7 @@ > > use Modern::Perl; > >+use Getopt::Long qw( GetOptions ); > use Try::Tiny qw( catch try ); > > use C4::Context; >@@ -13,11 +14,17 @@ use Koha::Script -cron; > my $command_line_options = join(" ",@ARGV); > cronlogaction({ info => $command_line_options }); > >+my $metadata; >+GetOptions( >+ 'm|metadata=s%' => \$metadata, >+); >+ > my $logger = Koha::Logger->get(); > if ( C4::Context->config("enable_plugins") ) { > my @plugins = Koha::Plugins->new->GetPlugins( > { >- method => 'cronjob_nightly', >+ method => 'cronjob_nightly', >+ metadata => $metadata, > } > ); > >@@ -44,7 +51,11 @@ plugins_nightly.pl - Run nightly tasks specified by plugins > > =head1 SYNOPSIS > >-plugins_nightly.pl >+plugins_nightly.pl [-m|--metadata key=value] >+ >+-m --metadata, repeatable, specify a metadata key and value to run only plugins >+ with nightly_cronjob methods and matching metadata. >+ e.g. plugins_nightly.pl -m name="My Awesome Plugin" > > =head1 AUTHOR > >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 37495
:
169741
|
169826