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

Renaming some Controller Concerns #1565

Closed
wants to merge 62 commits into from

Conversation

klenotiw
Copy link
Contributor

@klenotiw klenotiw commented Nov 3, 2022

What this PR does

We had two controllers concerns that we wanted to rename, but still have our old names be backwards compatible for the time being.

RequireKnownShop => EnsureInstalled
Authenticated => EnsureHasSession

I merged in the commit from the logging PR because I wanted to add some deprecation logs. So sorry for the messed up commit history.

closes #1502

Reviewer's guide to testing

Things to focus on

  1. Do we want to rename any other concerns?
  2. Are we happy with the new names?
  3. Are we happy with the log formatting?

Checklist

Before submitting the PR, please consider if any of the following are needed:

  • Update CHANGELOG.md if the changes would impact users
  • Update README.md, if appropriate.
  • Update any relevant pages in /docs, if necessary
  • For security fixes, the Disclosure Policy must be followed.

end

def self.deprecated(message)
send_to_logger(:warn, "DEPRECATED - #{message}")
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should be using the ActiveSupport Deprecation API for this:
https://andycroll.com/ruby/use-a-deprecation-message/

klenotiw and others added 23 commits November 7, 2022 15:03
Co-authored-by: Andy Waite <13400+andyw8@users.noreply.github.com>
Co-authored-by: Andy Waite <13400+andyw8@users.noreply.github.com>
Co-authored-by: Andy Waite <13400+andyw8@users.noreply.github.com>
Co-authored-by: Andy Waite <13400+andyw8@users.noreply.github.com>
before_action :login_again_if_different_user_or_shop
around_action :activate_shopify_session
after_action :add_top_level_redirection_headers
ShopifyApp::Logger.deprecated("Authenticated has been renamed to EnsureHasSession")
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
ShopifyApp::Logger.deprecated("Authenticated has been renamed to EnsureHasSession")
ShopifyApp::Logger.deprecated("Authenticated has been renamed to EnsureHasSession")

I would say 'replaced by' rather than renamed to here, since if someone is upgrading from an older version then there may also be behavior changes.

@klenotiw
Copy link
Contributor Author

this pr will take over #1581

@klenotiw klenotiw closed this Nov 15, 2022
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.

Consider renaming RequireKnownShop and Authenticated modules
2 participants