Skip to content

Commit 59af0b0

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
1 parent b2836db commit 59af0b0

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Note: For changes to the API, see https://shopify.dev/changelog?filter=api
44
## Unreleased
55

66
- [#1362](https://github.com/Shopify/shopify-api-ruby/pull/1362) Add support for client credentials grant
7+
- [#1366](https://github.com/Shopify/shopify-api-ruby/pull/1366) Add support for release candidate API versions
78

89
## 14.8.0
910

lib/shopify_api/admin_versions.rb

+5
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@
33

44
module ShopifyAPI
55
module AdminVersions
6+
extend T::Sig
7+
68
SUPPORTED_ADMIN_VERSIONS = T.let([
79
"unstable",
10+
"2025-04",
811
"2025-01",
912
"2024-10",
1013
"2024-07",
@@ -21,8 +24,10 @@ module AdminVersions
2124
], T::Array[String])
2225

2326
LATEST_SUPPORTED_ADMIN_VERSION = T.let("2025-01", String)
27+
RELEASE_CANDIDATE_ADMIN_VERSION = T.let("2025-04", String)
2428
end
2529

2630
SUPPORTED_ADMIN_VERSIONS = ShopifyAPI::AdminVersions::SUPPORTED_ADMIN_VERSIONS
2731
LATEST_SUPPORTED_ADMIN_VERSION = ShopifyAPI::AdminVersions::LATEST_SUPPORTED_ADMIN_VERSION
32+
RELEASE_CANDIDATE_ADMIN_VERSION = ShopifyAPI::AdminVersions::RELEASE_CANDIDATE_ADMIN_VERSION
2833
end

lib/shopify_api/context.rb

+3-2
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

+4
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)