1636: Hotfix: Log but don't panic when vergen can't retrieve commit information r=curquiza a=Kerollmops
This pull request fixes an issue we discovered when we tried to publish meilisearch v0.21 on brew, brew uses the tarball downloaded from github directly which doesn't contain the `.git` folder.
We use the `.git` folder with [vergen](https://docs.rs/vergen) to retrieve the commit and datetime information. Unfortunately, we were unwrapping the vergen result and it was crashing when the git folder was missing.
We no more panic when vergen can't find the `.git` folder and just log out a potential error returned by [the git2 library](https://docs.rs/git2). We then just check that the env variables are available at compile-time and replace it with "unknown" if not.
### When the `.git` folder is available
```
xh localhost:7700/version
HTTP/1.1 200 OK
Content-Type: application/json
Date: Thu, 26 Aug 2021 13:44:23 GMT
Transfer-Encoding: chunked
{
"commitSha": "81a76eab69944de8a8d5006345b5aec7b02acf50",
"commitDate": "2021-08-26T13:41:30+00:00",
"pkgVersion": "0.21.0"
}
```
### When the `.git` folder is unavailable
```bash
cp -R meilisearch meilisearch-cpy
cd meilisearch-cpy
rm -rf .git
cargo clean
cargo run --release
<snip>
Compiling meilisearch-http v0.21.0 (/Users/clementrenault/Documents/meilisearch-cpy/meilisearch-http)
warning: vergen: could not find repository from '/Users/clementrenault/Documents/meilisearch-cpy/meilisearch-http'; class=Repository (6); code=NotFound (-3)
```
```
xh localhost:7700/version
HTTP/1.1 200 OK
Content-Type: application/json
Date: Thu, 26 Aug 2021 13:46:33 GMT
Transfer-Encoding: chunked
{
"commitSha": "unknown",
"commitDate": "unknown",
"pkgVersion": "0.21.0"
}
```
Co-authored-by: Kerollmops <clement@meilisearch.com>
1605: Fix pacic when decoding r=curquiza a=curquiza
Update milli to fix the panic during document deletion
Co-authored-by: Clémentine Urquizar <clementine@meilisearch.com>
1540: Update milli to version 0.8.1 r=curquiza a=curquiza
Integrates this fix into MeiliSearch https://github.com/meilisearch/milli/pull/296
Co-authored-by: Clémentine Urquizar <clementine@meilisearch.com>
1539: Use serdeval for validating json format. r=curquiza a=MarinPostma
uses [serdeval](https://github.com/MarinPostma/serdeval) to validate that the json payload is valid json, and in the correct format.
fix#1535
Co-authored-by: mpostma <postma.marin@protonmail.com>
1533: Update milli version to v0.8.0 r=MarinPostma a=curquiza
- Update milli, heed and obkv
- fix relevancy issue and the `facetsDistribution` display
Co-authored-by: Clémentine Urquizar <clementine@meilisearch.com>
1528: Update of the Date Time Format in commitDate r=MarinPostma a=irevoire
Since we were relying on a [super old version of `vergen`](https://docs.rs/crate/vergen/3.0.1), we could not get the `commit timestamp`, so I updated `vergen` to the latest version.
This also allows us to remove all the features we don't use.
closes#1522
Co-authored-by: Tamo <tamo@meilisearch.com>