Bug 1792106

Summary: [RFE] RFE to improve returned message to have word "failed" in the text and explicitly say that category or tag is missing
Product: Red Hat CloudForms Management Engine Reporter: Saif Ali <saali>
Component: APIAssignee: Yuri Rudman <yrudman>
Status: CLOSED WONTFIX QA Contact: Parthvi Vala <pvala>
Severity: low Docs Contact: Red Hat CloudForms Documentation <cloudforms-docs>
Priority: medium    
Version: 5.10.0CC: dmetzger, jocarter, nansari, obarenbo, simaishi
Target Milestone: GAKeywords: FutureFeature, Reopened, RFE
Target Release: 5.11.7   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-07-01 20:01:24 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: Bug
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: CFME Core Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1822318    

Description Saif Ali 2020-01-17 03:40:10 UTC
Description of problem:
The API will return a 200 status code when a user attempts to assign a tag from a category that does not exist.  This should get a 400 response.

In my specific case, I was calling "/api/vms/#{vm_id}/tags" with a body of:
     {"action":"assign","resources":[{"category":"team","name":"it_pnp"}]}
but the category "team" did not exist.  This should generate a 400 since the parameters of the request were not valid, but cloudforms returned a 200.


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 4 Yuri Rudman 2020-05-21 20:07:53 UTC
PR: https://github.com/ManageIQ/manageiq/pull/20197

Comment 5 CFME Bot 2020-05-26 21:05:25 UTC
New commit detected on ManageIQ/manageiq/master:

https://github.com/ManageIQ/manageiq/commit/3a56e0e1f19e66fdc9fa65724c4b02d3e2438efb
commit 3a56e0e1f19e66fdc9fa65724c4b02d3e2438efb
Author:     Yuri Rudman <yrudman>
AuthorDate: Thu May 21 19:08:46 2020 +0000
Commit:     Yuri Rudman <yrudman>
CommitDate: Thu May 21 19:08:46 2020 +0000

    specify what is missing if tag assignment failed
    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1792106

 app/models/classification.rb | 12 +-
 1 file changed, 8 insertions(+), 4 deletions(-)

Comment 7 Yuri Rudman 2020-06-05 16:03:55 UTC
PR: https://github.com/ManageIQ/manageiq/pull/20216

Comment 9 CFME Bot 2020-06-19 19:31:28 UTC
New commit detected on ManageIQ/manageiq-api/master:

https://github.com/ManageIQ/manageiq-api/commit/e9e4001515cf1912a1deb8e9fcf464400e46a3da
commit e9e4001515cf1912a1deb8e9fcf464400e46a3da
Author:     Yuri Rudman <yrudman>
AuthorDate: Thu May 21 19:27:45 2020 +0000
Commit:     Yuri Rudman <yrudman>
CommitDate: Thu Jun 18 19:39:19 2020 +0000

    specify what is missing if tag assignment failed
    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1792106

 app/controllers/api/subcollections/tags.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comment 10 Yuri Rudman 2020-06-19 21:07:23 UTC
second PR: https://github.com/ManageIQ/manageiq-api/pull/843