Skip to content

Add new documentation links and update broken documentation links to interface methods#763

Open
equalsgibson wants to merge 4 commits intomeilisearch:mainfrom
equalsgibson:add-documentation-urls-to-methods
Open

Add new documentation links and update broken documentation links to interface methods#763
equalsgibson wants to merge 4 commits intomeilisearch:mainfrom
equalsgibson:add-documentation-urls-to-methods

Conversation

@equalsgibson
Copy link

@equalsgibson equalsgibson commented Mar 3, 2026

Pull Request

Related issue

Fixes #694

What does this PR do?

  • Extend existing comments above interface methods to include a link to the official API documentation for the respective method
  • Update broken or outdated links that are currently in the method comments (where applicable)
  • Use standard Go comment standards to provide in-repository links to types that the methods return for ease of use.
  • Add prefixes for methods that are considered experimental, to clearly show intention that these API methods may change before a stable release.

Example of a method comment;

// Experimental: UpdateNetworkWithContext updates the network object with a context.
// 	- If leader is set to a value then UpdateNetwork will return a *[Task] object.
// 	- If leader is not set or explicitly set to null it will return a *[Network] object.
// 	- Updates are partial; only the provided fields are updated.
//
// docs: https://www.meilisearch.com/docs/reference/api/experimental-features/configure-network-topology
UpdateNetworkWithContext(ctx context.Context, params *UpdateNetworkRequest) (any, error)
image

PR checklist

Please check if your PR fulfills the following requirements:

  • Did you use any AI tool while implementing this PR (code, tests, docs, etc.)? If yes, disclose it in the PR description and describe what it was used for. AI usage is allowed when it is disclosed.
  • 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

    • Expanded and clarified API reference comments across index, service, webhook, task, key, settings, and search interfaces; added endpoint links, usage notes, and an "Experimental" note for network-related methods.
  • Documentation-only

    • No changes to public method signatures or runtime behavior.

@coderabbitai
Copy link

coderabbitai bot commented Mar 3, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 80c9a4aa-8832-41ad-8685-ed8baccbc624

📥 Commits

Reviewing files that changed from the base of the PR and between 2f5be14 and 3292a99.

📒 Files selected for processing (1)
  • index_interface.go
✅ Files skipped from review due to trivial changes (1)
  • index_interface.go

📝 Walkthrough

Walkthrough

Added documentation comment blocks (including docs: URLs and clarifications) across three Go interface files: index_interface.go, meilisearch_interface.go, and webhooks_interface.go. No public signatures or behaviors were changed; edits are comment-only.

Changes

Cohort / File(s) Summary
Index Interface Documentation
index_interface.go
Added and expanded documentation comments and docs: URLs for public interface methods related to index operations (create/update/delete/compact/get, stats, documents, search, facets, similar-documents, settings). No signature or behavior changes.
Meilisearch Service Interface Documentation
meilisearch_interface.go
Inserted and clarified documentation comments and docs: URLs across ServiceManager, ServiceReader, KeyManager, KeyReader, TaskManager, and TaskReader interfaces. Marked network update methods as "Experimental" and documented their return behavior. Only comment edits.
Webhooks Interface Documentation
webhooks_interface.go
Added docs: URLs and explanatory doc comments for WebhookManager and WebhookReader interface methods. No code or signature modifications.
Module File
go.mod
Minor module file adjustments recorded (small line changes).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 I nibbled at comments, tidy and spry,
Planted links where the method signs lie,
No code did I chew, no logic did hop,
Just breadcrumbs of docs for each API stop,
Little rabbit hops—now devs can fly ✨

🚥 Pre-merge checks | ✅ 5
✅ 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: adding new documentation links and updating broken links to interface methods.
Linked Issues check ✅ Passed All code changes align with issue #694 objectives: documentation URLs added to interface method comments across three files without modifying public signatures.
Out of Scope Changes check ✅ Passed All changes are in-scope documentation additions to interface methods; no unrelated modifications to implementation code or public signatures detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

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: 2

🧹 Nitpick comments (1)
index_interface.go (1)

456-522: Inconsistent documentation URL format.

