Summary: | GET /patrons missing q parameters on the spec | ||
---|---|---|---|
Product: | Koha | Reporter: | Tomás Cohen Arazi (tcohen) <tomascohen> |
Component: | REST API | Assignee: | Tomás Cohen Arazi (tcohen) <tomascohen> |
Status: | CLOSED FIXED | QA Contact: | Nick Clemens (kidclamp) <nick> |
Severity: | normal | ||
Priority: | P5 - low | CC: | fridolin.somers, jonathan.druart, joonas.kylmala, kyle, martin.renvoize, victor |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
21.11.00,21.05.02
|
|
Circulation function: | |||
Bug Depends on: | |||
Bug Blocks: | 28613 | ||
Attachments: |
Bug 28480: Add q parameters for GET /patrons
Bug 28480: Add q parameters for GET /patrons Bug 28480: Add q parameters for GET /patrons Bug 28482: (QA follow-up) Add unit test Bug 28613: Add missing parameters to objects.search-based routes Bug 28480: (QA follow-up) Add unit test |
Description
Tomás Cohen Arazi (tcohen)
2021-05-28 11:33:00 UTC
Created attachment 121475 [details] [review] Bug 28480: Add q parameters for GET /patrons This patch adds the q query parameters to the route. To test: 1. Try the route with the following query parameter: q={"patron_id":2} i.e. GET /api/v1/patrons?q={"patron_id":2} => FAIL: You get a bad request respose 2. Apply this patch 3. Restart all 4. Repeat 1 => SUCCESS: You get the patron 5. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Created attachment 121503 [details] [review] Bug 28480: Add q parameters for GET /patrons This patch adds the q query parameters to the route. To test: 1. Try the route with the following query parameter: q={"patron_id":2} i.e. GET /api/v1/patrons?q={"patron_id":2} => FAIL: You get a bad request respose 2. Apply this patch 3. Restart all 4. Repeat 1 => SUCCESS: You get the patron 5. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: David Nind <david@davidnind.com> Created attachment 121874 [details] [review] Bug 28480: Add q parameters for GET /patrons This patch adds the q query parameters to the route. To test: 1. Try the route with the following query parameter: q={"patron_id":2} i.e. GET /api/v1/patrons?q={"patron_id":2} => FAIL: You get a bad request respose 2. Apply this patch 3. Restart all 4. Repeat 1 => SUCCESS: You get the patron 5. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 121875 [details] [review] Bug 28482: (QA follow-up) Add unit test Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Aren't they missing for other routes as well? Shouldn't we have a test to catch missing occurrences? Second patch has a wrong bug number. (In reply to Jonathan Druart from comment #5) > Aren't they missing for other routes as well? Shouldn't we have a test to > catch missing occurrences? Do you want a follow-up? Here? Separate bug? I can take care of that. I think we could have a test on the QA tools raise a warning, as some routes are not yet (maybe never) implemented using our stack (e.g. /ill_backends and /illrequests). Created attachment 122278 [details] [review] Bug 28613: Add missing parameters to objects.search-based routes The objects.search helper provides convenient ways to paginate and a 'q' filter parameter to build complex queries on this Koha::Objects-based routes. Some routes were created prior to this feature getting introduced. We need to adjust the parameters for all existing objects.search-based routes. This patch adds that. The only GET (as in list) routes that would still be missing the parameters are those about ILL, that are not objects.search based, and probably need to be rewritten. Pushed to master for 21.11, thanks to everybody involved! Created attachment 122332 [details] [review] Bug 28480: (QA follow-up) Add unit test Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Fixed bug number Pushed to 21.05.x for 21.05.02 Pushed to 20.11.x for 20.11.09 Arf breaks test suite : t/db_dependent/api/v1/patrons.t .. # Failed test 'exact match for JSON Pointer "/0/cardnumber"' # at t/db_dependent/api/v1/patrons.t line 66. # got: '1' # expected: 'O_HBrhYpvfsZOtvfyC' # Looks like you failed 1 test of 16. # Failed test 'librarian access tests' # at t/db_dependent/api/v1/patrons.t line 84. # Looks like you failed 1 test of 2. t/db_dependent/api/v1/patrons.t .. 1/7 # Failed test 'list() tests' # at t/db_dependent/api/v1/patrons.t line 85. t/db_dependent/api/v1/patrons.t .. 5/7 # Looks like you failed 1 test of 7. t/db_dependent/api/v1/patrons.t .. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/7 subtests Test Summary Report ------------------- t/db_dependent/api/v1/patrons.t (Wstat: 256 Tests: 7 Failed: 1) Failed test: 1 Non-zero exit status: 1 Files=1, Tests=7, 7 wallclock secs ( 0.03 usr 0.00 sys + 6.59 cusr 0.54 csys = 7.16 CPU) Result: FAIL So I revert from 20.11.x Missing dependencies for 20.05.x, it shouldn't be affected, no backport. |