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 #36797 - Update API in preparation for SCA-only #10760

Merged
merged 1 commit into from
Oct 12, 2023

Conversation

lfu
Copy link
Member

@lfu lfu commented Oct 3, 2023

What are the changes introduced in this pull request?

Prepare API endpoints and params for the retirement of entitlement mode in Katello 4.12.

Considerations taken when implementing this change?

What are the testing steps for this pull request?

  • Organization /Create/Edit throws a log message.

2023-10-03T20:04:59 [W|app|19e3e9b9] DEPRECATION WARNING: Simple Content Access will be required for all organizations in Katello 4.12.

@theforeman-bot
Copy link

Issues: #36797

param :organization_id, :number, :desc => N_("Organization ID"), :required => true
def status
status = @organization.simple_content_access?
render json: { simple_content_access: status }
end

api :PUT, "/organizations/:organization_id/simple_content_access/enable",
N_("Enable simple content access for a manifest")
N_("Enable simple content access for a manifest. %s") % sca_only_deprecation_text, deprecated: true
Copy link
Member

Choose a reason for hiding this comment

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

Adding the warning text here (when you're enabling) might be confusing. I'd keep it deprecated but don't add the sca_only_deprecation_text for this one.

@@ -47,6 +48,7 @@ def create
def update
return if params[:simple_content_access].nil?
sca_param = ::Foreman::Cast.to_bool(params[:simple_content_access])
Rails.logger.warn "DEPRECATION WARNING: Simple Content Access will be required for all organizations in Katello 4.12."
Copy link
Member

Choose a reason for hiding this comment

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

Can we use ::Foreman::Deprecation.api_deprecation_warning here?

Copy link
Member Author

Choose a reason for hiding this comment

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

For both update and create?

@lfu
Copy link
Member Author

lfu commented Oct 5, 2023

[test katello]

@lfu
Copy link
Member Author

lfu commented Oct 6, 2023

Local test passed.
[test katello]

@lfu
Copy link
Member Author

lfu commented Oct 6, 2023

[test katello]

@@ -17,6 +17,12 @@ def current_user
User.current
end

class_methods do
def sca_only_deprecation_text
N_("WARNING: Entitlement-based subscription management is deprecated and will be removed in Katello 4.12.")
Copy link
Member

@jeremylenz jeremylenz Oct 9, 2023

Choose a reason for hiding this comment

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

Suggested change
N_("WARNING: Entitlement-based subscription management is deprecated and will be removed in Katello 4.12.")
N_("WARNING: Simple Content Access will be required for all organizations in Katello 4.12.")

I feel like in the API context it's more clear to just stick with this wording everywhere.

Copy link
Member

@jeremylenz jeremylenz left a comment

Choose a reason for hiding this comment

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

LGTM 👍

thanks @lfu !

@jeremylenz jeremylenz merged commit 27ce2b7 into Katello:master Oct 12, 2023
5 checks passed
@lfu lfu deleted the sca_only_36797 branch November 16, 2023 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants