Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nuget Package Explorer only loads several nuget packages #25564

Closed
pmandalka opened this issue Jun 28, 2023 · 4 comments · Fixed by #25613
Closed

Nuget Package Explorer only loads several nuget packages #25564

pmandalka opened this issue Jun 28, 2023 · 4 comments · Fixed by #25613

Comments

@pmandalka
Copy link

Description

I have uploaded about 2900 Nuget packages to a local installed gitea instance, which worked fine. I can see all packages in the package list of the organisation in the Web-UI an also search for specific Packages.
But if I try to load all Packages e.g. in Visual Studio or in nuget Packages Explorer, i only some several of these packages:
image

In gitea Web-UI it looks like this:
image

Anybody knows this issue?
I have not testet it on try.gitea.io.

Gitea Version

1.20.0+rc2-12-g102dcfa3a

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

Docker on Debian

How are you running Gitea?

As docker image

Database

PostgreSQL

@DaKaLKa
Copy link

DaKaLKa commented Jun 28, 2023

Cannot test on try.github.io - no Package support activated.

@KN4CK3R
Copy link
Member

KN4CK3R commented Jun 29, 2023

I was aware of that problem as it's related to #23191. The problem is the client calling the "list" endpoint with the parameters query?q=&skip=0&take=15. The take parameter specifies how many packages should be returned. Currently this count is passed into the function which queries the database for the package versions. This method finds take package versions while it should find take packages. I could not build a performant sql query which limits the count of packages but returns all available package versions of these packages.

@pmandalka
Copy link
Author

Ok, I see the SetSessionPagination set the limit on the versions instead of the packages.

In SQLite the needed query with take = 1 and Skip = 0 would be - so that the limit is executed on the packages and not the pacakge_version table.
SELECT * FROM (SELECT * FROM package LIMIT 1 OFFSET 0) t1 INNER JOIN (SELECT * FROM package_version) t2 ON t1.id = t2.package_id

But I have no experience in xorm and if it's possible to build such a query with the engine.

@KN4CK3R
Copy link
Member

KN4CK3R commented Jun 30, 2023

I looked into the problem yesterday and will create a PR later which fixes the problem. 👍

I created 50 packages with 20 versions each and the NuGet Package Explorer works fine now:
grafik

techknowlogick pushed a commit that referenced this issue Aug 14, 2023
Fixes #25564
Fixes #23191

- Api v2 search endpoint should return only the latest version matching
the query
- Api v3 search endpoint should return `take` packages not package
versions
KN4CK3R added a commit to KN4CK3R/gitea that referenced this issue Aug 14, 2023
Fixes go-gitea#25564
Fixes go-gitea#23191

- Api v2 search endpoint should return only the latest version matching
the query
- Api v3 search endpoint should return `take` packages not package
versions
KN4CK3R added a commit that referenced this issue Aug 16, 2023
Backport of #25613

Fixes #25564
Fixes #23191

- Api v2 search endpoint should return only the latest version matching
the query
- Api v3 search endpoint should return `take` packages not package
versions
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants