Skip to content

Add cancel task for v0.30.0 #377

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

Merged

Conversation

bidoubiwa
Copy link
Contributor

@bidoubiwa bidoubiwa commented Nov 10, 2022

Breaking changes

  • Changed TasksQuery structure to TasksSearchQuery when building the query parameters for a get_tasks call.

before:

  let mut query = TasksQuery::new(&client)
      .with_index_uids(["movies"])
      .execute()

after:

  let mut query = TasksSearchQuery::new(&client)
      .with_index_uids(["movies"])
      .execute()
  • attributes of TasksSearchQuery are now private. Meaning you cannot do this anymore:
    let mut query = TasksSearchQuery::new(&client);
    query.limit = 10; // Does not work anymore, limit is private

Enhancement

  • New tasksCancelQuery to structure to build the filters to cancel tasks.

Todo

  • Implementation

    • rename TasksQuery to TasksSearchQuery
    • Creation of TasksCancelQuery
    • Create different implementation of TasksQuery:
      • TasksPaginationFilters
      • TasksCancelFilters
    • make TasksQuery filters private.
    • with_from only available on TasksSearchQuery
    • with_limit only available on TasksSearchQuery
    • Add canceledBy in the task return
  • Tests:

    • Add tests on TasksCancelQuery

@bidoubiwa bidoubiwa changed the base branch from main to add_tasks_filters_for_v0.30.0 November 10, 2022 17:16
@bidoubiwa bidoubiwa changed the title Bump meilisearch v0.30.0 add cancel task Add cancel task for v0.30.0 Nov 15, 2022
Base automatically changed from add_tasks_filters_for_v0.30.0 to bump-meilisearch-v0.30.0 November 15, 2022 18:10
@bidoubiwa bidoubiwa marked this pull request as ready for review November 15, 2022 18:31
@bidoubiwa bidoubiwa added the breaking-change The related changes are breaking for the users label Nov 15, 2022
Copy link
Contributor

@alallema alallema left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few comments. Also the tests seems to be broken

@bidoubiwa bidoubiwa requested a review from alallema November 17, 2022 11:30
* Add delete tasks for v0.30.0

* Add swap indexes for v0.30.0 (#382)

* Add swap indexes for v0.30.0

* Implement swap indexes

* Add indexSwap detail

* Use tuples as type for the indexes field

* Add tests on index swap

* Create better documentation for indexes swap

* Fix clippy errors

* Fix missing bracket

* Fix swap doc test

* Make doc more clear
@bidoubiwa bidoubiwa merged commit 52ac7d8 into bump-meilisearch-v0.30.0 Nov 17, 2022
@bidoubiwa bidoubiwa deleted the bump-meilisearch-v0.30.0-add-cancel-task branch November 17, 2022 12:53
bors bot added a commit that referenced this pull request Nov 28, 2022
399: Update version for the next release (v0.21.0) r=bidoubiwa a=bidoubiwa

This version makes this package compatible with Meilisearch v0.30.0 🎉
Check out the changelog of [Meilisearch v0.30.0](https://github.com/meilisearch/meilisearch/releases/tag/v0.30.0) for more information on the changes.

## 🚀 Enhancements

- New `pagination` strategy with the search parameters`page` and `hitsPerPage` #374
- New bulder methods on `get_tasks`: `with_uids`, `with_before_enqueued_at`, ... see #375
- New `client.cancel_tasks` method that lets you cancel `enqueued` and `processing` tasks #377 
- New `client.delete_tasks` method that lets you delete tasks #381 
- New `client.swap_indexes` method that lets you swap two indexes #382

## ⚠️ Breaking change

- builder functions on `TasksQuery` name changes: #375
   - `with_status` -> `with_statuses`
   - `with_index_uid` -> `with_index_uids`
   - `with_type` -> `with_types`
- Task detail `receivedDocumentIds` renamed to `providedIds` #393
- Error field in `Task` is now always present and has a `None` value when there are no errors #390
- Add and rename some error codes: #384 

Co-authored-by: Charlotte Vermandel <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change The related changes are breaking for the users
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants