[Bug 18229] New: update_dbix_class_files.pl loads defaults from ~/.my.cnf
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18229 Bug ID: 18229 Summary: update_dbix_class_files.pl loads defaults from ~/.my.cnf Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Command-line Utilities Assignee: gmcharlt@gmail.com Reporter: olli-antti.kivilahti@jns.fi QA Contact: testopia@bugs.koha-community.org CC: robin@catalyst.net.nz I am so frustrated having to write those elongated --db_name, --db* parameters. This patch automatically loads defaults from your ~/.my.cnf so you don't have to copypaste stuff or write ad-hoc bash scripts. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18229 --- Comment #1 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 60918 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=60918&action=edit Bug 18229 - update_dbix_class_files.pl loads defaults from ~/.my.cnf A) Put this to your ~/.my.cnf [client] host = 10.0.3.10 port = 3306 user = koha_ci password = "Mr. senior plays with his junior" database = koha_ci B) Then run update_dbix_class_files.pl perl misc/devel/update_dbix_class_files.pl --tablename issuingrules C) Update DBIx::Class files like a boss -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18229 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |18000 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18000 [Bug 18000] Add --tablename option to misc/devel/update_dbix_class_files.pl script -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18229 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=14967 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18229 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> 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=18229 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #2 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- See: commit e0b0ae20531736ede2cd1113baf16323cb69b3d9 bug 8798: (follow-up) pass DB connection params to DBIC schema updater explicitly This patch changes update_dbix_class_files.pl so that the connection parameters to the reference database must be passed explicitly via command-line switches, rather than grabbing them from the current Koha context. The purpose of this is to intentionally put up a roadblock to reduce the chance that a developer (or release manager) accidentally updates the schema files to include local testing cruft such as temporary tables. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18229 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |RESOLVED Resolution|--- |WORKSFORME --- Comment #3 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- If you feel like that. I don't mind forking this feature. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18229 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|WORKSFORME |--- Status|RESOLVED |REOPENED --- Comment #4 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Actually I already wrote such a patch, but when I say Galen's patch I did not submit mine. I think this could be re-discussed. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18229 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |In Discussion CC| |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=18229 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |julian.maurice@biblibre.com --- Comment #5 from Julian Maurice <julian.maurice@biblibre.com> --- (In reply to Jonathan Druart from comment #4)
Actually I already wrote such a patch, but when I say Galen's patch I did not submit mine.
I think this could be re-discussed.
Hmm.. I also wrote a similar patch (in bug 21177). We are at least 3 developers annoyed enough to have written a patch to change that. I think the reasoning behind this "roadblock" is not valid. Developers are lazy by definition, and if they are annoyed or frustrated by this they will quickly write a custom script to read $KOHA_CONF (or my.cnf) and call update_dbix_class_files.pl with the correct parameters (like this one: https://gitlab.com/snippets/1753594) Anyway the real danger is for people that push these modifications (RM and RMaint), and I think they know what they're doing. Now, about this particular bug, I think reading .my.cnf will not be useful for everyone. I, for instance, have several instances of Koha on the same host, and .my.cnf references my primary koha database. So if I'm working on another instance and forget to set --db_name, the script will update my local schema based on another database. So reading $KOHA_CONF would be better in my case. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18229 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |DUPLICATE Status|In Discussion |RESOLVED --- Comment #6 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- I think it makes more sense to read koha-conf.xml, marking as a duplicate of bug 21177. Feel free to reopen if you disagree. *** This bug has been marked as a duplicate of bug 21177 *** -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org