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 #25440 - Remove hosts list from host bulk actions #7829
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 6 additions & 4 deletions
10
app/views/katello/api/v2/hosts_bulk_actions/erratum.json.rabl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
extends "katello/api/v2/errata/show" | ||
|
||
node :applicable_hosts do |erratum| | ||
erratum.hosts_available.where("#{::Host.table_name}.id" => @hosts). | ||
select(["#{::Host.table_name}.id", "#{::Host.table_name}.name"]). | ||
collect { |host| {:name => host.name, :id => host.id} } | ||
if @compatibility_mode | ||
node :applicable_hosts do |erratum| | ||
erratum.hosts_available.where("#{::Host.table_name}.id" => @hosts). | ||
select(["#{::Host.table_name}.id", "#{::Host.table_name}.name"]). | ||
collect { |host| {:name => host.name, :id => host.id} } | ||
end | ||
end | ||
|
||
node(:affected_hosts_count) { |erratum| erratum.hosts_available(params[:organization_id]).where("#{::Host.table_name}.id" => @hosts).count } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Thought about this for a bit. Since it effectively breaks the API I was going to request that you add the param to the apipie spec as well as rename it to make its function more clear.
Then I thought some more and concluded that this data seems out of place in the response of this API - after all, you are hiding this node by default. I guess it was trying to do too much by making a convenient API for the UI view rather than a performant and well-scoped API.
My vote would be to undo the compatibility mode change and add a deprecation warning to the two controller methods stating that the applicable hosts data will not be available from the API response in Katello 2.0
@jlsherrill does this sound like a sane suggestion?
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.
@jturel I'm okay with that suggestion, however we may want to take over this pr as @ShimShtein i think is working on other stuff at the moment.