[Bug 23998] New: Messages REST API
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23998 Bug ID: 23998 Summary: Messages REST API Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: REST api Assignee: koha-bugs@lists.koha-community.org Reporter: lari.taskula@hypernova.fi Expose messages table via REST API. -- 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=23998 Lari Taskula <lari.taskula@hypernova.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |new feature Status|NEW |ASSIGNED Assignee|koha-bugs@lists.koha-commun |lari.taskula@hypernova.fi |ity.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=23998 Lari Taskula <lari.taskula@hypernova.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |24016 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24016 [Bug 24016] manager_id in Koha::Patron::Message->store should not depend on userenv alone -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23998 --- Comment #1 from Lari Taskula <lari.taskula@hypernova.fi> --- Created attachment 95304 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=95304&action=edit Bug 23998: REST API for messages - Add /api/v1/messages endpoint Exposes messages database table via REST API. GET /api/v1/messages POST /api/v1/messages PUT /api/v1/messages DELETE /api/v1/messages To test: 1. prove t/db_dependent/api/v1/messages.t https://bugs.koha-community.org/show_bug.cgi?id=23988 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23998 Lari Taskula <lari.taskula@hypernova.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #95304|0 |1 is obsolete| | --- Comment #2 from Lari Taskula <lari.taskula@hypernova.fi> --- Created attachment 95305 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=95305&action=edit Bug 23998: REST API for messages - Add /api/v1/messages endpoint Exposes messages database table via REST API. GET /api/v1/messages POST /api/v1/messages PUT /api/v1/messages DELETE /api/v1/messages To test: 1. prove t/db_dependent/api/v1/messages.t Sponsored-by: Koha-Suomi Oy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23998 Lari Taskula <lari.taskula@hypernova.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #95305|0 |1 is obsolete| | --- Comment #3 from Lari Taskula <lari.taskula@hypernova.fi> --- Created attachment 95310 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=95310&action=edit Bug 23998: REST API for messages - Add /api/v1/messages endpoint Exposes messages database table via REST API. GET /api/v1/messages POST /api/v1/messages PUT /api/v1/messages DELETE /api/v1/messages To test: 1. prove t/db_dependent/api/v1/messages.t Sponsored-by: Koha-Suomi Oy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23998 Lari Taskula <lari.taskula@hypernova.fi> 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=23998 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA CC| |david@davidnind.com --- Comment #4 from David Nind <david@davidnind.com> --- Sorry, tests fail 8-(: root@a9bc3171985d:koha(bz23998)$ prove t/db_dependent/api/v1/messages.t t/db_dependent/api/v1/messages.t .. 2/5 # Failed test 'SWAGGER3.2.1' # at t/db_dependent/api/v1/messages.t line 227. # got: '500' # expected: '201' # Failed test 'exact match for JSON Pointer "/patron_id"' # at t/db_dependent/api/v1/messages.t line 227. # got: undef # expected: '95' # Failed test 'exact match for JSON Pointer "/library_id"' # at t/db_dependent/api/v1/messages.t line 227. # got: undef # expected: 'kayx1Yh5' # Failed test 'exact match for JSON Pointer "/message_type"' # at t/db_dependent/api/v1/messages.t line 227. # got: undef # expected: 'B' # Failed test 'exact match for JSON Pointer "/message"' # at t/db_dependent/api/v1/messages.t line 227. # got: undef # expected: 'Old Fox jumped over Cheeseboy' # Failed test 'exact match for JSON Pointer "/manager_id"' # at t/db_dependent/api/v1/messages.t line 227. # got: undef # expected: '94' # Failed test 'SWAGGER3.2.1' # at t/db_dependent/api/v1/messages.t line 243. # got: '500' # expected: '201' # Failed test 'exact match for JSON Pointer "/patron_id"' # at t/db_dependent/api/v1/messages.t line 243. # got: undef # expected: '95' # Failed test 'exact match for JSON Pointer "/library_id"' # at t/db_dependent/api/v1/messages.t line 243. # got: undef # expected: 'kayx1Yh5' # Failed test 'exact match for JSON Pointer "/message_type"' # at t/db_dependent/api/v1/messages.t line 243. # got: undef # expected: 'B' # Failed test 'exact match for JSON Pointer "/message"' # at t/db_dependent/api/v1/messages.t line 243. # got: undef # expected: 'Old Fox jumped over Cheeseboy' # Failed test 'exact match for JSON Pointer "/manager_id"' # at t/db_dependent/api/v1/messages.t line 243. # got: undef # expected: '95' # Failed test 'exact match for JSON Pointer "/errors"' # at t/db_dependent/api/v1/messages.t line 253. # Structures begin differing at: # $got->[1] = HASH(0x557190092810) # $expected->[1] = Does not exist # Looks like you failed 13 tests of 27. # Failed test 'add() tests' # at t/db_dependent/api/v1/messages.t line 265. t/db_dependent/api/v1/messages.t .. 5/5 # Looks like you failed 1 test of 5. t/db_dependent/api/v1/messages.t .. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/5 subtests Test Summary Report ------------------- t/db_dependent/api/v1/messages.t (Wstat: 256 Tests: 5 Failed: 1) Failed test: 3 Non-zero exit status: 1 Files=1, Tests=5, 11 wallclock secs ( 0.02 usr 0.02 sys + 10.38 cusr 1.24 csys = 11.66 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=23998 Lisette Scheer <lisette.scheer@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lisette.scheer@bywatersolut | |ions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23998 Shi Yao Wang <shi-yao.wang@inLibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #95310|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=23998 --- Comment #5 from Shi Yao Wang <shi-yao.wang@inLibro.com> --- Created attachment 198316 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198316&action=edit Bug 23998: REST API for messages - Add /api/v1/messages endpoint Exposes messages database table via REST API. GET /api/v1/messages POST /api/v1/messages PUT /api/v1/messages DELETE /api/v1/messages To test: 1. prove t/db_dependent/api/v1/messages.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23998 Shi Yao Wang <shi-yao.wang@inLibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |caroline.cyr-la-rose@inlibr | |o.com, | |philippe.blouin@inlibro.com | |, shi-yao.wang@inLibro.com Status|Failed QA |Needs Signoff Assignee|lari.taskula@hypernova.fi |shi-yao.wang@inLibro.com --- Comment #6 from Shi Yao Wang <shi-yao.wang@inLibro.com> --- Remade the patch since last patch was 6-7 years ago -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23998 --- Comment #7 from David Nind <david@davidnind.com> --- Thanks for having a look at this again after all this time! The test pass when run by itself: prove t/db_dependent/api/v1/messages.t t/db_dependent/api/v1/messages.t .. 2/5 DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Duplicate entry '8' for key 'PRIMARY' at /kohadevbox/koha/Koha/Object.pm line 174 t/db_dependent/api/v1/messages.t .. ok All tests successful. Files=1, Tests=5, 7 wallclock secs ( 0.02 usr 0.00 sys + 5.72 cusr 1.11 csys = 6.85 CPU) Result: PASS (After applying the patch I did a yarn api:bundle and restart_all) However, running qa script complains when I run it 8-(. qa Tag v25.05.00-1 found in /kohadevbox/koha — checking out branch main in /kohadevbox/qa-test-tools Already on 'main' Your branch is up to date with 'origin/main'. testing 1 commit(s) (applied to dbbc1aa '3e Bug 41566: Restore item groups ft') Processing files [RUNNING] Koha/Patron/Message.pm [RUNNING] Koha/REST/V1/Messages.pm [RUNNING] api/v1/swagger/definitions/message.yaml [RUNNING] api/v1/swagger/paths/messages.yaml [RUNNING] api/v1/swagger/swagger.yaml [RUNNING] t/db_dependent/api/v1/messages.t [PASS] api/v1/swagger/paths/messages.yaml [FAIL] api/v1/swagger/definitions/message.yaml [PASS] api/v1/swagger/swagger.yaml [PASS] Koha/Patron/Message.pm [FAIL] Koha/REST/V1/Messages.pm [FAIL] t/db_dependent/api/v1/messages.t Result: [PASS] Koha/Patron/Message.pm [FAIL] Koha/REST/V1/Messages.pm FAIL tidiness File is not tidy, please run `perl misc/devel/tidy.pl Koha/REST/V1/Messages.pm` [FAIL] api/v1/swagger/definitions/message.yaml FAIL new_line_at_the_end_of_file Missing new line at the end of file, make sure your editor correctly reads .editorconfig ('insert_final_newline = true'). See bug 40541. [PASS] api/v1/swagger/paths/messages.yaml [PASS] api/v1/swagger/swagger.yaml [FAIL] t/db_dependent/api/v1/messages.t FAIL file_permissions File must have the exec flag FAIL forbidden_patterns forbidden pattern: Incorrect license statement (using postal address), may be a false positive if the file is coming from outside Koha (bug 24545) (line 16) FAIL test_no_warnings 'use Test::NoWarnings' must be present in this test file. FAIL tidiness File is not tidy, please run `perl misc/devel/tidy.pl t/db_dependent/api/v1/messages.t` Processing additional checks PASS! * Was this bug sponsored by anyone? Running tests (1) * Proving /kohadevbox/koha/t/db_dependent/api/v1/messages.t FAIL # Failed test 'Two messages returned' # at /kohadevbox/koha/t/db_dependent/api/v1/messages.t line 94. # got: '3' # expected: '2' # Looks like you failed 1 test of 20. # Failed test 'list() tests' # at /kohadevbox/koha/t/db_dependent/api/v1/messages.t line 112. DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Duplicate entry '18' for key 'PRIMARY' at /kohadevbox/koha/Koha/Object.pm line 174 # Looks like you failed 1 test of 5. /kohadevbox/koha/t/db_dependent/api/v1/messages.t .. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/5 subtests Test Summary Report ------------------- /kohadevbox/koha/t/db_dependent/api/v1/messages.t (Wstat: 256 (exited 1) Tests: 5 Failed: 1) Failed test: 1 Non-zero exit status: 1 Files=1, Tests=5, 7 wallclock secs ( 0.01 usr 0.00 sys + 5.92 cusr 1.18 csys = 7.11 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=23998 Shi Yao Wang <shi-yao.wang@inLibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #198316|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=23998 --- Comment #8 from Shi Yao Wang <shi-yao.wang@inLibro.com> --- Created attachment 198364 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198364&action=edit Bug 23998: REST API for messages - Add /api/v1/messages endpoint Exposes messages database table via REST API. GET /api/v1/messages POST /api/v1/messages PUT /api/v1/messages DELETE /api/v1/messages To test: 1. prove t/db_dependent/api/v1/messages.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23998 --- Comment #9 from Shi Yao Wang <shi-yao.wang@inLibro.com> --- Corrected tests and formatting. Ran `qa` on ktd and all steps passed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23998 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=23998 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #198364|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=23998 --- Comment #10 from David Nind <david@davidnind.com> --- Created attachment 198365 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198365&action=edit Bug 23998: REST API for messages - Add /api/v1/messages endpoint Exposes messages database table via REST API. GET /api/v1/messages POST /api/v1/messages PUT /api/v1/messages DELETE /api/v1/messages To test: 1. prove t/db_dependent/api/v1/messages.t 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=23998 --- Comment #11 from David Nind <david@davidnind.com> --- (In reply to Shi Yao Wang from comment #9)
Corrected tests and formatting. Ran `qa` on ktd and all steps passed
Thanks! -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org