[Bug 42036] New: Add diff support to REPORTS action logs
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42036 Bug ID: 42036 Summary: Add diff support to REPORTS action logs Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Transaction logs Assignee: koha-bugs@lists.koha-community.org Reporter: martin.renvoize@openfifth.co.uk QA Contact: testopia@bugs.koha-community.org Blocks: 37940 The action logging for saved reports does not pass the $original parameter to logaction(), so no structured diff is generated in the action_logs.diff column. Currently log entries store the report name and SQL concatenated as a plain string. Affected calls: - reports/guided_reports.pl MODIFY (~line 250): logaction( "REPORTS", "MODIFY", $id, "$reportname | $sql" ) (no $original; only post-change state captured as a string) - reports/guided_reports.pl ADD (~line 594): logaction( "REPORTS", "ADD", $id, "$name | $sql" ) - C4/Reports/Guided.pm DELETE (~line 798): logaction( "REPORTS", "DELETE", $id, $data->report_name . " | " . $data->savedsql ) This bug covers updating these calls to pass structured hashrefs (e.g. { report_name => ..., savedsql => ... }) as $infos and, for MODIFY, the pre-change report data as $original, enabling proper before/after diff display in the action log viewer. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37940 [Bug 37940] [OMNIBUS] All modification logged via action logs should include original to create JSON diff -- 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=42036 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |olivia.reynolds@openfifth.c |ity.org |o.uk -- 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=42036 Olivia Reynolds <olivia.reynolds@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch Comma delimited| |Open Fifth list of Sponsors| | Sponsorship status|--- |Sponsored 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=42036 --- Comment #1 from Olivia Reynolds <olivia.reynolds@openfifth.co.uk> --- Created attachment 202596 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=202596&action=edit Bug 42036: Support diffs for report logs This patch makes use of the `original` parameter to `logaction` to log a diff of the entire Report object on create/modify/delete. Test plan: 1. Apply patch. 2. Enable the system preference ReportsLog. 3. Navigate to Reports, and create a new report. The quickest way to do this is to create a report from SQL with any name and "SELECT 1" as the SQL query. 4. Once the report has been created, edit its title and save the changes. 5. Delete the report. 6. Navigate to Tools > Log Viewer. 7. Ensure "Reports" is enabled under "Modules", and click "Submit". 8. Verify there are three Reports log entries corresponding to the create/modify/delete of the report earlier. 9. Enable the "Diff" column in the log viewer. 10. Verify each of the three log entries has an appropriate diff displayed. Sponsored-by: Open Fifth -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42036 Roman Dolny <roman.dolny@jezuici.pl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply CC| |roman.dolny@jezuici.pl --- Comment #2 from Roman Dolny <roman.dolny@jezuici.pl> --- kohadev-koha@kohadevbox:koha(bug_42036)$ git bz apply 42036 📋 Bug 42036 - Add diff support to REPORTS action logs • 202596 - Bug 42036: Support diffs for report logs Apply? [(y)es, (n)o, (i)nteractive] y Preparing 1 patch(es): ✓ Prepared 1 patch(es) Applying 1 patch(es): Patch application failed for attachment 202596 - Bug 42036: Support diffs for report logs -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42036 Olivia Reynolds <olivia.reynolds@openfifth.co.uk> 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=42036 Olivia Reynolds <olivia.reynolds@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #202596|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=42036 --- Comment #3 from Olivia Reynolds <olivia.reynolds@openfifth.co.uk> --- Created attachment 202943 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=202943&action=edit Bug 42036: Support diffs for report logs This patch makes use of the `original` parameter to `logaction` to log a diff of the entire Report object on create/modify/delete. Test plan: 1. Apply patch. 2. Enable the system preference ReportsLog. 3. Navigate to Reports, and create a new report. The quickest way to do this is to create a report from SQL with any name and "SELECT 1" as the SQL query. 4. Once the report has been created, edit its title and save the changes. 5. Delete the report. 6. Navigate to Tools > Log Viewer. 7. Ensure "Reports" is enabled under "Modules", and click "Submit". 8. Verify there are three Reports log entries corresponding to the create/modify/delete of the report earlier. 9. Enable the "Diff" column in the log viewer. 10. Verify each of the three log entries has an appropriate diff displayed. Sponsored-by: Open Fifth -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42036 Roman Dolny <roman.dolny@jezuici.pl> 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=42036 Roman Dolny <roman.dolny@jezuici.pl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #202943|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=42036 --- Comment #4 from Roman Dolny <roman.dolny@jezuici.pl> --- Created attachment 202976 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=202976&action=edit Bug 42036: Support diffs for report logs This patch makes use of the `original` parameter to `logaction` to log a diff of the entire Report object on create/modify/delete. Test plan: 1. Apply patch. 2. Enable the system preference ReportsLog. 3. Navigate to Reports, and create a new report. The quickest way to do this is to create a report from SQL with any name and "SELECT 1" as the SQL query. 4. Once the report has been created, edit its title and save the changes. 5. Delete the report. 6. Navigate to Tools > Log Viewer. 7. Ensure "Reports" is enabled under "Modules", and click "Submit". 8. Verify there are three Reports log entries corresponding to the create/modify/delete of the report earlier. 9. Enable the "Diff" column in the log viewer. 10. Verify each of the three log entries has an appropriate diff displayed. Sponsored-by: Open Fifth Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42036 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |lisette@bywatersolutions.co |y.org |m -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42036 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #5 from Lisette Scheer <lisette@bywatersolutions.com> --- This breaks the 'compare' option, which is very helpful as the new diff doesn't highlight exact changes in the report. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42036 Olivia Reynolds <olivia.reynolds@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff --- Comment #6 from Olivia Reynolds <olivia.reynolds@openfifth.co.uk> --- Thanks for catching that. I've updated the calls to logaction to include the full object context on creation and deletion as well, so that you can compare with those logs meaningfully. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42036 Olivia Reynolds <olivia.reynolds@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #202976|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=42036 --- Comment #7 from Olivia Reynolds <olivia.reynolds@openfifth.co.uk> --- Created attachment 206789 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206789&action=edit Bug 42036: Support diffs for report logs This patch makes use of the `original` parameter to `logaction` to log a diff of the entire Report object on create/modify/delete. Test plan: 1. Apply patch. 2. Enable the system preference ReportsLog. 3. Navigate to Reports, and create a new report. The quickest way to do this is to create a report from SQL with any name and "SELECT 1" as the SQL query. 4. Once the report has been created, edit its title and save the changes. 5. Delete the report. 6. Navigate to Tools > Log Viewer. 7. Ensure "Reports" is enabled under "Modules", and click "Submit". 8. Verify there are three Reports log entries corresponding to the create/modify/delete of the report earlier. 9. Enable the "Diff" column in the log viewer. 10. Verify each of the three log entries has an appropriate diff displayed. 11. Verify you can use the "compare" functionality between each of the three entries, and that the results are meaningful. Sponsored-by: Open Fifth -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42036 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #8 from Lisette Scheer <lisette@bywatersolutions.com> --- The compare results works now, but it a little messy compared to before the patch. I'm not sure if it would be better to make the diff parse the sql better (probably more work, but also maybe better in the long run) or to make the compare modal only show the savedsql (probably easier?) field -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42036 --- Comment #9 from Olivia Reynolds <olivia.reynolds@openfifth.co.uk> --- Created attachment 206895 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206895&action=edit Prototype per-field diff in the report diff column's table I'm wondering whether having a per-field diff in the diff column's table would be most useful. I've implemented this as an experiment, just for non-nested string fields, and attached a screenshot. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org