-
Notifications
You must be signed in to change notification settings - Fork 106
chore: update networks in code-samples.meilisearch.yaml #740
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
Conversation
📝 WalkthroughWalkthroughThis PR updates code samples in Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks✅ Passed checks (5 passed)
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 #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. 🚀 New features to boost your workflow:
|
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
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 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_1code sample correctly demonstrates the GetNetwork API call.
1068-1073: LGTM!The
update_network_2code sample correctly demonstrates how to update the network with null values usingmeilisearch.Null[](). The type usage ofUpdateRemoteis correct and consistent with the v1.30 API changes.
| 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"), | ||
| }, | ||
| }, | ||
| }); |
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.
Fix type inconsistency and syntax errors.
This code sample has two critical issues:
-
Type mismatch: Line 1060 uses
meilisearch.Remotebut should usemeilisearch.UpdateRemoteto match the API changes. The second example at line 1072 correctly usesUpdateRemote. -
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.
| 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.
Pull Request
Related issue
Fixes #737
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
✏️ Tip: You can customize this high-level summary in your review settings.