Fix failure cases with integration test#115
Merged
pierre merged 1 commit intokillbill:masterfrom Jul 6, 2025
Merged
Conversation
b2cf04e to
13348c2
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR addresses failures in integration tests by ensuring a default locale is applied and improving parameter encoding compatibility.
- Adds a default
'en'locale fallback in invoice template retrieval to prevent nil-related errors. - Replaces
filter_mapwithmap + compactin HTTP parameter encoding for broader Ruby version support.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| lib/killbill_client/models/invoice.rb | Introduce `locale |
| lib/killbill_client/api/net_http_adapter.rb | Change parameter enumeration from filter_map to map + compact |
Comments suppressed due to low confidence (4)
lib/killbill_client/models/invoice.rb:215
- Consider updating the method’s documentation or docstring to mention that
localenow defaults to'en', so callers are aware of this behavior change.
locale ||= 'en'
lib/killbill_client/models/invoice.rb:215
- Add or update integration/unit tests to verify that omitting
localeresults in using'en'and that the correct endpoint is called.
locale ||= 'en'
lib/killbill_client/api/net_http_adapter.rb:160
- Add tests for
encode_paramscovering cases with nil values, arrays, and thewithStackTraceflag to ensure encoding changes behave as expected.
pairs = options[:params].map { |key, value|
lib/killbill_client/api/net_http_adapter.rb:160
- [nitpick] Using
map + compactincurs two iterations; consider usingfilter_mapif targeting Ruby ≥ 2.7 to perform filtering and mapping in one pass.
pairs = options[:params].map { |key, value|
pierre
approved these changes
Jul 6, 2025
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.
I found that we have a strange API: https://killbill.github.io/slate/invoice.html#retrieve-the-manualpay-invoice-template-for-the-tenant
This API url will work:
http://localhost:8080/1.0/kb/invoices/manualPayTemplate/
but this one will not work:
http://localhost:8080/1.0/kb/invoices/manualPayTemplate
it’s because of we have an option with language for example: http://localhost:8080/1.0/kb/invoices/manualPayTemplate/en
So I made an default option for the client API: https://github.com/killbill/killbill-client-ruby/pull/115/files