Skip to content

Conversation

Nymuxyzo
Copy link
Contributor

@Nymuxyzo Nymuxyzo commented Jun 1, 2025

Pull Request

Related issue

Fixes #629

What does this PR do?

Nothing had to be changed in the code, as the 3 attributes were automatically included in the response. I just extended the test a little

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?

Summary by CodeRabbit

  • Tests
    • Expanded test coverage to verify additional batch metadata and progress details in batch responses.

Copy link

coderabbitai bot commented Jun 1, 2025

Walkthrough

The test for the Meilisearch client's batches method was updated to verify additional keys and nested attributes in the batch response, including expanded statistics and metadata fields such as progressTrace, writeChannelCongestion, and internalDatabaseSizes, in alignment with new requirements from Meilisearch v1.14.

Changes

File(s) Change Summary
spec/meilisearch/client/batches_spec.rb Expanded test assertions to check for new and more detailed keys in the batch response hash.

Sequence Diagram(s)

sequenceDiagram
    participant TestSuite
    participant Client
    participant Meilisearch

    TestSuite->>Client: Call batches()
    Client->>Meilisearch: Request batch list
    Meilisearch-->>Client: Return batch data with expanded stats and metadata
    Client-->>TestSuite: Return batch data
    TestSuite->>TestSuite: Assert presence of new keys (progressTrace, writeChannelCongestion, internalDatabaseSizes, etc.)
Loading

Assessment against linked issues

Objective Addressed Explanation
Add progressTrace, writeChannelCongestion, and internalDatabaseSizes to batches stats (#629)

Poem

A bunny hopped through fields of test,
Expanding checks to do its best.
With stats and traces, keys anew,
The batches now are thorough too!
Congestion, sizes, progress shown—
This rabbit’s code has fully grown!
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5b1cd31 and 3378ca7.

📒 Files selected for processing (1)
  • spec/meilisearch/client/batches_spec.rb (1 hunks)
🔇 Additional comments (4)
spec/meilisearch/client/batches_spec.rb (4)

17-17: LGTM: UID verification added correctly.

Adding verification for the uid property ensures that batch responses include the expected identifier. Using anything matcher is appropriate since UIDs are dynamically generated.


19-19: LGTM: Progress tracking verification added.

The addition of progress property verification aligns with the v1.14 batch tracking enhancements. The anything matcher is suitable for this dynamic progress value.


21-26: LGTM: Comprehensive stats verification for v1.14 properties.

The expanded stats hash verification covers the new v1.14 batch statistics properties effectively:

  • totalNbTasks: 1 - Appropriately specific given the single document addition in the test
  • progressTrace, writeChannelCongestion, internalDatabaseSizes - Correctly use anything matcher for these internal metrics that can vary

This thorough verification ensures the new v1.14 properties are properly exposed in the API response.


27-29: LGTM: Timing properties verification added.

The addition of duration, startedAt, and finishedAt properties provides comprehensive batch lifecycle tracking. Using anything matcher is appropriate for these timestamp and duration values that are dynamically determined by the Meilisearch server.

✨ Finishing Touches
  • 📝 Generate Docstrings

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

codecov bot commented Jun 1, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (5b1cd31) to head (3378ca7).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #633   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           10        10           
  Lines          804       804           
=========================================
  Hits           804       804           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

brunoocasali
brunoocasali previously approved these changes Jun 10, 2025
Copy link
Member

@brunoocasali brunoocasali left a comment

Choose a reason for hiding this comment

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

LGTM! thank you!
bors merge

@brunoocasali brunoocasali added the maintenance Anything related to maintenance (CI, tests, refactoring...) label Jun 10, 2025
Copy link
Contributor

meili-bors bot commented Jun 10, 2025

@Nymuxyzo Nymuxyzo closed this Jun 10, 2025
@meili-bors meili-bors bot merged commit 8568dbc into meilisearch:main Jun 10, 2025
9 checks passed
@meili-bors meili-bors bot dismissed brunoocasali’s stale review June 10, 2025 11:42

The merge-base changed after approval.

@Nymuxyzo Nymuxyzo deleted the feat/batches_stats branch June 10, 2025 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Anything related to maintenance (CI, tests, refactoring...)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[v1.14] Add progressTrace, writeChannelCongestion, and internalDatabaseSizes to batches stats

2 participants