The newly added documentation comments use the docs: prefix (e.g., lines 457-458, 462-463), but existing comments in the same interface don't use this prefix (e.g., lines 477, 481, 485, etc.). Consider aligning the format for consistency throughout the file.

Example of inconsistency:

  • Line 458: // https://www.meilisearch.com/docs/reference/api/settings/update-separatortokens (no prefix)
  • Line 477: // https://www.meilisearch.com/docs/reference/api/settings#update-non-separator-tokens (no prefix, different path style)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@index_interface.go` around lines 456 - 522, The doc comment URLs are
inconsistent; update the new method comments (e.g., UpdateSeparatorTokens,
UpdateSeparatorTokensWithContext, ResetSeparatorTokens,
UpdateNonSeparatorTokens, UpdateNonSeparatorTokensWithContext,
ResetNonSeparatorTokens, UpdateDictionary, UpdateDictionaryWithContext,
ResetDictionary, UpdateProximityPrecision, UpdateProximityPrecisionWithContext,
ResetProximityPrecision, ResetProximityPrecisionWithContext) to match the
existing URL format used elsewhere in this file (remove or add the same "docs:"
prefix consistently and use the same path/anchor style as other settings
methods), so all settings method comments use the identical documentation URL
format.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@index_interface.go`:
- Around line 227-230: Typo: remove the duplicated "docs:" prefix in the comment
for GetDocumentWithContext; edit the doc comment above the
GetDocumentWithContext method to change "docs: docs: https://..." to a single
"docs: https://..." so the comment reads correctly while preserving the
reference to the Meilisearch docs and the method signature
GetDocumentWithContext(ctx context.Context, identifier string, request
*DocumentQuery, documentPtr interface{}) error.
- Around line 96-104: Update the doc comment URLs for the AddDocuments family to
point to the "add-or-replace-documents" endpoint: change the documentation link
for AddDocuments (and AddDocumentsWithContext) and for AddDocumentsInBatches
(and AddDocumentsInBatchesWithContext) so they reference
add-or-replace-documents instead of add-or-update-documents; this aligns the
comments with the actual HTTP method used by the addDocuments implementation
called by these functions.

---

Nitpick comments:
In `@index_interface.go`:
- Around line 456-522: The doc comment URLs are inconsistent; update the new
method comments (e.g., UpdateSeparatorTokens, UpdateSeparatorTokensWithContext,
ResetSeparatorTokens, UpdateNonSeparatorTokens,
UpdateNonSeparatorTokensWithContext, ResetNonSeparatorTokens, UpdateDictionary,
UpdateDictionaryWithContext, ResetDictionary, UpdateProximityPrecision,
UpdateProximityPrecisionWithContext, ResetProximityPrecision,
ResetProximityPrecisionWithContext) to match the existing URL format used
elsewhere in this file (remove or add the same "docs:" prefix consistently and
use the same path/anchor style as other settings methods), so all settings
method comments use the identical documentation URL format.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8b6433f and 870d2f8.

📒 Files selected for processing (3)
  • index_interface.go
  • meilisearch_interface.go
  • webhooks_interface.go

@equalsgibson equalsgibson marked this pull request as draft March 3, 2026 14:56
@equalsgibson equalsgibson marked this pull request as ready for review March 4, 2026 23:20
@equalsgibson
Copy link
Author

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Mar 4, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@equalsgibson equalsgibson changed the title DRAFT: Add new documentation links and update broken documentation links to interface methods Add new documentation links and update broken documentation links to interface methods Mar 4, 2026
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: 2

♻️ Duplicate comments (1)
index_interface.go (1)

86-104: ⚠️ Potential issue | 🟠 Major

Fix AddDocuments* docs URLs to the POST endpoint page (add-or-replace-documents).

The links for AddDocuments, AddDocumentsWithContext, AddDocumentsInBatches, and AddDocumentsInBatchesWithContext still point to add-or-update-documents. This was previously flagged and appears unresolved in this revision.

✏️ Proposed fix
-	// docs: https://www.meilisearch.com/docs/reference/api/documents/add-or-update-documents
+	// docs: https://www.meilisearch.com/docs/reference/api/documents/add-or-replace-documents
 	AddDocuments(documentsPtr interface{}, opts *DocumentOptions) (*TaskInfo, error)

-	// docs: https://www.meilisearch.com/docs/reference/api/documents/add-or-update-documents
+	// docs: https://www.meilisearch.com/docs/reference/api/documents/add-or-replace-documents
 	AddDocumentsWithContext(ctx context.Context, documentsPtr interface{}, opts *DocumentOptions) (*TaskInfo, error)

-	// docs: https://www.meilisearch.com/docs/reference/api/documents/add-or-update-documents
+	// docs: https://www.meilisearch.com/docs/reference/api/documents/add-or-replace-documents
 	AddDocumentsInBatches(documentsPtr interface{}, batchSize int, opts *DocumentOptions) ([]TaskInfo, error)

-	// docs: https://www.meilisearch.com/docs/reference/api/documents/add-or-update-documents
+	// docs: https://www.meilisearch.com/docs/reference/api/documents/add-or-replace-documents
 	AddDocumentsInBatchesWithContext(ctx context.Context, documentsPtr interface{}, batchSize int, opts *DocumentOptions) ([]TaskInfo, error)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@index_interface.go` around lines 86 - 104, Update the doc comment URLs for
