[Bug 42769] New: Add a SIP testing tool to the staff web interface
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42769 Bug ID: 42769 Summary: Add a SIP testing tool to the staff web interface Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: SIP2 Assignee: koha-bugs@lists.koha-community.org Reporter: kyle@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org Now that the SIP configuration is mostly in the staff interface, it would be very useful to have a tool not for testing SIP connectivity, but for checking the response value for the various custom template fields we have. I'm imagining a tab within the account editor ( for saved accounts ) where we can enter things like patron and item barcodes to test the generated response. It would be even better if we could wrap that in a transaction so it doesn't actually do anything, but I have the feeling that may prove infeasible. Such a testing tool would eliminate the need for someone to know the password for the SIP account in order to develop and test the various templates and options for that account. -- 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=42769 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |kyle@bywatersolutions.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=42769 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=42770 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42769 Kyle M Hall (khall) <kyle@bywatersolutions.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=42769 --- Comment #1 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 202833 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=202833&action=edit Bug 42769: Add Koha::SIP2::MessageTester Now that the SIP configuration lives in the staff interface, there is no easy way to check what a SIP account will actually return for the various custom template fields without opening a telnet session and knowing the SIP account password. This patch adds Koha::SIP2::MessageTester, which builds the same server context the SIP server builds at login time ( minus the authentication ) from a saved Koha::SIP2::Account, hands a constructed request to the real message handlers, and returns the generated response broken into its fixed portion and its variable length fields. It can build the request from a message type and a patron/item barcode, or run a raw request string built elsewhere. The whole thing runs inside a transaction that is always rolled back, so even checkout and checkin messages don't actually do anything. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42769 --- Comment #2 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 202834 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=202834&action=edit Bug 42769: Add unit tests Patch from commit d3576c2 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42769 --- Comment #3 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 202835 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=202835&action=edit Bug 42769: Add REST API for the SIP message tester This patch adds a POST /sip2/accounts/{sip_account_id}/test_message endpoint that runs Koha::SIP2::MessageTester for a saved account and returns the generated request, the raw response, and the response broken into its fixed portion and its variable length fields. It accepts either a message type with a patron/item barcode, or a raw SIP2 request string to run as-is. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42769 --- Comment #4 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 202836 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=202836&action=edit Bug 42769: Add unit tests Patch from commit eebf286 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42769 --- Comment #5 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 202837 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=202837&action=edit Bug 42769: Add SIP2 message testing tool to the staff interface This patch adds a "Test SIP2 messages" tool to the SIP2 account editor in the staff interface. Right now there is no way to check what a SIP account will return for a given message without standing up a real SIP connection and knowing the account's SIP password. That makes it hard to confirm the custom template fields configured on an account ( the AE personal name, the custom patron/item fields, and so on ) actually render the values you expect. The tool is reachable from a saved account: open an account and click the new "Test SIP2 messages" button in the toolbar. You pick a message type ( patron status, patron information, item information, checkout or check-in ), fill in a patron barcode, item barcode and/or patron password, and the raw outgoing SIP request is built for you and shown in an editable box that updates as you change the form. You can also edit the raw request by hand. Running the test calls the new REST endpoint, which builds the account's server context ( without authenticating ) and hands the request to the real SIP message handlers. The whole thing runs in a transaction that is always rolled back, so even a checkout or check-in leaves the database untouched. The response is shown raw and broken down field by field with each field's name. The SIP field code to name map is moved out of the account editor into a shared composable so both the editor and the tester use it. Test Plan: 1) Apply this patch 2) yarn js:build 3) Restart all the things! 4) Go to Administration -> SIP2 -> Accounts and open an account whose institution implementation is "ILS" 5) Note the new "Test SIP2 messages" button in the toolbar, click it 6) Leave the message type on "Patron information", enter a valid patron barcode, note the raw request box updates as you type! 7) Click "Run test", note you get a response back broken down field by field, with the patron's name in the AE field and your custom patron fields rendered! 8) Switch the message type to "Item information", enter an item barcode, run the test, note the item fields come back! 9) Edit the raw request by hand, note the form fields stop updating it and a "Reset to the generated request" link appears! 10) Try "Checkout" and "Check-in" against a patron and item, note you get a response but the item is *not* actually checked out or in! -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org