Drop Pulp 2 Smart Proxy status code#10721
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
ianballou
left a comment
There was a problem hiding this comment.
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
There was a problem hiding this comment.
I'm not 100% sure if this also needs to be reflected in any templates.
ianballou
left a comment
There was a problem hiding this comment.
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 |
749d654 to
ab383c3
Compare
There was a problem hiding this comment.
I think this should be done in factories as traits, but I considered it out of scope here.
There was a problem hiding this comment.
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 }).distinctThere was a problem hiding this comment.
This would be fine, I like avoiding excess queries where possible.
There was a problem hiding this comment.
| def self.with_environment(environment, include_default = false) | |
| def self.with_environment(environment) |
There was a problem hiding this comment.
This should be fine, I don't see any uses of include_default = false with with_environment().
ianballou
left a comment
There was a problem hiding this comment.
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'
f1bc1c7 to
6990829
Compare
ianballou
left a comment
There was a problem hiding this comment.
I haven't figured out why, but this PR is stopping find_resource from working. I have to manually add find_resource to controller methods for them to work in both Foreman and Katello. For example, there are nil errors in smart_proxies_controller#modules_card for @smart_proxy.statuses
There was a problem hiding this comment.
This line causes init to fail.
|
@ianballou would you be willing to take this over? I don't have the time to focus on this, but I still think cleaning up unused code is something that should be done. |
Sure, I can take it over 👍 |
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.
6990829 to
dab107b
Compare
| pulp_primary || fail(_("Could not find a smart proxy with pulp feature.")) | ||
| end | ||
|
|
||
| def self.default_capsule |
There was a problem hiding this comment.
Funny enough, the foreman_rh_cloud plugin uses it. It should switch to using pulp_primary ideally.
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.