Bug 29780

Summary: Add Koha::Old::Holds->anonymize
Product: Koha Reporter: Tomás Cohen Arazi <tomascohen>
Component: Architecture, internals, and plumbingAssignee: Tomás Cohen Arazi <tomascohen>
Status: RESOLVED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: kyle, martin.renvoize
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.05.00
Bug Depends on:    
Bug Blocks: 29525    
Attachments: Bug 29780: Unit tests
Bug 29780: Add Koha::Old::Holds->anonymize
Bug 29780: Unit tests
Bug 29780: Add Koha::Old::Holds->anonymize
Bug 29780: Unit tests
Bug 29780: Add Koha::Old::Holds->anonymize
Bug 29780: Unit tests

Description Tomás Cohen Arazi 2022-01-03 13:36:06 UTC
Add high-level methods to anonymize holds history as needed by bug 29526.
Comment 1 Tomás Cohen Arazi 2022-01-03 13:39:47 UTC
Created attachment 128964 [details] [review]
Bug 29780: Unit tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 2 Tomás Cohen Arazi 2022-01-03 13:39:50 UTC
Created attachment 128965 [details] [review]
Bug 29780: Add Koha::Old::Holds->anonymize

This patch adds a handy method for anonymizing a Koha::Old::Holds
resultset. It is planned to be used on bug 29526.

To test:
1. Apply this patches
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Old/Holds.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 3 Tomás Cohen Arazi 2022-01-03 14:35:35 UTC
Created attachment 128966 [details] [review]
Bug 29780: Unit tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 4 Tomás Cohen Arazi 2022-01-03 15:21:06 UTC
Just added some more tests, for the empty restultset case, which returns the weird '0E0' value instead of plain zero [1], and wanted to highlight it, as I stumbled upon it on bug 29526.

[1] https://stackoverflow.com/questions/13358793/why-does-dbis-do-method-return-0e0-if-zero-rows-were-affected
Comment 5 Lucas Gass 2022-01-03 18:27:04 UTC
Created attachment 128978 [details] [review]
Bug 29780: Add Koha::Old::Holds->anonymize

This patch adds a handy method for anonymizing a Koha::Old::Holds
resultset. It is planned to be used on bug 29526.

To test:
1. Apply this patches
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Old/Holds.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 6 Lucas Gass 2022-01-03 18:27:10 UTC
Created attachment 128979 [details] [review]
Bug 29780: Unit tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 7 Martin Renvoize 2022-02-08 08:03:49 UTC
Created attachment 130252 [details] [review]
Bug 29780: Add Koha::Old::Holds->anonymize

This patch adds a handy method for anonymizing a Koha::Old::Holds
resultset. It is planned to be used on bug 29526.

To test:
1. Apply this patches
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Old/Holds.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 8 Martin Renvoize 2022-02-08 08:03:53 UTC
Created attachment 130253 [details] [review]
Bug 29780: Unit tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 9 Martin Renvoize 2022-02-08 08:04:27 UTC
A simple and clear patch that works as expected and contains thorough unit tests.

Passing QA
Comment 10 Fridolin Somers 2022-02-11 00:37:50 UTC
Pushed to master for 22.05, thanks to everybody involved 🦄