-
Sub-task
-
Resolution: Done
-
Undefined
-
None
-
None
Description of problem:
When we have a CV with multiple versions published, the /katello/api/content_views/<id> endpoint returns CV versions unsorted, which results in unsorted output of `hammer content-view info` command.
Version-Release number of selected component (if applicable):
6.13.0
How reproducible:
always for higher (~10 or more) count of CVV published
Steps to Reproduce:
1. Have a CV with some repo, publish it multiple times (in a loop, no changes needed)
2. Display the CV details using hammer:
- hammer content-view info --id <cv_id>
3. GET the CV details using /katello/api/content_views/ endpoint: - curl -sku admin:passwd -X GET https://$(hostname)/katello/api/content_views/<cv_id> | jq
Actual results:
2. # hammer content-view info --id="27"
Id: 27
Name: ydKgmVXuAF
Label: ydKgmVXuAF
Composite: false
Description:
Content Host Count: 0
Solve Dependencies: false
Organization: UwcidX
Yum Repositories:
1) Id: 63
Name: XTrVRTDYMPnmkBS
Label: XTrVRTDYMPnmkBS
Container Image Repositories:
OSTree Repositories:
Lifecycle Environments:
1) Id: 13
Name: Library
Versions:
1) Id: 64
Version: 8.0 <---------------
Published: 2023/05/24 12:39:35
2) Id: 57
Version: 1.0
Published: 2023/05/24 12:38:29
3) Id: 58
Version: 2.0
Published: 2023/05/24 12:38:47
4) Id: 59
Version: 3.0
Published: 2023/05/24 12:38:55
5) Id: 60
Version: 4.0
Published: 2023/05/24 12:39:03
6) Id: 61
Version: 5.0
Published: 2023/05/24 12:39:11
7) Id: 62
Version: 6.0
Published: 2023/05/24 12:39:19
8) Id: 63
Version: 7.0
Published: 2023/05/24 12:39:27
9) Id: 65
Version: 9.0 <---------------
Published: 2023/05/24 12:39:43
10)Id: 66
Version: 10.0
Published: 2023/05/24 12:39:51
3. # curl -sku admin:passwd -X GET https://$(hostname)/katello/api/content_views/27 | jq
...
"versions": [
,
,
,
,
,
,
,
,
,
{ "id": 66, "version": "10.0", "published": "2023-05-24 12:39:51 UTC", "environment_ids": [ 13 ], "filters_applied": false }...
Expected results:
Output sorted by Id or Version.
QE Tracker for https://issues.redhat.com/browse/SAT-21779
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2209758