Bug 26636

Summary: Add objects.find Mojolicious helper
Product: Koha Reporter: Agustín Moyano <agustinmoyano>
Component: REST APIAssignee: Agustín Moyano <agustinmoyano>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P5 - low CC: andrew, fridolin.somers, kyle, martin.renvoize, tomascohen
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.05.00
Circulation function:
Bug Depends on:    
Bug Blocks: 17314, 26635, 27855    
Attachments: Bug 26636: Add tests
Bug 26636: Add objects.find helper
Bug 26636: Add tests
Bug 26636: Add objects.find helper
Bug 26636: (QA follow-up) Add POD
Bug 26636: Regression tests for undef case
Bug 26636: (QA follow-up) Handle no results correctly
Bug 26636: Add tests
Bug 26636: Add objects.find helper
Bug 26636: (QA follow-up) Add POD
Bug 26636: Regression tests for undef case
Bug 26636: (QA follow-up) Handle no results correctly
Bug 26636: Add tests
Bug 26636: Add objects.find helper
Bug 26636: (QA follow-up) Add POD
Bug 26636: Regression tests for undef case
Bug 26636: (QA follow-up) Handle no results correctly
Bug 26636: Add tests
Bug 26636: Add objects.find helper
Bug 26636: (QA follow-up) Add POD
Bug 26636: Regression tests for undef case
Bug 26636: (QA follow-up) Handle no results correctly
Bug 26636: Add tests [20.11.x]
Bug 26636: Add objects.find helper [20.11.x]
Bug 26636: (QA follow-up) Add POD [20.11.x]
Bug 26636: Regression tests for undef case [20.11.x]
Bug 26636: (QA follow-up) Handle no results correctly [20.11.x]

Description Agustín Moyano 2020-10-08 17:43:09 UTC
We need a new objects.find mojolicious helper, just as objects.search, that enables embedding child objects and authorisation values expansion
Comment 1 Agustín Moyano 2020-10-09 17:24:18 UTC
Created attachment 111418 [details] [review]
Bug 26636: Add tests

Add tests in t/db_dependent/Koha/REST/Plugin/Objects.t
Comment 2 Agustín Moyano 2020-10-09 17:24:23 UTC
Created attachment 111419 [details] [review]
Bug 26636: Add objects.find helper

This patch adds the objects.find helper. Much like objects.search, it
returns the to_api method with embedded children and expanded authorised
values.

This patch will be implemented in bug 8179, so please test there
Comment 3 Andrew Fuerste-Henry 2021-02-02 15:33:54 UTC
Please rebase for testing bug 8179
Comment 4 Tomás Cohen Arazi (tcohen) 2021-02-02 19:52:35 UTC
Created attachment 116222 [details] [review]
Bug 26636: Add tests

This patch adds tests for the new objects.find helper.

Sponsored-by: Virginia Tech Libraries
Comment 5 Tomás Cohen Arazi (tcohen) 2021-02-02 19:52:41 UTC
Created attachment 116223 [details] [review]
Bug 26636: Add objects.find helper

This patch adds the objects.find helper. Much like objects.search, it
returns the to_api method with embedded.

Sponsored-by: Virginia Tech Libraries
Comment 6 Tomás Cohen Arazi (tcohen) 2021-02-02 19:52:47 UTC
Created attachment 116224 [details] [review]
Bug 26636: (QA follow-up) Add POD

Sponsored-by: Virginia Tech Libraries

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 7 Tomás Cohen Arazi (tcohen) 2021-02-02 19:52:53 UTC
Created attachment 116225 [details] [review]
Bug 26636: Regression tests for undef case

This patch adds tests for the case in which there's no object identified
by the supplied $id. It should return undef.

Sponsored-by: Virginia Tech Libraries

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 8 Tomás Cohen Arazi (tcohen) 2021-02-02 19:53:01 UTC
Created attachment 116226 [details] [review]
Bug 26636: (QA follow-up) Handle no results correctly

Sponsored-by: Virginia Tech Libraries

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 9 Tomás Cohen Arazi (tcohen) 2021-02-02 19:54:56 UTC
With Agustin's permission, I decided to remove the authorised values bit from this bug, and move it to 26635. I added some QA follow-ups in the process.

Dependencies changed as well.
Comment 10 Andrew Fuerste-Henry 2021-02-02 19:55:19 UTC
Created attachment 116227 [details] [review]
Bug 26636: Add tests

This patch adds tests for the new objects.find helper.

Sponsored-by: Virginia Tech Libraries

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 11 Andrew Fuerste-Henry 2021-02-02 19:55:22 UTC
Created attachment 116228 [details] [review]
Bug 26636: Add objects.find helper

This patch adds the objects.find helper. Much like objects.search, it
returns the to_api method with embedded.

Sponsored-by: Virginia Tech Libraries

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 12 Andrew Fuerste-Henry 2021-02-02 19:55:25 UTC
Created attachment 116229 [details] [review]
Bug 26636: (QA follow-up) Add POD

Sponsored-by: Virginia Tech Libraries

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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 13 Andrew Fuerste-Henry 2021-02-02 19:55:27 UTC
Created attachment 116230 [details] [review]
Bug 26636: Regression tests for undef case

