Skip to content

Conversation

@ypeckstadt
Copy link
Contributor

@ypeckstadt ypeckstadt commented Nov 6, 2025

Description

This PR reverses the deprecation status of thread-related CLI arguments and renames the internal Java variable for better clarity. The --threads argument is now the primary option, while --max-threads becomes deprecated. This change is based on feedback that describes the original threads argument is clearer.

Related issues and/or PRs

NA

Changes made

  • ExportCommandOptions & ImportCommandOptions:
    • Changed --threads from deprecated to primary CLI argument
    • Changed --max-threads from primary to deprecated CLI argument

Variable Renaming

  • Renamed Java variable from maxThreads to threadCount across:
    • ExportCommandOptions.java and ImportCommandOptions.java
    • ExportCommand.java and ImportCommand.java
    • ImportOptions.java (core module)
    • ImportProcessor.java (core module)

Validation Updates

  • Updated validation error constant from INVALID_MAX_THREADS to INVALID_THREAD_COUNT
  • Updated deprecated option validation in both Export and Import commands
  • Ensured applyDeprecatedOptions() properly handles the reversed deprecation

Checklist

The following is a best-effort checklist. If any items in this checklist are not applicable to this PR or are dependent on other, unmerged PRs, please still mark the checkboxes after you have read and understood each item.

  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation to reflect the changes.
  • I have considered whether similar issues could occur in other products, components, or modules if this PR is for bug fixes.
  • Any remaining open issues linked to this PR are documented and up-to-date (Jira, GitHub, etc.).
  • Tests (unit, integration, etc.) have been added for the changes.
  • My changes generate no new warnings.
  • Any dependent changes in other PRs have been merged and published.

Additional notes (optional)

NA

Release notes

Reversed thread argument deprecation for Data Loader CLI

Copilot AI review requested due to automatic review settings November 6, 2025 00:12
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @ypeckstadt, 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 clarifies thread-related command-line interface arguments for the Data Loader CLI by reversing the deprecation status of --threads and --max-threads. The --threads argument is now the preferred option, and --max-threads is deprecated. This change also includes a refactoring of internal Java variable names and associated validation logic to enhance code clarity and maintainability.

Highlights

  • CLI Argument Reversal: The --threads argument is now the primary option for specifying thread count in the Data Loader CLI, while --max-threads has been deprecated based on user feedback for clearer naming.
  • Internal Variable Renaming: The internal Java variable maxThreads has been consistently renamed to threadCount across various classes for improved clarity and consistency in the codebase.
  • Validation and Deprecation Logic Updates: Error constants (e.g., INVALID_MAX_THREADS to INVALID_THREAD_COUNT) and the logic for handling deprecated CLI options have been updated to correctly reflect the new primary and deprecated argument statuses.
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
Contributor

@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 effectively reverses the deprecation status for the thread-related CLI arguments, making --threads the primary option and deprecating --max-threads. The associated refactoring to rename the internal variable to threadCount is applied consistently across all relevant files, including command-line options, core logic, and tests. The addition of new tests to verify the behavior of the deprecated and new options is a good improvement. I've identified one issue where a validation check in the export command would prevent the use of the default thread count, which I've detailed in a specific comment.

Copy link
Contributor

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 refactors the threading option naming from --max-threads to --threads throughout the data loader codebase, making --max-threads the deprecated option while --threads becomes the new primary option. This reverses the previous relationship where --threads was deprecated in favor of --max-threads.

Key changes:

  • Renamed the maxThreads field to threadCount in all affected classes
  • Swapped the roles: --threads is now the primary option, --max-threads is deprecated
  • Updated error messages, validation logic, and test cases accordingly

Reviewed Changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.

Show a summary per file
File Description
ImportOptions.java Renamed field from maxThreads to threadCount
ImportProcessor.java Updated method calls to use getThreadCount() instead of getMaxThreads()
DataLoaderError.java Renamed error constant from INVALID_MAX_THREADS to INVALID_THREAD_COUNT
ImportCommandOptions.java Swapped primary option to --threads and deprecated option to --max-threads
ImportCommand.java Updated validation and option building to use threadCount
ExportCommandOptions.java Added deprecated --max-threads option with migration logic
ExportCommand.java Updated validation and option building to use threadCount
Various test files Updated tests to use new naming and added test coverage for deprecated option handling

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ypeckstadt ypeckstadt self-assigned this Nov 6, 2025
@ypeckstadt ypeckstadt marked this pull request as draft November 6, 2025 01:47
@ypeckstadt ypeckstadt closed this Nov 7, 2025
@ypeckstadt
Copy link
Contributor Author

Will be done via other PR as some other changes need to be handled first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant