Commit Graph

34 Commits

Author SHA1 Message Date
Kerollmops 669a3ff85f
Improve the tasks error reporting 2022-06-20 11:08:05 +02:00
bors[bot] 4fc73195e6
Merge #2466
2466: index resolver tests r=MarinPostma a=MarinPostma

add more index resolver tests


depends on #2455 

followup #2453 

Co-authored-by: ad hoc <postma.marin@protonmail.com>
2022-06-09 17:50:01 +00:00
bors[bot] de356061db
Merge #2414
2414: Improve index uid validation upon API key creation r=Kerollmops a=pierre-l

- ~Use an IndexUid newtype to enforce stronger constraints~
- ~`cargo update -p vergen`~ (`rustup update` was the proper fix for this)
- Add a new `meilisearch_types` crate
- Move `meilisearch_error` to `meilisearch_types::error`
- Move `meilisearch_lib::index_resolver::IndexUid` to `meilisearch_types::index_uid`
- Add a new `InvalidIndexUid` error in `meilisearch_types::index_uid`
- Move `meilisearch_http::routes::StarOr` to `meilisearch_types::star_or`
- Use the `IndexUid` and `StarOr` in `meilisearch_auth::Key`

Fixes #2158


Co-authored-by: pierre-l <pierre.larger@gmail.com>
2022-06-09 15:41:51 +00:00
ad hoc 9a6841c7ce
remove unused test 2022-06-09 17:10:56 +02:00
ad hoc 354f7fb2bf
test index_update 2022-06-09 17:10:55 +02:00
ad hoc 0333bad057
delete documents test 2022-06-09 17:10:55 +02:00
ad hoc 0e416b4bcd
delete index test 2022-06-09 17:10:55 +02:00
pierre-l 36cb09eb25 Add a new `meilisearch_types` crate
Move `meilisearch_error` to `meilisearch_types::error`
Move `meilisearch_lib::index_resolver::IndexUid` to `meilisearch_types::index_uid`
Add a new `InvalidIndexUid` error in `meilisearch_types::index_uid`
2022-06-09 16:14:13 +02:00
ad hoc 8fc3b7d3b0
refactor process_document_addition_batch 2022-06-09 14:59:20 +02:00
ad hoc 64e3096790
process_task updates task events 2022-06-09 14:59:20 +02:00
ad hoc b594d49def
add IndexResolver BatchHandler tests 2022-06-09 14:59:19 +02:00
ad hoc fbba67fbe9
add mocker to IndexResolver 2022-06-09 14:59:19 +02:00
bors[bot] 2b2e571c76
Merge #2460
2460: Create custom error types for `TaskType`, `TaskStatus`, and `IndexUid` r=Kerollmops a=walterbm

# Pull Request

## What does this PR do?
Fixes #2443 by making the following changes:

- Add custom `TaskTypeError` for `TaskType::from_str` 
- Add custom `TaskStatusError` for `TaskStatus::from_str`
- Add custom `IndexUidFormatError` for `IndexUid::from_str`
- Implement `From<IndexUidFormatError> for IndexResolverError` to convert between errors
- Replace all usages of `IndexUid::new` with `IndexUid::from_str`
    - **NOTE** I am relatively new to Rust and I struggled a lot with this final part. This PR ended up with a messy error conversion which does not seem ideal. Please let me know if you have any suggestions for how to make this better and I'll be happy to make any updates!

## PR checklist
Please check if your PR fulfills the following requirements:
- [x] Does this PR fix an existing issue?
- [x] Have you read the contributing guidelines?
- [x] Have you made sure that the title is accurate and descriptive of the changes?

Thank you so much for contributing to Meilisearch!


