-
Notifications
You must be signed in to change notification settings - Fork 4
fix: you can now set "false" to the includeOriginalStrings of a file download #25
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
base: master
Are you sure you want to change the base?
fix: you can now set "false" to the includeOriginalStrings of a file download #25
Conversation
Summary of ChangesHello @nstapelbroek, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a critical bug in the file download functionality, specifically concerning the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request correctly fixes a bug where the includeOriginalStrings parameter could not be set to false. Changing the IncludeOriginal field's type from bool to *bool is the idiomatic Go approach for handling optional boolean parameters, allowing a distinction between an unset value and an explicit false. The implementation is clean and effective. Please note that this is a breaking change to the public API, which should be communicated to users. Additionally, there's a minor redundancy in the GetQuery method where the fileUri parameter is set twice; this could be cleaned up in a future change. Overall, the fix is solid.
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.
Pull request overview
This PR fixes a bug where the includeOriginalStrings parameter could not be explicitly set to "false" in file download requests. According to the Smartling API documentation, when the parameter is omitted, the API defaults to "true". The previous implementation using a boolean type couldn't distinguish between "false" and "omit the parameter", preventing users from explicitly setting it to false.
Changes:
- Changed
IncludeOriginalfield type fromboolto*boolto support three states: nil (omit), true, and false - Updated the
GetQuery()method to check for nil and usestrconv.FormatBool()to convert the boolean pointer to a string - Added
strconvimport to support the boolean-to-string conversion
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| Type RetrievalType | ||
| IncludeOriginal bool | ||
| IncludeOriginal *bool |
Copilot
AI
Jan 20, 2026
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.
Changing the type from bool to *bool is a breaking API change. Existing code that sets IncludeOriginal will fail to compile. Consider documenting this breaking change in a CHANGELOG or migration guide, or introducing this as a new field to maintain backward compatibility.
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.
searched for a changelog, but there is none. I'd be happy to do this if you could give me some pointers 😄
| if request.IncludeOriginal != nil { | ||
| query.Set("includeOriginalStrings", strconv.FormatBool(*request.IncludeOriginal)) | ||
| } |
Copilot
AI
Jan 20, 2026
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.
The GetQuery method for FileDownloadRequest lacks test coverage. Given that this change modifies how query parameters are constructed and this is a public API, add unit tests to verify the three states: nil (parameter not included), true (parameter set to "true"), and false (parameter set to "false").
Hi friends,
This PR fixes a bug where you cannot set the
includeOriginalStringsto "false" as the api's behaviour is to set the value to "true" when no value is send.See the API docs for more details: https://api-reference.smartling.com/#tag/Files/operation/downloadTranslatedFile