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

Add ability to use release candidate API version #1366

Merged
merged 2 commits into from
Apr 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Note: For changes to the API, see https://shopify.dev/changelog?filter=api
- [#1372](https://github.com/Shopify/shopify-api-ruby/pull/1372) Add support for 2025-04 API version
- [#1369](https://github.com/Shopify/shopify-api-ruby/pull/1369) Make `sub` and `sid` jwt claims optional (Checkout ui extension support)
- [#1370](https://github.com/Shopify/shopify-api-ruby/pull/1370) Add support for Shopify internal hosts

- [#1366](https://github.com/Shopify/shopify-api-ruby/pull/1366) Add support for release candidate API versions

## 14.8.0

Expand Down
4 changes: 4 additions & 0 deletions lib/shopify_api/admin_versions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ module ShopifyAPI
module AdminVersions
SUPPORTED_ADMIN_VERSIONS = T.let([
"unstable",
"2025-07",
"2025-04",
"2025-04",
"2025-01",
"2024-10",
Expand All @@ -22,8 +24,10 @@ module AdminVersions
], T::Array[String])

LATEST_SUPPORTED_ADMIN_VERSION = T.let("2025-04", String)
RELEASE_CANDIDATE_ADMIN_VERSION = T.let("2025-07", String)
end

SUPPORTED_ADMIN_VERSIONS = ShopifyAPI::AdminVersions::SUPPORTED_ADMIN_VERSIONS
LATEST_SUPPORTED_ADMIN_VERSION = ShopifyAPI::AdminVersions::LATEST_SUPPORTED_ADMIN_VERSION
RELEASE_CANDIDATE_ADMIN_VERSION = ShopifyAPI::AdminVersions::RELEASE_CANDIDATE_ADMIN_VERSION
end
5 changes: 3 additions & 2 deletions lib/shopify_api/context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,11 @@ def load_rest_resources(api_version:)
@rest_resource_loader&.setup
@rest_resource_loader&.unload

# No resources for the unstable version
return if api_version == "unstable"
# No resources for the unstable version or the release candidate version
return if api_version == "unstable" || api_version == RELEASE_CANDIDATE_ADMIN_VERSION

version_folder_name = api_version.gsub("-", "_")

path = "#{__dir__}/rest/resources/#{version_folder_name}"

unless Dir.exist?(path)
Expand Down
4 changes: 4 additions & 0 deletions test/admin_versions_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,9 @@ def test_supported_admin_versions
def test_supported_latest_supported_admin_version
assert_instance_of(String, ShopifyAPI::AdminVersions::LATEST_SUPPORTED_ADMIN_VERSION)
end

def test_supported_release_candidate_admin_version
assert_instance_of(String, ShopifyAPI::AdminVersions::RELEASE_CANDIDATE_ADMIN_VERSION)
end
end
end