Bug 28965 - Add public routes for lists
Summary: Add public routes for lists
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: REST API (show other bugs)
Version: Main
Hardware: All All
: P5 - low new feature
Assignee: Tomás Cohen Arazi (tcohen)
QA Contact: Martin Renvoize (ashimema)
URL:
Keywords:
: 34577 (view as bug list)
Depends on: 28948 28959
Blocks: 18148 38050
  Show dependency treegraph
 
Reported: 2021-09-07 16:23 UTC by Tomás Cohen Arazi (tcohen)
Modified: 2024-12-11 18:19 UTC (History)
8 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This enhancement adds new public API endpoint for retrieving lists.
Version(s) released in:
24.11.00
Circulation function:


Attachments
Bug 28965: filter_by_public() and filter_by_readable() (6.40 KB, patch)
2021-09-08 02:55 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 28965: Add /public/lists (8.20 KB, patch)
2021-09-08 02:55 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 28965: filter_by_public() and filter_by_readable() (5.78 KB, patch)
2024-05-01 14:11 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 28965: Add /public/lists (8.42 KB, patch)
2024-05-01 14:11 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 28965: filter_by_public() and filter_by_readable() (5.85 KB, patch)
2024-10-29 12:17 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 28965: Add /public/lists (8.45 KB, patch)
2024-10-29 12:17 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 28965: (QA follow-up) Fix misc qa issues (2.92 KB, patch)
2024-10-29 12:17 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 28965: (QA follow-up) Fix misc qa issues (2.98 KB, patch)
2024-10-29 12:25 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 28965: filter_by_public() and filter_by_readable() (5.84 KB, patch)
2024-10-29 19:22 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 28965: Add /public/lists (9.06 KB, patch)
2024-10-29 19:22 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 28965: (QA follow-up) Fix misc qa issues (2.80 KB, patch)
2024-10-29 19:22 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 28965: Unit tests (5.85 KB, patch)
2024-10-29 19:22 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 28965: filter_by_public() and filter_by_readable() (5.90 KB, patch)
2024-10-31 11:49 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 28965: Add /public/lists (9.13 KB, patch)
2024-10-31 11:49 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 28965: (QA follow-up) Fix misc qa issues (2.87 KB, patch)
2024-10-31 11:49 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 28965: Unit tests (5.91 KB, patch)
2024-10-31 11:49 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Tomás Cohen Arazi (tcohen) 2021-09-07 16:23:22 UTC

    
Comment 1 Tomás Cohen Arazi (tcohen) 2021-09-08 02:55:04 UTC
Created attachment 124635 [details] [review]
Bug 28965: filter_by_public() and filter_by_readable()

This patch adds helper methods for lists resultsets. Tests are added for
their behavior.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Virtualshelves.t
=> SUCCESS: Tests pass!
3. Sign off :-D
Comment 2 Tomás Cohen Arazi (tcohen) 2021-09-08 02:55:08 UTC
Created attachment 124636 [details] [review]
Bug 28965: Add /public/lists

This patch adds a route for publicly retrieving lists.
Comment 3 Tomás Cohen Arazi (tcohen) 2021-09-08 02:57:18 UTC
Submitting early to highlight the coolness of what we did on bug 28948. It still needs tests.

