New metadata for share resource broke API contract in Yoga

Bug #1968069 reported by Emilien Macchi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Shared File Systems Service (Manila)
Fix Released
Critical
Ashley Rodriguez

Bug Description

Before Yoga:

curl -X GET -s -H "X-Auth-Token:$TOKEN_ID" -H "Content-type: application/json" <host>/v2/50f38aaa774d459089d197ef6f8784da/shares/29f7af97-ae83-41e4-8ec4-7f9a31f8df66/metadata/key

Result:
{"meta": {"key": "value2"}}

In Yoga and forward:

curl -X GET -s -H "X-Auth-Token:$TOKEN_ID" -H "Content-type: application/json" <host>/v2/50f38aaa774d459089d197ef6f8784da/shares/29f7af97-ae83-41e4-8ec4-7f9a31f8df66/metadata/key

Result:
{"metadata": {"key": {"key": "value2"}}}

This is likely due to https://review.opendev.org/c/openstack/manila/+/824648 which broke the API contract and we noticed it via our OpenStack Golang library:
https://github.com/gophercloud/gophercloud/actions/runs/2096445225

Our logs show that it worked fine until March 6th (included), then broke, which correspond with the mentioned patch, merged on March 7th.

Changed in manila:
assignee: nobody → Ashley Rodriguez (ashrod98)
Changed in manila:
importance: Undecided → Critical
milestone: none → zed-1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to manila-tempest-plugin (master)

Related fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/manila-tempest-plugin/+/836877

Revision history for this message
Goutham Pacha Ravi (gouthamr) wrote :

Thanks for reporting this bug, Emilien.

Tempest tests were not testing the v2 API in many places, including where this API was specifically refactored; I'm changing that and adding relevant validation:
 https://review.opendev.org/c/openstack/manila-tempest-plugin/+/836877

Changed in manila:
status: New → In Progress
Revision history for this message
Goutham Pacha Ravi (gouthamr) wrote :

Fix proposed to branch: master
    https://review.opendev.org/c/openstack/manila/+/837400/

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

Reviewed: https://review.opendev.org/c/openstack/manila/+/837400
Committed: https://opendev.org/openstack/manila/commit/2c1456b3f24a9f8a6a031b0cc963fb61cbf869f9
Submitter: "Zuul (22348)"
Branch: master

commit 2c1456b3f24a9f8a6a031b0cc963fb61cbf869f9
Author: Ashley Rodriguez <email address hidden>
Date: Mon Apr 11 19:05:15 2022 +0000

    Shares Metadata follow-up patch

    Addresses some comments from initial patch here [1].
    Also addresses a regression regarding get_metadata_item or show_metadata
    and the response keys as shown in this bug [2].

    [1]: https://review.opendev.org/c/openstack/manila/+/824648
    [2]: https://bugs.launchpad.net/manila/+bug/1968069

    Closes-Bug: #1968069
    Change-Id: Ib5a62599b84ba55617071f8bcd8e2a1a11b2537b

Changed in manila:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila (stable/yoga)

Fix proposed to branch: stable/yoga
Review: https://review.opendev.org/c/openstack/manila/+/838536

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila (stable/yoga)

Reviewed: https://review.opendev.org/c/openstack/manila/+/838536
Committed: https://opendev.org/openstack/manila/commit/8817389ada9962ee00471102cf287627930d4b31
Submitter: "Zuul (22348)"
Branch: stable/yoga

commit 8817389ada9962ee00471102cf287627930d4b31
Author: Ashley Rodriguez <email address hidden>
Date: Mon Apr 11 19:05:15 2022 +0000

    Shares Metadata follow-up patch

    Addresses some comments from initial patch here [1].
    Also addresses a regression regarding get_metadata_item or show_metadata
    and the response keys as shown in this bug [2].

    [1]: https://review.opendev.org/c/openstack/manila/+/824648
    [2]: https://bugs.launchpad.net/manila/+bug/1968069

    Closes-Bug: #1968069
    Change-Id: Ib5a62599b84ba55617071f8bcd8e2a1a11b2537b
    (cherry picked from commit 2c1456b3f24a9f8a6a031b0cc963fb61cbf869f9)

tags: added: in-stable-yoga
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to manila-tempest-plugin (master)

Reviewed: https://review.opendev.org/c/openstack/manila-tempest-plugin/+/836877
Committed: https://opendev.org/openstack/manila-tempest-plugin/commit/8bb17fc562bef136ccf2683aaf32e3a1ddb6017c
Submitter: "Zuul (22348)"
Branch: master

commit 8bb17fc562bef136ccf2683aaf32e3a1ddb6017c
Author: Goutham Pacha Ravi <email address hidden>
Date: Wed Apr 6 23:42:27 2022 +0530

    Refactor share metadata tests

    1) Use the shares_v2_client to make metadata API requests.
    This allows us to test v1 proxies as well where appropriate,
    and actually test the supported version of the API instead
    of the deprecated version

    2) Verify key in GET /v2/shares/<share>/metadata/{key} API

    the client's _parse_body helper strips out the top
    level key allowing us to miss bugs associated with
    any key changes from the server [1]. Allow for opt-in
    verification of the key and add this verification
    to the affected API.

    [1] https://bugs.launchpad.net/manila/+bug/1968069

    Depends-On: Ib5a62599b84ba55617071f8bcd8e2a1a11b2537b
    Change-Id: I7b1af957f08328c642a74ff123deb78e193bbe3a
    Related-Bug: #1968069
    Signed-off-by: Goutham Pacha Ravi <email address hidden>

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to manila-tempest-plugin (master)

Related fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/manila-tempest-plugin/+/849995

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to manila-tempest-plugin (master)

Reviewed: https://review.opendev.org/c/openstack/manila-tempest-plugin/+/849995
Committed: https://opendev.org/openstack/manila-tempest-plugin/commit/0e4a3d2a877c4e85d73e3f3a318c5dfaa4624a27
Submitter: "Zuul (22348)"
Branch: master

commit 0e4a3d2a877c4e85d73e3f3a318c5dfaa4624a27
Author: Goutham Pacha Ravi <email address hidden>
Date: Fri Jul 15 17:37:42 2022 +0530

    Update tempest version required

    I093be875910ef18deebe3e56b83c6992d1a307e5 introduced the
    use of newer code from tempest that isn't available until
    the 31.1.0 release.

    Change-Id: Ibe2946fafd4d2b58d49b6c4040887346df1f9899
    Related-Bug: #1968069
    Signed-off-by: Goutham Pacha Ravi <email address hidden>

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/manila 15.0.0.0rc1

This issue was fixed in the openstack/manila 15.0.0.0rc1 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/manila 14.0.1

This issue was fixed in the openstack/manila 14.0.1 release.

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.