Skip to content
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 #24429 - Module stream host bulk actions #7736

Merged
merged 9 commits into from
Oct 11, 2018

Conversation

johnpmitsch
Copy link
Contributor

@johnpmitsch johnpmitsch commented Oct 5, 2018

This adds both bulk content host and host collection actions to manage module streams

@theforeman-bot
Copy link

Issues: #24429

@johnpmitsch johnpmitsch changed the title [WIP] Fixes #24429 module stream hosts [WIP] Fixes #24429 - Module stream host bulk actions Oct 5, 2018
{ action: 'install', description: translate("Install")},
{ action: 'update', description: translate("Update")},
{ action: 'remove', description: translate("Remove")}
];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we have an angular service for DRYing this up?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, was planning on that

@johnpmitsch johnpmitsch changed the title [WIP] Fixes #24429 - Module stream host bulk actions Fixes #24429 - Module stream host bulk actions Oct 9, 2018
@johnpmitsch
Copy link
Contributor Author

[test katello]

@johnpmitsch johnpmitsch force-pushed the 24429_module_stream_hosts branch 2 times, most recently from 1d7ff12 to 4337eb4 Compare October 9, 2018 23:42
@johnpmitsch
Copy link
Contributor Author

Here is an example of the host collections workflow. Bulk content host actions is very similar, just done from the content host page.
module stream bulk enable

@parthaa
Copy link
Contributor

parthaa commented Oct 10, 2018

Code changes LGTM. I was originally thinking if some of the stuff in views/content-host-bulk-module-streams-modal.html could be DRY'ed up, but I am hesitant to suggest that now considering content hosts module streams page will change once we get information from subman on enabled repositories.

@johnpmitsch
Copy link
Contributor Author

[test katello]

options = {}
options[:group] = [:name, :stream]
options[:resource_class] = Katello::ModuleStream
host_module_streams = Katello::ModuleStream.available_for_hosts(@hosts)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how does @hosts get set here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh find_editable_hosts is set to :except =>
nevermind :)

Copy link
Member

@jlsherrill jlsherrill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved from a code perspective. haven't' tested though

end
find_bulk_hosts('edit_hosts',
included: {
ids: params[:host_ids],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found a bug. It expects host_ids to be an array like :host_ids =>[1,2,3], while what gets sent to remote command controller is something like :host_ids =>"1,2,3" so need to change this to params[:host_ids].try(:split, ',')

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

may be do something like params[:host_ids].is_a?(Array) ? params[:host_ids]: params[:host_ids].try(:split, ',')

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jlsherrill would you think something like this might be better in Concerns::Api::V2::BulkHostsExtensions

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, the browser should be sending an array IMO

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm too many places to fix that then imo.

@jlsherrill
Copy link
Member

jlsherrill commented Oct 10, 2018 via email

@omkarkhatavkar
Copy link
Contributor

@johnpmitsch Any need of this Remove Button?
image

@omkarkhatavkar
Copy link
Contributor

module stream links are from Module Stream Management -> takes to blank page everytime, just remove that 'and host' from search string
module streams

@johnpmitsch
Copy link
Contributor Author

@parthaa @omkarkhatavkar @jlsherrill all issues have been addressed in a new commit. I'm currently setting up my environment to test multiple content hosts

@parthaa
Copy link
Contributor

parthaa commented Oct 11, 2018

@johnpmitsch looks good. wfm.
ack

Copy link
Member

@jlsherrill jlsherrill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK

@johnpmitsch johnpmitsch merged commit 322cd49 into Katello:master Oct 11, 2018
@johnpmitsch johnpmitsch deleted the 24429_module_stream_hosts branch October 11, 2018 20:11
@omkarkhatavkar
Copy link
Contributor

@johnpmitsch: Work Nicely

Test Scenarios:

  1. Verify the UI for host Collection Module Stream. -- Passed
  2. Module actions enable, install, disable, remove for multiple hosts and host collection. -- Passed
  3. Running same actions from rerun option. -- Passed
  4. Running Custom Module Action on the host/hosts working fine. -- Passed

@omkarkhatavkar
Copy link
Contributor

https://projects.theforeman.org/issues/25258 raised for running module stream actions on each host collections not all hosts.

1 similar comment
@omkarkhatavkar
Copy link
Contributor

https://projects.theforeman.org/issues/25258 raised for running module stream actions on each host collections not all hosts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants