https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37025

Katrin Fischer <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|Needs Signoff               |Failed QA

--- Comment #22 from Katrin Fischer <[email protected]> ---
Trying my best here to get this moving :)

1) QA checks - pass!

2) Code review

a) Spelling

Some slipped through, most are perfect:

+      <varlistentry>
+        <term><option>koha-api-keys</option></term>
+        <listitem>
+          <para>Create an api key for a given patron on a koha instance or
delete one based on its client id.</para>
+        </listitem>
+      </varlistentry>

API, Koha, ID :)

+# koha-api-keys: generate or delete api keys for a given patron and
+#   koha instance.

API

3) Testing

a) Usage

Having a koha- command that requires koha-shell at the same time seems a bit
unusual. A rule of thumb we use at work is that if a script starts with koha-
it should be run with sudo as root, if not use koha-shell of the instance. This
breaks the rule :)

When you run this script just with sudo, you get a nasty error message:

sudo koha-api-keys 
Can't locate Koha/Script.pm in @INC (you may need to install the Koha::Script
module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.36.0
/usr/local/share/perl/5.36.0 /usr/lib/x86_64-linux-gnu/perl5/5.36
/usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl-base
/usr/lib/x86_64-linux-gnu/perl/5.36 /usr/share/perl/5.36
/usr/local/lib/site_perl) at /usr/sbin/koha-api-keys line 24.
BEGIN failed--compilation aborted at /usr/sbin/koha-api-keys line 24.

Could we display a useful error instead hinting on the different usage?

b) Command not found (note for other testers)

sudo koha-shell -c "koha-api-keys --help" kohadev
/bin/bash: line 1: koha-api-keys: command not found

I have run koha_reset in hope it would copy some file into the right spot, but
that didn't do the trick here. 

The first test plan in comment#1 included copying files, but it's not part of
the current test plan. Still: it worked

cp debian/scripts/koha-api-keys /usr/sbin/
sudo koha-shell -c "koha-api-keys --help" kohadev

Help shows.

c) Create API key (quotes problem)

sudo koha-shell -c "koha-api-keys --generate --description 'Test key'
--borrowernumber 51" kohadev
Error: --generate requires --borrowernumber.

Strangely, this works:
sudo koha-shell -c "koha-api-keys --generate --description Test
--borrowernumber 51" kohadev

Problem appears to be the quotes. Fix the example in the test plan? Add a note
to the help?

c) Action log entries cannot be viewed in log viewer

This adds a new module to the action_logs table, but we have no way to display
these entries yet. So they don't show in the patron's modification log in the
staff interface.

Maybe for a follow-up bug?

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to