[Koha-bugs] [Bug 32440] Allow selective deletion of statistics entries based on type by cleanup_database

2024-11-01 Thread bugzilla-daemon--- via Koha-bugs
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32440

Andrew Fuerste-Henry  changed:

   What|Removed |Added

 Attachment #172791|0   |1
is obsolete||

--- Comment #5 from Andrew Fuerste-Henry  ---
Created attachment 173875
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=173875&action=edit
Bug 32440: Support purging statistics by type in cleanup_database.pl

Cleanup_database can delete all statistics entries more than X days
old. If one is using pseudonymization to create pseudonymized_transactions
data, then one may wish to use that cleanup_database function to delete
statistics entries that have been duplicated in pseudonymized_transactions.
However, not all types of transactions in statistics are duplicated in
pseudonymized transactions.

Pseudonymized_transactions currently only includes checkouts, returns,
and renewals.

This patch adds two additional parameters to cleanup_database.pl:

  1. --statistics-type

  Defines the types of statistics to purge. Will purge all types if
  parameter is omitted. Repeatable.

  2. --statistics-type-pseudo

  Grabs values from @Koha::Statistic::pseudonymization_types. At the
  time of writing this patch, they are:

  renew, issue, return and onsite_checkout

To test:
1. prove t/db_dependent/Koha/Statistic.t
2. Before applying this patch:
3. Create some statistics entry by checking out, renewing and checking in
   items.
4. perl misc/cronjobs/cleanup_database.pl --statistics 1 --verbose

Observe:
Purging statistics older than 1 days
n statistics would have been removed

Where n is the amount of statistics rows matching your test environment

5. Apply patch
6. Repeat step 4, observe same result
7. perl misc/cronjobs/cleanup_database.pl --statistics 1
--statistics-type-pseudo --verbose

Observe:

Purging statistics older than 1 days with types
"onsite_checkout,renew,return,issue".
n statistics would have been removed

Where n is the amount of statistics rows matching your test environment
(order of listed types does not matter)

8. perl misc/cronjobs/cleanup_database.pl --statistics 1 --statistics-type
test1 --statistics-type test2 --verbose

Observe:

Purging statistics older than 1 days with types "test1,test2".
n statistics would have been removed

Where n is the amount of statistics rows matching your test environment
(order of listed types does not matter)

9. perl misc/cronjobs/cleanup_database.pl --statistics 1
--statistics-type-pseudo --statistics-type test1 --verbose

Observe:

Purging statistics older than 1 days with types
"test1,onsite_checkout,renew,return,issue".
n statistics would have been removed

Where n is the amount of statistics rows matching your test environment
(order of listed types does not matter)

10. Try previous cleanup_database.pl commands with --confirm flag and make sure
correct rows are purged

Signed-off-by: Andrew Fuerste Henry 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 32440] Allow selective deletion of statistics entries based on type by cleanup_database

2024-11-01 Thread bugzilla-daemon--- via Koha-bugs
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32440

Andrew Fuerste-Henry  changed:

   What|Removed |Added

 Attachment #172790|0   |1
is obsolete||

--- Comment #4 from Andrew Fuerste-Henry  ---
Created attachment 173874
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=173874&action=edit
Bug 32440: Add missing unit test for Koha::Statistic->pseudonymize()

To test:
1. prove t/db_dependent/Koha/Statistic.t

Observe

Subtest: pseudonymize() tests
1..6
ok 1 - some pseudonymization_types are defined
ok 2 - Background job enqueued for type renew
ok 3 - Background job enqueued for type issue
ok 4 - Background job enqueued for type return
ok 5 - Background job enqueued for type onsite_checkout
ok 6 - Background job not enqueued for type not_gonna_pseudo
ok 2 - pseudonymize() tests

Signed-off-by: Andrew Fuerste Henry 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 32440] Allow selective deletion of statistics entries based on type by cleanup_database

2024-11-01 Thread bugzilla-daemon--- via Koha-bugs
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32440

Andrew Fuerste-Henry  changed:

   What|Removed |Added

 Status|Needs Signoff   |Signed Off

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 32440] Allow selective deletion of statistics entries based on type by cleanup_database

2024-10-15 Thread bugzilla-daemon--- via Koha-bugs
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32440

Lari Taskula  changed:

   What|Removed |Added

 CC||lari.task...@hypernova.fi
   Assignee|koha-b...@lists.koha-commun |lari.task...@hypernova.fi
   |ity.org |

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 32440] Allow selective deletion of statistics entries based on type by cleanup_database

2024-10-15 Thread bugzilla-daemon--- via Koha-bugs
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32440

--- Comment #3 from Lari Taskula  ---
Created attachment 172791
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=172791&action=edit
Bug 32440: Support purging statistics by type in cleanup_database.pl

