-
Notifications
You must be signed in to change notification settings - Fork 26
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
feat: upgrade the CLI to use the Go API client version 4 #176
Closed
Conversation
This file contains 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
80e2188
to
9d9dfb1
Compare
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.
With gofumpt and golines for more readability
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.
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.
Shows an outdated logo and has fulfilled it's gimmicky purpose.
For some commands, it was already implemented, but not for all commands. Having the option to wait until the (async) operation is done on Algolia's servers makes it possible to run automatic tests for the commands.
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.
This PR migrates the Algolia CLI to use version 4 of the Algolia Go API client.
Features
All commands and glue code use the latest major version of the Algolia Go API client.
Improvements on top of that
algolia settings import
command now has support for--forward-to-replicas
just likealgolia settings set
algolia objects operations
command now supports theclear
anddeleteIndex
actions as well (this makes theoperations
command support all batch operations).algolia rules browse
now returns an error if an index doesn't existalgolia synonyms browse
now returns an error if an index doesn't exist--wait
flag:algolia indices clear
algolia indices delete
algolia objects delete
algolia objects import
algolia rules delete
algolia rules import
algolia settings import
algolia settings set
algolia synonyms delete
algolia synonyms import
algolia synonyms save
--includeReplicas
option to--include-replicas
for thealgolia indices delete
command to be in line with other CLI optionsrecords
forobjects
list
forbrowse
Bugfixes
algolia indices copy
command has support again for the--wait
flagalgolia events tail
now works with newer profile files (that haveapi_key
instead ofadmin_api_key
storedImprovements for developers
gosec
,gofumpt
, andstylecheck
linters for more consistency and safety (fixed some potential issues thanks of that)Taskfile.yml
instead of Makefile. Allows for better discoverability (task -l
), documentation (each task can have descriptions), and cleaner syntax (no .PHONY build targets as tasks, handling of variables)devbox.json
file (Devbox and direnv are great in combination)