[Bug 43551] New: Convert misc/cronjobs/process_message_queue.pl to the Getopt::Long::Descriptive convention (see bug 43546)
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43551 Bug ID: 43551 Summary: Convert misc/cronjobs/process_message_queue.pl to the Getopt::Long::Descriptive convention (see bug 43546) Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Command-line Utilities Assignee: koha-bugs@lists.koha-community.org Reporter: martin.renvoize@openfifth.co.uk QA Contact: testopia@bugs.koha-community.org CC: jake.deery@openfifth.co.uk, robin@catalyst.net.nz Depends on: 43546 Target Milestone: --- This is one of a set of bugs filed alongside bug 43546 (Standardize command-line scripts on Getopt::Long::Descriptive) to convert individual, commonly-used cron scripts to whatever declarative option-parsing convention that bug settles on. Depends on 43546. Current state: process_message_queue.pl uses plain Getopt::Long (GetOptions call around line 40). No option is required -- every option (--username, --password, --limit, --method, --type, --code, --where, --exit-on-plugin-failure) is genuinely optional, and the script runs correctly with none of them supplied. What this bug covers: convert the GetOptions call to the new convention purely for consistency and self-documenting --help output, matching bug 43546's convention. No behavior change is expected, since nothing here is actually a missing-required-option bug to fix. Test plan: - --help output covers all documented options and matches current behavior - Running with no options still behaves exactly as before Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43546 [Bug 43546] Standardize command-line scripts on Getopt::Long::Descriptive for safer, more consistent option handling -- 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=43551 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |martin.renvoize@openfifth.c |ity.org |o.uk -- 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=43551 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |40934 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40934 [Bug 40934] process_message_queue.pl add ability to exclude some letter code -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43551 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on|43546 |43557 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43546 [Bug 43546] Standardize command-line scripts on Getopt::Long::Descriptive for safer, more consistent option handling https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43557 [Bug 43557] Add declarative mutually-exclusive option support to Koha::Script->describe_options -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43551 --- Comment #1 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 206178 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206178&action=edit Bug 43551: Convert process_message_queue.pl to the Getopt::Long::Descriptive convention Standardises the command-line option parsing in misc/cronjobs/process_message_queue.pl on Koha::Script->describe_options (bug 43546), giving it a self-documenting --help/--man and consistent error handling, matching other converted cron scripts. No option was required before and none is required now, so this does not change how the script needs to be run. Test plan: 1. misc/cronjobs/process_message_queue.pl --help Check the description and all options are listed: username, password, type, code, exclude-code, limit, method, verbose, where, exit-on-plugin-failure. 2. Queue up a mix of pending notices (different letter codes and transport types), then run the script with no options and confirm they are all sent as before. 3. Re-run with --code, --exclude-code, --type, --limit, --where and --verbose, individually and combined, and confirm each still filters as documented. 4. Confirm --code and --exclude-code together are still rejected as mutually exclusive. 5. prove t/db_dependent/cronjobs/process_message_queue.pl.t 6. prove t/db_dependent/Letters.t 7. koha-qa.pl passes. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43551 --- Comment #2 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 206179 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206179&action=edit Bug 43551: Use the new Koha::Script exclusive option support for --code/--exclude-code Replace the one-off $usage->die() mutual-exclusivity check with the declarative exclusive key added to Koha::Script->describe_options on bug 43557, removing the last piece of hand-rolled option validation from this script. Test plan: 1. misc/cronjobs/process_message_queue.pl --code FOO --exclude-code BAR Still rejected as mutually exclusive, same message as before. 2. misc/cronjobs/process_message_queue.pl -c --exclude-code DUEDGST A bare -c is still not falsely rejected (bug 40934). 3. prove t/db_dependent/cronjobs/process_message_queue.pl.t 4. prove t/db_dependent/Letters.t 5. koha-qa.pl passes. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43551 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org