meilisearch / meilisearch-rails

Meilisearch integration for Ruby on Rails
https://www.meilisearch.com
MIT License
300 stars 47 forks source link

Add meilisearch backend version check #95

Closed jitingcn closed 1 year ago

jitingcn commented 2 years ago

Description When I encountered a problem with meilisearch not being able to create model index after upgrading gems yesterday, after an hour of troubleshooting I found that this was caused by an incompatible version of meilisearch. I thought it would be a good idea to add a version check in the rails initializer.

Basic example Some other libraries I have used have similar functionality, for example https://github.com/stimulusreflex/stimulus_reflex/blob/master/lib/stimulus_reflex/utils/sanity_checker.rb

brunoocasali commented 2 years ago

Hey @jitingcn, thanks for raising this concern with us!

I really think that could be an awesome addition to the integration not only in the rails one but all the others!

@curquiza let me know if I'm wrong, but we do not have this kind of check inside our integrations right?

This is especially useful in this particular moment because the engine v1 was not released yet and most of the time our integrations are not backgrounded compatible with older versions.

Doing this particular check could help our users to prevent problems in projects that are using a CI + optimistic version control.

related: https://github.com/meilisearch/meilisearch-php/issues/199

curquiza commented 2 years ago

Hello @jitingcn and @brunoocasali! Thanks for your involvement in this repo!

@curquiza let me know if I'm wrong, but we do not have this kind of check inside our integrations right?

No we don't have anything like this at the moment :) Not that easy to set up I think. Compatibilities are not that easy between MeiliSearch and the packages. I would really if we could inform the users about compatibilities

jitingcn commented 2 years ago

I think we could encode a compatible version range in the library file and then try to connect to the /version endpoint of meilisearch to check version compatibility when rails is initialised.

brunoocasali commented 1 year ago

I agree this will be an excellent addition to the meilisearch SDKs (not only to rails), but since this would require a lot of work and Meilisearch is stable now, we don't think that should be harmful as it was in the v0.* era :)

Im closing this, thanks a lot for using Meilisearch @jitingcn ❤️