-
Notifications
You must be signed in to change notification settings - Fork 46
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
Changes related to the next MeiliSearch release (v0.25.0) #273
Conversation
947033f
to
de3e481
Compare
* First verison of the new task API * Create task.rb * Fix linter error * Add tests for client.wait_for_task * Fix linter errors
* Add API keys methods * Fix linter errors
bors try |
tryBuild failed: |
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.
Hey, @curquiza thanks for your awesome work (as always) on this! 💟
I left some comments, ideas, suggestions, feel free to reach me out with any doubt :)
Oh, I didn’t comment on every item I found, but most of the comments regarding specs could be applied on other spec cases :)
expect(response).to have_key('hits') | ||
end | ||
new_client = MeiliSearch::Client.new(URL, public_key['key']) | ||
response = new_client.index(uid).search('test') |
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.
If we just make the "search" without adding documents we could make an assertion by just ensuring there were no meilisearch_api_errors. That way we could simplify a bit this spec 🦘
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.
We need to create an index to perform the search, so I can replace add_documents!
with create_index!
, but it does not simplify the spec :(
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.
I was thinking about something like this:
let(:public_client) { MeiliSearch::Client.new(URL, public_key['key']) }
it 'succeeds to search when using public key' do
uid = random_uid
expect {
public_client.index(uid).search('test')
}.not_to raise_meilisearch_api_error_with(...)
end
- public_client could be reused
- we only check if no errors are produced since we don’t care about the search result
(btw, I did this here on the comment, probably there are some typo)
Feel free to disagree as well haha 🍔
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.
If the index does not exist, public_client.index(uid).search('test')
will return a 404 since the index does not exist. You cannot search in a non-existing index
* Add code samples for v0.25.0 * Update .code-samples.meilisearch.yaml
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.
I just came to copy over your README changes and saw a typo.
Co-authored-by: Amélie <alallema@users.noreply.github.com>
Co-authored-by: Amélie <alallema@users.noreply.github.com>
Co-authored-by: Amélie <alallema@users.noreply.github.com>
* Apply changes after the review * Fix linter errors
bors try |
tryBuild succeeded: |
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.
LGTM! 💪
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.
Awesome work @curquiza 🎉 🌮
bors merge |
Related to this issue: meilisearch/integration-guides#157
This PR:
This PR is auto-generated for the pre-release week purpose.