Cleanup_database can delete all statistics entries more than X days
old. If one is using pseudonymization to create pseudonymized_transactions
data, then one may wish to use that cleanup_database function to delete
statistics entries that have been duplicated in pseudonymized_transactions.
However, not all types of transactions in statistics are duplicated in
pseudonymized transactions.

Pseudonymized_transactions currently only includes checkouts, returns,
and renewals.

This patch adds two additional parameters to cleanup_database.pl:

  1. --statistics-type

  Defines the types of statistics to purge. Will purge all types if
  parameter is omitted. Repeatable.

  2. --statistics-type-pseudo

  Grabs values from @Koha::Statistic::pseudonymization_types. At the
  time of writing this patch, they are:

  renew, issue, return and onsite_checkout

To test:
1. prove t/db_dependent/Koha/Statistic.t
2. Before applying this patch:
3. Create some statistics entry by checking out, renewing and checking in
   items.
4. perl misc/cronjobs/cleanup_database.pl --statistics 1 --verbose

Observe:
Purging statistics older than 1 days
n statistics would have been removed

Where n is the amount of statistics rows matching your test environment

5. Apply patch
6. Repeat step 4, observe same result
7. perl misc/cronjobs/cleanup_database.pl --statistics 1
--statistics-type-pseudo --verbose

Observe:

Purging statistics older than 1 days with types
"onsite_checkout,renew,return,issue".
n statistics would have been removed

Where n is the amount of statistics rows matching your test environment
(order of listed types does not matter)

8. perl misc/cronjobs/cleanup_database.pl --statistics 1 --statistics-type
test1 --statistics-type test2 --verbose

Observe:

Purging statistics older than 1 days with types "test1,test2".
n statistics would have been removed

Where n is the amount of statistics rows matching your test environment
(order of listed types does not matter)

9. perl misc/cronjobs/cleanup_database.pl --statistics 1
--statistics-type-pseudo --statistics-type test1 --verbose

Observe:

Purging statistics older than 1 days with types
"test1,onsite_checkout,renew,return,issue".
n statistics would have been removed

Where n is the amount of statistics rows matching your test environment
(order of listed types does not matter)

10. Try previous cleanup_database.pl commands with --confirm flag and make sure
correct rows are purged

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 32440] Allow selective deletion of statistics entries based on type by cleanup_database

2024-10-15 Thread bugzilla-daemon--- via Koha-bugs
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32440

--- Comment #2 from Lari Taskula  ---
Created attachment 172790
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=172790&action=edit
Bug 32440: Add missing unit test for Koha::Statistic->pseudonymize()

To test:
1. prove t/db_dependent/Koha/Statistic.t

Observe

Subtest: pseudonymize() tests
1..6
ok 1 - some pseudonymization_types are defined
ok 2 - Background job enqueued for type renew
ok 3 - Background job enqueued for type issue
ok 4 - Background job enqueued for type return
ok 5 - Background job enqueued for type onsite_checkout
ok 6 - Background job not enqueued for type not_gonna_pseudo
ok 2 - pseudonymize() tests

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 32440] Allow selective deletion of statistics entries based on type by cleanup_database

2024-10-15 Thread bugzilla-daemon--- via Koha-bugs
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32440

Lari Taskula  changed:

   What|Removed |Added

 Status|NEW |Needs Signoff

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 32440] Allow selective deletion of statistics entries based on type by cleanup_database

2023-06-05 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32440

mathieu saby  changed:

   What|Removed |Added

 CC||mathsaby...@gmail.com

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 32440] Allow selective deletion of statistics entries based on type by cleanup_database

2023-04-25 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32440
Bug 32440 depends on bug 24151, which changed state.

Bug 24151 Summary: Add a pseudonymization process for patrons and transactions
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24151

   What|Removed |Added

 Status|Needs documenting   |RESOLVED
 Resolution|--- |FIXED

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 32440] Allow selective deletion of statistics entries based on type by cleanup_database

2023-03-10 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32440
Bug 32440 depends on bug 24151, which changed state.

Bug 24151 Summary: Add a pseudonymization process for patrons and transactions
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24151

   What|Removed |Added

 Status|CLOSED  |Needs documenting
 Resolution|FIXED   |---

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 32440] Allow selective deletion of statistics entries based on type by cleanup_database

2022-12-09 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32440

--- Comment #1 from Andrew Fuerste-Henry  ---
*** Bug 32439 has been marked as a duplicate of this bug. ***

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 32440] Allow selective deletion of statistics entries based on type by cleanup_database

2022-12-09 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32440

Andrew Fuerste-Henry  changed:

   What|Removed |Added

 Depends on||19008
   See Also||https://bugs.koha-community
   ||.org/bugzilla3/show_bug.cgi
   ||?id=32438


Referenced Bugs:

https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19008
[Bug 19008] Add more options to cleanup database script
-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/