Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the retrieve method to accept query parameters for DataSource and Invoice resources, enabling more flexible data retrieval with optional filtering parameters.
Key Changes:
- Refactored the
retrievemethod in theRetrieveaction module to support query parameters by separating path parameters from query parameters and properly encoding them in the URL - Removed the custom
retrieveimplementation fromDataSourceclass to use the updated generic implementation - Added comprehensive test coverage for the new query parameter functionality
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| lib/chartmogul/api/actions/retrieve.rb | Updated retrieve method to parse and append query parameters to the request path |
| lib/chartmogul/data_source.rb | Removed custom retrieve method to use the updated generic implementation |
| spec/chartmogul/data_source_spec.rb | Added test cases for query parameters including with_processing_status, with_auto_churn_subscription_setting, and with_invoice_handling_setting |
| spec/chartmogul/invoice_spec.rb | Added test cases for validation_type query parameter in both all and retrieve methods |
| spec/chartmogul/customer_invoices_spec.rb | Added test case for validation_type query parameter in the all method |
Comments suppressed due to low confidence (1)
lib/chartmogul/api/actions/retrieve.rb:32
- Removed blank line reduces code readability. The blank line before the JSON parsing section helps visually separate the HTTP request logic from the response processing logic.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
pkopac
approved these changes
Jan 1, 2026
| path = "#{resource_path.apply(options)}/#{uuid}" | ||
| path_param_keys = resource_path.named_params.values | ||
| query_params = options.reject { |key| path_param_keys.include?(key) } | ||
| path = "#{path}?#{URI.encode_www_form(query_params)}" if query_params.any? |
Contributor
There was a problem hiding this comment.
[refactor] Instead use the faraday library to pass params.
https://rubydoc.info/gems/faraday/Faraday/Request
J-ad
approved these changes
Jan 5, 2026
pkopac
approved these changes
Jan 6, 2026
…o-invoices-line-items-and
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It only applies to the
DataSourceandInvoiceat the moment, but will also apply toLineItemandTransactiononce their implemented.