From 1d5294d11a04230c93e73a26a5fa85a6459fc132 Mon Sep 17 00:00:00 2001 From: Kerollmops Date: Wed, 7 Dec 2022 15:03:38 +0100 Subject: [PATCH 01/14] Bump lmdb version --- Cargo.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 51e5e2b19..642f84152 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2156,7 +2156,7 @@ checksum = "d4d2456c373231a208ad294c33dc5bff30051eafd954cd4caae83a712b12854d" [[package]] name = "lmdb-rkv-sys" version = "0.15.1" -source = "git+https://github.com/meilisearch/lmdb-rs#5592bf5a812905cf0c633404ef8f8f4057112c65" +source = "git+https://github.com/meilisearch/lmdb-rs#0144fb2bac524cdc2897d7750681ed3fff2dc3ac" dependencies = [ "cc", "libc", From 5023d36ee798986059b48fd1bf90d0526eb2d0d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9mentine=20Urquizar=20-=20curqui?= Date: Thu, 8 Dec 2022 11:51:13 +0100 Subject: [PATCH 02/14] Use nightly in cargo fmt --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 8cde7d527..5c5ca827f 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -83,7 +83,7 @@ jobs: - uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: stable + toolchain: nightly override: true components: rustfmt - name: Cache dependencies From 026cf223b3c9f589626581275f7bf9851c95b9b8 Mon Sep 17 00:00:00 2001 From: curquiza Date: Thu, 8 Dec 2022 12:20:17 +0000 Subject: [PATCH 03/14] Update version for the next release (v1.0.0) in Cargo.toml files --- Cargo.lock | 16 ++++++++-------- dump/Cargo.toml | 2 +- file-store/Cargo.toml | 2 +- index-scheduler/Cargo.toml | 2 +- meili-snap/Cargo.toml | 2 +- meilisearch-auth/Cargo.toml | 2 +- meilisearch-http/Cargo.toml | 2 +- meilisearch-types/Cargo.toml | 2 +- permissive-json-pointer/Cargo.toml | 2 +- 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 642f84152..e0a864200 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1101,7 +1101,7 @@ dependencies = [ [[package]] name = "dump" -version = "0.30.1" +version = "1.0.0" dependencies = [ "anyhow", "big_s", @@ -1310,7 +1310,7 @@ dependencies = [ [[package]] name = "file-store" -version = "0.30.1" +version = "1.0.0" dependencies = [ "faux", "tempfile", @@ -1767,7 +1767,7 @@ dependencies = [ [[package]] name = "index-scheduler" -version = "0.30.1" +version = "1.0.0" dependencies = [ "anyhow", "big_s", @@ -2258,7 +2258,7 @@ checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771" [[package]] name = "meili-snap" -version = "0.30.1" +version = "1.0.0" dependencies = [ "insta", "md5", @@ -2267,7 +2267,7 @@ dependencies = [ [[package]] name = "meilisearch-auth" -version = "0.30.1" +version = "1.0.0" dependencies = [ "enum-iterator", "hmac", @@ -2284,7 +2284,7 @@ dependencies = [ [[package]] name = "meilisearch-http" -version = "0.30.1" +version = "1.0.0" dependencies = [ "actix-cors", "actix-http", @@ -2367,7 +2367,7 @@ dependencies = [ [[package]] name = "meilisearch-types" -version = "0.30.1" +version = "1.0.0" dependencies = [ "actix-web", "anyhow", @@ -2758,7 +2758,7 @@ checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" [[package]] name = "permissive-json-pointer" -version = "0.30.1" +version = "1.0.0" dependencies = [ "big_s", "serde_json", diff --git a/dump/Cargo.toml b/dump/Cargo.toml index f6850f71c..611b93735 100644 --- a/dump/Cargo.toml +++ b/dump/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dump" -version = "0.30.1" +version = "1.0.0" edition = "2021" [dependencies] diff --git a/file-store/Cargo.toml b/file-store/Cargo.toml index 3adef3315..577d54ac6 100644 --- a/file-store/Cargo.toml +++ b/file-store/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "file-store" -version = "0.30.1" +version = "1.0.0" edition = "2021" [dependencies] diff --git a/index-scheduler/Cargo.toml b/index-scheduler/Cargo.toml index fa324d98b..c5fd03533 100644 --- a/index-scheduler/Cargo.toml +++ b/index-scheduler/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "index-scheduler" -version = "0.30.1" +version = "1.0.0" edition = "2021" [dependencies] diff --git a/meili-snap/Cargo.toml b/meili-snap/Cargo.toml index 1682ddc11..547f76dbe 100644 --- a/meili-snap/Cargo.toml +++ b/meili-snap/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "meili-snap" -version = "0.30.1" +version = "1.0.0" edition = "2021" [dependencies] diff --git a/meilisearch-auth/Cargo.toml b/meilisearch-auth/Cargo.toml index 1df43411e..fbddc14d0 100644 --- a/meilisearch-auth/Cargo.toml +++ b/meilisearch-auth/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "meilisearch-auth" -version = "0.30.1" +version = "1.0.0" edition = "2021" [dependencies] diff --git a/meilisearch-http/Cargo.toml b/meilisearch-http/Cargo.toml index 7ffbd483b..f8370cae5 100644 --- a/meilisearch-http/Cargo.toml +++ b/meilisearch-http/Cargo.toml @@ -4,7 +4,7 @@ description = "Meilisearch HTTP server" edition = "2021" license = "MIT" name = "meilisearch-http" -version = "0.30.1" +version = "1.0.0" [[bin]] name = "meilisearch" diff --git a/meilisearch-types/Cargo.toml b/meilisearch-types/Cargo.toml index a36284adf..edbc05a8c 100644 --- a/meilisearch-types/Cargo.toml +++ b/meilisearch-types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "meilisearch-types" -version = "0.30.1" +version = "1.0.0" authors = ["marin "] edition = "2021" diff --git a/permissive-json-pointer/Cargo.toml b/permissive-json-pointer/Cargo.toml index 3343ee41f..c15c341db 100644 --- a/permissive-json-pointer/Cargo.toml +++ b/permissive-json-pointer/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "permissive-json-pointer" -version = "0.30.1" +version = "1.0.0" edition = "2021" description = "A permissive json pointer" readme = "README.md" From 50d9fe036e8478f8a9f4ef9ebd29b328a0bcdbc5 Mon Sep 17 00:00:00 2001 From: Bruno Casali Date: Tue, 6 Dec 2022 17:44:31 -0300 Subject: [PATCH 04/14] Setup COMMIT_SHA and COMMIT_DATE build args in the Docker image --- .github/workflows/publish-docker-images.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/publish-docker-images.yml b/.github/workflows/publish-docker-images.yml index a168c0bd8..17e85b322 100644 --- a/.github/workflows/publish-docker-images.yml +++ b/.github/workflows/publish-docker-images.yml @@ -39,6 +39,14 @@ jobs: if: github.event_name != 'schedule' && steps.check-tag-format.outputs.stable == 'true' run: bash .github/scripts/check-release.sh + - name: Set build-args for Docker buildx + id: build-metadata + run: | + # Extract commit date + commit_date=$(git show -s --format=%cd --date=iso-strict ${{ github.sha }}) + + echo "date=$commit_date" >> $GITHUB_OUTPUT + - name: Set up QEMU uses: docker/setup-qemu-action@v2 @@ -72,6 +80,9 @@ jobs: push: ${{ github.event_name != 'schedule' }} platforms: linux/amd64,linux/arm64 tags: ${{ steps.meta.outputs.tags }} + build-args: | + COMMIT_SHA=${{ github.sha }} + COMMIT_DATE=${{ steps.build-metadata.outputs.date }} # /!\ Don't touch this without checking with Cloud team - name: Send CI information to Cloud team From 58327979f158a9b1ad2e6ae399ce61db906c2318 Mon Sep 17 00:00:00 2001 From: Bruno Casali Date: Wed, 7 Dec 2022 17:21:19 -0300 Subject: [PATCH 05/14] Use correct env vars "VERGEN_*" on Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 0e54fcdae..6846fdad7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ WORKDIR /meilisearch ARG COMMIT_SHA ARG COMMIT_DATE -ENV COMMIT_SHA=${COMMIT_SHA} COMMIT_DATE=${COMMIT_DATE} +ENV VERGEN_GIT_SHA=${COMMIT_SHA} VERGEN_GIT_COMMIT_TIMESTAMP=${COMMIT_DATE} ENV RUSTFLAGS="-C target-feature=-crt-static" COPY . . From ee37d5e724a6b1843080e7e8b7282a7bdb06d7b2 Mon Sep 17 00:00:00 2001 From: Dave Larkan Date: Thu, 8 Dec 2022 15:02:34 +0000 Subject: [PATCH 06/14] Update README to reference Meilisearch Cloud --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f728d8a6b..9f4976c1d 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ You may also want to check out [Meilisearch 101](https://docs.meilisearch.com/le ## ☁️ Meilisearch cloud -Join the closed beta for Meilisearch cloud by filling out [this form](https://meilisearch.typeform.com/to/VI2cI2rv). +Let us manage your infrastructure so you can focus on integrating a great search experience. Try [Meilisearch Cloud](https://meilisearch.com/pricing) today. ## 🧰 SDKs & integration tools From ad2b1467da3c6550e0b4158c298f6a9ccca3503c Mon Sep 17 00:00:00 2001 From: Colby Allen Date: Wed, 7 Dec 2022 08:20:47 -0700 Subject: [PATCH 07/14] Renames meilisearch-http to meilisearch --- .github/workflows/publish-deb-brew-pkg.yml | 2 +- Cargo.lock | 38 +++++++++--------- Cargo.toml | 2 +- {meilisearch-http => meilisearch}/Cargo.toml | 6 +-- {meilisearch-http => meilisearch}/build.rs | 0 .../src/analytics/mock_analytics.rs | 0 .../src/analytics/mod.rs | 0 .../src/analytics/segment_analytics.rs | 0 .../src/error.rs | 0 .../src/extractors/authentication/error.rs | 0 .../src/extractors/authentication/mod.rs | 0 .../src/extractors/mod.rs | 0 .../src/extractors/payload.rs | 0 .../src/extractors/sequential_extractor.rs | 0 {meilisearch-http => meilisearch}/src/lib.rs | 0 {meilisearch-http => meilisearch}/src/main.rs | 4 +- .../src/metrics.rs | 0 .../src/option.rs | 2 +- .../src/route_metrics.rs | 0 .../src/routes/api_key.rs | 0 .../src/routes/dump.rs | 0 .../src/routes/indexes/documents.rs | 0 .../src/routes/indexes/mod.rs | 0 .../src/routes/indexes/search.rs | 0 .../src/routes/indexes/settings.rs | 0 .../src/routes/mod.rs | 0 .../src/routes/swap_indexes.rs | 0 .../src/routes/tasks.rs | 0 .../src/search.rs | 0 .../tests/assets/dumps/v1/metadata.json | 0 .../assets/dumps/v1/test/documents.jsonl | 0 .../tests/assets/dumps/v1/test/settings.json | 0 .../tests/assets/dumps/v1/test/updates.jsonl | 0 .../tests/assets/test_set.json | 0 .../tests/assets/v1_v0.20.0_movies.dump | Bin .../v1_v0.20.0_movies_with_settings.dump | Bin .../v1_v0.20.0_rubygems_with_settings.dump | Bin .../tests/assets/v2_v0.21.1_movies.dump | Bin .../v2_v0.21.1_movies_with_settings.dump | Bin .../v2_v0.21.1_rubygems_with_settings.dump | Bin .../tests/assets/v3_v0.24.0_movies.dump | Bin .../v3_v0.24.0_movies_with_settings.dump | Bin .../v3_v0.24.0_rubygems_with_settings.dump | Bin .../tests/assets/v4_v0.25.2_movies.dump | Bin .../v4_v0.25.2_movies_with_settings.dump | Bin .../v4_v0.25.2_rubygems_with_settings.dump | Bin .../tests/assets/v5_v0.28.0_test_dump.dump | Bin .../tests/auth/api_keys.rs | 0 .../tests/auth/authorization.rs | 0 .../tests/auth/mod.rs | 0 .../tests/auth/payload.rs | 0 .../tests/auth/tenant_token.rs | 0 .../tests/common/encoder.rs | 0 .../tests/common/index.rs | 0 .../tests/common/mod.rs | 4 +- .../tests/common/server.rs | 4 +- .../tests/common/service.rs | 2 +- .../tests/content_type.rs | 0 .../tests/dashboard/mod.rs | 0 .../tests/documents/add_documents.rs | 0 .../tests/documents/delete_documents.rs | 0 .../tests/documents/get_documents.rs | 0 .../tests/documents/mod.rs | 0 .../tests/documents/update_documents.rs | 0 .../tests/dumps/data.rs | 0 .../tests/dumps/mod.rs | 2 +- .../tests/index/create_index.rs | 0 .../tests/index/delete_index.rs | 0 .../tests/index/get_index.rs | 0 .../tests/index/mod.rs | 0 .../tests/index/stats.rs | 0 .../tests/index/update_index.rs | 0 .../tests/integration.rs | 0 .../tests/search/errors.rs | 0 .../tests/search/formatted.rs | 0 .../tests/search/mod.rs | 0 .../tests/search/pagination.rs | 0 .../tests/settings/distinct.rs | 0 .../tests/settings/get_settings.rs | 0 .../tests/settings/mod.rs | 0 .../tests/snapshot/mod.rs | 2 +- .../tests/stats/mod.rs | 0 .../tests/tasks/mod.rs | 0 83 files changed, 32 insertions(+), 36 deletions(-) rename {meilisearch-http => meilisearch}/Cargo.toml (98%) rename {meilisearch-http => meilisearch}/build.rs (100%) rename {meilisearch-http => meilisearch}/src/analytics/mock_analytics.rs (100%) rename {meilisearch-http => meilisearch}/src/analytics/mod.rs (100%) rename {meilisearch-http => meilisearch}/src/analytics/segment_analytics.rs (100%) rename {meilisearch-http => meilisearch}/src/error.rs (100%) rename {meilisearch-http => meilisearch}/src/extractors/authentication/error.rs (100%) rename {meilisearch-http => meilisearch}/src/extractors/authentication/mod.rs (100%) rename {meilisearch-http => meilisearch}/src/extractors/mod.rs (100%) rename {meilisearch-http => meilisearch}/src/extractors/payload.rs (100%) rename {meilisearch-http => meilisearch}/src/extractors/sequential_extractor.rs (100%) rename {meilisearch-http => meilisearch}/src/lib.rs (100%) rename {meilisearch-http => meilisearch}/src/main.rs (98%) rename {meilisearch-http => meilisearch}/src/metrics.rs (100%) rename {meilisearch-http => meilisearch}/src/option.rs (99%) rename {meilisearch-http => meilisearch}/src/route_metrics.rs (100%) rename {meilisearch-http => meilisearch}/src/routes/api_key.rs (100%) rename {meilisearch-http => meilisearch}/src/routes/dump.rs (100%) rename {meilisearch-http => meilisearch}/src/routes/indexes/documents.rs (100%) rename {meilisearch-http => meilisearch}/src/routes/indexes/mod.rs (100%) rename {meilisearch-http => meilisearch}/src/routes/indexes/search.rs (100%) rename {meilisearch-http => meilisearch}/src/routes/indexes/settings.rs (100%) rename {meilisearch-http => meilisearch}/src/routes/mod.rs (100%) rename {meilisearch-http => meilisearch}/src/routes/swap_indexes.rs (100%) rename {meilisearch-http => meilisearch}/src/routes/tasks.rs (100%) rename {meilisearch-http => meilisearch}/src/search.rs (100%) rename {meilisearch-http => meilisearch}/tests/assets/dumps/v1/metadata.json (100%) rename {meilisearch-http => meilisearch}/tests/assets/dumps/v1/test/documents.jsonl (100%) rename {meilisearch-http => meilisearch}/tests/assets/dumps/v1/test/settings.json (100%) rename {meilisearch-http => meilisearch}/tests/assets/dumps/v1/test/updates.jsonl (100%) rename {meilisearch-http => meilisearch}/tests/assets/test_set.json (100%) rename {meilisearch-http => meilisearch}/tests/assets/v1_v0.20.0_movies.dump (100%) rename {meilisearch-http => meilisearch}/tests/assets/v1_v0.20.0_movies_with_settings.dump (100%) rename {meilisearch-http => meilisearch}/tests/assets/v1_v0.20.0_rubygems_with_settings.dump (100%) rename {meilisearch-http => meilisearch}/tests/assets/v2_v0.21.1_movies.dump (100%) rename {meilisearch-http => meilisearch}/tests/assets/v2_v0.21.1_movies_with_settings.dump (100%) rename {meilisearch-http => meilisearch}/tests/assets/v2_v0.21.1_rubygems_with_settings.dump (100%) rename {meilisearch-http => meilisearch}/tests/assets/v3_v0.24.0_movies.dump (100%) rename {meilisearch-http => meilisearch}/tests/assets/v3_v0.24.0_movies_with_settings.dump (100%) rename {meilisearch-http => meilisearch}/tests/assets/v3_v0.24.0_rubygems_with_settings.dump (100%) rename {meilisearch-http => meilisearch}/tests/assets/v4_v0.25.2_movies.dump (100%) rename {meilisearch-http => meilisearch}/tests/assets/v4_v0.25.2_movies_with_settings.dump (100%) rename {meilisearch-http => meilisearch}/tests/assets/v4_v0.25.2_rubygems_with_settings.dump (100%) rename {meilisearch-http => meilisearch}/tests/assets/v5_v0.28.0_test_dump.dump (100%) rename {meilisearch-http => meilisearch}/tests/auth/api_keys.rs (100%) rename {meilisearch-http => meilisearch}/tests/auth/authorization.rs (100%) rename {meilisearch-http => meilisearch}/tests/auth/mod.rs (100%) rename {meilisearch-http => meilisearch}/tests/auth/payload.rs (100%) rename {meilisearch-http => meilisearch}/tests/auth/tenant_token.rs (100%) rename {meilisearch-http => meilisearch}/tests/common/encoder.rs (100%) rename {meilisearch-http => meilisearch}/tests/common/index.rs (100%) rename {meilisearch-http => meilisearch}/tests/common/mod.rs (85%) rename {meilisearch-http => meilisearch}/tests/common/server.rs (98%) rename {meilisearch-http => meilisearch}/tests/common/service.rs (98%) rename {meilisearch-http => meilisearch}/tests/content_type.rs (100%) rename {meilisearch-http => meilisearch}/tests/dashboard/mod.rs (100%) rename {meilisearch-http => meilisearch}/tests/documents/add_documents.rs (100%) rename {meilisearch-http => meilisearch}/tests/documents/delete_documents.rs (100%) rename {meilisearch-http => meilisearch}/tests/documents/get_documents.rs (100%) rename {meilisearch-http => meilisearch}/tests/documents/mod.rs (100%) rename {meilisearch-http => meilisearch}/tests/documents/update_documents.rs (100%) rename {meilisearch-http => meilisearch}/tests/dumps/data.rs (100%) rename {meilisearch-http => meilisearch}/tests/dumps/mod.rs (99%) rename {meilisearch-http => meilisearch}/tests/index/create_index.rs (100%) rename {meilisearch-http => meilisearch}/tests/index/delete_index.rs (100%) rename {meilisearch-http => meilisearch}/tests/index/get_index.rs (100%) rename {meilisearch-http => meilisearch}/tests/index/mod.rs (100%) rename {meilisearch-http => meilisearch}/tests/index/stats.rs (100%) rename {meilisearch-http => meilisearch}/tests/index/update_index.rs (100%) rename {meilisearch-http => meilisearch}/tests/integration.rs (100%) rename {meilisearch-http => meilisearch}/tests/search/errors.rs (100%) rename {meilisearch-http => meilisearch}/tests/search/formatted.rs (100%) rename {meilisearch-http => meilisearch}/tests/search/mod.rs (100%) rename {meilisearch-http => meilisearch}/tests/search/pagination.rs (100%) rename {meilisearch-http => meilisearch}/tests/settings/distinct.rs (100%) rename {meilisearch-http => meilisearch}/tests/settings/get_settings.rs (100%) rename {meilisearch-http => meilisearch}/tests/settings/mod.rs (100%) rename {meilisearch-http => meilisearch}/tests/snapshot/mod.rs (98%) rename {meilisearch-http => meilisearch}/tests/stats/mod.rs (100%) rename {meilisearch-http => meilisearch}/tests/tasks/mod.rs (100%) diff --git a/.github/workflows/publish-deb-brew-pkg.yml b/.github/workflows/publish-deb-brew-pkg.yml index 79da1e4e4..1f84b84c5 100644 --- a/.github/workflows/publish-deb-brew-pkg.yml +++ b/.github/workflows/publish-deb-brew-pkg.yml @@ -25,7 +25,7 @@ jobs: run: cargo install cargo-deb - uses: actions/checkout@v3 - name: Build deb package - run: cargo deb -p meilisearch-http -o target/debian/meilisearch.deb + run: cargo deb -p meilisearch -o target/debian/meilisearch.deb - name: Upload debian pkg to release uses: svenstaro/upload-release-action@2.3.0 with: diff --git a/Cargo.lock b/Cargo.lock index e0a864200..f824f785c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2266,25 +2266,8 @@ dependencies = [ ] [[package]] -name = "meilisearch-auth" -version = "1.0.0" -dependencies = [ - "enum-iterator", - "hmac", - "meilisearch-types", - "rand", - "roaring", - "serde", - "serde_json", - "sha2", - "thiserror", - "time", - "uuid 1.2.1", -] - -[[package]] -name = "meilisearch-http" -version = "1.0.0" +name = "meilisearch" +version = "0.30.1" dependencies = [ "actix-cors", "actix-http", @@ -2365,6 +2348,23 @@ dependencies = [ "zip", ] +[[package]] +name = "meilisearch-auth" +version = "1.0.0" +dependencies = [ + "enum-iterator", + "hmac", + "meilisearch-types", + "rand", + "roaring", + "serde", + "serde_json", + "sha2", + "thiserror", + "time", + "uuid 1.2.1", +] + [[package]] name = "meilisearch-types" version = "1.0.0" diff --git a/Cargo.toml b/Cargo.toml index 2b756f87c..b3be0075a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [workspace] resolver = "2" members = [ - "meilisearch-http", + "meilisearch", "meilisearch-types", "meilisearch-auth", "meili-snap", diff --git a/meilisearch-http/Cargo.toml b/meilisearch/Cargo.toml similarity index 98% rename from meilisearch-http/Cargo.toml rename to meilisearch/Cargo.toml index f8370cae5..b3d40b35c 100644 --- a/meilisearch-http/Cargo.toml +++ b/meilisearch/Cargo.toml @@ -3,12 +3,8 @@ authors = ["Quentin de Quelen ", "Clément Renault { - let post_query: meilisearch_http::routes::search::SearchQueryPost = + let post_query: meilisearch::routes::search::SearchQueryPost = serde_json::from_str(&$query.clone().to_string()).unwrap(); - let get_query: meilisearch_http::routes::search::SearchQuery = post_query.into(); + let get_query: meilisearch::routes::search::SearchQuery = post_query.into(); let get_query = ::serde_url_params::to_string(&get_query).unwrap(); let ($response, $status_code) = $server.search_get(&get_query).await; let _ = ::std::panic::catch_unwind(|| $block) diff --git a/meilisearch-http/tests/common/server.rs b/meilisearch/tests/common/server.rs similarity index 98% rename from meilisearch-http/tests/common/server.rs rename to meilisearch/tests/common/server.rs index f96c659a4..c3c9b7c60 100644 --- a/meilisearch-http/tests/common/server.rs +++ b/meilisearch/tests/common/server.rs @@ -8,8 +8,8 @@ use actix_web::dev::ServiceResponse; use actix_web::http::StatusCode; use byte_unit::{Byte, ByteUnit}; use clap::Parser; -use meilisearch_http::option::{IndexerOpts, MaxMemory, Opt}; -use meilisearch_http::{analytics, create_app, setup_meilisearch}; +use meilisearch::option::{IndexerOpts, MaxMemory, Opt}; +use meilisearch::{analytics, create_app, setup_meilisearch}; use once_cell::sync::Lazy; use serde_json::{json, Value}; use tempfile::TempDir; diff --git a/meilisearch-http/tests/common/service.rs b/meilisearch/tests/common/service.rs similarity index 98% rename from meilisearch-http/tests/common/service.rs rename to meilisearch/tests/common/service.rs index 945ff4c13..f7c9b8294 100644 --- a/meilisearch-http/tests/common/service.rs +++ b/meilisearch/tests/common/service.rs @@ -6,7 +6,7 @@ use actix_web::test; use actix_web::test::TestRequest; use index_scheduler::IndexScheduler; use meilisearch_auth::AuthController; -use meilisearch_http::{analytics, create_app, Opt}; +use meilisearch::{analytics, create_app, Opt}; use serde_json::Value; use crate::common::encoder::Encoder; diff --git a/meilisearch-http/tests/content_type.rs b/meilisearch/tests/content_type.rs similarity index 100% rename from meilisearch-http/tests/content_type.rs rename to meilisearch/tests/content_type.rs diff --git a/meilisearch-http/tests/dashboard/mod.rs b/meilisearch/tests/dashboard/mod.rs similarity index 100% rename from meilisearch-http/tests/dashboard/mod.rs rename to meilisearch/tests/dashboard/mod.rs diff --git a/meilisearch-http/tests/documents/add_documents.rs b/meilisearch/tests/documents/add_documents.rs similarity index 100% rename from meilisearch-http/tests/documents/add_documents.rs rename to meilisearch/tests/documents/add_documents.rs diff --git a/meilisearch-http/tests/documents/delete_documents.rs b/meilisearch/tests/documents/delete_documents.rs similarity index 100% rename from meilisearch-http/tests/documents/delete_documents.rs rename to meilisearch/tests/documents/delete_documents.rs diff --git a/meilisearch-http/tests/documents/get_documents.rs b/meilisearch/tests/documents/get_documents.rs similarity index 100% rename from meilisearch-http/tests/documents/get_documents.rs rename to meilisearch/tests/documents/get_documents.rs diff --git a/meilisearch-http/tests/documents/mod.rs b/meilisearch/tests/documents/mod.rs similarity index 100% rename from meilisearch-http/tests/documents/mod.rs rename to meilisearch/tests/documents/mod.rs diff --git a/meilisearch-http/tests/documents/update_documents.rs b/meilisearch/tests/documents/update_documents.rs similarity index 100% rename from meilisearch-http/tests/documents/update_documents.rs rename to meilisearch/tests/documents/update_documents.rs diff --git a/meilisearch-http/tests/dumps/data.rs b/meilisearch/tests/dumps/data.rs similarity index 100% rename from meilisearch-http/tests/dumps/data.rs rename to meilisearch/tests/dumps/data.rs diff --git a/meilisearch-http/tests/dumps/mod.rs b/meilisearch/tests/dumps/mod.rs similarity index 99% rename from meilisearch-http/tests/dumps/mod.rs rename to meilisearch/tests/dumps/mod.rs index 10098c60f..0759454e8 100644 --- a/meilisearch-http/tests/dumps/mod.rs +++ b/meilisearch/tests/dumps/mod.rs @@ -1,6 +1,6 @@ mod data; -use meilisearch_http::Opt; +use meilisearch::Opt; use serde_json::json; use self::data::GetDump; diff --git a/meilisearch-http/tests/index/create_index.rs b/meilisearch/tests/index/create_index.rs similarity index 100% rename from meilisearch-http/tests/index/create_index.rs rename to meilisearch/tests/index/create_index.rs diff --git a/meilisearch-http/tests/index/delete_index.rs b/meilisearch/tests/index/delete_index.rs similarity index 100% rename from meilisearch-http/tests/index/delete_index.rs rename to meilisearch/tests/index/delete_index.rs diff --git a/meilisearch-http/tests/index/get_index.rs b/meilisearch/tests/index/get_index.rs similarity index 100% rename from meilisearch-http/tests/index/get_index.rs rename to meilisearch/tests/index/get_index.rs diff --git a/meilisearch-http/tests/index/mod.rs b/meilisearch/tests/index/mod.rs similarity index 100% rename from meilisearch-http/tests/index/mod.rs rename to meilisearch/tests/index/mod.rs diff --git a/meilisearch-http/tests/index/stats.rs b/meilisearch/tests/index/stats.rs similarity index 100% rename from meilisearch-http/tests/index/stats.rs rename to meilisearch/tests/index/stats.rs diff --git a/meilisearch-http/tests/index/update_index.rs b/meilisearch/tests/index/update_index.rs similarity index 100% rename from meilisearch-http/tests/index/update_index.rs rename to meilisearch/tests/index/update_index.rs diff --git a/meilisearch-http/tests/integration.rs b/meilisearch/tests/integration.rs similarity index 100% rename from meilisearch-http/tests/integration.rs rename to meilisearch/tests/integration.rs diff --git a/meilisearch-http/tests/search/errors.rs b/meilisearch/tests/search/errors.rs similarity index 100% rename from meilisearch-http/tests/search/errors.rs rename to meilisearch/tests/search/errors.rs diff --git a/meilisearch-http/tests/search/formatted.rs b/meilisearch/tests/search/formatted.rs similarity index 100% rename from meilisearch-http/tests/search/formatted.rs rename to meilisearch/tests/search/formatted.rs diff --git a/meilisearch-http/tests/search/mod.rs b/meilisearch/tests/search/mod.rs similarity index 100% rename from meilisearch-http/tests/search/mod.rs rename to meilisearch/tests/search/mod.rs diff --git a/meilisearch-http/tests/search/pagination.rs b/meilisearch/tests/search/pagination.rs similarity index 100% rename from meilisearch-http/tests/search/pagination.rs rename to meilisearch/tests/search/pagination.rs diff --git a/meilisearch-http/tests/settings/distinct.rs b/meilisearch/tests/settings/distinct.rs similarity index 100% rename from meilisearch-http/tests/settings/distinct.rs rename to meilisearch/tests/settings/distinct.rs diff --git a/meilisearch-http/tests/settings/get_settings.rs b/meilisearch/tests/settings/get_settings.rs similarity index 100% rename from meilisearch-http/tests/settings/get_settings.rs rename to meilisearch/tests/settings/get_settings.rs diff --git a/meilisearch-http/tests/settings/mod.rs b/meilisearch/tests/settings/mod.rs similarity index 100% rename from meilisearch-http/tests/settings/mod.rs rename to meilisearch/tests/settings/mod.rs diff --git a/meilisearch-http/tests/snapshot/mod.rs b/meilisearch/tests/snapshot/mod.rs similarity index 98% rename from meilisearch-http/tests/snapshot/mod.rs rename to meilisearch/tests/snapshot/mod.rs index 1c2e33534..eba260722 100644 --- a/meilisearch-http/tests/snapshot/mod.rs +++ b/meilisearch/tests/snapshot/mod.rs @@ -1,6 +1,6 @@ use std::time::Duration; -use meilisearch_http::Opt; +use meilisearch::Opt; use tokio::time::sleep; use crate::common::server::default_settings; diff --git a/meilisearch-http/tests/stats/mod.rs b/meilisearch/tests/stats/mod.rs similarity index 100% rename from meilisearch-http/tests/stats/mod.rs rename to meilisearch/tests/stats/mod.rs diff --git a/meilisearch-http/tests/tasks/mod.rs b/meilisearch/tests/tasks/mod.rs similarity index 100% rename from meilisearch-http/tests/tasks/mod.rs rename to meilisearch/tests/tasks/mod.rs From 226276649468a525f8d8f3199c17e0fd21c58e31 Mon Sep 17 00:00:00 2001 From: Colby Allen Date: Thu, 8 Dec 2022 08:31:15 -0700 Subject: [PATCH 08/14] chore: run fmt nightly on project --- meilisearch/src/main.rs | 2 +- meilisearch/tests/common/service.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/meilisearch/src/main.rs b/meilisearch/src/main.rs index 02ea00f21..50575cbbf 100644 --- a/meilisearch/src/main.rs +++ b/meilisearch/src/main.rs @@ -6,9 +6,9 @@ use actix_web::http::KeepAlive; use actix_web::web::Data; use actix_web::HttpServer; use index_scheduler::IndexScheduler; -use meilisearch_auth::AuthController; use meilisearch::analytics::Analytics; use meilisearch::{analytics, create_app, setup_meilisearch, Opt}; +use meilisearch_auth::AuthController; #[global_allocator] static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc; diff --git a/meilisearch/tests/common/service.rs b/meilisearch/tests/common/service.rs index f7c9b8294..3d663c322 100644 --- a/meilisearch/tests/common/service.rs +++ b/meilisearch/tests/common/service.rs @@ -5,8 +5,8 @@ use actix_web::http::StatusCode; use actix_web::test; use actix_web::test::TestRequest; use index_scheduler::IndexScheduler; -use meilisearch_auth::AuthController; use meilisearch::{analytics, create_app, Opt}; +use meilisearch_auth::AuthController; use serde_json::Value; use crate::common::encoder::Encoder; From 84204b8cd574b16072d0b10219de6f1dceaac8e0 Mon Sep 17 00:00:00 2001 From: curquiza Date: Fri, 9 Dec 2022 19:27:58 +0100 Subject: [PATCH 09/14] Replace the released type by published --- .github/workflows/latest-git-tag.yml | 2 +- .github/workflows/publish-deb-brew-pkg.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/latest-git-tag.yml b/.github/workflows/latest-git-tag.yml index e8cbc50f3..0adf0a1c6 100644 --- a/.github/workflows/latest-git-tag.yml +++ b/.github/workflows/latest-git-tag.yml @@ -3,7 +3,7 @@ name: Update latest git tag on: workflow_dispatch: release: - types: [released] + types: [published] jobs: check-version: diff --git a/.github/workflows/publish-deb-brew-pkg.yml b/.github/workflows/publish-deb-brew-pkg.yml index 1f84b84c5..3d9446321 100644 --- a/.github/workflows/publish-deb-brew-pkg.yml +++ b/.github/workflows/publish-deb-brew-pkg.yml @@ -2,7 +2,7 @@ name: Publish to APT repository & Homebrew on: release: - types: [released] + types: [published] jobs: check-version: From b1ffbe561eed808fa246cc1a8c16304518fd9050 Mon Sep 17 00:00:00 2001 From: curquiza Date: Fri, 9 Dec 2022 20:02:01 +0100 Subject: [PATCH 10/14] Add nightly for docker CI --- .github/workflows/publish-docker-images.yml | 31 ++++++++++++--------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/.github/workflows/publish-docker-images.yml b/.github/workflows/publish-docker-images.yml index 17e85b322..a21db7b32 100644 --- a/.github/workflows/publish-docker-images.yml +++ b/.github/workflows/publish-docker-images.yml @@ -1,7 +1,5 @@ --- on: - schedule: - - cron: '0 4 * * *' # Every day at 4:00am push: # Will run for every tag pushed except `latest` # When the `latest` git tag is created with this [CI](../latest-git-tag.yml) @@ -9,6 +7,10 @@ on: # The `latest` Docker image push is already done in this CI when releasing a stable version of Meilisearch. tags-ignore: - latest + # Both `schedule` and `workflow_dispatch` build the nightly tag + schedule: + - cron: '0 23 * * *' # Every day at 11:00pm + workflow_dispatch: name: Publish tagged images to Docker Hub @@ -18,25 +20,28 @@ jobs: steps: - uses: actions/checkout@v3 - # Check if the tag has the v.. format. If yes, it means we are publishing an official release. + # If we are running a cron or manual job ('schedule' or 'workflow_dispatch' event), it means we are publishing the `nightly` tag, so not considered stable. + # If we have pushed a tag, and the tag has the v.. format, it means we are publishing an official release, so considered stable. # In this situation, we need to set `output.stable` to create/update the following tags (additionally to the `vX.Y.Z` Docker tag): # - a `vX.Y` (without patch version) Docker tag # - a `latest` Docker tag - - name: Check tag format - if: github.event_name != 'schedule' + # For any other tag pushed, this is not considered stable. + - name: Define if stable release id: check-tag-format run: | escaped_tag=$(printf "%q" ${{ github.ref_name }}) - if [[ $escaped_tag =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + if [[ ${{ github.event_name }} != 'push' ]]; then + echo "stable=false" >> $GITHUB_OUTPUT + elif [[ $escaped_tag =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then echo "stable=true" >> $GITHUB_OUTPUT else echo "stable=false" >> $GITHUB_OUTPUT fi - # Check only the validity of the tag for official releases (not for pre-releases or other tags) + # Check only the validity of the tag for stable releases (not for pre-releases or other tags) - name: Check release validity - if: github.event_name != 'schedule' && steps.check-tag-format.outputs.stable == 'true' + if: steps.check-tag-format.outputs.stable == 'true' run: bash .github/scripts/check-release.sh - name: Set build-args for Docker buildx @@ -54,7 +59,6 @@ jobs: uses: docker/setup-buildx-action@v2 - name: Login to Docker Hub - if: github.event_name != 'schedule' uses: docker/login-action@v2 with: username: ${{ secrets.DOCKERHUB_USERNAME }} @@ -65,11 +69,12 @@ jobs: uses: docker/metadata-action@v4 with: images: getmeili/meilisearch - # The latest and `vX.Y` tags are only pushed for the official Meilisearch releases - # See https://github.com/docker/metadata-action#latest-tag + # Prevent `latest` to be updated for each new tag pushed. + # We need latest and `vX.Y` tags to only be pushed for the stable Meilisearch releases. flavor: latest=false tags: | type=ref,event=tag + type=raw,value=nightly,enable=${{ github.event_name != 'push' }} type=semver,pattern=v{{major}}.{{minor}},enable=${{ steps.check-tag-format.outputs.stable == 'true' }} type=raw,value=latest,enable=${{ steps.check-tag-format.outputs.stable == 'true' }} @@ -77,7 +82,6 @@ jobs: uses: docker/build-push-action@v3 with: # We do not push tags for the cron jobs, this is only for test purposes - push: ${{ github.event_name != 'schedule' }} platforms: linux/amd64,linux/arm64 tags: ${{ steps.meta.outputs.tags }} build-args: | @@ -86,7 +90,8 @@ jobs: # /!\ Don't touch this without checking with Cloud team - name: Send CI information to Cloud team - if: github.event_name != 'schedule' + # Do not send if nightly build (i.e. 'schedule' or 'workflow_dispatch' event) + if: github.event_name == 'push' uses: peter-evans/repository-dispatch@v2 with: token: ${{ secrets.MEILI_BOT_GH_PAT }} From 2c8eb92537929b688ba644d54731e18bed3a1728 Mon Sep 17 00:00:00 2001 From: curquiza Date: Sun, 11 Dec 2022 21:24:52 +0100 Subject: [PATCH 11/14] Check before publish latest --- .github/scripts/is-latest-release.sh | 48 +++++++++++++++++++++ .github/workflows/publish-docker-images.yml | 9 +++- 2 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 .github/scripts/is-latest-release.sh diff --git a/.github/scripts/is-latest-release.sh b/.github/scripts/is-latest-release.sh new file mode 100644 index 000000000..e61a153e4 --- /dev/null +++ b/.github/scripts/is-latest-release.sh @@ -0,0 +1,48 @@ +#!/bin/sh + +# Used in our CIs to publish the latest Docker image. + +# Checks if the current tag ($GITHUB_REF) corresponds to the latest release tag on GitHub +# Returns "true" or "false" (as a string) as a string. + +GITHUB_API='https://api.github.com/repos/meilisearch/meilisearch/releases' +PNAME='meilisearch' + +# FUNCTIONS + +# Returns the version of the latest stable version of Meilisearch by setting the $latest variable. +get_latest() { + # temp_file is needed because the grep would start before the download is over + temp_file=$(mktemp -q /tmp/$PNAME.XXXXXXXXX) + latest_release="$GITHUB_API/latest" + + if [ $? -ne 0 ]; then + echo "$0: Can't create temp file." + exit 1 + fi + + if [ -z "$GITHUB_PAT" ]; then + curl -s "$latest_release" > "$temp_file" || return 1 + else + curl -H "Authorization: token $GITHUB_PAT" -s "$latest_release" > "$temp_file" || return 1 + fi + + latest="$(cat "$temp_file" | grep '"tag_name":' | cut -d ':' -f2 | tr -d '"' | tr -d ',' | tr -d ' ')" + + rm -f "$temp_file" + return 0 +} + +# MAIN +current_tag="$(echo $GITHUB_REF | tr -d 'refs/tags/')" +get_latest + +if [ "$current_tag" != "$latest" ]; then + # The current release tag is not the latest + echo "false" +else + # The current release tag is the latest + echo "true" +fi + +exit 0 diff --git a/.github/workflows/publish-docker-images.yml b/.github/workflows/publish-docker-images.yml index a21db7b32..89b61fd4d 100644 --- a/.github/workflows/publish-docker-images.yml +++ b/.github/workflows/publish-docker-images.yml @@ -26,15 +26,20 @@ jobs: # - a `vX.Y` (without patch version) Docker tag # - a `latest` Docker tag # For any other tag pushed, this is not considered stable. - - name: Define if stable release + - name: Define if stable and latest release id: check-tag-format + env: + # To avoid request limit with the .github/scripts/is-latest-release.sh script + GITHUB_PATH: ${{ secrets.MEILI_BOT_GH_PAT }} run: | escaped_tag=$(printf "%q" ${{ github.ref_name }}) + echo "latest=false" >> $GITHUB_OUTPUT if [[ ${{ github.event_name }} != 'push' ]]; then echo "stable=false" >> $GITHUB_OUTPUT elif [[ $escaped_tag =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then echo "stable=true" >> $GITHUB_OUTPUT + echo "latest=$(sh .github/scripts/is-latest-release.sh)" >> $GITHUB_OUTPUT else echo "stable=false" >> $GITHUB_OUTPUT fi @@ -76,7 +81,7 @@ jobs: type=ref,event=tag type=raw,value=nightly,enable=${{ github.event_name != 'push' }} type=semver,pattern=v{{major}}.{{minor}},enable=${{ steps.check-tag-format.outputs.stable == 'true' }} - type=raw,value=latest,enable=${{ steps.check-tag-format.outputs.stable == 'true' }} + type=raw,value=latest,enable=${{ steps.check-tag-format.outputs.stable == 'true' && steps.check-tag-format.outputs.latest == 'true' }} - name: Build and push uses: docker/build-push-action@v3 From 9a3f9577b880ee3a5b3a58fca578e262fb22270f Mon Sep 17 00:00:00 2001 From: curquiza Date: Sun, 11 Dec 2022 21:26:05 +0100 Subject: [PATCH 12/14] Remove useless line in CI --- .github/workflows/milestone-workflow.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/milestone-workflow.yml b/.github/workflows/milestone-workflow.yml index 3a49b342b..1bf3e3d50 100644 --- a/.github/workflows/milestone-workflow.yml +++ b/.github/workflows/milestone-workflow.yml @@ -31,8 +31,6 @@ jobs: runs-on: ubuntu-latest outputs: is-patch: ${{ steps.check-patch.outputs.is-patch }} - env: - MILESTONE_VERSION: ${{ github.event.milestone.title }} steps: - uses: actions/checkout@v3 - name: Check if this release is a patch release only From 796e61ec7e23bf57c7d805e3d26cbb80a2bf55b8 Mon Sep 17 00:00:00 2001 From: curquiza Date: Sun, 11 Dec 2022 21:29:23 +0100 Subject: [PATCH 13/14] Remove useless CI --- .github/workflows/coverage.yml | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 .github/workflows/coverage.yml diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml deleted file mode 100644 index 54d3b38b4..000000000 --- a/.github/workflows/coverage.yml +++ /dev/null @@ -1,33 +0,0 @@ ---- -on: - workflow_dispatch: - -name: Execute code coverage - -jobs: - nightly-coverage: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 - with: - toolchain: nightly - override: true - - uses: actions-rs/cargo@v1 - with: - command: clean - - uses: actions-rs/cargo@v1 - with: - command: test - args: --all-features --no-fail-fast - env: - CARGO_INCREMENTAL: "0" - RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=unwind -Zpanic_abort_tests" - - uses: actions-rs/grcov@v0.1 - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: ${{ steps.coverage.outputs.report }} - yml: ./codecov.yml - fail_ci_if_error: true From 14824cee864df3b140891484962b605053d6bd2a Mon Sep 17 00:00:00 2001 From: curquiza Date: Sun, 11 Dec 2022 21:44:17 +0100 Subject: [PATCH 14/14] Remove obsolete comment line --- .github/scripts/is-latest-release.sh | 2 +- .github/workflows/publish-docker-images.yml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/scripts/is-latest-release.sh b/.github/scripts/is-latest-release.sh index e61a153e4..720dfdf4f 100644 --- a/.github/scripts/is-latest-release.sh +++ b/.github/scripts/is-latest-release.sh @@ -3,7 +3,7 @@ # Used in our CIs to publish the latest Docker image. # Checks if the current tag ($GITHUB_REF) corresponds to the latest release tag on GitHub -# Returns "true" or "false" (as a string) as a string. +# Returns "true" or "false" (as a string). GITHUB_API='https://api.github.com/repos/meilisearch/meilisearch/releases' PNAME='meilisearch' diff --git a/.github/workflows/publish-docker-images.yml b/.github/workflows/publish-docker-images.yml index 89b61fd4d..2d95e6784 100644 --- a/.github/workflows/publish-docker-images.yml +++ b/.github/workflows/publish-docker-images.yml @@ -86,7 +86,6 @@ jobs: - name: Build and push uses: docker/build-push-action@v3 with: - # We do not push tags for the cron jobs, this is only for test purposes platforms: linux/amd64,linux/arm64 tags: ${{ steps.meta.outputs.tags }} build-args: |