Add ExactMatch flag to packages API #14119

Closed
opened 2025-11-02 11:03:29 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @PulsarFX on GitHub (Feb 10, 2025).

Feature Description

Currently the API for /packages/{owner} localhost:3000/api/swagger/package/listPackages
(Gets all packages of an owner)
is defined with the following parameters:

  • page number
  • limit items
  • type of package
  • q name filter

The problem is, that the name filter is treated with the LIKE operator. There is no way to do an exact name search.

-> Please add a flag to do an exact name search.

Background:
Our repository is very, very big with lots of nuget packages (100k packages and counting) that share parts of the same name, like a base package package.name.part and lots of specialized packages like package.name.part.subA, package.name.part.subB, ...

there is no way to filter for package.name.part, as it will always include all other packages aswell. This makes it impossible to do a performant lookup of what is present in the registry. Or is there?
Currently I query the whole registry which takes about 5 minutes to finish using package/listPackages with not q filter and do the grouping in code.
Earlier I used the nuget api directly, but it is much slower than listPackages.

-> It would be nice to have an API where the latest version of each package could be fetched, and then an API to get all versions of an package.

Screenshots

No response

Originally created by @PulsarFX on GitHub (Feb 10, 2025). ### Feature Description Currently the API for `/packages/{owner}` `localhost:3000/api/swagger/package/listPackages` (Gets all packages of an owner) is defined with the following parameters: - `page` number - `limit` items - `type` of package - `q` name filter The problem is, that the name filter is treated with the LIKE operator. There is no way to do an exact name search. -> Please add a flag to do an exact name search. Background: Our repository is very, very big with lots of nuget packages (100k packages and counting) that share parts of the same name, like a base package `package.name.part` and lots of specialized packages like `package.name.part.subA`, `package.name.part.subB`, ... there is no way to filter for `package.name.part`, as it will always include all other packages aswell. This makes it impossible to do a performant lookup of what is present in the registry. Or is there? Currently I query the whole registry which takes about 5 minutes to finish using `package/listPackages` with not q filter and do the grouping in code. Earlier I used the nuget api directly, but it is much slower than `listPackages`. -> It would be nice to have an API where the latest version of each package could be fetched, and then an API to get all versions of an package. ### Screenshots _No response_
GiteaMirror added the topic/packagestype/proposal labels 2025-11-02 11:03:29 -06:00
Author
Owner

@KN4CK3R commented on GitHub (Apr 10, 2025):

Added with #34173.

@KN4CK3R commented on GitHub (Apr 10, 2025): Added with #34173.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#14119