-
Notifications
You must be signed in to change notification settings - Fork 2
Metadata query params #34
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
Conversation
@@ -13,6 +13,7 @@ jobs: | |||
strategy: | |||
matrix: | |||
ruby-version: [3.0.1, 2.7.4, 2.6.8] | |||
max-parallel: 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will slow down CI but reduce the amount of "collisions" we may see due to the same tests running on the same endpoints in parallel. Considering we don't run CI on these projects very frequently, I feel the stability is worth the extra 2 minutes until we change up the test suite to not hit the real API
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes sense!
@@ -33,7 +27,7 @@ | |||
) | |||
|
|||
expect(flight_estimate.data.type).to eq 'flight' | |||
expect(flight_estimate.data.mass_g).to eq 1_031_697 | |||
expect(flight_estimate.data.mass_g).to eq 1_000_622 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I confirmed this change is correct with Brendan
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed, we will probably want to remove this type of tests from the SDK itself.
@@ -71,15 +65,24 @@ | |||
expect(order.registry_url).not_to be_empty | |||
end | |||
|
|||
it 'supports create with metadata' do | |||
it 'supports creation with and querying by metadata' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel this is the most stable strategy for now. Creating an order with metadata and then querying for it in the same spec reduces the chance of the order being on a following page
@@ -43,20 +39,12 @@ | |||
end | |||
|
|||
describe 'returned fields' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
combining specs here for performance and stability
if ENV.fetch('LOCAL_SDK_TEST', false) | ||
config.access_token = ENV.fetch('LOCAL_PATCH_API_KEY') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set these 2 env vars to run tests against your local patch instance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To confirm: Ruby was handling the metadata object quite nicely out of the box?
If so, looks good to go!
lib/patch_ruby/api/orders_api.rb
Outdated
# @option opts [String] :metadata_ext_id | ||
# @option opts [String] :metadata_disregarded |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those two feel a little confusing here. Any chance we could rename those two examples?
@@ -27,6 +29,7 @@ def self.attribute_map | |||
{ | |||
:'timestamp' => :'timestamp', | |||
:'gas_used' => :'gas_used', | |||
:'transaction_value_eth_gwei' => :'transaction_value_eth_gwei', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kleinjm can you add this one to the changelog?
before do | ||
Patch.configure do |config| | ||
config.access_token = ENV['SANDBOX_API_KEY'] | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to the helper
it 'returns average_price_per_tonne_cents_usd' do | ||
expect(@project.average_price_per_tonne_cents_usd).to be_an_instance_of(Integer) | ||
end | ||
it 'returns the expected fields' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
Note: please add the new ETH parameter to the changelog! |
yep! Which makes sense since it's ruby to ruby |
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. | |||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | |||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | |||
|
|||
## [1.9.0] - 2021-08-17 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thoughts on having this be Unreleased
until we tag main
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bspellacy not sure I follow. What's the release flow you have in mind? I'm planning on releasing all the SDKs then the changes to patch (docs)
What
Why
SDK Release Checklist