[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.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43551 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #206178|0 |1 is obsolete| | Attachment #206179|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=43551 --- Comment #3 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 208580 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=208580&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 #4 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 208581 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=208581&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 ---------------------------------------------------------------------------- Attachment #208580|0 |1 is obsolete| | Attachment #208581|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=43551 --- Comment #5 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 208594 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=208594&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 #6 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 208595 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=208595&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 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- 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=43551 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #208594|0 |1 is obsolete| | Attachment #208595|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=43551 --- Comment #7 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 209036 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209036&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> Signed-off-by: Juliet Heltibridle <jheltibridle@rcplib.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43551 --- Comment #8 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 209037 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209037&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. Signed-off-by: Juliet Heltibridle <jheltibridle@rcplib.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43551 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |andrew@bywatersolutions.com |y.org | CC| |andrew@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43551 Andrew Fuerste-Henry <andrew@bywatersolutions.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=43551 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #209036|0 |1 is obsolete| | Attachment #209037|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=43551 --- Comment #9 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 209228 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209228&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 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> Signed-off-by: Juliet Heltibridle <jheltibridle@rcplib.org> Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.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 #10 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 209229 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209229&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. Signed-off-by: Juliet Heltibridle <jheltibridle@rcplib.org> Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.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 #11 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- (In reply to Andrew Fuerste-Henry from comment #9)
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 and consistent
Updated this bit of the commit message to remove the reference to --man, since this script has no POD and therefore --man makes it print the source code -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43551 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main Version(s)| |26.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43551 --- Comment #12 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=43551 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |`misc/cronjobs/process_mess release notes| |age_queue.pl` uses the same | |option handling as the | |other converted cron | |scripts. `--help` describes | |every option, and invalid | |options exit with status 1. | |Options and defaults are | |unchanged, and `--code` and | |`--exclude-code` remain | |mutually exclusive. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43551 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com Status|Pushed to main |Needs documenting --- Comment #13 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.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org