[koha-commits] main Koha release repository branch master updated. v17.11.00-121-g233b83c
Git repo owner
gitmaster at git.koha-community.org
Mon Dec 11 21:53:34 CET 2017
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "main Koha release repository".
The branch, master has been updated
via 233b83ca5d6632e6d84f82e9fe50306b30212f49 (commit)
via ec9f74791364906dea243a67a661645ae02d4567 (commit)
via f1163dba9d70bfd463c0abe2f70528c66d12d7e7 (commit)
via 86706c3b349e77bd2e67ced763dabec3b74c5b72 (commit)
via 9f5b10126d3d2a2522277b64dd7a1996ca82181d (commit)
via dda7b2ce4d8e7a7460740fb9e01257e9150bb608 (commit)
via 7805ef2c01bf8a566daeb805b3c2f8943dafc80d (commit)
via 8430a541af9302ae6cef247253000c1469ae2f33 (commit)
via 254883608912456bc15f57cf282099b8641faf54 (commit)
via 5a31321676e8bfd02d3a7c1888b89a7fc01166f4 (commit)
via 2485afc57cb26ce331be60f413a519644ce29796 (commit)
via 4b07ae3f41df33c73cfe2f5989b4a50be6efce3d (commit)
via 296442d2d5d8d506ae299b136ddbd834f5123880 (commit)
via 96f442badd65f672ddc2ba425e851e11a42112ad (commit)
via 54880b1a4ef8a656d270182d368d4254bc811042 (commit)
via a7d333f3cde9b6fe7cdd0f816b9c357e741ce8e9 (commit)
via 5fd7834394fb0d4996bbd93e206c2337d922333f (commit)
via 538536da73681719a1c2d7349a6d729bad7f39f4 (commit)
via 83ca8fb600e598995b3547912092ec6df2dd3cac (commit)
via d9046b76843b426d7a62a687f4fa62d6a222bc05 (commit)
via cea8b9c7c5465a66cd2510117e88468259bc3983 (commit)
via 656efc09dc55d639258741e3b0bcfc8e38dd7dcb (commit)
from 03dd8267575559caadcc892a488ed74cd7c35e2b (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 233b83ca5d6632e6d84f82e9fe50306b30212f49
Author: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
Date: Mon Dec 11 17:12:05 2017 -0300
Bug 19410: (follow-up) Move build_query_params_from_api into a helper
Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
commit ec9f74791364906dea243a67a661645ae02d4567
Author: Tomas Cohen Arazi <tomascohen at theke.io>
Date: Tue Dec 5 15:40:56 2017 -0300
Bug 19410: (follow-up) Add reserved params definitions
This patch re-adds some parameters I left out during some rebasing tasks
and ended up on a separate patchset (bug 18731).
The introduced parameters definitions are only used on endpoint definitions
that implement (at least) pagination. No need to test them here but easier
adding them here than on a patch implementing a new enpoint, which would become
a dependency for other endpoints.
Signed-off-by: Tomas Cohen Arazi <tomascohen at theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
commit f1163dba9d70bfd463c0abe2f70528c66d12d7e7
Author: Tomas Cohen Arazi <tomascohen at theke.io>
Date: Tue Nov 21 16:12:08 2017 -0300
Bug 19410: Move build_query_params_from_api into a helper
This patch creates the 'build_query_params' helper, instead of the
original function in Koha::Objects.
Unit tests are removed for Koha::Objects::_build_query_params_from_api and
written for the helper plugin.
The objects.search helper gets a call to build_query_params added. Tests for it
updated to match this behaviour change.
To test:
- Apply this patches
- Run:
$ kshell
k$ prove t/Koha/REST/Plugin/Query.t \
t/db_dependent/Koha/Objects.t \
t/db_dependent/Koha/REST/Plugin/Objects.t
=> SUCCESS: Tests pass!
- Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen at theke.io>
Signed-off-by: Julian Maurice <julian.maurice at biblibre.com>
Signed-off-by: Lari Taskula <lari.taskula at jns.fi>
Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
commit 86706c3b349e77bd2e67ced763dabec3b74c5b72
Author: Julian Maurice <julian.maurice at biblibre.com>
Date: Tue Nov 21 14:36:49 2017 +0000
Bug 19410: Move search_for_api into a Mojo helper
Signed-off-by: Tomas Cohen Arazi <tomascohen at theke.io>
Signed-off-by: Julian Maurice <julian.maurice at biblibre.com>
Signed-off-by: Lari Taskula <lari.taskula at jns.fi>
Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
commit 9f5b10126d3d2a2522277b64dd7a1996ca82181d
Author: Lari Taskula <lari.taskula at jns.fi>
Date: Sat Oct 7 12:55:56 2017 +0000
Bug 19410: (follow-up) Fix typo in POD
Signed-off-by: Tomas Cohen Arazi <tomascohen at theke.io>
Signed-off-by: Julian Maurice <julian.maurice at biblibre.com>
Signed-off-by: Lari Taskula <lari.taskula at jns.fi>
Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
commit dda7b2ce4d8e7a7460740fb9e01257e9150bb608
Author: Tomas Cohen Arazi <tomascohen at theke.io>
Date: Fri Oct 6 12:49:27 2017 -0300
Bug 19410: Unit tests
Signed-off-by: Tomas Cohen Arazi <tomascohen at theke.io>
Signed-off-by: Julian Maurice <julian.maurice at biblibre.com>
Signed-off-by: Lari Taskula <lari.taskula at jns.fi>
Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
commit 7805ef2c01bf8a566daeb805b3c2f8943dafc80d
Author: Tomas Cohen Arazi <tomascohen at theke.io>
Date: Wed Oct 4 15:41:35 2017 -0300
Bug 19410: Add Koha::Objects->search_for_api
Following the discussion about the best way to make things simpler for
developing the REST api, I quote Lari's email:
"As many other endpoint will have the exact same usage, by looking at your example, I would prefer to avoid writing parameter / pagination / sorting / header handling for each list operation in our API controllers. Do you think it's possible to centralize all of this e.g. by passing $c into a customized search sub? Perhaps in Koha::Objects?
so instead we could have something like (ignore my bad choice of naming)...:
sub list_vendors {
my $c = shift->openapi->valid_input or return;
my $args = $c->validation->output;
my $vendors;
return try {
$vendors = Koha::Acquisition::Booksellers->api_list_search($c);
return $c->render(status => 200, openapi => $vendors);
} catch {
...
}
}"
We all agreed we neeed something like that. Here's a possible implementation. I take
advantage of the previously written Mojo helpers, that are fully covered by tests.
I submit this early so anyone can take a look and gather ideas to make it even better.
I'm already using it (effectively) for the /acquisitions/orders endpoint I'm writing
on bug 18731.
Thanks!
Signed-off-by: Tomas Cohen Arazi <tomascohen at theke.io>
Signed-off-by: Julian Maurice <julian.maurice at biblibre.com>
Signed-off-by: Lari Taskula <lari.taskula at jns.fi>
Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
commit 8430a541af9302ae6cef247253000c1469ae2f33
Author: Tomas Cohen Arazi <tomascohen at theke.io>
Date: Thu Nov 23 10:45:59 2017 -0300
Bug 19370: (QA follow-up) Use OpenAPI's handling of pipe separated values
This patch makes the helper handling _order_by params expect a list of
values instead of a (to-be-splitted) string.
The idea is that the OpenAPI plugin will take care of splitting
pipe-delimited values if the spec is correctly defined.
Note: In the process I noticed + on the URL represents a space, so the
helper function is updated to handle both + and %2B as ascending.
To test:
- Run:
$ kshell
k$ prove t/Koha/REST/Plugin/Query.t
=> SUCCESS: Tests pass!
- Sign off :-D
Edit: Removed rebasing leftover making the tests fail.
Signed-off-by: Tomas Cohen Arazi <tomascohen at theke.io>
Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
commit 254883608912456bc15f57cf282099b8641faf54
Author: Tomas Cohen Arazi <tomascohen at theke.io>
Date: Tue Oct 3 17:03:54 2017 -0300
Bug 19370: Remove undefined variable warning
Signed-off-by: Tomas Cohen Arazi <tomascohen at theke.io>
Signed-off-by: Lari Taskula <lari.taskula at jns.fi>
Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
commit 5a31321676e8bfd02d3a7c1888b89a7fc01166f4
Author: Tomas Cohen Arazi <tomascohen at theke.io>
Date: Tue Sep 26 15:17:43 2017 -0300
Bug 19370: Add helper function for order_by attribute generation
This patch introduces a helper function called 'dbic_merge_sorting'
to Koha::REST::Plugin::Query.
This simple function adds SQL::Abstract order_by attribute to the passed
$filter hashref, as explained in the POD.
It introduces a syntax for passing sorting params on the request to the REST api.
The proposed syntax has been found in the wild, and is pretty trivial to parse/work with:
GET /api/v1/<endpoint>?order_by=+column_1|-column_2|column_3
As explained on the POD, + stands for 'asc' and - for 'desc'. If ommited, it defaults to the
DB engine default (usually asc).
To test:
- Apply this patches
- Run:
$ sudo koha-shell kohadev
k$ cd kohaclone
k$ prove t/Koha/REST/Plugin/Query.t
=> SUCCESS: Tests pass! And they make sense! :-P
- Sign off :-D
Edit: renamed params to match DBIC terminology. My bad :-D (tcohen)
Sponsored-by: Camden County
Signed-off-by: Lari Taskula <lari.taskula at jns.fi>
Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
commit 2485afc57cb26ce331be60f413a519644ce29796
Author: Tomas Cohen Arazi <tomascohen at theke.io>
Date: Tue Sep 26 15:17:01 2017 -0300
Bug 19370: Unit tests
Signed-off-by: Lari Taskula <lari.taskula at jns.fi>
Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
commit 4b07ae3f41df33c73cfe2f5989b4a50be6efce3d
Author: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
Date: Mon Dec 11 17:30:49 2017 -0300
Bug 19278: DBRev 17.12.00.004
Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
commit 296442d2d5d8d506ae299b136ddbd834f5123880
Author: Tomas Cohen Arazi <tomascohen at theke.io>
Date: Fri Sep 22 19:15:43 2017 -0300
Bug 19278: Mention RESTdefaultPageSize in POD
This patch adds information about RESTdefaultPageSize usage
when the per_page parameter is absent on the query.
Signed-off-by: Lari Taskula <lari.taskula at jns.fi>
Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
commit 96f442badd65f672ddc2ba425e851e11a42112ad
Author: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
Date: Mon Dec 11 17:42:15 2017 -0300
Bug 19278: (follow-up) Make the pagination plugin use RESTdefaultPageSize
Use 20 as default for RESTdefaultPageSize (just in case)
Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
commit 54880b1a4ef8a656d270182d368d4254bc811042
Author: Tomas Cohen Arazi <tomascohen at theke.io>
Date: Fri Sep 8 12:20:20 2017 -0300
Bug 19278: Make the pagination plugin use RESTdefaultPageSize
This bug introduces a new syspref RESTdefaultPageSize that is used on
the Koha::REST::Plugin::Pagination plugin to default to a valid value
for the page size if the param is not present on the query.
This patch also considers the situation in which no 'page' param is
passed, and no header should be added.
To test:
- Run:
$ sudo koha-shell kohadev
k$ cd kohaclone
k$ prove t/Koha/REST/Plugin/Pagination.t
=> FAIL: Tests fail because the plugin doesn't behave as the tests
expect.
- Apply this patch
- Run:
k$ prove t/Koha/REST/Plugin/Pagination.t
=> SUCCESS: Tests pass!
- Sign off :-D
Sponsored-by: Camden County
Sponsored-by: ByWater Solutions
Signed-off-by: Lari Taskula <lari.taskula at jns.fi>
Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
commit a7d333f3cde9b6fe7cdd0f816b9c357e741ce8e9
Author: Tomas Cohen Arazi <tomascohen at theke.io>
Date: Fri Sep 8 12:18:35 2017 -0300
Bug 19278: Unit tests
This patch introduces tests for a behaviour change in
Koha::REST::Plugin::Pagination.
To test:
- Run:
$ sudo koha-shell kohadev
k$ cd kohaclone
k$ prove t/Koha/REST/Plugin/Pagination.t
=> FAIL: Tests should fail without the followup patch applied
Sponsored-by: Camden County
Sponsored-by: Bywater Solutions
Signed-off-by: Lari Taskula <lari.taskula at jns.fi>
Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
commit 5fd7834394fb0d4996bbd93e206c2337d922333f
Author: Tomas Cohen Arazi <tomascohen at theke.io>
Date: Fri Sep 8 12:18:21 2017 -0300
Bug 19278: Add RESTdefaultPageSize syspref
Signed-off-by: Lari Taskula <lari.taskula at jns.fi>
Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
commit 538536da73681719a1c2d7349a6d729bad7f39f4
Author: Tomas Cohen Arazi <tomascohen at theke.io>
Date: Tue Sep 26 15:12:19 2017 -0300
Bug 19369: Add helper function for pagination attributes generation
This patch introduces a new helper function to the Koha::REST::Plugin::Pagination
plugin, called 'dbic_merge_pagination'.
This simple function adds SQL::Abstract pagination attributes ('page' and 'rows') to the
passed $filter hashref.
To test:
- Apply this patches
- Run:
$ koha-shell kohadev
k$ cd kohaclone
k$ prove t/Koha/REST/Plugin/Pagination.t
=> SUCCESS: Tests pass!
- Sign off :-D
Sponsored-by: Camden County
Signed-off-by: Lari Taskula <lari.taskula at jns.fi>
Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
commit 83ca8fb600e598995b3547912092ec6df2dd3cac
Author: Tomas Cohen Arazi <tomascohen at theke.io>
Date: Tue Sep 26 15:11:38 2017 -0300
Bug 19369: Unit tests
Signed-off-by: Lari Taskula <lari.taskula at jns.fi>
Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
commit d9046b76843b426d7a62a687f4fa62d6a222bc05
Author: Tomas Cohen Arazi <tomascohen at theke.io>
Date: Fri Sep 1 12:01:08 2017 -0300
Bug 19234: (follow-up) Make Query plugin available to endpoints
Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>
Signed-off-by: Lari Taskula <lari.taskula at jns.fi>
Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
commit cea8b9c7c5465a66cd2510117e88468259bc3983
Author: Tomas Cohen Arazi <tomascohen at theke.io>
Date: Fri Sep 1 11:53:35 2017 -0300
Bug 19234: Add query parameters handling helpers
This patch introduces a Mojolicious plugin to be used on the REST api.
It adds a helper method:
generate_dbic_query
===================
When used, it generates what's needed to perform a search on
DBIC/Koha::Objects like this:
my $params = $c->validation->output;
my ($filtered_params, $reserved_params) = $c->extract_reserved_params($params);
my $filter = do_smth($filtered_params, $reserved_params);
my $attributes = do_smth_reserved($reserved_params);
my $patrons = Koha::Patrons->search( $filter, $attributes );
It introduces reserved param names:
- _match
- _order_by
- _page
- _per_page
They are reserved for later usage (pagination, matching algorithm on building DB queries)
All the plugin's behaviour is tested.
To test:
- Run:
$ sudo koha-shell kohadev
k$ cd kohaclone
k$ prove t/Koha/REST/Plugin/Query.t
=> SUCCESS: Tests pass!
- Sign off :-D
Sponsored-by: ByWater solutions
Sponsored-by: Camden County
Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen at theke.io>
Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>
Signed-off-by: Lari Taskula <lari.taskula at jns.fi>
Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
commit 656efc09dc55d639258741e3b0bcfc8e38dd7dcb
Author: Tomas Cohen Arazi <tomascohen at theke.io>
Date: Fri Sep 1 11:52:29 2017 -0300
Bug 19234: Unit tests for query parameters handling helpers
This patch adds unit tests for the new query parameters handling Mojo plugin.
Sponsored-by: Camden County
Sponsored-by: ByWater Solutions
Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen at theke.io>
Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>
Signed-off-by: Lari Taskula <lari.taskula at jns.fi>
Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
-----------------------------------------------------------------------
Summary of changes:
Koha.pm | 2 +-
Koha/REST/Plugin/Objects.pm | 86 +++++++++
Koha/REST/Plugin/Pagination.pm | 34 +++-
Koha/REST/Plugin/Query.pm | 187 ++++++++++++++++++++
Koha/REST/V1.pm | 2 +
api/v1/swagger/parameters.json | 40 ++++-
installer/data/mysql/sysprefs.sql | 1 +
installer/data/mysql/updatedatabase.pl | 12 ++
.../en/modules/admin/preferences/web_services.pref | 6 +
t/Koha/REST/Plugin/Pagination.t | 63 ++++++-
t/Koha/REST/Plugin/Query.t | 185 +++++++++++++++++++
t/db_dependent/Koha/Objects.t | 3 +-
t/db_dependent/Koha/REST/Plugin/Objects.t | 125 +++++++++++++
13 files changed, 740 insertions(+), 6 deletions(-)
create mode 100644 Koha/REST/Plugin/Objects.pm
create mode 100644 Koha/REST/Plugin/Query.pm
create mode 100644 t/Koha/REST/Plugin/Query.t
create mode 100644 t/db_dependent/Koha/REST/Plugin/Objects.t
hooks/post-receive
--
main Koha release repository
More information about the koha-commits
mailing list