[Bug 24502] New: objects.search filter by prefetched columns
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24502 Bug ID: 24502 Summary: objects.search filter by prefetched columns Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: agustinmoyano@theke.io QA Contact: testopia@bugs.koha-community.org Depends on: 24356 Blocks: 20936 Make object.search helper filter by prefetched columns Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20936 [Bug 20936] Holds History for patrons in OPAC https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24356 [Bug 24356] objects.search prefetch -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24502 Agustín Moyano <agustinmoyano@theke.io> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com Assignee|koha-bugs@lists.koha-commun |agustinmoyano@theke.io |ity.org | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24502 Agustín Moyano <agustinmoyano@theke.io> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |24487 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24502 Agustín Moyano <agustinmoyano@theke.io> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24502 --- Comment #1 from Agustín Moyano <agustinmoyano@theke.io> --- Created attachment 97934 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=97934&action=edit Bug 24502: object.search also filter by prefetched columns This patch adds the possibility to object.search helper, to also filter by prefetched columns. In order to dynamically add filter parameters, they must be coded as json string, and sent within the q parameter. The coded json, is in fact dbix syntax. To test: 1. apply this patch 2. prove t/Koha/REST/Plugin/Query.t t/db_dependent/Koha/REST/Plugin/Objects.t 3. Sign off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24502 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit | |y.org | Summary|objects.search filter by |Add a query language and |prefetched columns |param (q=) to the API Component|Architecture, internals, |REST API |and plumbing | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24502 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org, | |kyle@bywatersolutions.com, | |martin.renvoize@ptfs-europe | |.com, | |nick@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24502 --- Comment #2 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- How about taking ES and an example for DSL and Querying structures.. They allow for a simple syntax in the query string, but if you want to 'level up' your queries then they use JSON in a request body.. I like this work so far, but I'm not a big fan of escaped JSON directly in the query string, it feels a bit messy and feels like it could end up leading to escaping problems down the line. Moving the JSON based query DSL into a GET request body seems like a good move to me. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24502 --- Comment #3 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- https://www.elastic.co/guide/en/elasticsearch/reference/current/search-searc... for inspiration. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24502 --- Comment #4 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Tomas also asked me to mention how I did similar when coding another project.. just for possible inspiration... I used 'Search::Query::Dialect' and adopted the DBIx::Class dialect with some customised additions to get it working.. it leads to a reasonably nice functional query string syntax for mostly simple queries.. I don't remember getting as far as doing full-on JSON based body queries though.. so I'm not sure how helpful it would be here? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24502 --- Comment #5 from Agustín Moyano <agustinmoyano@theke.io> --- (In reply to Martin Renvoize from comment #2)
How about taking ES and an example for DSL and Querying structures..
They allow for a simple syntax in the query string, but if you want to 'level up' your queries then they use JSON in a request body..
I like this work so far, but I'm not a big fan of escaped JSON directly in the query string, it feels a bit messy and feels like it could end up leading to escaping problems down the line. Moving the JSON based query DSL into a GET request body seems like a good move to me.
Hi Martin, agreed, I'll put the q parameter in the body. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24502 --- Comment #6 from Agustín Moyano <agustinmoyano@theke.io> --- (In reply to Martin Renvoize from comment #4)
Tomas also asked me to mention how I did similar when coding another project.. just for possible inspiration...
I used 'Search::Query::Dialect' and adopted the DBIx::Class dialect with some customised additions to get it working.. it leads to a reasonably nice functional query string syntax for mostly simple queries.. I don't remember getting as far as doing full-on JSON based body queries though.. so I'm not sure how helpful it would be here?
Regarding DSL, I didn't find it was illogical the one dbic proposes.. it certainly has ugly names like "-or" or "-and", but the rest it's quite similar. Maybe we can discuss it later on a following bug? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24502 --- Comment #7 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- All sounds good to me. 😀 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24502 Agustín Moyano <agustinmoyano@theke.io> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #97934|0 |1 is obsolete| | --- Comment #8 from Agustín Moyano <agustinmoyano@theke.io> --- Created attachment 98185 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=98185&action=edit Bug 24502: object.search also filter by prefetched columns This patch adds the possibility to object.search helper, to also filter by prefetched columns. In order to dynamically add filter parameters, they must be coded as json and placed in the body of the request, within the q parameter. The coded json, is in fact dbix syntax. To test: 1. apply this patch 2. prove t/Koha/REST/Plugin/Query.t t/db_dependent/Koha/REST/Plugin/Objects.t 3. Sign off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24502 --- Comment #9 from Agustín Moyano <agustinmoyano@theke.io> --- Created attachment 98186 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=98186&action=edit Bug 24502: (follow-up) Add default q parameter in api definition -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24502 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |joonas.kylmala@helsinki.fi, | |josef.moravec@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24502 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #10 from David Nind <david@davidnind.com> --- I get this message when trying to apply this patch (git bz apply 24502): Failed to retrieve bug information: NotPermitted Other bugs apply fine. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24502 Agustín Moyano <agustinmoyano@theke.io> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |24561 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24561 [Bug 24561] Add embedded column filter feature to datatables api wrapper -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24502 Agustín Moyano <agustinmoyano@theke.io> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks|20936 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20936 [Bug 20936] Holds History for patrons in OPAC -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24502 --- Comment #11 from David Nind <david@davidnind.com> --- (In reply to David Nind from comment #10)
I get this message when trying to apply this patch (git bz apply 24502):
Failed to retrieve bug information: NotPermitted
Figured it out - a dependency is security related. Will let someone else test who has the right access! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24502 --- Comment #12 from Agustín Moyano <agustinmoyano@theke.io> --- (In reply to David Nind from comment #11)
(In reply to David Nind from comment #10)
I get this message when trying to apply this patch (git bz apply 24502):
Failed to retrieve bug information: NotPermitted
Figured it out - a dependency is security related.
Will let someone else test who has the right access!
Thaks for trying anyway! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24502 --- Comment #13 from Agustín Moyano <agustinmoyano@theke.io> --- Hi Martin, I tryed to use this version of q parameter to be sent into the body of a GET request, but unfortunately browsers don't allow that kind of messages. I stripped the code to de bare bones of JS creating a XMLHTTPRequest and it's replacement, the "Fetch API", but nither of both sends body content with a GET request. The first one ignores the content if the method is GET, and the second one throws an exception. I would suggest to keep q parameter in body, but also to have a q parameter in the query, and maybe also in a header (something like 'x-koha-query') So if you are using any server side program to fetch from de API, you can send body content in the GET request, but if you are using the browser you can choose to use q parameter in the query, or if you want to keep it clean, use the x-koha-query header. Regards -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24502 Agustín Moyano <agustinmoyano@theke.io> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #98185|0 |1 is obsolete| | Attachment #98186|0 |1 is obsolete| | --- Comment #14 from Agustín Moyano <agustinmoyano@theke.io> --- Created attachment 98596 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=98596&action=edit Bug 24502: object.search also filter by prefetched columns This patch adds the possibility to object.search helper, to also filter by prefetched columns. In order to dynamically add filter parameters, they must be coded as json and placed in the body of the request, coded as string in 'q' query parameter or as string in 'x-koha-query' header. The coded json, is in fact dbix syntax. To test: 1. apply this patch 2. prove t/Koha/REST/Plugin/Query.t t/db_dependent/Koha/REST/Plugin/Objects.t 3. Sign off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24502 --- Comment #15 from Agustín Moyano <agustinmoyano@theke.io> --- Created attachment 98597 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=98597&action=edit Bug 24502: (follow-up) Add all 3 query parameters in api definition This patch adds api definition for body, query or header parameters. To use them include: * "$ref": "../parameters.json#/q_body" for body parameter. * "$ref": "../parameters.json#/q_param" for query parameter. * "$ref": "../parameters.json#/q_header" for header parameter. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24502 Agustín Moyano <agustinmoyano@theke.io> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |24615 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24615 [Bug 24615] REST API order by prefetched columns -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24502 Agustín Moyano <agustinmoyano@theke.io> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #98596|0 |1 is obsolete| | Attachment #98597|0 |1 is obsolete| | --- Comment #16 from Agustín Moyano <agustinmoyano@theke.io> --- Created attachment 98605 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=98605&action=edit Bug 24502: object.search also filter by prefetched columns This patch adds the possibility to object.search helper, to also filter by prefetched columns. In order to dynamically add filter parameters, they must be coded as json and placed in the body of the request, coded as string in 'q' query parameter or as string in 'x-koha-query' header. The coded json, is in fact dbix syntax. To test: 1. apply this patch 2. prove t/Koha/REST/Plugin/Query.t t/db_dependent/Koha/REST/Plugin/Objects.t 3. Sign off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24502 --- Comment #17 from Agustín Moyano <agustinmoyano@theke.io> --- Created attachment 98606 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=98606&action=edit Bug 24502: (follow-up) Add all 3 query parameters in api definition This patch adds api definition for body, query or header parameters. To use them include: * "$ref": "../parameters.json#/q_body" for body parameter. * "$ref": "../parameters.json#/q_param" for query parameter. * "$ref": "../parameters.json#/q_header" for header parameter. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24502 Agustín Moyano <agustinmoyano@theke.io> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #98606|0 |1 is obsolete| | --- Comment #18 from Agustín Moyano <agustinmoyano@theke.io> --- Created attachment 98611 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=98611&action=edit Bug 24502: (follow-up) Add all 3 query parameters in api definition This patch adds api definition for body, query or header parameters. To use them include: * "$ref": "../parameters.json#/q_body" for body parameter. * "$ref": "../parameters.json#/q_param" for query parameter. * "$ref": "../parameters.json#/q_header" for header parameter. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24502 --- Comment #19 from Agustín Moyano <agustinmoyano@theke.io> --- (In reply to David Nind from comment #11)
(In reply to David Nind from comment #10)
I get this message when trying to apply this patch (git bz apply 24502):
Failed to retrieve bug information: NotPermitted
Figured it out - a dependency is security related.
Will let someone else test who has the right access!
Hi David, bug 24487 is now in master. Would you please try again? Thanks -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24502 Agustín Moyano <agustinmoyano@theke.io> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks|24561 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24561 [Bug 24561] Add embedded column order by and filter features to datatables api wrapper -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24502 --- Comment #20 from David Nind <david@davidnind.com> ---
Hi David, bug 24487 is now in master. Would you please try again?
The bug is still restricted, so not able to yet. Also, is there anyway to test the query parameters in the follow up patch (without writing a program, as I'm not a programmer), or are these sufficiently covered by the tests? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24502 --- Comment #21 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to David Nind from comment #20)
Hi David, bug 24487 is now in master. Would you please try again?
The bug is still restricted, so not able to yet.
Also, is there anyway to test the query parameters in the follow up patch (without writing a program, as I'm not a programmer), or are these sufficiently covered by the tests?
David, you don't seem to need to apply that bug: (base) ✔ ~/git/koha [qa_24502|⚑ 13] 16:24 $ git bz apply 24502 Bug 24502 Depends on bug 24356 Follow? [(y)es, (n)o] y Bug 24356 - objects.search prefetch 98602 - Bug 24356: prefetch_whitelist tests 98603 - Bug 24356: Make objects.search prefetch embedded relations Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 24356: prefetch_whitelist tests Applying: Bug 24356: Make objects.search prefetch embedded relations Bug 24502 - Add a query language and param (q=) to the API 98605 - Bug 24502: object.search also filter by prefetched columns 98611 - Bug 24502: (follow-up) Add all 3 query parameters in api definition Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 24502: object.search also filter by prefetched columns Applying: Bug 24502: (follow-up) Add all 3 query parameters in api definition (base) ✔ ~/git/koha [qa_24502 ↑·4|⚑ 13] 16:25 $ -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24502 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de --- Comment #22 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- 24356 is not in security, which is the bug that gives you trouble? I can give you access to security bugs if needed (just needs someone with access to add you to the CC list) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24502 --- Comment #23 from David Nind <david@davidnind.com> --- This is what I get when I try to apply: root@b7a19a96d4cf:koha(bz24502)$ git bz apply 24502 Bug 24502 Depends on bug 24356 Follow? [(y)es, (n)o] y Bug 24356 - objects.search prefetch 98602 - Bug 24356: prefetch_whitelist tests 98603 - Bug 24356: Make objects.search prefetch embedded relations Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 24356: prefetch_whitelist tests Applying: Bug 24356: Make objects.search prefetch embedded relations Failed to retrieve bug information: NotPermitted When I go to bug 24487 in Bugzilla I get "You are not authorized to access bug #24487." (with a red background) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24502 --- Comment #24 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to David Nind from comment #23)
This is what I get when I try to apply:
root@b7a19a96d4cf:koha(bz24502)$ git bz apply 24502
Bug 24502 Depends on bug 24356 Follow? [(y)es, (n)o] y Bug 24356 - objects.search prefetch
98602 - Bug 24356: prefetch_whitelist tests 98603 - Bug 24356: Make objects.search prefetch embedded relations
Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 24356: prefetch_whitelist tests Applying: Bug 24356: Make objects.search prefetch embedded relations Failed to retrieve bug information: NotPermitted
When I go to bug 24487 in Bugzilla I get "You are not authorized to access bug #24487." (with a red background)
Hi David, I've added you to the CC list, that should give you access. As it's already pushed, maybe it's a problem in git bz not being able to determine the status. Applying the bugs manually without following the dependencies could also work in this case. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24502 --- Comment #25 from David Nind <david@davidnind.com> --- Thanks Katrin. Can now apply the patches! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24502 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #26 from David Nind <david@davidnind.com> --- After all that, 1 test failed for me! root@5bbe8b290c9a:koha(bz24502)$ prove t/Koha/REST/Plugin/Query.t t/db_dependent/Koha/REST/Plugin/Objects.t t/Koha/REST/Plugin/Query.t ................. 3/6 # Failed test '200 OK' # at t/Koha/REST/Plugin/Query.t line 314. # got: '500' # expected: '200' # Failed test 'exact match for JSON Pointer "/-and"' # at t/Koha/REST/Plugin/Query.t line 314. # Structures begin differing at: # $got = undef # $expected = ARRAY(0x5564a4153a48) # Looks like you failed 2 tests of 3. # Failed test '/merge_q_params' # at t/Koha/REST/Plugin/Query.t line 357. # Looks like you failed 1 test of 6. t/Koha/REST/Plugin/Query.t ................. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/6 subtests t/db_dependent/Koha/REST/Plugin/Objects.t .. ok Test Summary Report ------------------- t/Koha/REST/Plugin/Query.t (Wstat: 256 Tests: 6 Failed: 1) Failed test: 4 Non-zero exit status: 1 Files=2, Tests=14, 25 wallclock secs ( 0.06 usr 0.01 sys + 21.66 cusr 3.74 csys = 25.47 CPU) Result: FAIL -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24502 Agustín Moyano <agustinmoyano@theke.io> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24502 Agustín Moyano <agustinmoyano@theke.io> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #98605|0 |1 is obsolete| | Attachment #98611|0 |1 is obsolete| | --- Comment #27 from Agustín Moyano <agustinmoyano@theke.io> --- Created attachment 99252 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=99252&action=edit Bug 24502: object.search also filter by prefetched columns This patch adds the possibility to object.search helper, to also filter by prefetched columns. In order to dynamically add filter parameters, they must be coded as json and placed in the body of the request, coded as string in 'q' query parameter or as string in 'x-koha-query' header. The coded json, is in fact dbix syntax. To test: 1. apply this patch 2. prove t/Koha/REST/Plugin/Query.t t/db_dependent/Koha/REST/Plugin/Objects.t 3. Sign off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24502 --- Comment #28 from Agustín Moyano <agustinmoyano@theke.io> --- Created attachment 99253 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=99253&action=edit Bug 24502: (follow-up) Add all 3 query parameters in api definition This patch adds api definition for body, query or header parameters. To use them include: * "$ref": "../parameters.json#/q_body" for body parameter. * "$ref": "../parameters.json#/q_param" for query parameter. * "$ref": "../parameters.json#/q_header" for header parameter. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24502 --- Comment #29 from Agustín Moyano <agustinmoyano@theke.io> --- (In reply to David Nind from comment #26)
After all that, 1 test failed for me!
root@5bbe8b290c9a:koha(bz24502)$ prove t/Koha/REST/Plugin/Query.t t/db_dependent/Koha/REST/Plugin/Objects.t t/Koha/REST/Plugin/Query.t ................. 3/6 # Failed test '200 OK' # at t/Koha/REST/Plugin/Query.t line 314. # got: '500' # expected: '200'
# Failed test 'exact match for JSON Pointer "/-and"' # at t/Koha/REST/Plugin/Query.t line 314. # Structures begin differing at: # $got = undef # $expected = ARRAY(0x5564a4153a48) # Looks like you failed 2 tests of 3.
# Failed test '/merge_q_params' # at t/Koha/REST/Plugin/Query.t line 357. # Looks like you failed 1 test of 6. t/Koha/REST/Plugin/Query.t ................. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/6 subtests t/db_dependent/Koha/REST/Plugin/Objects.t .. ok
Test Summary Report ------------------- t/Koha/REST/Plugin/Query.t (Wstat: 256 Tests: 6 Failed: 1) Failed test: 4 Non-zero exit status: 1 Files=2, Tests=14, 25 wallclock secs ( 0.06 usr 0.01 sys + 21.66 cusr 3.74 csys = 25.47 CPU) Result: FAIL
Hi David, sorry for the delay. Now it should work ok. Thanks for testing -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24502 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #99252|0 |1 is obsolete| | --- Comment #30 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 99351 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=99351&action=edit Bug 24502: object.search also filter by prefetched columns This patch adds the possibility to object.search helper, to also filter by prefetched columns. In order to dynamically add filter parameters, they must be coded as json and placed in the body of the request, coded as string in 'q' query parameter or as string in 'x-koha-query' header. The coded json, is in fact dbix syntax. To test: 1. apply this patch 2. prove t/Koha/REST/Plugin/Query.t t/db_dependent/Koha/REST/Plugin/Objects.t 3. Sign off Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24502 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #99253|0 |1 is obsolete| | --- Comment #31 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 99352 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=99352&action=edit Bug 24502: (follow-up) Add all 3 query parameters in api definition This patch adds api definition for body, query or header parameters. To use them include: * "$ref": "../parameters.json#/q_body" for body parameter. * "$ref": "../parameters.json#/q_param" for query parameter. * "$ref": "../parameters.json#/q_header" for header parameter. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24502 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off --- Comment #32 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- All works as expected and passes qa tests.. Well done Agustin, this is a great feature to have added.. Signing off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24502 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.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24502 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #99351|0 |1 is obsolete| | Attachment #99352|0 |1 is obsolete| | --- Comment #33 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 99946 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=99946&action=edit Bug 24502: object.search also filter by prefetched columns This patch adds the possibility to object.search helper, to also filter by prefetched columns. In order to dynamically add filter parameters, they must be coded as json and placed in the body of the request, coded as string in 'q' query parameter or as string in 'x-koha-query' header. The coded json, is in fact dbix syntax. To test: 1. apply this patch 2. prove t/Koha/REST/Plugin/Query.t t/db_dependent/Koha/REST/Plugin/Objects.t 3. Sign off Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24502 --- Comment #34 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 99947 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=99947&action=edit Bug 24502: (follow-up) Add all 3 query parameters in api definition This patch adds api definition for body, query or header parameters. To use them include: * "$ref": "../parameters.json#/q_body" for body parameter. * "$ref": "../parameters.json#/q_param" for query parameter. * "$ref": "../parameters.json#/q_header" for header parameter. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24502 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |20.05.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24502 --- Comment #35 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Nice work everyone! Pushed to master for 20.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24502 Joy Nelson <joy@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |joy@bywatersolutions.com --- Comment #36 from Joy Nelson <joy@bywatersolutions.com> --- enhancement not backported to 19.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24502 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |25514 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25514 [Bug 25514] REST/Plugin/Objects.t is failing randomly -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org