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 #8699 - Scoped search for system #5541

Merged
merged 1 commit into from
Nov 10, 2015

Conversation

johnpmitsch
Copy link
Contributor

No description provided.

@@ -20,7 +21,7 @@ class Api::V2::SystemsController < Api::V2::ApiController

before_filter :find_environment_and_content_view, :only => [:create]
before_filter :find_content_view, :only => [:create, :update]
before_filter :load_search_service, :only => [:index, :available_host_collections, :tasks]
before_filter :load_search_service, :only => [:index, :available_host_collections, :tasks, :auto_complete_search]
Copy link
Member

Choose a reason for hiding this comment

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

We shouldn't need to load the search service here if we are switching to scoped search.

Copy link
Member

Choose a reason for hiding this comment

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

This comment is still unaddressed

@ehelms
Copy link
Member

ehelms commented Oct 21, 2015

Shouldn't there be removal of files such as https://github.com/Katello/katello/blob/master/app/models/katello/glue/elastic_search/system.rb included in this PR?

@@ -244,5 +226,20 @@ def test_product_content
assert_response :success
assert_template 'api/v2/systems/product_content'
end

Copy link
Member

Choose a reason for hiding this comment

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

Will need to remove loading of the fake search service in this test class as well.

@johnpmitsch johnpmitsch force-pushed the contenthost branch 2 times, most recently from b52cfa6 to ee459ce Compare October 21, 2015 17:59
}
respond_for_index(:collection => item_search(System, params, options))
environment_ids << params[:environment_id].to_i if params[:environment_id]
collection = collection.where(:id => KTEnvironment.where(:id => environment_ids).map(&:systems).flatten.map(&:id)) if environment_ids.any?
Copy link
Member

Choose a reason for hiding this comment

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

You should be able to just do a where with the environment_id directly here since systems has a belongs to relationship with environment.

@@ -5,7 +5,6 @@ class AutoAttachSubscriptions < Actions::EntryAction
middleware.use ::Actions::Middleware::RemoteAction

def plan(system)
system.disable_auto_reindex!
action_subject system
plan_action(::Actions::Candlepin::Consumer::AutoAttachSubscriptions, system) if ::SETTINGS[:katello][:use_cp]
plan_action(ElasticSearch::Reindex, system) if ::SETTINGS[:katello][:use_elasticsearch]
Copy link
Member

Choose a reason for hiding this comment

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

This line isn't needed

@johnpmitsch johnpmitsch force-pushed the contenthost branch 2 times, most recently from a16da24 to 81465f0 Compare October 22, 2015 18:55
@johnpmitsch
Copy link
Contributor Author

@ehelms @jlsherrill updated

:through => :system_activation_keys,
:after_add => :add_activation_key,
:after_remove => :remove_activation_key
:through => :system_activation_keys

Copy link
Member

Choose a reason for hiding this comment

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

Move this up to line 35 so it's not dangling

@johnpmitsch
Copy link
Contributor Author

@jlsherrill ah ok, took me a minute to catch up to your train of thought :) I removed that line and added the scoped search on environment.

@jlsherrill
Copy link
Member

Getting an error when registering a client with subscription-manager, looks like the system create and update actions need updating, such as:

https://github.com/Katello/katello/blob/master/app/lib/actions/katello/system/create.rb#L45

(also the system.disable_auto_reindex! at the top)

@johnpmitsch
Copy link
Contributor Author

@jlsherrill updated to fix errors when registering a client

@jlsherrill
Copy link
Member

Since you are removing all usage of hooks, mind removing it from the katello.gemspec?

@jlsherrill
Copy link
Member

Other than those two item, (auto complete on role filters ,and removal of hooks gem dep), it all looks good to me. I also tried merging this as well as #5536 together and the conflicts were very minimal, so I'm okay with going ahead and merging once these two things are fixed.

@johnpmitsch
Copy link
Contributor Author

@jlsherrill does #5536 have to be merged first? I am adding dynflow to that right now.

@johnpmitsch
Copy link
Contributor Author

@jlsherrill @cfouant updated

@cfouant
Copy link
Member

cfouant commented Nov 6, 2015

In systems bulk actions controller please remove before filter :load_search_service

@cfouant
Copy link
Member

cfouant commented Nov 6, 2015

in system.rb please remove rollback_on_create method call and method.

@johnpmitsch
Copy link
Contributor Author

@cfouant updated to remove those

@cfouant
Copy link
Member

cfouant commented Nov 9, 2015

Thanks! It worked great for me. ACK pending a senior engineer review

@jlsherrill
Copy link
Member

ACK from me, and i say go ahead and merge, the conflict with #5536 is minimal.

johnpmitsch pushed a commit that referenced this pull request Nov 10, 2015
Fixes #8699 - Scoped search for system
@johnpmitsch johnpmitsch merged commit f9828f5 into Katello:master Nov 10, 2015
@johnpmitsch johnpmitsch deleted the contenthost branch November 10, 2015 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants