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

Collect endpoint sorting ability and default ordering. #508

Open
tdruez opened this issue Jul 23, 2024 · 3 comments
Open

Collect endpoint sorting ability and default ordering. #508

tdruez opened this issue Jul 23, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request high priority High Priority

Comments

@tdruez
Copy link
Contributor

tdruez commented Jul 23, 2024

In general, when multiple package entries are found in the PurlDB, we decided to use the most recent version for "package enriching" or data display in ScanCode.io and DejaCode.

When using the packages endpoint, one can use the sort=-version filter for ordering, but this is not available on the collect endpoint.

I think we should:

  1. Add the ability to provide the sort parameter to the collect endpoint
  2. Set a default order_by on the collect endpoint package QuerySet, to avoid returning a random order by the results. I would suggest always sorting by the most recent version, ie: -version, to be coherent with the data we care to display first.
@tdruez tdruez added enhancement New feature or request high priority High Priority labels Jul 23, 2024
JonoYang added a commit that referenced this issue Jul 23, 2024
@JonoYang
Copy link
Contributor

@tdruez I've set ordering of the package results from collect to -version. Just wondering: should the sort parameter be a list of fields?

@tdruez
Copy link
Contributor Author

tdruez commented Jul 24, 2024

@JonoYang We want consistency across all endpoints. The sort parameter on collect should work the same way it does on the packages endpoint.
https://github.com/nexB/purldb/blob/main/packagedb/api.py#L334

JonoYang added a commit that referenced this issue Aug 1, 2024
JonoYang added a commit that referenced this issue Aug 2, 2024
    * Create CommaListField

Signed-off-by: Jono Yang <[email protected]>
JonoYang added a commit that referenced this issue Aug 2, 2024
JonoYang added a commit that referenced this issue Aug 2, 2024
JonoYang added a commit that referenced this issue Aug 2, 2024
JonoYang added a commit that referenced this issue Aug 2, 2024
JonoYang added a commit that referenced this issue Aug 2, 2024
JonoYang added a commit that referenced this issue Aug 12, 2024
JonoYang added a commit that referenced this issue Aug 12, 2024
    * Create CommaListField

Signed-off-by: Jono Yang <[email protected]>
JonoYang added a commit that referenced this issue Aug 12, 2024
JonoYang added a commit that referenced this issue Aug 12, 2024
JonoYang added a commit that referenced this issue Aug 12, 2024
@JonoYang
Copy link
Contributor

@tdruez I've merged #513 and I've deployed it to public instance of purldb. Let me know if there are more changes needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request high priority High Priority
Projects
None yet
Development

No branches or pull requests

2 participants