Skip to content

Conversation

@ElyarSadig
Copy link
Collaborator

@ElyarSadig ElyarSadig commented Jan 2, 2026

Pull Request

Related issue

Fixes #737

What does this PR do?

  • Update code samples for network apis.

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!

Summary by CodeRabbit

  • Documentation
    • Updated network operation code samples with revised request structures and payloads
    • Refreshed example configurations and field values in documentation
    • Reorganized code sample identifiers for improved consistency

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 2, 2026

📝 Walkthrough

Walkthrough

This PR updates code samples in .code-samples.meilisearch.yaml to align with Meilisearch v1.30 Network API changes. It renames network sample keys, replaces patch samples with updated ones, and adjusts the request payload structure to use the new UpdateNetworkRequest type with updated fields and values.

Changes

Cohort / File(s) Summary
Network API Code Samples
.code-samples.meilisearch.yaml
Renames network_getget_network_1 and network_patch_1/network_patch_2update_network_1/update_network_2; updates request type from Network to UpdateNetworkRequest; introduces Leader and WriteAPIKey fields; updates Self field values ("TEST" → "ms-00"/"ms-01"); changes Remotes value type to UpdateRemote and updates remote URLs/keys to meilisearch.com endpoints.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • PR #695: Main PR that updates network code samples to use new UpdateNetworkRequest/UpdateRemote types with modified fields, directly related to original network API implementation.
  • PR #705: Touches the Network/Remote update API surface, specifically the UpdateNetwork request/response types and Remotes.WriteAPIKey field.

Suggested labels

enhancement

Suggested reviewers

  • ja7ad

Poem

🐰 Networks dance with API new,
Remotes sparkle, Leaders true,
Fields renamed, structures bright,
Meilisearch v1.30 in sight! ✨

Pre-merge checks

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: updating network code samples in the .code-samples.meilisearch.yaml file.
Linked Issues check ✅ Passed The PR completes the remaining task from issue #737 by updating examples in .code-samples.meilisearch.yaml under get_network_1 and update_network_1 keys for v1.30 API compatibility.
Out of Scope Changes check ✅ Passed All changes are focused on updating network-related code samples in .code-samples.meilisearch.yaml to match the v1.30 API changes, with no unrelated modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Jan 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.53%. Comparing base (d4c5cfd) to head (4db4150).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #740   +/-   ##
=======================================
  Coverage   88.53%   88.53%           
=======================================
  Files          22       22           
  Lines        3262     3262           
=======================================
  Hits         2888     2888           
  Misses        216      216           
  Partials      158      158           

☔ 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.

Copy link

@coderabbitai coderabbitai bot left a 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

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d4c5cfd and 4db4150.

📒 Files selected for processing (1)
  • .code-samples.meilisearch.yaml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: integration-tests (go latest version)
  • GitHub Check: integration-tests (go current version)
🔇 Additional comments (2)
.code-samples.meilisearch.yaml (2)

1054-1055: LGTM!

The get_network_1 code sample correctly demonstrates the GetNetwork API call.


1068-1073: LGTM!

The update_network_2 code sample correctly demonstrates how to update the network with null values using meilisearch.Null[](). The type usage of UpdateRemote is correct and consistent with the v1.30 API changes.

Comment on lines +1056 to 1067
update_network_1: |-
client.UpdateNetwork(&meilisearch.UpdateNetworkRequest{
Self: meilisearch.String("ms-00"),
Leader: meilisearch.String("ms-00"),
Remotes: meilisearch.NewOpt(map[string]meilisearch.Opt[meilisearch.Remote]{
"ms-00": meilisearch.NewOpt(meilisearch.Remote{
URL: meilisearch.String("https://example.com"),
SearchAPIKey: meilisearch.String("TEST"),
URL: meilisearch.String("https://meilisearch.com"),
SearchAPIKey: meilisearch.String("ReadKey"),
WriteAPIKey: meilisearch.String("WriteKey"),
},
},
});
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Fix type inconsistency and syntax errors.

This code sample has two critical issues:

  1. Type mismatch: Line 1060 uses meilisearch.Remote but should use meilisearch.UpdateRemote to match the API changes. The second example at line 1072 correctly uses UpdateRemote.

  2. Syntax errors: Lines 1065-1066 are missing closing parentheses for the NewOpt() calls, which will cause compilation failures.

🔎 Proposed fix
 update_network_1: |-
   client.UpdateNetwork(&meilisearch.UpdateNetworkRequest{
     Self: meilisearch.String("ms-00"),
     Leader: meilisearch.String("ms-00"),
-    Remotes: meilisearch.NewOpt(map[string]meilisearch.Opt[meilisearch.Remote]{
-      "ms-00": meilisearch.NewOpt(meilisearch.Remote{
+    Remotes: meilisearch.NewOpt(map[string]meilisearch.Opt[meilisearch.UpdateRemote]{
+      "ms-00": meilisearch.NewOpt(meilisearch.UpdateRemote{
         URL:          meilisearch.String("https://meilisearch.com"),
         SearchAPIKey: meilisearch.String("ReadKey"),
         WriteAPIKey: meilisearch.String("WriteKey"),
-      },
-    },
+      }),
+    }),
   });
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
update_network_1: |-
client.UpdateNetwork(&meilisearch.UpdateNetworkRequest{
Self: meilisearch.String("ms-00"),
Leader: meilisearch.String("ms-00"),
Remotes: meilisearch.NewOpt(map[string]meilisearch.Opt[meilisearch.Remote]{
"ms-00": meilisearch.NewOpt(meilisearch.Remote{
URL: meilisearch.String("https://example.com"),
SearchAPIKey: meilisearch.String("TEST"),
URL: meilisearch.String("https://meilisearch.com"),
SearchAPIKey: meilisearch.String("ReadKey"),
WriteAPIKey: meilisearch.String("WriteKey"),
},
},
});
update_network_1: |-
client.UpdateNetwork(&meilisearch.UpdateNetworkRequest{
Self: meilisearch.String("ms-00"),
Leader: meilisearch.String("ms-00"),
Remotes: meilisearch.NewOpt(map[string]meilisearch.Opt[meilisearch.UpdateRemote]{
"ms-00": meilisearch.NewOpt(meilisearch.UpdateRemote{
URL: meilisearch.String("https://meilisearch.com"),
SearchAPIKey: meilisearch.String("ReadKey"),
WriteAPIKey: meilisearch.String("WriteKey"),
}),
}),
});
🤖 Prompt for AI Agents
In .code-samples.meilisearch.yaml around lines 1056 to 1067, the sample has a
type and syntax error: replace meilisearch.Remote with meilisearch.UpdateRemote
to match the API, and fix the unbalanced parentheses/braces by adding the
missing closing parentheses for the meilisearch.NewOpt(...) calls (and ensure
the map and UpdateNetwork call are properly closed) so the statement compiles
and uses UpdateRemote entries for Remotes.

@ja7ad ja7ad added the enhancement New feature or request label Jan 2, 2026
@ja7ad ja7ad added this pull request to the merge queue Jan 2, 2026
Merged via the queue into meilisearch:main with commit 3ed3b43 Jan 2, 2026
6 checks passed
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

Development

Successfully merging this pull request may close these issues.

[v1.30] Update Network API compatibility

2 participants