Repository navigation
Migrate CLI from go-flags to Kong - #51
Conversation
There was a problem hiding this comment.
Code Review
This pull request migrates the CLI argument parsing library from go-flags to kong and introduces support for loading query parameters from a YAML or JSON file via a new --param-file flag. It also replaces the go-spannulls dependency with spanvalue/gcvctor for constructing null values. Feedback on the changes suggests removing unsupported query modes (WITH_STATS and WITH_PLAN_AND_STATS) from the CLI options, as they are not valid in the Spanner gRPC API and will silently fall back to NORMAL mode.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Preserve existing flags, env vars, and --param-file integration while switching to Kong for parsing and help output. Co-authored-by: Cursor <cursoragent@cursor.com>
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request migrates the command-line argument parsing library from go-flags to kong. It updates the option struct tags, replaces the map-based parameter parsing with a slice-based manual parser (ParseParamFlags), and updates the main function to use the new parser. A review comment points out that the migration removed the error and help-printing logic on flag parsing failures, which would cause the application to exit silently without feedback. A suggestion is provided to restore this behavior using a deferred block.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Print parse/validation errors to stderr and show Kong usage help, matching go-flags behavior. Co-authored-by: Cursor <cursoragent@cursor.com>
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request replaces the go-flags CLI parsing library with kong. It updates the command-line options struct tags, introduces a new helper function ParseParamFlags to parse parameter flags from a slice of strings, and adds corresponding unit tests. Feedback on the changes highlights that the errors.As(err, &parseErr) check in the deferred error handler is unreachable dead code, as Kong's parser exits the program on parsing errors, and subsequent validation errors would trigger the preceding ctx != nil check.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Capture parseErr.Context before return so defer only needs ctx for usage output. Co-authored-by: Cursor <cursoragent@cursor.com>
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request replaces the go-flags command-line parsing library with github.com/alecthomas/kong. It refactors the options struct and validation logic to use Kong's declarative tags and adds helper functions to parse parameter flags. The review feedback suggests leveraging more of Kong's built-in features, such as the xor tag for declaring mutually exclusive flags (for SQL options, filter options, and timestamp bounds), using the group tag to preserve help output organization, and writing usage information to standard error on failure instead of standard output.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Declare mutually exclusive flags with xor tags, restore Timestamp Bound help group, and print usage to stderr on failure. Co-authored-by: Cursor <cursoragent@cursor.com>
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request migrates the CLI argument parsing library from go-flags to kong. This involves refactoring the option structures, removing manual exclusivity checks now handled natively by kong, and introducing a new ParseParamFlags helper to parse repeated parameter flags. Feedback is provided to refactor the flag processing and validation logic in main.go so that the full command usage is not unnecessarily printed for simple validation errors.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Use xor+required for SQL source, ExplicitGroups for timestamp help, print full usage only on parse errors, and guard read-timestamp parsing. Co-authored-by: Cursor <cursoragent@cursor.com>
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request replaces the github.com/jessevdk/go-flags library with github.com/alecthomas/kong for command-line argument parsing. The opts struct and flag processing logic in main.go have been refactored to use Kong's tagging system, which simplifies manual validation for exclusive and required flags. Additionally, a new helper function ParseParamFlags and its corresponding tests have been introduced in the params package to handle repeated parameter flags. There are no review comments, and we have no further feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Summary
databasearg, and--param-fileintegration.Dependencies
Merge after #49 and #50, then rebase this branch onto
mainso the diff is Kong-only.Test plan
go test ./...--helpand env var binding