-
Notifications
You must be signed in to change notification settings - Fork 284
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
Fixes #36462 - check for presence of content facet before assigning CVE #10602
Fixes #36462 - check for presence of content facet before assigning CVE #10602
Conversation
Issues: #36462 |
3376e78
to
7e0fca5
Compare
7e0fca5
to
70658eb
Compare
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.
Works like a charm. Do you think adding any tests make sense to look out for regressions?
I did think about adding tests. But once the multi-CV feature is finished, a lot of this logic will be quite different anyway. Since the ubiquity of |
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.
All good, if this is taken out then we shouldn't have regressions.
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.
Added a test in hosts_controller_test
👍
45a32da
to
55b7d72
Compare
before assigning CVE
55b7d72
to
59c4df2
Compare
…VE (Katello#10602) * Fixes #36462 - check for presence of content facet before assigning CVE (cherry picked from commit 2fdd82a)
…VE (Katello#10602) * Fixes #36462 - check for presence of content facet before assigning CVE (cherry picked from commit 2fdd82a)
What are the changes introduced in this pull request?
Sometimes in Katello we assume that all hosts have content facets. We should stop doing that.
Specifically in this case, the host edit page will try to inherit content facet attributes from a hostgroup without first checking if the host has a content facet.
Before assigning a content view environment based on the deprecated
content_view_id
andlifecycle_environment_id
attributes, we should check if the content facet actually exists.Considerations taken when implementing this change?
same as #10595 and #10600 ugh I'm getting tired of saying this
What are the testing steps for this pull request?
Create a hostgroup with CV and LCE
Create a host (Hosts > Create Host) - I did it by syncing a kickstart repo
In rails console, remove the host's content facet (verify that
myhost.content_facet
returnsnil
)Edit the host and attempt to add/remove the hostgroup (you may have to fill in other required fields, it's a pain I know sorry)
Before patch:
After patch: host is edited without error