GET /os-migrations sample has incorrect sort order

Bug #1801789 reported by Matt Riedemann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Takashi Natsume

Bug Description

The API reference sample for the GET /os-migrations API with the 2.59 microversion:

https://developer.openstack.org/api-ref/compute/?expanded=list-migrations-detail#list-migrations

Shows an incorrect sort order. The returned migrations are sorted by [created_at, id] in descending order:

https://github.com/openstack/nova/blob/c64b03d218c4d05b9db47eaf7660cdab9baa6468/nova/api/openstack/compute/migrations.py#L158

The response sample shows several random migration records and they aren't sorted by created_at in descending order, because the sample is based on stubs in the functional test:

https://github.com/openstack/nova/blob/c64b03d218c4d05b9db47eaf7660cdab9baa6468/nova/tests/functional/api_sample_tests/test_migrations.py#L193

Since the API reference does not mention what the sort order is, a user might have to guess from the sample, which would be pretty much impossible with the existing sample.

With this bug, the API reference sample should:

1. Fix the sample response data to use proper sort order from the API for the 2.59 samples (since there is no guaranteed sort order for microversion < 2.59, especially with multiple cells).

2. Mention the sort order in the API reference when using microversion 2.59+.

Matt Riedemann (mriedem)
Changed in nova:
status: New → Triaged
importance: Undecided → Low
Changed in nova:
assignee: nobody → Takashi NATSUME (natsume-takashi)
status: Triaged → In Progress
Revision history for this message
Takashi Natsume (natsume-takashi) wrote :

The v2.59 example has already sorted by created_at in descending order.
So add a description about the sort order in the API reference when using microversion 2.59+.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/616773

Changed in nova:
assignee: Takashi NATSUME (natsume-takashi) → Ken'ichi Ohmichi (oomichi)
Matt Riedemann (mriedem)
Changed in nova:
assignee: Ken'ichi Ohmichi (oomichi) → Takashi NATSUME (natsume-takashi)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/616773
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=084ce9b28af1320d17ff3ebf63d23f7830019982
Submitter: Zuul
Branch: master

commit 084ce9b28af1320d17ff3ebf63d23f7830019982
Author: Takashi NATSUME <email address hidden>
Date: Fri Nov 9 14:17:07 2018 +0900

    api-ref: Add a description about sort order

    Add a description about the sort order
    in the "List Migrations" (GET /os-migrations) API.

    Change-Id: Iaa8e264ca95b69f3c97a6848918862ee22922de1
    Closes-Bug: #1801789

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 19.0.0.0rc1

This issue was fixed in the openstack/nova 19.0.0.0rc1 release candidate.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.