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.
Created attachment 132576 [details] [review] 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>
Created attachment 132577 [details] [review] 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>
Created attachment 132578 [details] [review] 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>
Created attachment 132579 [details] [review] 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>
Created attachment 132582 [details] [review] 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>
Created attachment 132583 [details] [review] 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>
Created attachment 132584 [details] [review] 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>
Created attachment 132585 [details] [review] 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>
Created attachment 132598 [details] [review] 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>
Created attachment 132599 [details] [review] 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>
Created attachment 132600 [details] [review] 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>
Created attachment 132601 [details] [review] 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>
Created attachment 132602 [details] [review] 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>
Another QA stamp never hurts.
Pushed to master for 22.05, thanks to everybody involved [U+1F984]
This could actually be backported?