I will file a separate bug for all the CRUD (staff/public). The barebones are done anyway :-D
Comment 4 David Nind 2021-09-08 19:33:25 UTC
Tests fail for me after applying patch (and dependencies) 8-(...

root@kohadevbox:koha(bz28965)$ prove t/db_dependent/Virtualshelves.t
t/db_dependent/Virtualshelves.t .. No method count found for Koha::Virtualshelves DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Unknown column 'public' in 'where clause' at /kohadevbox/koha/Koha/Objects.pm line 601
 at /kohadevbox/koha/Koha/Virtualshelf.pm line 99.
DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Unknown column 'public' in 'field list' at /kohadevbox/koha/Koha/Object.pm line 170
    # Looks like you planned 13 tests but ran 1.
t/db_dependent/Virtualshelves.t .. 1/8 
#   Failed test 'CRUD'
#   at t/db_dependent/Virtualshelves.t line 110.
DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Unknown column 'public' in 'field list' at /kohadevbox/koha/Koha/Object.pm line 170
# Looks like your test exited with 11 just after 1.
t/db_dependent/Virtualshelves.t .. Dubious, test returned 11 (wstat 2816, 0xb00)
Failed 8/8 subtests 

Test Summary Report
-------------------
t/db_dependent/Virtualshelves.t (Wstat: 2816 Tests: 1 Failed: 1)
  Failed test:  1
  Non-zero exit status: 11
  Parse errors: Bad plan.  You planned 8 tests but ran 1.
Files=1, Tests=1,  2 wallclock secs ( 0.02 usr  0.00 sys +  1.58 cusr  0.15 csys =  1.75 CPU)
Result: FAIL
Comment 5 Tomás Cohen Arazi (tcohen) 2021-09-08 19:37:30 UTC
(In reply to David Nind from comment #4)
> Tests fail for me after applying patch (and dependencies) 8-(...
> 
> root@kohadevbox:koha(bz28965)$ prove t/db_dependent/Virtualshelves.t
> t/db_dependent/Virtualshelves.t .. No method count found for
> Koha::Virtualshelves DBIx::Class::Storage::DBI::_dbh_execute(): DBI
> Exception: DBD::mysql::st execute failed: Unknown column 'public' in 'where
> clause' at /kohadevbox/koha/Koha/Objects.pm line 601

This failure is because you didn't run the updatedatabase script with bug 28959 applied. That said, I found some missing bits on that bug as well. So hold on.
Comment 6 David Cook 2023-05-05 02:22:01 UTC
(In reply to Tomás Cohen Arazi from comment #5)
> This failure is because you didn't run the updatedatabase script with bug
> 28959 applied. That said, I found some missing bits on that bug as well. So
> hold on.

Now that the dependencies are pushed, what else needs to be done to move this into Needs Signoff?
Comment 7 Jonathan Druart 2023-11-28 09:45:33 UTC
*** Bug 34577 has been marked as a duplicate of this bug. ***
Comment 8 David Cook 2023-11-28 23:13:45 UTC
Seems like there's a few of us keen on this one. Let's get this one in? 

I'm hoping to tackle bug 18148 before the end of the year, but it relies on having a public list endpoint.
Comment 9 Martin Renvoize (ashimema) 2024-05-01 14:11:26 UTC
Created attachment 165976 [details] [review]
Bug 28965: filter_by_public() and filter_by_readable()

This patch adds helper methods for lists resultsets. Tests are added for
their behavior.

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

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 10 Martin Renvoize (ashimema) 2024-05-01 14:11:29 UTC
Created attachment 165977 [details] [review]
Bug 28965: Add /public/lists

This patch adds a route for publicly retrieving lists.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 11 Martin Renvoize (ashimema) 2024-05-01 14:12:25 UTC
I've rebased this and got it passing QA scripts.. however it needs a good testing and QA run.
Comment 12 Martin Renvoize (ashimema) 2024-09-17 12:31:49 UTC
Still applies.. would be nice to see someone QA it soon.
Comment 13 David Cook 2024-10-09 04:59:28 UTC
(In reply to Martin Renvoize (ashimema) from comment #12)
> Still applies.. would be nice to see someone QA it soon.

I've got quite the backlog at the moment, but since this blocks bug 18148 it's definitely on my radar.
Comment 14 David Cook 2024-10-29 01:03:22 UTC
I know I'm being slow on this one, but this is one of those ones I'm really going to do at some point, as it relates to a customer request.

I figure November/December timeline. Hopefully sooner rather than later but we'll see...
Comment 15 Kyle M Hall (khall) 2024-10-29 12:17:20 UTC
Created attachment 173624 [details] [review]
Bug 28965: filter_by_public() and filter_by_readable()

This patch adds helper methods for lists resultsets. Tests are added for
their behavior.

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

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 16 Kyle M Hall (khall) 2024-10-29 12:17:27 UTC
Created attachment 173625 [details] [review]
Bug 28965: Add /public/lists

This patch adds a route for publicly retrieving lists.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 17 Kyle M Hall (khall) 2024-10-29 12:17:30 UTC
Created attachment 173626 [details] [review]
Bug 28965: (QA follow-up) Fix misc qa issues

* Tidy code
* Fix number of unit tests
* Remove unecessary use of delete

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 18 Kyle M Hall (khall) 2024-10-29 12:18:00 UTC
Tomas, can you add api unit tests?
Comment 19 Kyle M Hall (khall) 2024-10-29 12:25:03 UTC
Created attachment 173627 [details] [review]
Bug 28965: (QA follow-up) Fix misc qa issues

* Tidy code
* Fix number of unit tests
* Fix use of delete

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 20 Tomás Cohen Arazi (tcohen) 2024-10-29 12:34:18 UTC
(In reply to Kyle M Hall (khall) from comment #18)
> Tomas, can you add api unit tests?

Oops. Sure!
Comment 21 Tomás Cohen Arazi (tcohen) 2024-10-29 19:22:13 UTC
Created attachment 173687 [details] [review]
Bug 28965: filter_by_public() and filter_by_readable()

This patch adds helper methods for lists resultsets. Tests are added for
their behavior.

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

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 22 Tomás Cohen Arazi (tcohen) 2024-10-29 19:22:16 UTC
Created attachment 173688 [details] [review]
Bug 28965: Add /public/lists

This patch adds a route for publicly retrieving lists.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 23 Tomás Cohen Arazi (tcohen) 2024-10-29 19:22:19 UTC
Created attachment 173689 [details] [review]
Bug 28965: (QA follow-up) Fix misc qa issues

* Tidy code
* Fix number of unit tests
* Fix use of delete

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 24 Tomás Cohen Arazi (tcohen) 2024-10-29 19:22:22 UTC
Created attachment 173690 [details] [review]
Bug 28965: Unit tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 25 Tomás Cohen Arazi (tcohen) 2024-10-29 19:23:23 UTC
(In reply to Kyle M Hall (khall) from comment #18)
> Tomas, can you add api unit tests?

Done, please review the changes and let me know if there's something else missing. Thanks!
Comment 26 Martin Renvoize (ashimema) 2024-10-31 11:49:20 UTC
Created attachment 173780 [details] [review]
Bug 28965: filter_by_public() and filter_by_readable()

This patch adds helper methods for lists resultsets. Tests are added for
their behavior.

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

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 27 Martin Renvoize (ashimema) 2024-10-31 11:49:23 UTC
Created attachment 173781 [details] [review]
Bug 28965: Add /public/lists

This patch adds a route for publicly retrieving lists.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 28 Martin Renvoize (ashimema) 2024-10-31 11:49:26 UTC
Created attachment 173782 [details] [review]
Bug 28965: (QA follow-up) Fix misc qa issues

* Tidy code
* Fix number of unit tests
* Fix use of delete

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 29 Martin Renvoize (ashimema) 2024-10-31 11:49:29 UTC
Created attachment 173783 [details] [review]
Bug 28965: Unit tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 30 Martin Renvoize (ashimema) 2024-10-31 11:49:46 UTC
All looking good here now, thanks :)
Comment 31 Katrin Fischer 2024-11-08 15:09:59 UTC
Pushed for 24.11!

Well done everyone, thank you!
Comment 32 David Nind 2024-12-11 18:19:28 UTC
API not covered in the manual, so no updates required.