This patch adds tests for the case in which there's no object identified
by the supplied $id. It should return undef.

Sponsored-by: Virginia Tech Libraries

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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 14 Andrew Fuerste-Henry 2021-02-02 19:55:30 UTC
Created attachment 116231 [details] [review]
Bug 26636: (QA follow-up) Handle no results correctly

Sponsored-by: Virginia Tech Libraries

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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 15 Agustín Moyano 2021-02-09 15:35:13 UTC
Created attachment 116594 [details] [review]
Bug 26636: Add tests

This patch adds tests for the new objects.find helper.

Sponsored-by: Virginia Polytechnic Institute and State University

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 16 Agustín Moyano 2021-02-09 15:35:16 UTC
Created attachment 116595 [details] [review]
Bug 26636: Add objects.find helper

This patch adds the objects.find helper. Much like objects.search, it
returns the to_api method with embedded.

Sponsored-by: Virginia Polytechnic Institute and State University

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 17 Agustín Moyano 2021-02-09 15:35:19 UTC
Created attachment 116596 [details] [review]
Bug 26636: (QA follow-up) Add POD

Sponsored-by: Virginia Polytechnic Institute and State University

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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 18 Agustín Moyano 2021-02-09 15:35:23 UTC
Created attachment 116597 [details] [review]
Bug 26636: Regression tests for undef case

This patch adds tests for the case in which there's no object identified
by the supplied $id. It should return undef.

Sponsored-by: Virginia Polytechnic Institute and State University

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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 19 Agustín Moyano 2021-02-09 15:35:27 UTC
Created attachment 116598 [details] [review]
Bug 26636: (QA follow-up) Handle no results correctly

Sponsored-by: Virginia Polytechnic Institute and State University

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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 20 Martin Renvoize (ashimema) 2021-03-04 10:34:10 UTC
Created attachment 117669 [details] [review]
Bug 26636: Add tests

This patch adds tests for the new objects.find helper.

Sponsored-by: Virginia Polytechnic Institute and State University

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 21 Martin Renvoize (ashimema) 2021-03-04 10:34:13 UTC
Created attachment 117670 [details] [review]
Bug 26636: Add objects.find helper

This patch adds the objects.find helper. Much like objects.search, it
returns the to_api method with embedded.

Sponsored-by: Virginia Polytechnic Institute and State University

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 22 Martin Renvoize (ashimema) 2021-03-04 10:34:16 UTC
Created attachment 117671 [details] [review]
Bug 26636: (QA follow-up) Add POD

Sponsored-by: Virginia Polytechnic Institute and State University

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 23 Martin Renvoize (ashimema) 2021-03-04 10:34:20 UTC
Created attachment 117672 [details] [review]
Bug 26636: Regression tests for undef case

This patch adds tests for the case in which there's no object identified
by the supplied $id. It should return undef.

Sponsored-by: Virginia Polytechnic Institute and State University

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 24 Martin Renvoize (ashimema) 2021-03-04 10:34:23 UTC
Created attachment 117673 [details] [review]
Bug 26636: (QA follow-up) Handle no results correctly

Sponsored-by: Virginia Polytechnic Institute and State University

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 25 Martin Renvoize (ashimema) 2021-03-04 10:35:57 UTC
A clear and concise patchset that include regressions tests, works as expected and passes QA script.

Passing QA
Comment 26 Jonathan Druart 2021-03-09 10:02:39 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 27 Fridolin Somers 2021-03-12 08:49:56 UTC
Enhancement not pushed to 20.11.x
Comment 28 Tomás Cohen Arazi (tcohen) 2021-11-11 11:34:14 UTC
Created attachment 127528 [details] [review]
Bug 26636: Add tests [20.11.x]

This patch adds tests for the new objects.find helper.

Sponsored-by: Virginia Polytechnic Institute and State University

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 29 Tomás Cohen Arazi (tcohen) 2021-11-11 11:34:29 UTC
Created attachment 127529 [details] [review]
Bug 26636: Add objects.find helper [20.11.x]

This patch adds the objects.find helper. Much like objects.search, it
returns the to_api method with embedded.

Sponsored-by: Virginia Polytechnic Institute and State University

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 30 Tomás Cohen Arazi (tcohen) 2021-11-11 11:34:36 UTC
Created attachment 127530 [details] [review]
Bug 26636: (QA follow-up) Add POD [20.11.x]

Sponsored-by: Virginia Polytechnic Institute and State University

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 31 Tomás Cohen Arazi (tcohen) 2021-11-11 11:34:42 UTC
Created attachment 127531 [details] [review]
Bug 26636: Regression tests for undef case [20.11.x]

This patch adds tests for the case in which there's no object identified
by the supplied $id. It should return undef.

Sponsored-by: Virginia Polytechnic Institute and State University

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 32 Tomás Cohen Arazi (tcohen) 2021-11-11 11:34:48 UTC
Created attachment 127532 [details] [review]
Bug 26636: (QA follow-up) Handle no results correctly [20.11.x]

Sponsored-by: Virginia Polytechnic Institute and State University

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>