thoth-station / jupyterlab-requirements

JupyterLab Extension for dependency management and optimization
GNU General Public License v3.0
16 stars 9 forks source link

constraints versions of packages are not ordered #620

Closed pacospace closed 2 years ago

pacospace commented 2 years ago

Describe the bug constraints versions of packages are not ordered

To Reproduce Steps to reproduce the behavior:

  1. Add boto3
  2. check constraints

Expected behavior A clear and concise description of what you expected to happen.

Screenshots Screenshot from 2022-02-17 17-23-12

Environment information

Stack information

Additional context

Gkrumbach07 commented 2 years ago

Hi @pacospace. I have seen this issue before and it pops up only for some packages. The issue is that sometimes the packages are stored in order and sometimes they are not. Previously, to get around this, I would iteratively fetch each page of data and then sort it on the frontend. Depending on the amount of versions available, this could slow down the ui.

The fix I would recommend would be on User API or even storages: to presort the data.

But a quick and dirty fix on the front is what's described above: fetch each page and then sort.

Note: version's endpoint is pagenated with a max page size of 100 version entries.

pacospace commented 2 years ago

Hi @pacospace. I have seen this issue before and it pops up only for some packages. The issue is that sometimes the packages are stored in order and sometimes they are not. Previously, to get around this, I would iteratively fetch each page of data and then sort it on the frontend. Depending on the amount of versions available, this could slow down the ui.

The fix I would recommend would be on User API or even storages: to presort the data.

But a quick and dirty fix on the front is what's described above: fetch each page and then sort.

Note: version's endpoint is pagenated with a max page size of 100 version entries.

thanks @Gkrumbach07 for the comment and proposed solutions! I see there is no sort in the query for package versions here in the method in User-API: https://github.com/thoth-station/user-api/blob/b96280a57010a46481265e63b066883987d6dfc0/thoth/user_api/api_v1.py#L735, it needs some new logic indeeed on the backend side.

Can you please open a feature request in User-API in that case then? so we can discuss there with @fridex also.

Gkrumbach07 commented 2 years ago

Can you please open a feature request in User-API in that case then? so we can discuss there with @fridex also.

Sure thing! I believe this will be an excellent feature moving forward for UI.

In the meantime do you want the quick fix implemented?

pacospace commented 2 years ago

Can you please open a feature request in User-API in that case then? so we can discuss there with @fridex also.

Sure thing! I believe this will be an excellent feature moving forward for UI.

In the meantime do you want the quick fix implemented?

I think we can wait a bit, it is not critical.

Gkrumbach07 commented 2 years ago

/priority important-soon

sesheta commented 2 years ago

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

/lifecycle stale

sesheta commented 2 years ago

Stale issues rot after 30d of inactivity. Mark the issue as fresh with /remove-lifecycle rotten. Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

/lifecycle rotten

sesheta commented 2 years ago

Rotten issues close after 30d of inactivity. Reopen the issue with /reopen. Mark the issue as fresh with /remove-lifecycle rotten.

/close

sesheta commented 2 years ago

@sesheta: Closing this issue.

In response to [this](https://github.com/thoth-station/jupyterlab-requirements/issues/620#issuecomment-1192954411): >Rotten issues close after 30d of inactivity. >Reopen the issue with `/reopen`. >Mark the issue as fresh with `/remove-lifecycle rotten`. > >/close Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.