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

[1.4.0] Refactor Settings and Add Pagination, Separator and Dictionary Settings #417

Closed
wants to merge 10 commits into from

Conversation

Sherlouk
Copy link
Collaborator

@Sherlouk Sherlouk commented Sep 23, 2023

Pull Request

Related issue

Fixes #308
Fixes changes raised under meilisearch/integration-guides#286 (#406) - ⚠️ Wait for v1.4.0

What does this PR do?

  • Refactors index settings to improve reuse (functionally identical, but around 300 less lines of code)
  • Cleaning up some unsafe practices in unit tests
  • Adds support for three new types of index-level settings (improving parity)

All integration tests have been run against v1.4.0 (pre-release) RC 2 and is running locally. CI uses the latest version of the executable (1.3.0) and thus will not work and will throw errors. This is expected. This PR won't be merged until after the 1.4.0 release due to Swift being a tier 3 project, as such we can simply re-run CI once that's released.

This PR starts to contain a little bit of cleanup with some various nit picks (nothing that changes the code style though).

PR checklist

Please check if your PR fulfills the following requirements:

  • Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)?
  • Have you read the contributing guidelines?
  • Have you made sure that the title is accurate and descriptive of the changes?

Thank you so much for contributing to Meilisearch!

All 'reset' functions had the same exact implementation with the only chane being the API path. By reusing a single function we can have the same functionality with 100 less lines of code.
All 'get' functions had the same exact implementation with the only change being the API path. By reusing a single function we can have the same functionality with 100 less lines of code.
All 'update' functions more or less had the same exact implementation with the only change being the API path and how the data was encoded. By reusing a single function we can have the same functionality with 150 less lines of code.
Running integration tests highlighted that I was a bit overzealous with my previous refactor. This one function uses a different HTTP method, in this instance it was cleaner to just have some duplication. I've added a comment for future reference.
@Sherlouk Sherlouk marked this pull request as draft September 23, 2023 13:09
Throwing tests are better than force unwrapping as it allows the test runner to complete and prepare a proper report.

Removed many instances of force unwrapping by using a better data initialiser.
@Sherlouk Sherlouk marked this pull request as ready for review September 23, 2023 13:43
@Sherlouk Sherlouk changed the title Refactor Settings and Add Pagination, Separator and Dictionary Settings [1.4.0] Refactor Settings and Add Pagination, Separator and Dictionary Settings Sep 23, 2023
@curquiza curquiza added the enhancement New feature or request label Sep 27, 2023
Copy link
Member

@curquiza curquiza left a comment

Choose a reason for hiding this comment

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

bors merge

meili-bors bot added a commit that referenced this pull request Sep 27, 2023
417: [1.4.0] Refactor Settings and Add Pagination, Separator and Dictionary Settings r=curquiza a=Sherlouk

# Pull Request

## Related issue
Fixes #308
Fixes changes raised under meilisearch/integration-guides#286 (#406) - ⚠️ Wait for v1.4.0

## What does this PR do?
- Refactors index settings to improve reuse (functionally identical, but around 300 less lines of code)
- Cleaning up some unsafe practices in unit tests
- Adds support for three new types of index-level settings (improving parity)

All integration tests have been run against v1.4.0 (pre-release) RC 2 and is running locally. CI uses the latest version of the executable (1.3.0) and thus will not work and will throw errors. This is expected. This PR won't be merged until after the 1.4.0 release due to Swift being a tier 3 project, as such we can simply re-run CI once that's released.

This PR starts to contain a little bit of cleanup with some various nit picks (nothing that changes the code style though).

## PR checklist
Please check if your PR fulfills the following requirements:
- [x] Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)?
- [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: James Sherlock <15193942+Sherlouk@users.noreply.github.com>
@meili-bors
Copy link
Contributor

meili-bors bot commented Sep 27, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants