Skip to content

Commit

Permalink
Merge branch 'main' of github.com:meilisearch/meilisearch-dart into f…
Browse files Browse the repository at this point in the history
…ix/pana-ci
  • Loading branch information
ahmednfwela committed Feb 16, 2024
2 parents 257fe84 + a8429a8 commit 7a7ad22
Show file tree
Hide file tree
Showing 36 changed files with 2,467 additions and 1,061 deletions.
526 changes: 120 additions & 406 deletions .code-samples.meilisearch.yaml

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions .github/release-draft-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ categories:
label: 'bug'
- title: '🔒 Security'
label: 'security'
- title: '⚙️ Maintenance/misc'
label:
- 'maintenance'
- 'documentation'
template: |
$CHANGES
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pre-release-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
name: integration-tests-against-rc (dart ${{ matrix.version }})
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Get the latest Meilisearch RC
run: echo "MEILISEARCH_VERSION=$(curl https://raw.githubusercontent.com/meilisearch/integration-guides/main/scripts/get-latest-meilisearch-rc.sh | bash)" >> $GITHUB_ENV
- name: Meilisearch (${{ env.MEILISEARCH_VERSION }}) setup with Docker
run: docker run -d -p 7700:7700 getmeili/meilisearch:${{ env.MEILISEARCH_VERSION }} meilisearch --master-key=masterKey --no-analytics
- name: Run integration tests
run: docker run --net="host" -v $PWD:/package -w /package dart:${{ matrix.version }} /bin/sh -c 'dart pub get && dart run test'
run: docker run --net="host" -v $PWD:/package -w /package dart:${{ matrix.version }} /bin/sh -c 'dart pub get && dart pub get -C tool && dart run test'
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Check release validity
run: sh .github/scripts/check-release.sh
- name: Publish
Expand Down
36 changes: 26 additions & 10 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@ jobs:
# Will still run for each push to bump-meilisearch-v*
if: github.event_name != 'pull_request' || !startsWith(github.base_ref, 'bump-meilisearch-v')
timeout-minutes: 10
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
version: ['3.0.0']
version: ['latest']
name: integration-tests (dart ${{ matrix.version }})
services:
meilisearch:
Expand All @@ -35,56 +34,73 @@ jobs:
- 7700:7700

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dart-lang/setup-dart@v1
with:
sdk: ${{ matrix.version }}
- name: Install dependencies
run: |
dart pub get
dart pub get -C tool
dart pub global activate coverage
- name: Run integration tests
run: dart test --concurrency=4 --reporter=github --coverage=./coverage/reports
- name: Generate coverage reports
run: dart pub global run coverage:format_coverage --report-on=./lib --lcov --in=./coverage/reports --out=coverage/lcov.info
- name: Report to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
file: coverage/lcov.info
fail_ci_if_error: true
fail_ci_if_error: false


linter:
name: linter-check
runs-on: ubuntu-latest
container:
image: dart:latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dart-lang/setup-dart@v1
with:
sdk: '3.0.0'
- name: Install dependencies
run: dart pub get
run: |
dart pub get
dart pub get -C tool
- name: Run linter
run: dart analyze --fatal-infos && dart format . --set-exit-if-changed

yaml-lint:
name: Yaml linting check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Yaml lint check
uses: ibiqlik/action-yamllint@v3
with:
config_file: .yamllint.yml

check-code-samples:
name: check .code-samples.meilisearch.yaml
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dart-lang/setup-dart@v1
with:
sdk: 'latest'
- name: check if samples changed
run: |
dart pub get
dart pub get -C tool
dart run ./tool/bin/meili.dart update-samples --fail-on-change
pana:
runs-on: ubuntu-latest
timeout-minutes: 10
container:
image: dart:latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dart-lang/setup-dart@v1
with:
sdk: '3.0.0'
Expand Down
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
[comment]: <> (All notable changes to this project will be documented in this file.)

# 0.15.0
### Breaking Changes:

- Change members of `Faceting` to be `final`, and remove the default values
- Mark all `Searcheable<T>` fields in the constructor as `required`
- Bug Fix `Searcheable<T>` had a wrong `matchesPosition` property, which was moved into `MeiliDocumentContainer<T>`

### Changes:

- Add `int? total` to `TasksResults`
- Add `attributesToSearchOn` to `SearchQuery` and `IndexSearchQuery`
- Add `Future<FacetSearchResult> facetSearch(FacetSearchQuery query)` to `MeiliSearchIndex`
- Add `enum FacetingSortTypes`
- Add `Map<String, FacetingSortTypes>? sortFacetValuesBy` to `Faceting`
- [experimental]* Add `List? vector` to `SearchQuery` and `IndexSearchQuery`
- [experimental]* Add `bool? showRankingScoreDetails` to `SearchQuery` and `IndexSearchQuery`
- Add `bool? showRankingScore` to `SearchQuery` and `IndexSearchQuery`
- Add `MeiliDocumentContainer<T>`
- Add `Map<String, dynamic> src` to `Searchable` which exposes the raw json object returned from the server.
Just in case we don't keep up with new meilisearch releases, the user has a way to access new features.

[experimental]* To adopt a experimental [change you must opt-in manually](https://www.meilisearch.com/docs/learn/experimental/overview#activating-experimental-features)

# 0.14.0
### Breaking Changes:
- Moved `indexUid`, `query` from `SearchQuery` to the new `IndexSearchQuery`.
Expand Down
26 changes: 26 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ First of all, thank you for contributing to Meilisearch! The goal of this docume
- [Requirements ](#requirements-)
- [Setup ](#setup-)
- [Tests and Linter ](#tests-and-linter-)
- [Updating code samples](#updating-code-samples)
- [Git Guidelines](#git-guidelines)
- [Git Branches ](#git-branches-)
- [Git Commits ](#git-commits-)
Expand Down Expand Up @@ -76,6 +77,31 @@ dart test
dart analyze
```

### Updating code samples

Some PRs require updating the code samples (found in `.code-samples.meilisearch.yaml`), this is done automatically using code excerpts, which are actual pieces of code subject to testing and linting.

A lot of them are placed in `test/code_samples.dart`.

Also most of the tests in that file are skipped, since they are mostly duplicated in other test files.

The process to define a new code sample is as follows:
1. Add the piece of code in `test/code_samples.dart`
2. surround it with `#docregion key` and `#enddocregion`, e.g.
```
// #docregion meilisearch_contributing_1
final client = MeilisearchClient();
anything();
// #enddocregion
```
3. run this command to update the code samples
```bash
dart run ./tool/bin/meili.dart update-samples
```
4. to test if the code samples are updated correctly, run:
```bash
dart run ./tool/bin/meili.dart update-samples --fail-on-change
```
## Git Guidelines
### Git Branches <!-- omit in TOC -->
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020-2022 Meili SAS
Copyright (c) 2020-2024 Meili SAS
Copyright (c) 2020 Misir Jafarov <misir.ceferov@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

**Meilisearch** is an open-source search engine. [Learn more about Meilisearch.](https://github.com/meilisearch/meilisearch)

## Table of Contents <!-- omit in toc -->
## Table of Contents <!-- omit in TOC -->

- [📖 Documentation](#-documentation)
- [⚡ Supercharge your Meilisearch experience](#-supercharge-your-meilisearch-experience)
Expand All @@ -55,7 +55,7 @@ You can install the **meilisearch** package by adding a few lines into `pubspec.

```yaml
dependencies:
meilisearch: ^0.14.0
meilisearch: ^0.15.0
```
Then open your terminal and update dart packages.
Expand Down Expand Up @@ -202,6 +202,8 @@ await index.search('wonder', filter: ['id > 1 AND genres = Action']);

This package guarantees compatibility with [version v1.x of Meilisearch](https://github.com/meilisearch/meilisearch/releases/tag/latest), but some features may not be present. Please check the [issues](https://github.com/meilisearch/meilisearch-dart/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22+label%3Aenhancement) for more info.

⚠️ This package is not compatible with the [`vectoreStore` experimental feature](https://www.meilisearch.com/docs/learn/experimental/vector_search) of Meilisearch v1.6.0 and later. More information on this [issue](https://github.com/meilisearch/meilisearch-dart/issues/369).

## 💡 Learn more

The following sections in our main documentation website may interest you:
Expand Down
6 changes: 3 additions & 3 deletions bors.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
status = [
'integration-tests (dart 3.0.0)',
'linter-check',
'pana'
'integration-tests (dart latest)',
'linter-check',
'pana'
]
# 1 hour timeout
timeout-sec = 3600
Loading

0 comments on commit 7a7ad22

Please sign in to comment.