[Bug 21177] New: Use koha-conf.xml in misc/devel/update_dbix_class_files.pl
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21177 Bug ID: 21177 Summary: Use koha-conf.xml in misc/devel/update_dbix_class_files.pl Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: ASSIGNED Severity: enhancement Priority: P5 - low Component: Command-line Utilities Assignee: julian.maurice@biblibre.com Reporter: julian.maurice@biblibre.com QA Contact: testopia@bugs.koha-community.org CC: robin@catalyst.net.nz It is annoying to have to specify database connection parameters each time DBIx::Class files need to be updated. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21177 --- Comment #1 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 77574 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=77574&action=edit Bug 21177: Use koha-conf.xml in misc/devel/update_dbix_class_files.pl It is annoying to have to specify database connection parameters each time DBIx::Class files need to be updated. This patch adds a new option --koha-conf that takes an optional <path> which defaults to the value of KOHA_CONF environment variable, and use the database connection parameters found in that file. --db_* options override values from $KOHA_CONF Test plan: 1. Run the script with the same parameters as before the patch and see that it still works. Example: misc/devel/update_dbix_class_files.pl --db_name koha_dev \ --db_user koha --db_pass koha 2. Verify that KOHA_CONF is set and execute: misc/devel/update_dbix_class_files.pl --koha-conf Verify that Koha/Schema files were updated accordingly 3. Execute: misc/devel/update_dbix_class_files.pl --koha-conf \ /path/to/another/koha-conf.xml Verify that Koha/Schema files were updated accordingly -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21177 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21177 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |olli-antti.kivilahti@jns.fi --- Comment #2 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- *** Bug 18229 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21177 --- Comment #3 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Maybe we could even remove the need of the option (--koha-conf) and make it the default? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21177 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org, | |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21177 --- Comment #4 from Julian Maurice <julian.maurice@biblibre.com> --- (In reply to Jonathan Druart from comment #3)
Maybe we could even remove the need of the option (--koha-conf) and make it the default?
I think that making it the default can potentially break existing workflows. Imagine a script that always run the same command: update_dbix_class_files.pl --db_name $name --db_user $user --db_pass $pass but it also happens to have a $KOHA_CONF with host and port different than localhost/3306 This is probably an extremely rare scenario. I don't know if keeping backward compatibility is worth it in this case. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21177 --- Comment #5 from Tomás Cohen Arazi <tomascohen@gmail.com> --- I say do whatever you want, but don't break the kohadevbox use case :-D You should probably have aliases set for this instead. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21177 --- Comment #6 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Julian Maurice from comment #4)
(In reply to Jonathan Druart from comment #3)
Maybe we could even remove the need of the option (--koha-conf) and make it the default?
I think that making it the default can potentially break existing workflows.
What I meant was to use info from $ENV{KOHA_CONF} if called without options. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21177 --- Comment #7 from Julian Maurice <julian.maurice@biblibre.com> --- (In reply to Jonathan Druart from comment #6)
(In reply to Julian Maurice from comment #4)
(In reply to Jonathan Druart from comment #3)
Maybe we could even remove the need of the option (--koha-conf) and make it the default?
I think that making it the default can potentially break existing workflows.
What I meant was to use info from $ENV{KOHA_CONF} if called without options.
Ah so you mean use $KOHA_CONF *only* if no other options is specified ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21177 --- Comment #8 from M. Tompsett <mtompset@hotmail.com> --- Comment on attachment 77574 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=77574 Bug 21177: Use koha-conf.xml in misc/devel/update_dbix_class_files.pl Review of attachment 77574: --> (https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=21177&attachment=77574) ----------------------------------------------------------------- ::: misc/devel/update_dbix_class_files.pl @@ +61,5 @@
+ print STDERR "Error: KOHA_CONF is not defined\n"; + exit(1); + } + + $koha_conf ||= $ENV{KOHA_CONF};
I think comment #6 was about putting this kind of line above line 59, and then perhaps just check if ($koha_conf) in 59. This way $koha_conf can default to the environment variable if koha-conf isn't explicitly stated. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21177 Jonathan Druart <jonathan.druart@bugs.koha-community.org> 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=21177 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #77574|0 |1 is obsolete| | --- Comment #9 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 95849 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=95849&action=edit Bug 21177: Use koha-conf.xml in misc/devel/update_dbix_class_files.pl It is annoying to have to specify database connection parameters each time DBIx::Class files need to be updated. This patch adds a new option --koha-conf that takes an optional <path> which defaults to the value of KOHA_CONF environment variable, and use the database connection parameters found in that file. --db_* options override values from $KOHA_CONF Test plan: 1. Run the script with the same parameters as before the patch and see that it still works. Example: misc/devel/update_dbix_class_files.pl --db_name koha_dev \ --db_user koha --db_pass koha 2. Verify that KOHA_CONF is set and execute: misc/devel/update_dbix_class_files.pl --koha-conf Verify that Koha/Schema files were updated accordingly 3. Execute: misc/devel/update_dbix_class_files.pl --koha-conf \ /path/to/another/koha-conf.xml Verify that Koha/Schema files were updated accordingly 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=21177 --- Comment #10 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Julian Maurice from comment #7)
(In reply to Jonathan Druart from comment #6)
(In reply to Julian Maurice from comment #4)
(In reply to Jonathan Druart from comment #3)
Maybe we could even remove the need of the option (--koha-conf) and make it the default?
I think that making it the default can potentially break existing workflows.
What I meant was to use info from $ENV{KOHA_CONF} if called without options.
Ah so you mean use $KOHA_CONF *only* if no other options is specified ?
Yes. Not blocker. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21177 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA CC| |m.de.rooy@rijksmuseum.nl --- Comment #11 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- database, hostname and port are in koha-conf.xml too It is still "annoying" to enter db_name, hostname, port too. Could be extended to db_driver too. We should remove all parameters coming from koha-conf to be consistent. And when removing the mandatory from db_name, I guess we should add a confirm parameter like other misc scripts. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21177 --- Comment #12 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Marcel, I do not understand. If --koha-conf is passed, all those variables will be retrieved from the config file. Are you suggesting to pick the value from koha-conf by default then overwrite them by the parameters? That's more or less what I suggested in a previous comment. But 1 year after I prefer to let it go as it than to block it again. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21177 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off --- Comment #13 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Jonathan Druart from comment #12)
Marcel, I do not understand. If --koha-conf is passed, all those variables will be retrieved from the config file. Hmm. Overlooked that probably.
Are you suggesting to pick the value from koha-conf by default then overwrite them by the parameters? That's more or less what I suggested in a previous comment. But 1 year after I prefer to let it go as it than to block it again. Good idea. But ok.
Back to SO for now. Next week things will be better ;) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21177 --- Comment #14 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Marcel de Rooy from comment #13)
Back to SO for now. Next week things will be better ;)
Ping Marcel? :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21177 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch 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=21177 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #95849|0 |1 is obsolete| | --- Comment #15 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 98516 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=98516&action=edit Bug 21177: Use koha-conf.xml in misc/devel/update_dbix_class_files.pl It is annoying to have to specify database connection parameters each time DBIx::Class files need to be updated. This patch adds a new option --koha-conf that takes an optional <path> which defaults to the value of KOHA_CONF environment variable, and use the database connection parameters found in that file. --db_* options override values from $KOHA_CONF Test plan: 1. Run the script with the same parameters as before the patch and see that it still works. Example: misc/devel/update_dbix_class_files.pl --db_name koha_dev \ --db_user koha --db_pass koha 2. Verify that KOHA_CONF is set and execute: misc/devel/update_dbix_class_files.pl --koha-conf Verify that Koha/Schema files were updated accordingly 3. Execute: misc/devel/update_dbix_class_files.pl --koha-conf \ /path/to/another/koha-conf.xml Verify that Koha/Schema files were updated accordingly Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> 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=21177 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |m.de.rooy@rijksmuseum.nl |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21177 --- Comment #16 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Jonathan Druart from comment #14)
(In reply to Marcel de Rooy from comment #13)
Back to SO for now. Next week things will be better ;)
Ping Marcel? :)
A typical Koha week ;) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21177 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |20.05.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21177 --- Comment #17 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Nice work everyone! Pushed to master for 20.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21177 Joy Nelson <joy@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |RESOLVED CC| |joy@bywatersolutions.com Resolution|--- |FIXED --- Comment #18 from Joy Nelson <joy@bywatersolutions.com> --- enhancement not backported to 19.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21177 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com Summary|Use koha-conf.xml in |Add ability to run |misc/devel/update_dbix_clas |misc/devel/update_dbic_clas |s_files.pl |s_files.pl without passing | |parameters by default to | |koha-conf.xml -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21177 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Add ability to run |Add ability to run |misc/devel/update_dbic_clas |misc/devel/update_dbic_clas |s_files.pl without passing |s_files.pl without passing |parameters by default to |parameters by defaulting to |koha-conf.xml |koha-conf.xml -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org