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

Update api version handling #790

Merged
merged 3 commits into from
Sep 9, 2019
Merged

Update api version handling #790

merged 3 commits into from
Sep 9, 2019

Conversation

jtgrenz
Copy link
Contributor

@jtgrenz jtgrenz commented Sep 6, 2019

Updates the install generator to use the new api_version from v8.0.0 of shopify_api

I debated adding adding config flags for the generator to set the api_version lookup mode and the fetch_known_version on boot, but it doesn't strike me as something you'd want to necessarily configure via a flag. I opted to just add it to the initializer and comment it out in case anyone wants to enable it.

I wrapped ShopifyAPI::ApiVersion.fetch_known_versions in a utility method that just logs out that its fetching the versions and rescues and logs that the versions could not be fetched if it hits an ActiveResource::ConnectionError

@jtgrenz jtgrenz requested a review from a team as a code owner September 6, 2019 15:34
@@ -10,3 +10,6 @@
config.api_version = "<%= @api_version %>"
config.session_repository = ShopifyApp::InMemorySessionStore
end

# ShopifyApp::Utils.fetch_known_api_versions # Uncomment to fetch known api versions from shopify servers on boot
# ShopifyAPI::ApiVersion.version_lookup_mode = :raise_on_unknown # Uncomment to raise an error if attempting to use an api version that was not previously known
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a great addition.

Copy link
Contributor

@tylerball tylerball left a comment

Choose a reason for hiding this comment

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

Awesome!

Copy link
Contributor

@alexaitken alexaitken left a comment

Choose a reason for hiding this comment

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

LGTM

@jtgrenz jtgrenz merged commit 55c607d into master Sep 9, 2019
@jtgrenz jtgrenz temporarily deployed to rubygems September 9, 2019 20:27 Inactive
@tanema tanema deleted the update-api-version-handling branch January 21, 2020 17:24
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.

None yet

4 participants