Skip to content

Conversation

@nstapelbroek
Copy link

@nstapelbroek nstapelbroek commented Jan 20, 2026

Hi friends,

This PR fixes a bug where you cannot set the includeOriginalStrings to "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

Copilot AI review requested due to automatic review settings January 20, 2026 09:00
@gemini-code-assist
Copy link

Summary of Changes

Hello @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 includeOriginalStrings parameter. Previously, the SDK implicitly sent true if the parameter was set, but offered no way to explicitly send false, leading to incorrect behavior when the API defaulted to true for missing values. The changes introduce a pointer to boolean for this field, enabling precise control over whether true, false, or no value (nil) is sent to the API, thus resolving the limitation and enhancing the flexibility of file download requests.

Highlights

  • Bug Fix: Resolved an issue preventing users from explicitly setting includeOriginalStrings to false in file download requests, aligning behavior with the Smartling API.
  • Type Change: Updated the IncludeOriginal field in FileDownloadRequest from a bool to a *bool (pointer to boolean) to differentiate between an unset value and an explicit false.
  • Parameter Serialization: Modified the GetQuery method to correctly serialize the includeOriginalStrings parameter as "true" or "false" based on the pointer's value, ensuring the API receives the intended setting.

🧠 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 Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a 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.

Copy link

Copilot AI left a 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 IncludeOriginal field type from bool to *bool to support three states: nil (omit), true, and false
  • Updated the GetQuery() method to check for nil and use strconv.FormatBool() to convert the boolean pointer to a string
  • Added strconv import 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
Copy link

Copilot AI Jan 20, 2026

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.

Copilot uses AI. Check for mistakes.
Copy link
Author

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 😄

Comment on lines +78 to 80
if request.IncludeOriginal != nil {
query.Set("includeOriginalStrings", strconv.FormatBool(*request.IncludeOriginal))
}
Copy link

Copilot AI Jan 20, 2026

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").

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant