Skip to content
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

Add tasks filters for v0.30 #390

Merged
merged 4 commits into from Dec 6, 2022

Conversation

alallema
Copy link
Contributor

@alallema alallema commented Dec 1, 2022

Add new filters on the get /tasks route.

Present in this spec

V0.30.0
in TasksQuery:

  • Add uid
  • Add CanceledBy
  • Add BeforeEnqueuedAt
  • Add AfterEnqueuedAt
  • Add BeforeStartedAt
  • Add AfterStatedAt
  • Add BeforeFinishedAt
  • Add AfterFinishedAt

Tests:

  • uid
  • canceledBy
  • beforeEnqueuedAt

@alallema alallema marked this pull request as ready for review December 5, 2022 14:36
@alallema alallema force-pushed the add_tasks_filters_for_v0.30 branch 4 times, most recently from f2c7017 to 11f2deb Compare December 6, 2022 13:53
@alallema alallema changed the title Add tasks filters for v0.30 Modify tasks for v0.30 Dec 6, 2022
@alallema alallema changed the title Modify tasks for v0.30 Add tasks filters for v0.30 Dec 6, 2022
.code-samples.meilisearch.yaml Show resolved Hide resolved
@@ -390,9 +377,7 @@ func convertKeyToParsedKey(key Key) (resp KeyParsed) {
// Convert time.Time to *string to feat the exact ISO-8601
// format of Meilisearch
if !key.ExpiresAt.IsZero() {
const Format = "2006-01-02T15:04:05"
Copy link
Member

Choose a reason for hiding this comment

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

This was really the way go uses to format dates? 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know any other way except Format method

Copy link
Member

Choose a reason for hiding this comment

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

I mean, in other languages is very common to have YYYY-MM-DD or something like this, but in this case you're using a real date value to do the format...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes I know ...

client_test.go Outdated Show resolved Hide resolved
@alallema alallema merged commit 4163f1f into bump-meilisearch-v0.30.0 Dec 6, 2022
@alallema alallema deleted the add_tasks_filters_for_v0.30 branch December 6, 2022 18:35
@alallema alallema added the breaking-change The related changes are breaking for the users label Dec 7, 2022
bors bot added a commit that referenced this pull request Dec 14, 2022
382: Changes related to the next Meilisearch release (v0.30.0) r=alallema a=meili-bot

Related to this issue: meilisearch/integration-guides#221

This PR:
- gathers the changes related to the next Meilisearch release (v0.30.0) so that this package is ready when the official release is out.
- should pass the tests against the [latest pre-release of Meilisearch](https://github.com/meilisearch/meilisearch/releases).
- might eventually contain test failures until the Meilisearch v0.30.0 is out.

⚠️ This PR should NOT be merged until the next release of Meilisearch (v0.30.0) is out.

_This PR is auto-generated for the [pre-release week](https://github.com/meilisearch/integration-guides/blob/main/resources/pre-release-week.md) purpose._

Done:
- #390
- #392
- #395
- #396
- #397

Co-authored-by: meili-bot <74670311+meili-bot@users.noreply.github.com>
Co-authored-by: Amélie <alallema@users.noreply.github.com>
Co-authored-by: alallema <amelie@meilisearch.com>
bors bot added a commit that referenced this pull request Dec 15, 2022
398: Update version for the next release (0.22.0) r=alallema a=alallema

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` #392
- New filters on `GetTasks`: `UID`, `BeforeEnqueuedAt`, `AfterEnqueuedAt`, ... see #390 
- New `client.CancelTasks` method that lets you cancel `enqueued` and `processing` tasks #395
- New `client.DeleteTasks` method that lets you delete tasks #396 
- New `client.SwapIndexes` method that lets you swap two indexes #397
- New fields on `Task.Details` #395

## ⚠️ Breaking change

- Parameters on `GetTasks` name changes: #390
   - `Status` -> `Statuses`
   - `IndexUID` -> `IndexUIDS`
   - `Type` -> `Types`


Co-authored-by: alallema <amelie@meilisearch.com>
Co-authored-by: Amélie <alallema@users.noreply.github.com>
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.

None yet

2 participants