Skip to content
This repository has been archived by the owner on Jul 23, 2020. It is now read-only.

API: /namedspaces/{userName} to support all spaces #1628

Closed
dlabrecq opened this issue Dec 11, 2017 · 7 comments
Closed

API: /namedspaces/{userName} to support all spaces #1628

dlabrecq opened this issue Dec 11, 2017 · 7 comments

Comments

@dlabrecq
Copy link
Collaborator

The existing /namedspaces/{userName} API only supports paginated data. For the new my spaces page, I need to obtain all spaces for a given user in order to apply a filter and sort.

I've tried omitting page[limit] and using -1, but that defaults to 20 items. The alternative is to set a page limit of 2000, which is a short term workaround, but doesn't scale.

I expected this to behave more like the /spaces/{spaceID}/codebases API. That is, when page[limit] is omitted, all codebases are returned for the given space.

Note that the SpaceService.getSpacesByUser method of ngx-fabric8-wit should also be updated to provide all spaces instead of defaulting to 20 items.

@alexeykazakov
Copy link
Member

But what if there are 2000+ spaces? Uncontrolled result size may kill the UI, right? Are UI ready to handle 2000-space list as a response from backend? Yes? Then what about 3 000? 10 000? No? Then set page limit to 2000. Paginating is not a limitation. It just gives you some control over the result size.

@dlabrecq
Copy link
Collaborator Author

Setting a page limit of 2000 is a temporary workaround, until the APIs support sort and filtering. The main reason we need all the user's spaces is so the UI can apply sort and filtering properly.

When data is paginated, the sorting and filtering client-side fails. With paginated data, the API should perform sort and filtering server-side.

@alexeykazakov
Copy link
Member

What if there are 10 000 spaces in the response? Will UI handle it properly?

@dlabrecq
Copy link
Collaborator Author

dlabrecq commented Dec 12, 2017

Do we really expect a single user to own 10k spaces? I'm not speaking about all spaces across the system, only those owned by a given user.

That's not my point, however. Regardless how the data is obtained, it all has to be sorted and filtered together.

I simply want a single user's spaces so the UI can sort and filter client-side. That is, until the APIs are able support server-side sort and filter. Otherwise, the client-side sort and filter may fail without all the necessary data -- can't sort/filter spaces that have yet to load.

I thought this could be a compromise. That is, a temporary workaround until the APIs can be enhanced? If the API cannot provide all the user's spaces, then can the API please add support for sort and filtering?

@joshuawilson
Copy link
Member

It sounds reasonable to me but I would like @aslakknutsen to reply too.

@aslakknutsen
Copy link
Collaborator

I expected this to behave more like the /spaces/{spaceID}/codebases API. That is, when page[limit] is omitted, all codebases are returned for the given space.

That's a bug if anything...

@aslakknutsen
Copy link
Collaborator

Replaced by #1627

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants