diff --git a/CHANGELOG.md b/CHANGELOG.md index 119ea469a..2612c399c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ Unreleased ---------- * ⚠️ [Breaking] Bumps minimum supported Ruby version to 3.0. Bumps `shopify_api` to 14.0 [1801](https://github.com/Shopify/shopify_app/pull/1801) +* ⚠️ [Breaking] Removes deprecated controller concerns that were renamed in `v21.10.0`. [1805](https://github.com/Shopify/shopify_app/pull/1805) * Make type param for webhooks route optional. This will fix a bug with CLI initiated webhooks.[1786](https://github.com/Shopify/shopify_app/pull/1786) * Fix redirecting to login when we catch a 401 response from Shopify, so that it can also handle cases where the app is already embedded when that happens.[1787](https://github.com/Shopify/shopify_app/pull/1787) * Always register webhooks with offline sessions.[1788](https://github.com/Shopify/shopify_app/pull/1788) diff --git a/app/controllers/concerns/shopify_app/authenticated.rb b/app/controllers/concerns/shopify_app/authenticated.rb deleted file mode 100644 index 9743f447c..000000000 --- a/app/controllers/concerns/shopify_app/authenticated.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -module ShopifyApp - module Authenticated - extend ActiveSupport::Concern - - included do - ShopifyApp::Logger.deprecated( - "Authenticated has been replaced by EnsureHasSession."\ - " Please use the EnsureHasSession controller concern for the same behavior", - "22.0.0", - ) - end - - include ShopifyApp::EnsureHasSession - end -end diff --git a/app/controllers/concerns/shopify_app/require_known_shop.rb b/app/controllers/concerns/shopify_app/require_known_shop.rb deleted file mode 100644 index 7aced050c..000000000 --- a/app/controllers/concerns/shopify_app/require_known_shop.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -module ShopifyApp - module RequireKnownShop - extend ActiveSupport::Concern - include ShopifyApp::EnsureInstalled - - included do - ShopifyApp::Logger.deprecated( - "RequireKnownShop has been replaced by EnsureInstalled."\ - " Please use the EnsureInstalled controller concern for the same behavior", - "22.0.0", - ) - end - end -end diff --git a/docs/Upgrading.md b/docs/Upgrading.md index 754909ee7..662b8e021 100644 --- a/docs/Upgrading.md +++ b/docs/Upgrading.md @@ -8,6 +8,8 @@ This file documents important changes needed to upgrade your app's Shopify App v [Unreleased](#unreleased) +[Upgrading to `v22.0.0`](#upgrading-to-v2020) + [Upgrading to `v20.3.0`](#upgrading-to-v2030) [Upgrading to `v20.2.0`](#upgrading-to-v2020) @@ -38,8 +40,22 @@ We also recommend the use of a staging site which matches your production enviro If you do run into issues, we recommend looking at our [debugging tips.](https://github.com/Shopify/shopify_app/blob/main/docs/Troubleshooting.md#debugging-tips) +## Upgrading to `v22.0.0` +#### Dropped support for Ruby 2.x +Support for Ruby 2.x has been dropped as it is no longer supported. You'll need to upgrade to 3.x.x + +#### Renamed Controller Concerns +The following controller concerns have been renamed/replaced in `v21.10.0` and have now been removed. To upgrade, please rename any usage in your apps's controllers that include them to the following: + +|Old Deprecated Controller Concern |Replaced By New Controller Concern| +|---|---| +|`Authenticated`|`EnsureHasSession`| +|`RequireKnownShop`|`EnsureInstalled`| + +The new names better reflect what assurances the including the controller concern provide. The new concern provide similar if not identical functionality as the concerns they replaced. + ## Upgrading to 21.3.0 -The `Itp` controller concern has been removed from `LoginProtection` which is included by the `Authenticated` controller concern. +The `Itp` controller concern has been removed from `LoginProtection` which is included by the `Authenticated`/`EnsureHasSession` controller concern. If any of your controllers are dependant on methods from `Itp` then you can include `ShopifyApp::Itp` directly. You may notice a deprecation notice saying, `Itp will be removed in an upcoming version`. This is because we intend on removing `Itp` completely in `v22.0.0`, but this will work in the meantime. diff --git a/test/controllers/concerns/authenticated_test.rb b/test/controllers/concerns/authenticated_test.rb deleted file mode 100644 index 38a4deac7..000000000 --- a/test/controllers/concerns/authenticated_test.rb +++ /dev/null @@ -1,35 +0,0 @@ -# frozen_string_literal: true - -require "test_helper" - -class AuthenticatedTest < ActionController::TestCase - class AuthenticatedTestController < ActionController::Base - include ShopifyApp::Authenticated - - def index - end - end - - tests AuthenticatedTestController - - test "includes all the needed concerns" do - AuthenticatedTestController.include?(ShopifyApp::Localization) - AuthenticatedTestController.include?(ShopifyApp::LoginProtection) - AuthenticatedTestController.include?(ShopifyApp::CsrfProtection) - AuthenticatedTestController.include?(ShopifyApp::EmbeddedApp) - AuthenticatedTestController.include?(ShopifyApp::EnsureBilling) - end - - test "detects deprecation message" do - version = "22.0.0" - ShopifyApp::Logger.expects(:deprecated).with( - regexp_matches(/Authenticated has been replaced by EnsureHasSession./), version - ) - ShopifyApp::Logger.stubs(:deprecated).with("Itp will be removed in an upcoming version", version) - Class.new(ApplicationController) do - include ShopifyApp::Authenticated - end - - assert_within_deprecation_schedule(version) - end -end diff --git a/test/controllers/concerns/require_known_shop_test.rb b/test/controllers/concerns/require_known_shop_test.rb deleted file mode 100644 index da1ecf3b3..000000000 --- a/test/controllers/concerns/require_known_shop_test.rb +++ /dev/null @@ -1,117 +0,0 @@ -# frozen_string_literal: true - -require "test_helper" - -class RequireKnownShopTest < ActionController::TestCase - class UnauthenticatedTestController < ActionController::Base - include ShopifyApp::RequireKnownShop - - def index - render(html: "