Co-authored-by: walter <walter.beller.morales@gmail.com>
2022-06-09 09:10:28 +00:00
walter 96d4fd54bb Change the index uid format check for better legibility 2022-06-08 19:58:47 -04:00
walter 2b944ecd89 Remove IndexUid::new and replace with IndexUid::from_str 2022-06-08 19:56:01 -04:00
ad hoc 6ac8675c6d
add IndexResolver BatchHandler tests 2022-06-07 09:33:57 +02:00
ad hoc df61ca9cae
add mocker to IndexResolver 2022-06-07 09:33:57 +02:00
ad hoc bbd685af5e
move IndexResolver to real module 2022-06-07 09:33:56 +02:00
walter ba55905377 Add custom IndexUidFormatError for IndexUid 2022-06-05 02:26:48 -04:00
ad hoc 0c5352fc22
move index_uid from task to task_content 2022-06-02 15:30:35 +02:00
ad hoc 446f1f31e0
rename Succeded to Succeeded 2022-05-31 17:22:37 +02:00
Kerollmops 3684c822f1
Add indexUid filtering on the /tasks route 2022-05-31 11:33:20 +02:00
ad hoc 0f9c134114
fix tests 2022-05-25 11:13:35 +02:00
ad hoc 46cdc17701
make scheduler accept multiple batch handlers 2022-05-25 11:13:34 +02:00
ad hoc 6a0231cb28
perform dump method 2022-05-25 11:13:33 +02:00
ad hoc 5a5066023b
introduce TaskListIdentifier 2022-05-25 11:13:33 +02:00
ad hoc aa50acb031
make Task index_uid an option
Not all task relate to an index. Tasks that don't have an index_uid set
to None
2022-05-25 11:13:32 +02:00
Sai Kumar e271395971
chore(all): bump milli
* updates to Use the milli's heed dependency #2210

* Update index.rs

* Update store.rs

* Update mod.rs

* cargo fmt
2022-03-16 16:34:44 +01:00
Irevoire 05c8d81e65
chore: get rid of chrono in favor of time
Chrono has been unmaintened for a few month now and there is a CVE on it.

make clippy happy

bump milli
2022-02-16 18:14:29 +01:00
mpostma c9a236b0af
feat(lib): auto-batching 2022-02-01 18:06:20 +01:00
bors[bot] 5d48f72ade
Merge #2065
2065: MeiliSearch v0.25.0: `stable` -> `main` r=curquiza a=curquiza



Co-authored-by: Clémentine Urquizar <clementine@meilisearch.com>
Co-authored-by: Clément Renault <clement@meilisearch.com>
Co-authored-by: bors[bot] <26634292+bors[bot]@users.noreply.github.com>
Co-authored-by: many <maxime@meilisearch.com>
Co-authored-by: Marin Postma <postma.marin@protonmail.com>
Co-authored-by: Maxime Legendre <maximelegendre@MacBook-Pro-de-Maxime.local>
Co-authored-by: Maxime Legendre <maximelegendre@mbp-de-maxime.home>
Co-authored-by: Tamo <tamo@meilisearch.com>
Co-authored-by: ManyTheFish <many@meilisearch.com>
2022-01-11 16:30:22 +00:00
Maxime Legendre a845cd8880 Fix(auth): Forbid index creation on alternates routes
Forbid index creation on alternates routes when the action `index.create` is not given

fix #2024
2021-12-20 14:48:18 +01:00
Marin Postma b28a465304 bug(lib): drop env on last use
fixes the `too many open files` error when running tests by closing the
environment on last drop
2021-12-16 10:57:55 +01:00
Marin Postma a30e02c18c feat(all): Task store
implements:
https://github.com/meilisearch/specifications/blob/develop/text/0060-refashion-updates-apis.md

linked PR:

- #1889
- #1891
- #1892
- #1902
- #1906
- #1911
- #1914
- #1915
- #1916
- #1918
- #1924
- #1925
- #1926
- #1930
- #1936
- #1937
- #1942
- #1944
- #1945
- #1946
- #1947
- #1950
- #1951
- #1957
- #1959
- #1960
- #1961
- #1962
- #1964

- https://github.com/meilisearch/milli/pull/414
- https://github.com/meilisearch/milli/pull/409
- https://github.com/meilisearch/milli/pull/406
- https://github.com/meilisearch/milli/pull/418

- close #1687
- close #1786
- close #1940
- close #1948
- close #1949
- close #1932
- close #1956
2021-12-02 20:14:42 +01:00