Add task documents endpoint#698
Conversation
Signed-off-by: Nymuxyzo <1729839+Nymuxyzo@users.noreply.github.com>
📝 WalkthroughWalkthroughThis PR adds a new ChangesTask Documents API Integration
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 #698 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 10 10
Lines 809 812 +3
=========================================
+ Hits 809 812 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@spec/meilisearch/client/tasks_spec.rb`:
- Around line 95-106: Wrap the test body that enables the experimental feature
so it always disables it in an ensure block: call
client.update_experimental_features(getTaskDocumentsRoute: true) inside a begin,
run the test actions (index.add_documents, client.task_documents, and
expectations), and then in ensure call
client.update_experimental_features(getTaskDocumentsRoute: false) to guarantee
teardown even if an exception occurs.
🪄 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: 5b471e07-ddf2-4799-abff-924aa2d13584
📒 Files selected for processing (4)
.code-samples.meilisearch.yamllib/meilisearch/client.rblib/meilisearch/task.rbspec/meilisearch/client/tasks_spec.rb
Pull Request
Related issue
Fixes #685
What does this PR do?
PR checklist
Please check if your PR fulfills the following requirements:
Summary
This PR adds support for the
GET /tasks/{task_id}/documentsendpoint to retrieve task documents, as specified in Meilisearch v1.13.0. It includes the method implementation, tests, and documentation examples.Changes
New functionality
task_documents(task_uid)method toMeilisearch::Clientthat retrieves the document payload associated with a task by delegating totask_endpoint.task_documents(task_uid)task_documents(task_uid)method toMeilisearch::Taskthat performs a GET request to/tasks/{task_uid}/documentsRefactoring
index_taskinMeilisearch::Taskfrom a separate method to an alias of the existingtaskmethod, eliminating duplicate codeTesting
spec/meilisearch/client/tasks_spec.rbthat verifiesclient.task_documentscorrectly returns documents from a task, including enabling/disabling the experimentalgetTaskDocumentsRoutefeature flagDocumentation
get_task_documents_1in.code-samples.meilisearch.yamldemonstrating usage viaclient.task_documents(1)