-
Notifications
You must be signed in to change notification settings - Fork 898
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
Allow partial POST edits on miq policy REST #14518
Conversation
@miq-bot add_label bug, api, control |
@dkorn can you please review? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM :)
policy = resource_search(id, type, collection_class(:policies)) | ||
begin | ||
add_policies_content(data, policy) | ||
add_policies_content(data, policy) if data["policy_contents"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@abellotti please review |
I think this is fine, could you add a test for editing a policy without those previously required attributes, maybe editing name or description ? Thanks. |
Fix https://bugzilla.redhat.com/show_bug.cgi?id=1435777 policies API (MiqPolicy) should allow partial POST edits e.g POST localhost:3000/api/policies/1000000000007 { "action": "edit", "description": "Desc bar" } In addition the current error message is wrong as it is about creation not edit: { "error": { "kind": "bad_request", "message": "Resource conditions_ids, policy_contents needs be specified for creating a new policies", "klass": "Api::BadRequestError" } }
Checked commit moolitayer@8cb8017 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
@abellotti please review |
Thanks for adding the test, LGTM!! Is this for fix needed for 5.7 (fine release) too, I see the BZ for 5.8. |
We have no specific need for it in 5.7 (euwe?) ATM as we are not using this API outside yet. Thanks |
sorry my confusion, I see the ticket is 5.8. |
Allow partial POST edits on miq policy REST (cherry picked from commit 6872ded) https://bugzilla.redhat.com/show_bug.cgi?id=1435777
Fine backport details:
|
Fix https://bugzilla.redhat.com/show_bug.cgi?id=1435777
policies API (MiqPolicy) should allow partial POTS edits
e.g
In addition the error message is wrong as it is about creation not edit: