Skip to content

CON-1843 all option for download command#93

Merged
az-smartling merged 4 commits into
masterfrom
all_option_for_download_command
Nov 19, 2025
Merged

CON-1843 all option for download command#93
az-smartling merged 4 commits into
masterfrom
all_option_for_download_command

Conversation

@az-smartling

Copy link
Copy Markdown
Contributor

Added --all option to download all file.
Removed possibility to download files without --all or uri.
Added tests.

@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello @az-smartling, 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 enhances the smartling-cli files pull command by introducing an --all option, enabling users to conveniently download all files from Smartling. Concurrently, it strengthens input validation, making it mandatory to specify either a file URI or the new --all flag, thereby preventing accidental or ambiguous file download operations. This change improves both the usability and safety of the command.

Highlights

  • New --all option for files pull command: Users can now download all files using smartling-cli files pull --all.
  • Mandatory uri or --all for files pull: The command now requires either a specific URI or the --all flag to prevent unintended operations.
  • Improved parameter validation: A new validation logic ensures that --all is not used with specific URIs (except . or **) and that a URI or --all is always provided.
  • New error type for conflicting parameters: A dedicated error ErrConflictingParams was introduced for better error handling when mutually exclusive options are used.
  • Added comprehensive tests: New test cases cover the scenarios for the --all option and the validation rules.
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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

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 introduces an --all option to the pull command for downloading all files and makes it mandatory to specify either a URI or the --all flag. The changes are logical and include updates to the command definition, parameter validation, and tests. My review focuses on simplifying the validation logic for the new flag to make it less confusing and to avoid potential bugs. Additionally, I've suggested expanding the tests for the new functionality to cover the primary use case of the --all flag and its interaction with other parameters.

Comment thread services/files/run_pull.go Outdated
Comment on lines +39 to +41
if p.All && p.URI != "" && p.URI != "." && p.URI != "**" {
return clierror.ErrConflictingParams([]string{"uri", "all"})
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The validation logic for conflicting uri and --all parameters is unnecessarily complex and allows for confusing combinations. Specifically, allowing uri to be . or ** when --all is also specified is redundant. The case for . is also likely a bug, as it would cause the glob pattern to match only a file literally named . instead of all files. A simpler approach would be to disallow any uri argument when --all is used.

Suggested change
if p.All && p.URI != "" && p.URI != "." && p.URI != "**" {
return clierror.ErrConflictingParams([]string{"uri", "all"})
}
if p.All && p.URI != "" {
return clierror.ErrConflictingParams([]string{"uri", "all"})
}

Comment thread tests/cmd/files/pull/pull_test.go
@dimitrystd dimitrystd changed the title all option for download command CON-1843 all option for download command Nov 19, 2025
Comment thread cmd/files/pull/cmd_pull.go Outdated
Comment thread cmd/files/pull/cmd_pull.go Outdated
Comment thread cmd/files/pull/cmd_pull.go Outdated
Comment thread services/files/run_pull.go Outdated
az-smartling and others added 2 commits November 19, 2025 11:13
Co-authored-by: Dmitry Studynsky <dimitrystd@users.noreply.github.com>
@az-smartling az-smartling merged commit e16b06b into master Nov 19, 2025
@az-smartling az-smartling deleted the all_option_for_download_command branch November 19, 2025 15:52
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.

2 participants