[Bug 13758] New: KOHAVERSION should be statically set
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13758 Bug ID: 13758 Summary: KOHAVERSION should be statically set Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: gmcharlt@gmail.com Reporter: tomascohen@gmail.com QA Contact: testopia@bugs.koha-community.org Currently, C4::Context::KOHAVERSION calculates the version number by running kohaversion.pl on a new Perl interpreter: sub KOHAVERSION { my $cgidir = C4::Context->intranetdir; # Apparently the GIT code does not run out of a CGI-BIN subdirectory # but distribution code does? (Stan, 1jan08) if(-d $cgidir . "/cgi-bin"){ my $cgidir .= "/cgi-bin"; } do $cgidir."/kohaversion.pl" || die "NO $cgidir/kohaversion.pl"; return kohaversion(); } There's no point on doing this, as it is a hardcoded value we write on each DB update. It adds several milliseconds of latency to each request as the version comparisson is done on each request to detect needed DB updates. It should be statically set as $VERSION is (hmpf) on C4::Context, and if for some reason we want to keep kohaversion.pl we should definitely read C4::Context::VERSION (or KOHAVERSION if we rename it). -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13758 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|gmcharlt@gmail.com |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13758 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@biblibre.co | |m -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13758 Fridolin SOMERS <fridolyn.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolyn.somers@biblibre.co | |m -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13758 --- Comment #1 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 36951 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=36951&action=edit Bug 13758: Move the Koha version from kohaversion.pl It will permit not to run another perl interpreter. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13758 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |In Discussion --- Comment #2 from Jonathan Druart <jonathan.druart@biblibre.com> --- I did not find any time saving using a new package to store the version. # Without the patch $ more t.pl use Modern::Perl; use C4::Context; say C4::Context->KOHAVERSION; $ time perl t.pl => 0.150s # With the patch $ more t.pl use Modern::Perl; use C4::Context; use Koha; say Koha::version; $ time perl t.pl => 0.150s To be fair I kept the use of C4::Context, if I remove it I get, of course, ~0.024s -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13758 --- Comment #3 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Jonathan Druart from comment #2)
I did not find any time saving using a new package to store the version.
# Without the patch $ more t.pl use Modern::Perl; use C4::Context; say C4::Context->KOHAVERSION;
$ time perl t.pl => 0.150s
# With the patch $ more t.pl use Modern::Perl; use C4::Context; use Koha; say Koha::version;
$ time perl t.pl => 0.150s
To be fair I kept the use of C4::Context, if I remove it I get, of course, ~0.024s
Could you try the opac home page using ntyprof? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13758 --- Comment #4 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Tomás Cohen Arazi from comment #3)
(In reply to Jonathan Druart from comment #2)
I did not find any time saving using a new package to store the version.
# Without the patch $ more t.pl use Modern::Perl; use C4::Context; say C4::Context->KOHAVERSION;
$ time perl t.pl => 0.150s
# With the patch $ more t.pl use Modern::Perl; use C4::Context; use Koha; say Koha::version;
$ time perl t.pl => 0.150s
To be fair I kept the use of C4::Context, if I remove it I get, of course, ~0.024s
Could you try the opac home page using ntyprof?
BTW, I would simplify getting the Koha version just for the sake of cleaning the code. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13758 --- Comment #5 from Jonathan Druart <jonathan.druart@biblibre.com> --- (In reply to Tomás Cohen Arazi from comment #3)
Could you try the opac home page using ntyprof?
I would not expect any difference. If the simple script I tested give the same execution time, it should be the same on the opac main page. (In reply to Tomás Cohen Arazi from comment #4)
BTW, I would simplify getting the Koha version just for the sake of cleaning the code.
Yep, that's a sufficient reason :) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13758 --- Comment #6 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 36962 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=36962&action=edit Bug 13758: Koha::Version introduced (counterpatch) This patch introduces a trivial package: Koha::Version. It only contains a constant: VERSION. It is set the current version number. The idea is that we stop relying on calling the kohaversion.pl script to get the current version number. The workfl Sponsored-by: Universidad Nacional de Cordoba -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13758 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #36962|0 |1 is obsolete| | --- Comment #7 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 36963 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=36963&action=edit Bug 13758: Koha::Version introduced (counterpatch) This patch introduces a trivial package: Koha::Version. It only contains a constant: VERSION. It is set the current version number. The idea is that we stop relying on calling the kohaversion.pl script to get the current version number. The workflow for RM/RMaints versioning their updates should be slightly changed, but overall is the same effort. To test: 1 - Run $ perl Makefile.PL (it doesn't matter which version, just continue till the end) => SUCCESS: The printed version, is the correct one (3.19.00.016). 2 - Tweak the Koha/Version.pm file, shifting the version number - Launch the opac interface => SUCCESS: The OPAC shows the maintenance page - Launch the intranet: => SUCCESS: You are offered the update Those are the most important use cases, because the rest just uses C4::Context->KOHAVERSION() to access the version number, which is proven to work by the use cases. Edit: The commit message got truncated at some point, probably because I recovered the version prior to completing the commit message after the power outage -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13758 --- Comment #8 from Jonathan Druart <jonathan.druart@biblibre.com> --- I prefer my version :) It cleans much more code, and Koha::version() (or $Koha::VERSION) make more sense that Koha::Version::VERSION. Besides, your patch introduces another way to know the Koha version, mine replaces the existing one. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13758 --- Comment #9 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 36988 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=36988&action=edit Bug 13758: Add POD -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13758 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #36963|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13758 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|In Discussion |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13758 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|tomascohen@gmail.com |jonathan.druart@biblibre.co | |m -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13758 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #36951|0 |1 is obsolete| | --- Comment #10 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 38661 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=38661&action=edit Bug 13758: Move the Koha version from kohaversion.pl It will permit not to run another perl interpreter. Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13758 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #38661|0 |1 is obsolete| | --- Comment #11 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 38662 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=38662&action=edit [SIGNED OFF] Bug 13758: Move the Koha version from kohaversion.pl It will permit not to run another perl interpreter. Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13758 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #36988|0 |1 is obsolete| | --- Comment #12 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 38663 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=38663&action=edit [SIGNED OFF] Bug 13758: Add POD Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13758 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch CC| |tomascohen@gmail.com Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13758 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13758 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #38662|0 |1 is obsolete| | Attachment #38663|0 |1 is obsolete| | --- Comment #13 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 38738 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=38738&action=edit [PASSED QA] Bug 13758: Move the Koha version from kohaversion.pl It will permit not to run another perl interpreter. Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13758 --- Comment #14 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 38739 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=38739&action=edit [PASSED QA] Bug 13758: Add POD Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13758 --- Comment #15 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 38952 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=38952&action=edit Bug 13758: (QA followup) Make Makefile.PL aware of Koha.pm Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13758 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #16 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Patches pushed to master. Thanks Jonathan! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13758 --- Comment #17 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 38958 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=38958&action=edit Bug 13758: (QA followup) revert case change that broke the tests Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13758 --- Comment #18 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 38971 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=38971&action=edit Bug 13758: Correct KOHA::VERSION in OverDrive.pm Correct $KOHA::VERSION to $Koha::VERSION. Also, passing this string to LWP::UserAgent is wrong. It expects key/value pairs. Since this string is apparently intended as an agent, this patch passes it as such. Note: The OverDrive has unfortunately no unit tests. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Tested this change in the perl debugger with just these lines: use C4::External::OverDrive; C4::External::OverDrive::_request(); Printed $ua->agent while stepping into sub _request. Without the agent change, the adjusted Koha string would just be ignored and I would still have "libwww-perl/6.04" as agent. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13758 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl Status|Pushed to Master |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13758 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13758 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13758 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13758 --- Comment #19 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Tomas: Please see the last QA follow-up. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13758 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mtompset@hotmail.com --- Comment #20 from M. Tompsett <mtompset@hotmail.com> --- (In reply to Tomás Cohen Arazi from comment #16)
Patches pushed to master.
Thanks Jonathan!
Uh... no it isn't? prove t/db_dependent/Context.t kaboom, because C4::Context::KOHAVERSION is not there yet. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13758 --- Comment #21 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to M. Tompsett from comment #20)
(In reply to Tomás Cohen Arazi from comment #16)
Patches pushed to master.
Thanks Jonathan!
Uh... no it isn't? prove t/db_dependent/Context.t kaboom, because C4::Context::KOHAVERSION is not there yet.
git fetch git reset--hard origin/master Maybe? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13758 --- Comment #22 from M. Tompsett <mtompset@hotmail.com> --- (In reply to Tomás Cohen Arazi from comment #21) [SNIP]
Maybe?
Remedied somehow. Confusion probably started with rebase of bug 5010. :) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13758 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #23 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Patch pushed to master. Thanks for the followup Marcel! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13758 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=9006 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13758 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Pushed to Master |RESOLVED -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13758 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |14427 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org