[Bug 30394] New: Add 'draw' handling to the datatables wrapper and REST API
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30394 Bug ID: 30394 Summary: Add 'draw' handling to the datatables wrapper and REST API 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: tomascohen@gmail.com QA Contact: testopia@bugs.koha-community.org A new header handling should be added so it is passed back and forth when requests are made. It should then be translated into/from the 'draw' parameter by the wrapper. We could name the headerr x-koha-request-id. -- 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=30394 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=30055 -- 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=30394 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=30063 -- 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=30394 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |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=30394 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |30393 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30393 [Bug 30393] datatables wrapper should handle searching for %, _ and \ -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30394 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30394 --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 132576 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=132576&action=edit Bug 30394: Unit tests This patch adds tests for checking the x-koha-request-id header is returned on GET routes that have it enabled, and then the request includes it. To test: 1. Apply this patch 2. Run: $ kshell k$ prove t/db_dependent/api/v1/query.t => FAIL: The feature is not implemented, tests fail Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30394 --- Comment #2 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 132577 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=132577&action=edit Bug 30394: Add x-koha-request-id handling in controllers This patch adds 'x-koha-request-id' to the reserved param names list, and makes the objects.search helper read it and send it back in the response headers. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30394 --- Comment #3 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 132578 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=132578&action=edit Bug 30394: Add x-koha-request-id support on API routes This patch adds the x-koha-request-id to all GET routes that rely on objects.search, for immediate support for the header. The patch itself is trivial: - It adds the header parameter definition to the top level swagger.yaml - It adds a reference on each route that already implements q params, etc To test: 1. Apply the patch 2. Reload plack 3. Notice the API still works 4. Run: $ kshell k$ prove t/db_dependent/api/v1/query.t => SUCCESS: It now passes! The /cities route implements the x-koha-request-id header pass through. 5. Run the rest of the API tests => SUCCESS: All good 6. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30394 --- Comment #4 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 132579 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=132579&action=edit Bug 30394: Make datatables.js aware of x-koha-request-id This patch makes the wrapper handle the data.draw parameter (from DataTables) translating it into the x-koha-request-id header for making the Koha request, and then translates the received header into data.draw for proper use in DataTables. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30394 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |30408 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30408 [Bug 30408] API and OpenAPI versions should be string in spec -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30394 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30394 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #132576|0 |1 is obsolete| | Attachment #132577|0 |1 is obsolete| | Attachment #132578|0 |1 is obsolete| | Attachment #132579|0 |1 is obsolete| | --- Comment #5 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 132582 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=132582&action=edit Bug 30394: Unit tests This patch adds tests for checking the x-koha-request-id header is returned on GET routes that have it enabled, and then the request includes it. To test: 1. Apply this patch 2. Run: $ kshell k$ prove t/db_dependent/api/v1/query.t => FAIL: The feature is not implemented, tests fail Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30394 --- Comment #6 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 132583 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=132583&action=edit Bug 30394: Add x-koha-request-id handling in controllers This patch adds 'x-koha-request-id' to the reserved param names list, and makes the objects.search helper read it and send it back in the response headers. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30394 --- Comment #7 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 132584 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=132584&action=edit Bug 30394: Add x-koha-request-id support on API routes This patch adds the x-koha-request-id to all GET routes that rely on objects.search, for immediate support for the header. The patch itself is trivial: - It adds the header parameter definition to the top level swagger.yaml - It adds a reference on each route that already implements q params, etc To test: 1. Apply the patch 2. Reload plack 3. Notice the API still works 4. Run: $ kshell k$ prove t/db_dependent/api/v1/query.t => SUCCESS: It now passes! The /cities route implements the x-koha-request-id header pass through. 5. Run the rest of the API tests => SUCCESS: All good 6. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30394 --- Comment #8 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 132585 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=132585&action=edit Bug 30394: Make datatables.js aware of x-koha-request-id This patch makes the wrapper handle the data.draw parameter (from DataTables) translating it into the x-koha-request-id header for making the Koha request, and then translates the received header into data.draw for proper use in DataTables. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30394 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com 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=30394 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #132582|0 |1 is obsolete| | --- Comment #9 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 132598 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=132598&action=edit Bug 30394: Unit tests This patch adds tests for checking the x-koha-request-id header is returned on GET routes that have it enabled, and then the request includes it. To test: 1. Apply this patch 2. Run: $ kshell k$ prove t/db_dependent/api/v1/query.t => FAIL: The feature is not implemented, tests fail Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> 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=30394 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #132583|0 |1 is obsolete| | --- Comment #10 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 132599 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=132599&action=edit Bug 30394: Add x-koha-request-id handling in controllers This patch adds 'x-koha-request-id' to the reserved param names list, and makes the objects.search helper read it and send it back in the response headers. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> 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=30394 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #132584|0 |1 is obsolete| | --- Comment #11 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 132600 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=132600&action=edit Bug 30394: Add x-koha-request-id support on API routes This patch adds the x-koha-request-id to all GET routes that rely on objects.search, for immediate support for the header. The patch itself is trivial: - It adds the header parameter definition to the top level swagger.yaml - It adds a reference on each route that already implements q params, etc To test: 1. Apply the patch 2. Reload plack 3. Notice the API still works 4. Run: $ kshell k$ prove t/db_dependent/api/v1/query.t => SUCCESS: It now passes! The /cities route implements the x-koha-request-id header pass through. 5. Run the rest of the API tests => SUCCESS: All good 6. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> 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=30394 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #132585|0 |1 is obsolete| | --- Comment #12 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 132601 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=132601&action=edit Bug 30394: Make datatables.js aware of x-koha-request-id This patch makes the wrapper handle the data.draw parameter (from DataTables) translating it into the x-koha-request-id header for making the Koha request, and then translates the received header into data.draw for proper use in DataTables. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> 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=30394 --- Comment #13 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 132602 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=132602&action=edit Bug 30408: Make API and OpenAPI versions strings in spec Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> 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=30394 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com Attachment #132602|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30394 --- Comment #14 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Another QA stamp never hurts. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30394 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |22.05.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30394 --- Comment #15 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to master for 22.05, thanks to everybody involved 🦄 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30394 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED CC| |kyle@bywatersolutions.com Status|Pushed to master |RESOLVED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30394 --- Comment #16 from Tomás Cohen Arazi <tomascohen@gmail.com> --- This could actually be backported? -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org