-
Notifications
You must be signed in to change notification settings - Fork 303
Fixes #38723 - Updates katello controllers to delay actions for RH Cloud #11490
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
base: master
Are you sure you want to change the base?
Conversation
Reviewer's GuideThis PR refactors Katello’s API controllers by extracting repeated before_action targets into constants and introducing yield-based class methods to temporarily skip and reapply those filters, enabling the foreman_rh_cloud plugin to delay organization/product and taxonomy lookups as needed. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
|
||
resource_description do | ||
api_version 'v2' | ||
api_base_url "/katello/api" | ||
end | ||
|
||
def self.delay_find_taxonomy_actions |
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.delay_find_taxonomy_actions | |
def self.before_find_taxonomy_actions |
will read better when used:
Katello::Api::V2::OrganizationsController.before_find_taxonomy_actions do
Katello::Api::V2::OrganizationsController.add_smart_proxy_filters(
[:index, :download_debug_certificate],
features: ForemanRhCloud.on_prem_smart_proxy_features
)
end
@@ -35,6 +35,15 @@ class Api::V2::RepositoriesController < Api::V2::ApiController # rubocop:disable | |||
skip_before_action :authorize, :only => [:gpg_key_content] | |||
skip_before_action :check_media_type, :only => [:upload_content] | |||
|
|||
def self.delay_index_actions |
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.
Ditto:
def self.delay_index_actions | |
def self.before_index_actions |
What are the changes introduced in this pull request?
This pr adds methods to delay index and other organization controller actions so that those actions work with RH cloud properly setup
Considerations taken when implementing this change?
The foreman_rh_cloud plugin overwrites the list of methods that run local_find_taxonomy as a before_action in the Organizations controller: https://github.com/theforeman/foreman_rh_cloud/pull/1003/files#diff-d703d9179cea9d0d9bb78f9d6a1028620c7d4270479ebed553223bf4826ddc3dR227
Changed it to work via a yield mechanism
What are the testing steps for this pull request?
Could not update CDN configuration.:
Internal Server Error: the server was unable to finish the request. This may be caused by unavailability of some required service, incorrect API call or a server-side bug. There may be more information in the server's logs.
CDN Configuration Updated