[Bug 27593] New: Inconsistent return status on club holds routes
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27593 Bug ID: 27593 Summary: Inconsistent return status on club holds routes Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: minor Priority: P5 - low Component: REST API Assignee: koha-bugs@lists.koha-community.org Reporter: tomascohen@gmail.com When the requested item doesn't exist it returns a 404. But it returns a 400 if a biblio was requested and is not present. -- 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=27593 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | Depends on| |27330 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27330 [Bug 27330] Wrong return status when no enrollments in club holds -- 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=27593 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27593 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27593 --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 116216 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=116216&action=edit Bug 27593: Regression tests This patch introduces tests for the behaviour change (400 => 404) and also adds tests for untested (error) behaviours. Notably, the 'Biblio not found' problematic return value couldn't be triggered, because the OpenAPI plugin returns a 500 because the response was malformed (expected { error => 'message' } and it was returning a string). For the above reason, running the regression tests will show a 500... instead of the expected 400. I covered the rest of the codepaths that trigger errors to have full coverage. To test: 1. Apply this patch 2. Run: $ kshell k$ prove t/db_dependent/api/v1/clubs_holds.t => FAIL: Tests fail loudly 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=27593 --- Comment #2 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 116217 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=116217&action=edit Bug 27593: Consistent behavior for club holds route This patch: - Fixes a malformed response when biblio_id is invalid - Fixes the return status (400 => 404) when biblio_id is invalid - Adapts the error strings to be consistent with the Cities.pm file To test: 1. Apply the regression tests patch 2. Run: $ kshell k$ prove t/db_dependent/api/v1/clubs_holds.t => FAIL: Tests fail 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass! 5. 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=27593 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=27593 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #116216|0 |1 is obsolete| | --- Comment #3 from David Nind <david@davidnind.com> --- Created attachment 117007 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=117007&action=edit Bug 27593: Regression tests This patch introduces tests for the behaviour change (400 => 404) and also adds tests for untested (error) behaviours. Notably, the 'Biblio not found' problematic return value couldn't be triggered, because the OpenAPI plugin returns a 500 because the response was malformed (expected { error => 'message' } and it was returning a string). For the above reason, running the regression tests will show a 500... instead of the expected 400. I covered the rest of the codepaths that trigger errors to have full coverage. To test: 1. Apply this patch 2. Run: $ kshell k$ prove t/db_dependent/api/v1/clubs_holds.t => FAIL: Tests fail loudly 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=27593 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #116217|0 |1 is obsolete| | --- Comment #4 from David Nind <david@davidnind.com> --- Created attachment 117008 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=117008&action=edit Bug 27593: Consistent behavior for club holds route This patch: - Fixes a malformed response when biblio_id is invalid - Fixes the return status (400 => 404) when biblio_id is invalid - Adapts the error strings to be consistent with the Cities.pm file To test: 1. Apply the regression tests patch 2. Run: $ kshell k$ prove t/db_dependent/api/v1/clubs_holds.t => FAIL: Tests fail 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass! 5. 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=27593 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #117007|0 |1 is obsolete| | --- Comment #5 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 117155 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=117155&action=edit Bug 27593: Regression tests This patch introduces tests for the behaviour change (400 => 404) and also adds tests for untested (error) behaviours. Notably, the 'Biblio not found' problematic return value couldn't be triggered, because the OpenAPI plugin returns a 500 because the response was malformed (expected { error => 'message' } and it was returning a string). For the above reason, running the regression tests will show a 500... instead of the expected 400. I covered the rest of the codepaths that trigger errors to have full coverage. To test: 1. Apply this patch 2. Run: $ kshell k$ prove t/db_dependent/api/v1/clubs_holds.t => FAIL: Tests fail loudly Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: David Nind <david@davidnind.com> 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=27593 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #117008|0 |1 is obsolete| | --- Comment #6 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 117156 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=117156&action=edit Bug 27593: Consistent behavior for club holds route This patch: - Fixes a malformed response when biblio_id is invalid - Fixes the return status (400 => 404) when biblio_id is invalid - Adapts the error strings to be consistent with the Cities.pm file To test: 1. Apply the regression tests patch 2. Run: $ kshell k$ prove t/db_dependent/api/v1/clubs_holds.t => FAIL: Tests fail 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass! 5. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: David Nind <david@davidnind.com> 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=27593 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com Status|Signed Off |Passed QA --- Comment #7 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Works as expected, a sensible improvement. QA Script passes, covered by tests. Passing QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27593 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |21.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=27593 --- Comment #8 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 21.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=27593 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|21.05.00 |21.05.00,20.11.04 released in| | CC| |fridolin.somers@biblibre.co | |m Status|Pushed to master |Pushed to stable --- Comment #9 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 20.11.x for 20.11.04 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27593 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|21.05.00,20.11.04 |21.05.00,20.11.04,20.05.10 released in| | Status|Pushed to stable |Pushed to oldstable CC| |andrew@bywatersolutions.com --- Comment #10 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Pushed to 20.05.x for 20.05.10 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27593 Bug 27593 depends on bug 27330, which changed state. Bug 27330 Summary: Wrong return status when no enrollments in club holds https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27330 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to oldstable |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=27593 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED CC| |victor@tuxayo.net Status|Pushed to oldstable |RESOLVED --- Comment #11 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org