-
Notifications
You must be signed in to change notification settings - Fork 295
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
Drop Pulp 2 Smart Proxy status code #10721
base: master
Are you sure you want to change the base?
Conversation
0d9ad06
to
bd0f12f
Compare
Guessing we missed this since it didn't show up in triage via redmine, mind adding one so we can get it on our job board? |
bd0f12f
to
8559d28
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.
engine.rb still has ::SmartProxiesController.include Katello::Concerns::SmartProxiesControllerExtensions
in it, removing that should fix the tests.
8559d28
to
562c66d
Compare
562c66d
to
d58b925
Compare
Rebased and removed require statements. |
d58b925
to
2d2f2f5
Compare
module Overrides | ||
def show | ||
@task_search_url = main_app.foreman_tasks_tasks_path(:search => "resource_id = #{@smart_proxy.id} AND resource_type = #{@smart_proxy.class}") | ||
render 'foreman/smart_proxies/show', :layout => 'katello/layouts/foreman_with_bastion' |
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.
I'm not 100% sure if this also needs to be reflected in any templates.
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.
Looks like it's breaking the smart proxy details pages:
2024-07-16T20:18:30 [F|app|3fb86828]
3fb86828 | ActionView::Template::Error (undefined method `map' for nil:NilClass):
3fb86828 | 1: <%= render :partial => 'disk_usage', :collection => disks(@storage), :as => :disk %>
3fb86828 |
3fb86828 | /home/vagrant/katello/app/helpers/katello/concerns/smart_proxy_helper_extensions.rb:5:in `disks'
3fb86828 | /home/vagrant/katello/app/views/smart_proxies/pulp_storage.html.erb:1
3fb86828 | app/controllers/concerns/foreman/controller/timezone.rb:10:in `set_timezone'
3fb86828 | app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
3fb86828 | app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in `set_topbar_sweeper_controller'
3fb86828 | /home/vagrant/katello/lib/katello/middleware/organization_created_enforcer.rb:18:in `call'
3fb86828 | /home/vagrant/katello/lib/katello/middleware/event_daemon.rb:10:in `call'
3fb86828 | lib/foreman/middleware/libvirt_connection_cleaner.rb:9:in `call'
3fb86828 | lib/foreman/middleware/telemetry.rb:10:in `call'
3fb86828 | lib/foreman/middleware/logging_context_session.rb:22:in `call'
3fb86828 | lib/foreman/middleware/logging_context_request.rb:11:in `call'
3fb86828 | /home/vagrant/katello/lib/katello/prevent_json_parsing.rb:12:in `call'
2024-07-16T20:18:32 [I|app|3c441f02] Processing by Katello::Api::V2::CapsuleContentController#sync_status as JSON
I think the Pulp and Pulp Node bits can also be removed from: https://github.com/katello/katello/blob/master/lib/katello/plugin.rb#L313 |
before_action :find_resource_and_status, :only => [:pulp_storage, :pulp_status] | ||
|
||
def pulp_storage | ||
@storage = @smart_proxy.pulp_disk_usage |
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.
I'm not sure how much of this file is still used, but this bit definitely is still used to show the Pulp 3 storage amount. @storage
being nil
in the error I pasted earlier makes sense since this file was deleted.
2d2f2f5
to
749d654
Compare
The PULP_FEATURE and PULP_NODE_FEATURE features were for Pulp 2. This is never present in a current Katello installation and can be dropped. It also replaces the deprecated default_capsule code, which is replaced by pulp_primary. In the template the code to handle primaries is disabled because it's only shown for mirrors. A mirror is by definition not a primary, so it can never trigger.
749d654
to
ab383c3
Compare
@@ -1,10 +1,9 @@ | |||
module Support | |||
module CapsuleSupport |
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.
I think this should be done in factories as traits, but I considered it out of scope here.
|
||
unscoped.with_features(features).joins(:capsule_lifecycle_environments). | ||
where(katello_capsule_lifecycle_environments: { lifecycle_environment_id: environment.id }) | ||
pulpcore_proxies_with_environment(environment).try(:uniq) | ||
end | ||
|
||
def self.pulpcore_proxies_with_environment(environment) |
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.
I thought about optimizing this to:
unscoped.select { |p| p.pulp_mirror? }.joins(:capsule_lifecycle_environments).
where(katello_capsule_lifecycle_environments: { lifecycle_environment_id: environment.id }).distinct
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.
This would be fine, I like avoiding excess queries where possible.
def self.default_capsule! | ||
pulp_primary! | ||
end | ||
|
||
def self.with_environment(environment, include_default = false) |
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.
def self.with_environment(environment, include_default = false) | |
def self.with_environment(environment) |
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.
This should be fine, I don't see any uses of include_default = false
with with_environment()
.
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.
Something is still broken on the smart proxies page, looks like storage
is still ending up nil
.
48a2c081 | ActionView::Template::Error (undefined method `map' for nil:NilClass):
48a2c081 | 1: <%= render :partial => 'disk_usage', :collection => disks(@storage), :as => :disk %>
48a2c081 |
48a2c081 | /home/vagrant/katello/app/helpers/katello/concerns/smart_proxy_helper_extensions.rb:5:in `disks'
48a2c081 | /home/vagrant/katello/app/views/smart_proxies/pulp_storage.html.erb:1
48a2c081 | app/controllers/concerns/foreman/controller/timezone.rb:10:in `set_timezone'
48a2c081 | app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
48a2c081 | app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in `set_topbar_sweeper_controller'
48a2c081 | /home/vagrant/katello/lib/katello/middleware/organization_created_enforcer.rb:18:in `call'
48a2c081 | /home/vagrant/katello/lib/katello/middleware/event_daemon.rb:10:in `call'
48a2c081 | lib/foreman/middleware/libvirt_connection_cleaner.rb:9:in `call'
48a2c081 | lib/foreman/middleware/telemetry.rb:10:in `call'
48a2c081 | lib/foreman/middleware/logging_context_session.rb:22:in `call'
48a2c081 | lib/foreman/middleware/logging_context_request.rb:11:in `call'
48a2c081 | /home/vagrant/katello/lib/katello/prevent_json_parsing.rb:12:in `call'
What are the changes introduced in this pull request?
It drops the Pulp 2 Smart Proxy status extensions.
Considerations taken when implementing this change?
These were likely not triggered anymore because the Pulp 2 features were never present.
What are the testing steps for this pull request?
Go to the Smart Proxies overview and for every Smart Proxy it should still render well. I forgot if there's a Pulp 3 tab today, but if there is, it should still be present after.