Skip to content

Commit c91ac47

Browse files
committed
Add ability to use release candidate API version
Falls back to latest API version for REST resources Dont load rest resources for release candidate version changeset skip loading if unstable or rc remove sig
1 parent c6029ed commit c91ac47

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Note: For changes to the API, see https://shopify.dev/changelog?filter=api
77
- [#1372](https://github.com/Shopify/shopify-api-ruby/pull/1372) Add support for 2025-04 API version
88
- [#1369](https://github.com/Shopify/shopify-api-ruby/pull/1369) Make `sub` and `sid` jwt claims optional (Checkout ui extension support)
99
- [#1370](https://github.com/Shopify/shopify-api-ruby/pull/1370) Add support for Shopify internal hosts
10-
10+
- [#1366](https://github.com/Shopify/shopify-api-ruby/pull/1366) Add support for release candidate API versions
1111

1212
## 14.8.0
1313

lib/shopify_api/admin_versions.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33

44
module ShopifyAPI
55
module AdminVersions
6+
67
SUPPORTED_ADMIN_VERSIONS = T.let([
78
"unstable",
89
"2025-04",
10+
"2025-04",
911
"2025-01",
1012
"2024-10",
1113
"2024-07",
@@ -21,9 +23,11 @@ module AdminVersions
2123
"2022-01",
2224
], T::Array[String])
2325

24-
LATEST_SUPPORTED_ADMIN_VERSION = T.let("2025-04", String)
26+
LATEST_SUPPORTED_ADMIN_VERSION = T.let("2025-01", String)
27+
RELEASE_CANDIDATE_ADMIN_VERSION = T.let("2025-04", String)
2528
end
2629

2730
SUPPORTED_ADMIN_VERSIONS = ShopifyAPI::AdminVersions::SUPPORTED_ADMIN_VERSIONS
2831
LATEST_SUPPORTED_ADMIN_VERSION = ShopifyAPI::AdminVersions::LATEST_SUPPORTED_ADMIN_VERSION
32+
RELEASE_CANDIDATE_ADMIN_VERSION = ShopifyAPI::AdminVersions::RELEASE_CANDIDATE_ADMIN_VERSION
2933
end

lib/shopify_api/context.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,11 @@ def load_rest_resources(api_version:)
101101
@rest_resource_loader&.setup
102102
@rest_resource_loader&.unload
103103

104-
# No resources for the unstable version
105-
return if api_version == "unstable"
104+
# No resources for the unstable version or the release candidate version
105+
return if api_version == "unstable" || api_version == RELEASE_CANDIDATE_ADMIN_VERSION
106106

107107
version_folder_name = api_version.gsub("-", "_")
108+
108109
path = "#{__dir__}/rest/resources/#{version_folder_name}"
109110

110111
unless Dir.exist?(path)

test/admin_versions_test.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,9 @@ def test_supported_admin_versions
1212
def test_supported_latest_supported_admin_version
1313
assert_instance_of(String, ShopifyAPI::AdminVersions::LATEST_SUPPORTED_ADMIN_VERSION)
1414
end
15+
16+
def test_supported_release_candidate_admin_version
17+
assert_instance_of(String, ShopifyAPI::AdminVersions::RELEASE_CANDIDATE_ADMIN_VERSION)
18+
end
1519
end
1620
end

0 commit comments

Comments
 (0)