feat: update CLI code base to use latest major version of the Go API client#178
feat: update CLI code base to use latest major version of the Go API client#178dylantientcheu merged 59 commits intoalgolia:mainfrom
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.
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. |
|
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/cmdare mostly related to the actual migration from v4 to v4pkg/cmdare mostly related to formatting and lintingImprovements
--waitto all indexing operations--forward-to-replicasto thealgolia settings setcommand--includeReplicasto--include-replicasin the algolia index delete commandrecordsforobjects,listforbrowse, anddictfordictionariesalgolia rules browseandalgolia synonyms browse(the empty response comes from the API)Bug fixes
algolia index deletewhen deleting replicasalgolia events tailcommand that didn't work with newer config files (withapi_keyinstead ofadmin_api_key)Linting/formatting/tasks
This PR adds
gofumpt,gosec, andstylechecktogolangci-lintand 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).