-
Notifications
You must be signed in to change notification settings - Fork 193
fix: improve wording for unassignable Policy #4414
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
fix: improve wording for unassignable Policy #4414
Conversation
@romanblanco as there are might be 2 cases:
For the 2nd case we might want to add additional request to else block: It's not cool to have another request for that but it will be beneficial for all of us + this request is easy one for backend. You also need to sign off your PR ( |
@@ -227,7 +227,7 @@ def policy_link(self, policy_id, opt): | |||
logger.info("Operation completed successfully.\n") |
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.
can we also change Operation completed successfully
to something more specific like System successfully assigned to policy
?
@romanblanco, Please also update the expected assert string in tests. Thanks. |
From a user's point of view, along with saying that I believe that would probably help delivering a better user-experience here. |
38cc746
to
da0b004
Compare
When Compliance tries to assign Host to a Policy, it returns either 202 in case of success or 404 in any other case. When one tries to assign a Host that already has a Policy assigned, the Policy is not anymore in the list of available options, hence the process can not succeed with creating the link and returns 404. That in the logic of insights-client seems as failure, and it returns non-zero error status with the confusing message "Policy ... does not exist". This commit is to improve the message sent in such case to make it less misleading. Signed-off-by: Roman Blanco <[email protected]>
da0b004
to
e78ea6f
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4414 +/- ##
==========================================
- Coverage 77.70% 77.69% -0.01%
==========================================
Files 745 745
Lines 41740 41740
Branches 6704 6704
==========================================
- Hits 32432 32430 -2
- Misses 8277 8278 +1
- Partials 1031 1032 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Agreed with @LightOfHeaven1994 to add this change in a separate PR. |
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
@xiangce can you help us get it merged, please? |
When Compliance tries to assign Host to a Policy, it returns either 202 in case of success or 404 in any other case. When one tries to assign a Host that already has a Policy assigned, the Policy is not anymore in the list of available options, hence the process can not succeed with creating the link and returns 404. That in the logic of insights-client seems as failure, and it returns non-zero error status with the confusing message "Policy ... does not exist". This commit is to improve the message sent in such case to make it less misleading. Signed-off-by: Roman Blanco <[email protected]> (cherry picked from commit a4e9afc)
https://issues.redhat.com/browse/RHINENG-10847
When Compliance tries to assign Host to a Policy, it returns either 202 in case of success or 404 in any other case.
When one tries to assign a Host that already has a Policy assigned, the Policy is not anymore in the list of available options, hence the process can not succeed with creating the link and returns 404.
That in the logic of insights-client seems as failure, and it returns non-zero error status with the confusing message
"Policy ... does not exist"
.This commit is to improve the message sent in such case to make it less misleading.