-
Notifications
You must be signed in to change notification settings - Fork 27
feat: update CLI code base to use latest major version of the Go API client #178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Adds devbox for easy environment management. In combination with `direnv`, the env is started automatically. Without `direnv`, just do `devbox shell`. Running Make as a task runner is phony. A Taskfile is better suited for this.
Copying the binary into the Docker container doesn't work if the host CPU architecture is different (like an M1 mac). Since it's quick to build, we can just build the CLI inside Docker.
This commit also re-enables support for the `--wait` flag, which was commented out.
Can also use 'records'
This commit gets rid of some custom validation code. We don't have to validate the multiple-batch request body in the CLI, since that is done in the v4 API client now. This commit also adds support for the 'delete index' and 'clear objects' actions.
c, new,n for create and l for list
Now that all commands are migrated, we can rename the v4IndexNames function
fix: add support for search_hosts
All files that aren't part of actual commands
feat: update code base to use v4 of the Go API client
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a VERY good PR.
It was scary at first, but most of it is formatting. I tested it along with the docker install. It all worked good.
I left a few nits and questions but nothing blocking.
I'm not sure about how the CI react to all the actions upgrades v2
-> v5
is quite the leap IMO. But only one way to know :D.
YOLO
The CI for testing and bilding ran in my fork on every commit. The only things I couldn't test was the release and the PR for updating the docs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's try that release then! 🚀
I have 2 more PRs in the making. One for adding e2e tests and 1 for adding a (Also, I don't have permissions to merge, so if you're cool with this PR, can you merge it please?) |
... and other improvements
This PR updates dependencies and migrates the CLI code base to use the Algolia Go API client v4. During this process, I also found it valuable to add more formatting and linting to the code base, for better readability and consistency. Unfortunately, I could not untangle this part from the actual migration part.
pkg/cmd
are mostly related to the actual migration from v4 to v4pkg/cmd
are mostly related to formatting and lintingImprovements
--wait
to all indexing operations--forward-to-replicas
to thealgolia settings set
command--includeReplicas
to--include-replicas
in the algolia index delete commandrecords
forobjects
,list
forbrowse
, anddict
fordictionaries
algolia rules browse
andalgolia synonyms browse
(the empty response comes from the API)Bug fixes
algolia index delete
when deleting replicasalgolia events tail
command that didn't work with newer config files (withapi_key
instead ofadmin_api_key
)Linting/formatting/tasks
This PR adds
gofumpt
,gosec
, andstylecheck
togolangci-lint
and defines tasks for formatting and linting in theTaskfile
. This has a number of advantages over a Makefile, but introduces a new dependency (the Makefile still works and handles the CI stuff, so nothing should break).