AddDocuments, AddDocumentsWithContext, AddDocumentsInBatches, and
AddDocumentsInBatchesWithContext to point to the POST "add-or-replace-documents"
endpoint instead of "add-or-update-documents": locate the comments above the
methods AddDocuments, AddDocumentsWithContext, AddDocumentsInBatches, and
AddDocumentsInBatchesWithContext and replace the docs link host/path segment
referencing "add-or-update-documents" with "add-or-replace-documents" so the
comments reference the correct POST endpoint page.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@index_interface.go`:
- Around line 990-993: Update the comment for GetPrefixSearch to match the
project's comment style by adding the "docs:" prefix before the URL (i.e.,
change the standalone URL comment to start with "// docs: https://..."). Locate
the GetPrefixSearch declaration and replace the existing URL comment so it is
consistent with other methods' documentation links.
- Around line 116-184: The batch "Add" method doc comments mistakenly reference
the add-or-update-documents endpoint; update the endpoint links in the doc
comments for AddDocumentsCsvInBatches, AddDocumentsCsvInBatchesWithContext,
AddDocumentsCsvFromReaderInBatches,
AddDocumentsCsvFromReaderInBatchesWithContext, AddDocumentsNdjsonInBatches,
AddDocumentsNdjsonInBatchesWithContext, AddDocumentsNdjsonFromReaderInBatches,
and AddDocumentsNdjsonFromReaderInBatchesWithContext to point to
add-or-replace-documents (the same endpoint used by the non-batch
AddDocumentsCsvFromReader* and AddDocumentsNdjson* methods), since the
implementation delegates to AddDocuments*WithContext which performs an HTTP
POST.

---

Duplicate comments:
In `@index_interface.go`:
- Around line 86-104: Update the doc comment URLs for AddDocuments,
AddDocumentsWithContext, AddDocumentsInBatches, and
AddDocumentsInBatchesWithContext to point to the POST "add-or-replace-documents"
endpoint instead of "add-or-update-documents": locate the comments above the
methods AddDocuments, AddDocumentsWithContext, AddDocumentsInBatches, and
AddDocumentsInBatchesWithContext and replace the docs link host/path segment
referencing "add-or-update-documents" with "add-or-replace-documents" so the
comments reference the correct POST endpoint page.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bbf06695-7dff-41b2-a95d-19c980f50e77

📥 Commits

Reviewing files that changed from the base of the PR and between 870d2f8 and 2f5be14.

📒 Files selected for processing (1)
  • index_interface.go

Copy link
Collaborator

@ElyarSadig ElyarSadig left a comment

Choose a reason for hiding this comment

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

@equalsgibson
Thanks.

@ElyarSadig ElyarSadig enabled auto-merge March 7, 2026 07:18
@ElyarSadig
Copy link
Collaborator

@ja7ad
Network integration tests are failing due to recent breaking change! After resolving the issue this will be merged!

@ja7ad
Copy link
Collaborator

ja7ad commented Mar 7, 2026

@ja7ad Network integration tests are failing due to recent breaking change! After resolving the issue this will be merged!

Please fix issue #762

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve API references by adding documentation URLs for each method

3 participants