Ordersv2026-01-01#108
Conversation
Wiz Scan Summary
To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension. |
There was a problem hiding this comment.
Pull request overview
Adds initial support (client + fixtures + specs) for the Amazon SP-API Orders API 2026-01-01, and bumps the gem version/changelog accordingly.
Changes:
- Introduces
MuffinMan::Orders::V20260101withsearch_ordersandget_order. - Adds JSON fixtures and a basic RSpec file for the new Orders version.
- Bumps gem version to
2.6.0and updatesCHANGELOG.md(and removes an API-support list fromREADME.md).
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
lib/muffin_man/orders/v20260101.rb |
New client for Orders API 2026-01-01 endpoints. |
lib/muffin_man.rb |
Requires the new Orders client. |
spec/muffin_man/orders/v20260101_spec.rb |
Adds tests for search_orders / get_order (currently broken due to stubbing). |
spec/support/orders/v20260101_search_orders.json |
Fixture for search_orders response. |
spec/support/orders/v20260101_get_order.json |
Fixture for get_order response. |
lib/muffin_man/version.rb |
Version bump to 2.6.0. |
CHANGELOG.md |
Changelog entry for 2.6.0. |
README.md |
Removes the “supported APIs” list section. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
lib/muffin_man/orders/v20260101.rb
Outdated
|
|
||
| def get_order(order_id, included_data: []) | ||
| @local_var_path = "/orders/2026-01-01/orders/#{order_id}" | ||
| @query_params = { "includedData" => included_data.join(",") } if included_data.any? |
| it "returns orders" do | ||
| stub_request(:get, canonical_uri) | ||
| .to_return(status: 200, body: File.read("./spec/support/orders/v20260101_search_orders.json")) | ||
|
|
| stub_request(:get, canonical_uri) | ||
| .to_return(status: 200, body: File.read("./spec/support/orders/v20260101_get_order.json")) | ||
|
|
||
| order_id = "202-1234567-8901234" |
There was a problem hiding this comment.
Pull request overview
Introduces support for the Amazon SP-API Orders API v2026-01-01 in the MuffinMan client, including fixtures/specs, and bumps the gem version for release.
Changes:
- Added
MuffinMan::Orders::V20260101client withsearch_ordersandget_order. - Added RSpec coverage and JSON fixtures for the new Orders API version.
- Bumped gem version to
2.6.0and updatedCHANGELOG.md(and removed the supported-APIs list fromREADME.md).
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| spec/support/orders/v20260101_search_orders.json | Adds fixture response for search_orders in Orders v2026-01-01. |
| spec/support/orders/v20260101_get_order.json | Adds fixture response for get_order in Orders v2026-01-01. |
| spec/muffin_man/orders/v20260101_spec.rb | Adds basic request/response specs for the new Orders v2026-01-01 client. |
| README.md | Removes the enumerated list of supported APIs from the README. |
| lib/muffin_man/version.rb | Bumps gem version from 2.5.1 to 2.6.0. |
| lib/muffin_man/orders/v20260101.rb | Implements the new Orders v2026-01-01 API client methods. |
| lib/muffin_man.rb | Requires the new Orders v2026-01-01 client. |
| CHANGELOG.md | Documents the new release entry for 2.6.0 / Orders v2026-01-01. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
lib/muffin_man/orders/v20260101.rb
Outdated
|
|
||
| def get_order(order_id, included_data: []) | ||
| @local_var_path = "/orders/2026-01-01/orders/#{order_id}" | ||
| @query_params = { "includedData" => included_data.join(",") } if included_data.any? |
| describe "#search_orders" do | ||
| it "returns orders" do | ||
| stub_request(:get, "https://#{hostname}/orders/2026-01-01/orders") | ||
| .to_return(status: 200, body: File.read("./spec/support/orders/v20260101_search_orders.json")) | ||
|
|
||
| response = orders_client.search_orders | ||
|
|
||
| expect(response).to be_success | ||
| expect(JSON.parse(response.body)["orders"]).to be_an(Array) | ||
| end | ||
| end | ||
|
|
||
| describe "#get_order" do | ||
| it "returns the order" do | ||
| order_id = "202-1234567-8901234" | ||
|
|
||
| stub_request(:get, "https://#{hostname}/orders/2026-01-01/orders/#{order_id}") | ||
| .to_return(status: 200, body: File.read("./spec/support/orders/v20260101_get_order.json")) | ||
|
|
||
| response = orders_client.get_order(order_id) | ||
|
|
||
| expect(response).to be_success | ||
| expect(JSON.parse(response.body).dig("order", "orderId")).to eq(order_id) | ||
| end |
There was a problem hiding this comment.
Pull request overview
Adds support for the Orders API 2026-01-01 to the MuffinMan SP-API client, including a new client class and basic request specs/fixtures, along with a version bump and changelog entry.
Changes:
- Introduce
MuffinMan::Orders::V20260101withsearch_ordersandget_ordermethods. - Add RSpec coverage and JSON fixtures for the new Orders endpoints.
- Bump gem version to
2.6.0, updateCHANGELOG.md, and wire the new client intolib/muffin_man.rb.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
lib/muffin_man/orders/v20260101.rb |
New Orders 2026-01-01 client implementation. |
lib/muffin_man.rb |
Requires the new Orders client. |
spec/muffin_man/orders/v20260101_spec.rb |
Adds request specs for search_orders and get_order. |
spec/support/orders/v20260101_search_orders.json |
Fixture for search_orders response. |
spec/support/orders/v20260101_get_order.json |
Fixture for get_order response. |
lib/muffin_man/version.rb |
Version bump to 2.6.0. |
CHANGELOG.md |
Adds 2.6.0 entry for Orders 2026-01-01. |
README.md |
Removes the supported-APIs list section. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| def get_order(order_id, included_data: []) | ||
| @local_var_path = "/orders/2026-01-01/orders/#{order_id}" | ||
| @query_params = {} | ||
| @query_params["includedData"] = included_data.join(",") if included_data.any? | ||
| @request_type = "GET" | ||
| call_api |
| includedData | ||
| ].freeze | ||
|
|
||
| def search_orders(query_params: {}) | ||
| @local_var_path = "/orders/2026-01-01/orders" | ||
| @query_params = query_params.slice(*SEARCH_ORDERS_QUERY_PARAMS) |
| describe "#get_order" do | ||
| it "returns the order" do | ||
| order_id = "202-1234567-8901234" | ||
| included_data = ["BUYER", "RECIPIENT"] | ||
|
|
||
| stub_request(:get, "https://#{hostname}/orders/2026-01-01/orders/#{order_id}") | ||
| .with(query: { "includedData" => included_data.join(",") }) | ||
| .to_return(status: 200, body: File.read("./spec/support/orders/v20260101_get_order.json")) | ||
|
|
||
| response = orders_client.get_order(order_id, included_data: included_data) | ||
|
|
||
| expect(response).to be_success | ||
| expect(JSON.parse(response.body).dig("order", "orderId")).to eq(order_id) | ||
| end |
Aniruddha Birajdar (aniruddha-birajdar-pattern)
left a comment
There was a problem hiding this comment.
LGTM
d7a2f41
into
master
This pull request introduces support for the new Orders API version
v2026-01-01and updates the gem version to2.6.0. The main changes include adding a new client for the Orders API v2026-01-01, updating documentation and changelogs, and adding comprehensive tests and fixtures for the new API endpoints.Support for Orders API v2026-01-01:
MuffinMan::Orders::V20260101with methods forsearch_ordersandget_order, supporting the latest query parameters and endpoint structure.lib/muffin_man.rbfile for easy access.Documentation and versioning:
README.mdto remove the outdated list of supported APIs, making the documentation more maintainable.2.6.0inlib/muffin_man/version.rb.Testing and fixtures:
MuffinMan::Orders::V20260101with tests for bothsearch_ordersandget_orderendpoints.