Add support for /export API [v1.16]#696
Conversation
Signed-off-by: Nymuxyzo <1729839+Nymuxyzo@users.noreply.github.com>
📝 WalkthroughWalkthroughThis PR implements ChangesExport API Support
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 #696 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 10 10
Lines 809 813 +4
=========================================
+ Hits 809 813 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
spec/meilisearch/client/exports_spec.rb (1)
5-5: 💤 Low valueConsider adding protocol scheme to the URL.
The URL
'localhost:7701'lacks a protocol scheme (http:// or https://). While this might be accepted by the underlying HTTP library or server, including the scheme explicitly improves clarity and follows standard URL format conventions.🔧 Suggested improvement
- task = client.export({ url: 'localhost:7701', indexes: { '*': { overrideSettings: true } } }) + task = client.export({ url: 'http://localhost:7701', indexes: { '*': { overrideSettings: true } } })🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@spec/meilisearch/client/exports_spec.rb` at line 5, The test call to client.export uses a URL lacking a scheme: update the argument passed to client.export (the task assignment in exports_spec, variable task) to include an explicit protocol (e.g. change 'localhost:7701' to 'http://localhost:7701' or 'https://localhost:7701') so the URL is fully qualified and unambiguous for the HTTP client.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@lib/meilisearch/client.rb`:
- Around line 475-483: Update the YARD comment for the /export endpoint in
lib/meilisearch/client.rb so that only :url is documented as required and both
:api_key (apiKey) and :payload_size (payloadSize) are marked optional; adjust
the `@param` lines for export_options to reflect optionality (e.g., indicate
[String, nil] or "optional") for :api_key and :payload_size, optionally add a
short note that a Bearer Authorization header with an admin key is required for
the request, and ensure the documented names match the API payload keys (apiKey,
payloadSize) and the hash keys used in the export-related method.
---
Nitpick comments:
In `@spec/meilisearch/client/exports_spec.rb`:
- Line 5: The test call to client.export uses a URL lacking a scheme: update the
argument passed to client.export (the task assignment in exports_spec, variable
task) to include an explicit protocol (e.g. change 'localhost:7701' to
'http://localhost:7701' or 'https://localhost:7701') so the URL is fully
qualified and unambiguous for the HTTP client.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 72e90f40-3810-4760-bb68-ff2658d861d1
📒 Files selected for processing (3)
.code-samples.meilisearch.yamllib/meilisearch/client.rbspec/meilisearch/client/exports_spec.rb
Pull Request
Related issue
Fixes #639
What does this PR do?
PR checklist
Please check if your PR fulfills the following requirements:
Overview
Added client support for the Meilisearch
/exportAPI (v1.16), enabling users to export indexes through a newexportmethod on theMeilisearch::Clientclass.Changes
New Client Method
Added
export(export_options)method toMeilisearch::Clientthat:/exportendpointModels::Taskobject for tracking the export operationTest Coverage
Added comprehensive test specification in
spec/meilisearch/client/exports_spec.rbthat verifies:overrideSettings: true)typeof'export'Documentation
Added code sample
export_post_1to.code-samples.meilisearch.yamldemonstrating:client.exportmethod"*") and settings override optionsImplementation Details