Adds explicit search command for better UX#2
Merged
Conversation
a446bf3 to
fcb323d
Compare
There was a problem hiding this comment.
Copilot reviewed 7 out of 20 changed files in this pull request and generated no comments.
Files not reviewed (13)
- go.mod: Language not supported
- cmd/api.go: Evaluated as low risk
- cmd/api_test.go: Evaluated as low risk
- cmd/config.go: Evaluated as low risk
- cmd/config_test.go: Evaluated as low risk
- cmd/generate.go: Evaluated as low risk
- cmd/generate_test.go: Evaluated as low risk
- taskfile.yml: Evaluated as low risk
- pkg/testutils/setup.go: Evaluated as low risk
- pkg/testutils/mock_client.go: Evaluated as low risk
- pkg/llm/openapi_test.go: Evaluated as low risk
- cmd/root_test.go: Evaluated as low risk
- cmd/openapi_spec.go: Evaluated as low risk
Comments suppressed due to low confidence (1)
pkg/config/config.go:22
- Setting
ConfigPathin theinitfunction might not be ideal for testing purposes. Consider setting it in a separate function that can be called explicitly.
func init() {
Contributor
Author
|
Just going to merge this in and effectively reset the state of the repo. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
glean search ...command to provide a better UX to perform searches. This command wraps our existing http client implementation and uses that to load config, perform search, etc. Most of the code relates to providing types for marshaling/unmarshaling.This pull request includes significant refactoring and improvements to the command structure of the CLI. The changes focus on improving code maintainability by converting existing command functions to use a more consistent and modular approach.
Refactoring and Improvements:
Command Structure Refactoring:
cmd/api.go: RenamedapiOptionstoAPIOptions, updated function names to follow Go naming conventions, and removed theinitfunction in favor of returning the command fromNewCmdAPI. [1] [2] [3] [4]cmd/config.go: IntroducedConfigOptionsstruct, replacedvar configCmdwithNewCmdConfigfunction, and updated flag handling to use the new struct. [1] [2] [3] [4]cmd/generate.go: Replacedvar generateCmdwithNewCmdGeneratefunction.cmd/openapi_spec.go: IntroducedOpenAPISpecOptionsstruct, replacednewOpenapiSpecCmdwithNewCmdOpenAPISpecfunction, and updated flag handling to use the new struct. [1] [2] [3]Test Updates:
cmd/api_test.go: Adjusted tests to use the newNewCmdAPIfunction and removed redundant test cases.cmd/config_test.go: Updated tests to use the newNewCmdConfigfunction and simplified test cases.cmd/generate_test.go: Adjusted tests to use the newNewCmdGeneratefunction.cmd/openapi_spec_test.go: Updated tests to use the newNewCmdOpenAPISpecfunction, removed mock client setup, and simplified test case structure. [1] [2] [3]Root Command Update:
cmd/root.go: IntroducedNewCmdRootfunction to create the root command, replacing the previousvar rootCmd.