-
Notifications
You must be signed in to change notification settings - Fork 47
Add tests for composite embedders and pooling #644
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 tests for composite embedders and pooling #644
Conversation
WalkthroughAdds a Changes
Sequence Diagram(s)(omitted — changes are documentation/comments and test/helper additions; no new runtime control flow to diagram) Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Pre-merge checks (1 passed, 3 warnings, 1 inconclusive)❌ Failed checks (3 warnings, 1 inconclusive)
✅ Passed checks (1 passed)
Poem
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal). Please share your feedback with us on this Discord post. 📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (5)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (4)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #644 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 10 10
Lines 806 806
=========================================
Hits 806 806 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
88c8da1
to
d1682a3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
spec/support/experimental_feature_helpers.rb (1)
11-13
: Optionally assert feature toggle succeeded to avoid flaky specsCurrently, failures from
/experimental-features
(e.g., wrong host/port, 4xx) are ignored. For more robust tests, consider raising on non-2xx responses insideconfigure_feature
.You can adapt
configure_feature
like this (outside the changed lines):def configure_feature(attribute_to_toggle, toggle) uri = URI("http://#{ENV.fetch('MEILISEARCH_URL', 'localhost')}") uri.path = '/experimental-features' uri.port = ENV.fetch('MEILISEARCH_PORT', '7700') req = Net::HTTP::Patch.new(uri) req.body = { attribute_to_toggle => toggle }.to_json req.content_type = 'application/json' req['Authorization'] = "Bearer #{MASTER_KEY}" res = Net::HTTP.start(uri.hostname, uri.port) { |http| http.request(req) } unless res.is_a?(Net::HTTPSuccess) raise "Failed to toggle experimental feature #{attribute_to_toggle}=#{toggle}: #{res.code} #{res.body}" end res end
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (5)
.ruby-version
(1 hunks)lib/meilisearch/index.rb
(2 hunks)spec/meilisearch/index/settings_spec.rb
(1 hunks)spec/spec_helper.rb
(1 hunks)spec/support/experimental_feature_helpers.rb
(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
spec/meilisearch/index/settings_spec.rb (4)
spec/support/experimental_feature_helpers.rb (1)
enable_composite_embedders
(11-13)lib/meilisearch/client.rb (1)
index
(132-134)lib/meilisearch/index.rb (2)
update_embedders
(763-769)embedders
(759-761)lib/meilisearch/models/task.rb (1)
await
(114-121)
spec/spec_helper.rb (1)
lib/meilisearch/client.rb (1)
include
(14-488)
🪛 GitHub Actions: Tests
spec/meilisearch/index/settings_spec.rb
[error] 876-876: RuboCop: Layout/TrailingWhitespace detected trailing whitespace.
[error] 878-878: RuboCop: Layout/FirstHashElementIndentation: Use 2 spaces for indentation in a hash.
[error] 879-879: RuboCop: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
[error] 881-881: RuboCop: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
[error] 882-882: RuboCop: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
[error] 883-883: RuboCop: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
[error] 883-883: RuboCop: Style/TrailingCommaInHashLiteral: Avoid comma after the last item of a hash.
[error] 886-886: RuboCop: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
[error] 887-887: RuboCop: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
[error] 888-888: RuboCop: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
[error] 889-889: RuboCop: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
[error] 893-893: RuboCop: Layout/FirstHashElementIndentation: Indent the right brace the same as the first position after the preceding left parenthesis.
[error] 895-895: RuboCop: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
[error] 895-895: RuboCop: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
[error] 896-896: RuboCop: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
[error] 896-896: RuboCop: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
🔇 Additional comments (5)
.ruby-version (1)
1-1
: Ruby version pin looks goodPinning to Ruby 3.1.7 is fine for CI consistency.
spec/support/experimental_feature_helpers.rb (1)
11-13
: Helper naming and usage are consistent with existing pattern
enable_composite_embedders
mirrorsenable_edit_documents_by_function
and targets the expectedcompositeEmbedders
flag. Good addition.spec/spec_helper.rb (1)
81-81
: Good: expose ExperimentalFeatureHelpers globallyIncluding
ExperimentalFeatureHelpers
here avoids per-spec boilerplate and aligns with other helper inclusions.lib/meilisearch/index.rb (2)
577-595
: Typo tolerance settings: API integration looks correct
- Getter, updater (PATCH with transformed attributes), and reset map cleanly to the API.
- Aliases (
get_typo_tolerance
,typo_tolerance=
) match existing conventions.Looks good.
596-614
: Faceting settings: consistent with settings API patterns
- Getter, updater (PATCH with transformed attributes), and reset are implemented consistently.
- Aliases (
get_faceting
,faceting=
) align with existing naming.All good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
spec/support/experimental_feature_helpers.rb (1)
11-13
: Helper to toggle composite embedders is consistent and correct; consider a safe “with_…” wrapperThis mirrors the existing pattern and delegates to the shared configurator correctly. As an optional enhancement to avoid leaking global server state across examples, add a block-based helper that ensures the feature is reverted even if the spec fails.
Example addition (outside the selected lines):
def with_composite_embedders_enabled enable_composite_embedders(true) begin yield ensure enable_composite_embedders(false) end endUsage in specs:
with_composite_embedders_enabled do # your test logic that relies on composite embedders being enabled end
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (5)
.ruby-version
(1 hunks)lib/meilisearch/index.rb
(2 hunks)spec/meilisearch/index/settings_spec.rb
(1 hunks)spec/spec_helper.rb
(1 hunks)spec/support/experimental_feature_helpers.rb
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- .ruby-version
🚧 Files skipped from review as they are similar to previous changes (2)
- spec/meilisearch/index/settings_spec.rb
- lib/meilisearch/index.rb
🔇 Additional comments (1)
spec/spec_helper.rb (1)
81-81
: Global include of ExperimentalFeatureHelpers: LGTMMakes the experimental toggle helpers available across specs and aligns with how other helper modules are included.
d1682a3
to
5f0e635
Compare
5f0e635
to
f0d12fd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for fixing this tests!
bors merge
Pull Request
Related issue
Fixes #626
What does this PR do?
PR checklist
Please check if your PR fulfills the following requirements:
Thank you so much for contributing to Meilisearch!
Summary by CodeRabbit
New Features
Tests
Chores