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

param order_by=version doesn't sort correctly #1516

Closed
jerabekjiri opened this issue Jul 17, 2023 · 0 comments · Fixed by #1517
Closed

param order_by=version doesn't sort correctly #1516

jerabekjiri opened this issue Jul 17, 2023 · 0 comments · Fixed by #1517

Comments

@jerabekjiri
Copy link
Contributor

jerabekjiri commented Jul 17, 2023

AAH issue: AAH-2581

Version

"server_version":"4.8.0dev"
"galaxy_ng_version":"4.8.0dev"
galaxy_ng_commit":"origin/master:a314e11"
"galaxy_importer_version":"0.4.10"
"pulp_core_version":"3.23.4"
"pulp_ansible_version":"0.17.2"
"pulp_container_version":"2.14.5"

Describe the bug
The order_by=-version param isn't working as expected on x-repo search, so the ui is getting the whole list and 1.7.3 shows up first and it's just marking it "latest".

pulp=> SELECT version FROM ansible_collectionversion ORDER BY version DESC;
 version
---------
 1.7.3
 1.21.2
 1.21.1
 1.21.0
 1.20.0
 1.19.3
 1.16.2
 1.15.1
 1.12.1
 1.0.1
 1.0.0
(11 rows)

To Reproduce
Go to the rhel_system roles collection main page: https://console.redhat.com/ansible/automation-hub/repo/published/redhat/rhel_system_roles/

Click on the collection version drop down, and the collection showing "(latest)" is the v1.7.3 version, not the actual latest, v1.21.1.

The list comes from the URL: https://console.redhat.com/api/automation-hub/v3/plugin/ansible/search/collection-versions/?repository_name=published&namespace=redhat&name=rhel_system_roles&order_by=-version&offset=0&limit=10

Expected behavior
Semantic versions should be sorted in the correct order.

jerabekjiri added a commit to jerabekjiri/pulp_ansible that referenced this issue Jul 17, 2023
jerabekjiri added a commit to jerabekjiri/pulp_ansible that referenced this issue Jul 17, 2023
jerabekjiri added a commit to jerabekjiri/pulp_ansible that referenced this issue Jul 18, 2023
jerabekjiri added a commit to jerabekjiri/pulp_ansible that referenced this issue Jul 20, 2023
jerabekjiri added a commit to jerabekjiri/pulp_ansible that referenced this issue Jul 20, 2023
jerabekjiri added a commit to jerabekjiri/pulp_ansible that referenced this issue Jul 25, 2023
jerabekjiri added a commit to jerabekjiri/pulp_ansible that referenced this issue Aug 1, 2023
jerabekjiri added a commit to jerabekjiri/pulp_ansible that referenced this issue Aug 1, 2023
jerabekjiri added a commit to jerabekjiri/pulp_ansible that referenced this issue Aug 2, 2023
@jerabekjiri jerabekjiri self-assigned this Aug 2, 2023
jerabekjiri added a commit to jerabekjiri/pulp_ansible that referenced this issue Aug 3, 2023
jctanner pushed a commit that referenced this issue Aug 14, 2023
* Add custom SemanticVersionOrderingFilter for version sorting

fixes: #1516

* order by version fields

fixes: #1516

* improve sorting

fixes: #1516

* cleanup version sorting

fixes: #1516

* add sort version test

fixes: #1516

* sort only in created repo

fixes: #1516

* improve functional test

fixes: #1516

* use sorted

fixes: #1516
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant