[Bug 31795] New: REST API: POST endpoint for Authorities
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31795 Bug ID: 31795 Summary: REST API: POST endpoint for Authorities Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: new feature Priority: P5 - low Component: MARC Authority data support Assignee: koha-bugs@lists.koha-community.org Reporter: nick@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org -- 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=31795 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | Blocks| |31790 Change sponsored?|--- |Sponsored Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31790 [Bug 31790] REST API: CRUD endpoints for Authorities [omnibus] -- 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=31795 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|tomascohen@gmail.com |agustinmoyano@theke.io -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31795 Agustín Moyano <agustinmoyano@theke.io> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Depends on| |31793 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31793 [Bug 31793] REST API: DELETE endpoint for Authorities -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31795 Agustín Moyano <agustinmoyano@theke.io> 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=31795 --- Comment #1 from Agustín Moyano <agustinmoyano@theke.io> --- Created attachment 144555 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=144555&action=edit Bug 31795: Add REST endpoint to add an authority To test: 1. Apply patch 2. Set RESTBasicAuth preference to true 3. Make a POST request to /api/v1/authorities with one of the following content type header - application/json - application/marcxml+xml - application/marc-in-json - application/marc 5. Check that the authority is created 6. Sign off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31795 Agustín Moyano <agustinmoyano@theke.io> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |31796 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31796 [Bug 31796] REST API: PUT endpoint for Authorities -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31795 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #2 from David Nind <david@davidnind.com> --- I had a go at testing using Postman, but I'm not familiar enough with APIs etc., to know how to work out what needs to be in the body for the format. If you could provide an example of what to put in the body for one of the formats, I'll have another go. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31795 --- Comment #3 from Agustín Moyano <agustinmoyano@theke.io> --- (In reply to David Nind from comment #2)
I had a go at testing using Postman, but I'm not familiar enough with APIs etc., to know how to work out what needs to be in the body for the format.
If you could provide an example of what to put in the body for one of the formats, I'll have another go.
Hi David, I got this from KTD, but an example of marcxml would be <?xml version="1.0" encoding="UTF-8"?> <record xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd" xmlns="http://www.loc.gov/MARC21/slim"> <leader>00390nz a2200133o 4500</leader> <controlfield tag="001">1707</controlfield> <controlfield tag="003">csc</controlfield> <controlfield tag="005">20140507162102.0</controlfield> <controlfield tag="008">140507|| aca||aabn | a|a d</controlfield> <datafield tag="040" ind1=" " ind2=" "> <subfield code="a">csc</subfield> <subfield code="c">csc</subfield> </datafield> <datafield tag="150" ind1=" " ind2=" "> <subfield code="a">C++ (Computer program language)</subfield> </datafield> <datafield tag="667" ind1=" " ind2=" "> <subfield code="a">Machine generated authority record.</subfield> </datafield> <datafield tag="670" ind1=" " ind2=" "> <subfield code="a">Work cat.: (csc)0: Josuttis, Nicolai M. 5582, The C++ standard library :, c2012.</subfield> </datafield> <datafield tag="942" ind1=" " ind2=" "> <subfield code="a">TOPIC_TERM</subfield> </datafield> </record> Maybe you can change some data so that Koha won't think it's a duplicate Cheers! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31795 Agustín Moyano <agustinmoyano@theke.io> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #144555|0 |1 is obsolete| | --- Comment #4 from Agustín Moyano <agustinmoyano@theke.io> --- Created attachment 144746 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=144746&action=edit Bug 31795: Add REST endpoint to add an authority To test: 1. Apply patch 2. Set RESTBasicAuth preference to true 3. Make a POST request to /api/v1/authorities with one of the following content type header - application/json - application/marcxml+xml - application/marc-in-json - application/marc 4. If content type is other than application/json, then add the following header to the request: "x-authority-type: <auth type code>" 5. Check that the authority is created 6. Sign off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31795 --- Comment #5 from Agustín Moyano <agustinmoyano@theke.io> --- Created attachment 144747 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=144747&action=edit Bug 31795: (follow-up) fix header name -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31795 David Nind <david@davidnind.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=31795 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #144746|0 |1 is obsolete| | --- Comment #6 from David Nind <david@davidnind.com> --- Created attachment 144749 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=144749&action=edit Bug 31795: Add REST endpoint to add an authority To test: 1. Apply patch 2. Set RESTBasicAuth preference to true 3. Make a POST request to /api/v1/authorities with one of the following content type header - application/json - application/marcxml+xml - application/marc-in-json - application/marc 4. If content type is other than application/json, then add the following header to the request: "x-authority-type: <auth type code>" 5. Check that the authority is created 6. Sign off Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31795 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #144747|0 |1 is obsolete| | --- Comment #7 from David Nind <david@davidnind.com> --- Created attachment 144750 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=144750&action=edit Bug 31795: (follow-up) fix header name Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31795 --- Comment #8 from David Nind <david@davidnind.com> --- (In reply to Agustín Moyano from comment #3)
(In reply to David Nind from comment #2)
... Hi David, I got this from KTD, but an example of marcxml would be ...
Thanks Agustín! I removed the 001 tag and changed the name in the 150 tag. In Postman I created a new HTTP request and added these details: 1. Changed to a POST with the URL as http://127.0.0.1:8081/api/v1/authorities 2. Body: changed to 'raw', pasted in the amended XML for the MARC authority record, and changed the type to XML 3. Added Headers: . x-authority-type: used TOPIC_TERM as the value . Content-Type: used application/marcxml+xml as the value 4. For authorization, add the Basic Auth type with koha as the username and password The new authority record was then created! David -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31795 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This adds a POST endpoint release notes| |to the REST API for adding | |new authority records. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31795 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|MARC Authority data support |REST API CC| |tomascohen@gmail.com QA Contact|testopia@bugs.koha-communit | |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31795 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl Status|Signed Off |Patch doesn't apply --- Comment #9 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Applying: Bug 31795: Add REST endpoint to add an authority error: sha1 information is lacking or useless (api/v1/swagger/swagger.yaml). error: could not build fake ancestor -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31795 Bug 31795 depends on bug 31793, which changed state. Bug 31793 Summary: REST API: DELETE endpoint for Authorities https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31793 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31795 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31795 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #144749|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=31795 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #144750|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=31795 --- Comment #10 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 149380 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=149380&action=edit Bug 31795: Add REST endpoint to add an authority To test: 1. Apply patch 2. Set RESTBasicAuth preference to true 3. Make a POST request to /api/v1/authorities with one of the following content type header - application/json - application/marcxml+xml - application/marc-in-json - application/marc 4. If content type is other than application/json, then add the following header to the request: "x-authority-type: <auth type code>" 5. Check that the authority is created 6. Sign off Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31795 --- Comment #11 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 149407 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=149407&action=edit Bug 31795: (QA follow-up) Use x-koha-override header Despite its title, this patch does a couple more things. 1. The tests are rewritten to cover more things, and also to avoid deleting all authorities inside the transaction. It is really not required. 2. It makes the endpoint rely on the already generically implemented x-koha-override header, which is intended for the same use case as x-confirm-not-duplicate is for. 3. It changes the return codes to match the coding guidelines [1] 4. Only checks for duplicates if no override passed. To test: 1. Run: $ ktd --shell k$ prove t/db_dependent/api/v1/authorities.t => SUCCESS: Tests pass! 2. Apply this follow-up 3. Repeat 1 => SUCCESS: Tests pass! 4. Sign off :-D [1] https://wiki.koha-community.org/wiki/Coding_Guidelines_-_API#SWAGGER3.2.1_PO... 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=31795 --- Comment #12 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 149409 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=149409&action=edit Bug 31795: Fix required permissions 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=31795 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #13 from David Nind <david@davidnind.com> --- The tests don't pass after applying the patches: prove t/db_dependent/api/v1/authorities.t t/db_dependent/api/v1/authorities.t .. 1/3 # Failed test '409 Conflict' # at t/db_dependent/api/v1/authorities.t line 204. # got: '201' # expected: '409' # Failed test 'Location header is only set when the new resource is created' # at t/db_dependent/api/v1/authorities.t line 204. # Failed test 'similar match for JSON Pointer "/error"' # at t/db_dependent/api/v1/authorities.t line 204. # undef # doesn't match '(?^u:Duplicate record (\d*))' # Failed test 'exact match for JSON Pointer "/error_code"' # at t/db_dependent/api/v1/authorities.t line 204. # got: undef # expected: 'duplicate' # Looks like you failed 4 tests of 19. t/db_dependent/api/v1/authorities.t .. 3/3 # Failed test 'post() tests' # at t/db_dependent/api/v1/authorities.t line 227. # Looks like you failed 1 test of 3. t/db_dependent/api/v1/authorities.t .. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/3 subtests Test Summary Report ------------------- t/db_dependent/api/v1/authorities.t (Wstat: 256 Tests: 3 Failed: 1) Failed test: 3 Non-zero exit status: 1 Files=1, Tests=3, 4 wallclock secs ( 0.02 usr 0.00 sys + 3.67 cusr 0.14 csys = 3.83 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=31795 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |ASSIGNED --- Comment #14 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to David Nind from comment #13)
The tests don't pass after applying the patches:
prove t/db_dependent/api/v1/authorities.t t/db_dependent/api/v1/authorities.t .. 1/3 # Failed test '409 Conflict' # at t/db_dependent/api/v1/authorities.t line 204. # got: '201' # expected: '409'
This is odd. It fails on Zebra, and passes on ES. It means the FindDuplicateAuthority method is not behaving the same on each. I'll mock the call to the method and file a new bug for the method specifically. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31795 --- Comment #15 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 149451 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=149451&action=edit Bug 31795: (follow-up) Mock call to FindDuplicateAuthority When running against Zebra, this tests fail because it requires the record to be indexed timely. In theory, a 5 seconds delay should be enough for the indexer to pick up. But that's not the point of the test, and we should better just mock the query in this case. To test: 1. Have ktd launch with zebra: $ ktd up -d 2. Run: $ ktd --shell k$ prove t/db_dependent/api/v1/authorities.t => FAIL: Tests fail! 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass! 5. Launch ktd with ES: $ ktd down $ ktd --es7 up -d 6. Repeat 2 => SUCCESS: Tests pass! 7. 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=31795 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31795 David Nind <david@davidnind.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=31795 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #149380|0 |1 is obsolete| | --- Comment #16 from David Nind <david@davidnind.com> --- Created attachment 149459 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=149459&action=edit Bug 31795: Add REST endpoint to add an authority To test: 1. Apply patch 2. Set RESTBasicAuth preference to true 3. Make a POST request to /api/v1/authorities with one of the following content type header - application/json - application/marcxml+xml - application/marc-in-json - application/marc 4. If content type is other than application/json, then add the following header to the request: "x-authority-type: <auth type code>" 5. Check that the authority is created 6. Sign off Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31795 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #149407|0 |1 is obsolete| | --- Comment #17 from David Nind <david@davidnind.com> --- Created attachment 149460 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=149460&action=edit Bug 31795: (QA follow-up) Use x-koha-override header Despite its title, this patch does a couple more things. 1. The tests are rewritten to cover more things, and also to avoid deleting all authorities inside the transaction. It is really not required. 2. It makes the endpoint rely on the already generically implemented x-koha-override header, which is intended for the same use case as x-confirm-not-duplicate is for. 3. It changes the return codes to match the coding guidelines [1] 4. Only checks for duplicates if no override passed. To test: 1. Run: $ ktd --shell k$ prove t/db_dependent/api/v1/authorities.t => SUCCESS: Tests pass! 2. Apply this follow-up 3. Repeat 1 => SUCCESS: Tests pass! 4. Sign off :-D [1] https://wiki.koha-community.org/wiki/Coding_Guidelines_-_API#SWAGGER3.2.1_PO... Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31795 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #149409|0 |1 is obsolete| | --- Comment #18 from David Nind <david@davidnind.com> --- Created attachment 149461 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=149461&action=edit Bug 31795: Fix required permissions Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31795 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #149451|0 |1 is obsolete| | --- Comment #19 from David Nind <david@davidnind.com> --- Created attachment 149462 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=149462&action=edit Bug 31795: (follow-up) Mock call to FindDuplicateAuthority When running against Zebra, this tests fail because it requires the record to be indexed timely. In theory, a 5 seconds delay should be enough for the indexer to pick up. But that's not the point of the test, and we should better just mock the query in this case. To test: 1. Have ktd launch with zebra: $ ktd up -d 2. Run: $ ktd --shell k$ prove t/db_dependent/api/v1/authorities.t => FAIL: Tests fail! 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass! 5. Launch ktd with ES: $ ktd down $ ktd --es7 up -d 6. Repeat 2 => SUCCESS: Tests pass! 7. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31795 Nick Clemens <nick@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=31795 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #149459|0 |1 is obsolete| | Attachment #149460|0 |1 is obsolete| | Attachment #149461|0 |1 is obsolete| | Attachment #149462|0 |1 is obsolete| | --- Comment #20 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 150370 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=150370&action=edit Bug 31795: Add REST endpoint to add an authority To test: 1. Apply patch 2. Set RESTBasicAuth preference to true 3. Make a POST request to /api/v1/authorities with one of the following content type header - application/json - application/marcxml+xml - application/marc-in-json - application/marc 4. If content type is other than application/json, then add the following header to the request: "x-authority-type: <auth type code>" 5. Check that the authority is created 6. Sign off Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Nick Clemens <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=31795 --- Comment #21 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 150371 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=150371&action=edit Bug 31795: (QA follow-up) Use x-koha-override header Despite its title, this patch does a couple more things. 1. The tests are rewritten to cover more things, and also to avoid deleting all authorities inside the transaction. It is really not required. 2. It makes the endpoint rely on the already generically implemented x-koha-override header, which is intended for the same use case as x-confirm-not-duplicate is for. 3. It changes the return codes to match the coding guidelines [1] 4. Only checks for duplicates if no override passed. To test: 1. Run: $ ktd --shell k$ prove t/db_dependent/api/v1/authorities.t => SUCCESS: Tests pass! 2. Apply this follow-up 3. Repeat 1 => SUCCESS: Tests pass! 4. Sign off :-D [1] https://wiki.koha-community.org/wiki/Coding_Guidelines_-_API#SWAGGER3.2.1_PO... 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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31795 --- Comment #22 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 150372 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=150372&action=edit Bug 31795: Fix required permissions 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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31795 --- Comment #23 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 150373 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=150373&action=edit Bug 31795: (follow-up) Mock call to FindDuplicateAuthority When running against Zebra, this tests fail because it requires the record to be indexed timely. In theory, a 5 seconds delay should be enough for the indexer to pick up. But that's not the point of the test, and we should better just mock the query in this case. To test: 1. Have ktd launch with zebra: $ ktd up -d 2. Run: $ ktd --shell k$ prove t/db_dependent/api/v1/authorities.t => FAIL: Tests fail! 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass! 5. Launch ktd with ES: $ ktd down $ ktd --es7 up -d 6. Repeat 2 => SUCCESS: Tests pass! 7. 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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31795 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |23.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=31795 --- Comment #24 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 23.05. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31795 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com Status|Pushed to master |RESOLVED Resolution|--- |FIXED --- Comment #25 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Enhancement - not backporting to 22.11.x Good work everyone! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31795 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|REST API: POST endpoint for |Add POST endpoint for |Authorities |Authorities -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31795 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the|This adds a POST endpoint | release notes|to the REST API for adding | |new authority records. | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31795 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |41901 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41901 [Bug 41901] Allow duplicate check when adding authority via API -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org