Skip to content

Conversation

@RIT3shSapata
Copy link
Contributor

CBG-5103

Describe your PR here...

  • The docID is read from the request body instead of query parameter
  • renamed the errors field of Import Filter response to exception
  • The OpenAPI specs have been updated in Diagnostic API: Update OpenAPI Specs #7955

Pre-review checklist

  • Removed debug logging (fmt.Print, log.Print, ...)
  • Logging sensitive data? Make sure it's tagged (e.g. base.UD(docID), base.MD(dbName))
  • Updated relevant information in the API specifications (such as endpoint descriptions, schemas, ...) in docs/api

Dependencies (if applicable)

Integration Tests

bbrks
bbrks previously approved these changes Jan 14, 2026
Base automatically changed from CBG-5089 to main January 16, 2026 14:17
@RIT3shSapata RIT3shSapata dismissed bbrks’s stale review January 16, 2026 14:17

The base branch was changed.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR modifies the Diagnostic API endpoints /_sync and /_import_filter to accept the document ID in the request body instead of as a query parameter, improving consistency with REST API best practices.

Changes:

  • Document ID (doc_id) is now read from the request body instead of query parameters for both sync function and import filter dry run endpoints
  • The Error field in ImportFilterDryRun response has been renamed to Exception for consistency
  • All test cases have been updated to reflect the new request body format

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
rest/diagnostic_doc_api.go Modified handlers to read doc_id from request body; added DocID field to payload structs; renamed Error to Exception in response struct
rest/diagnostic_doc_api_test.go Updated all test cases to pass doc_id in request body instead of query parameter; updated expected response field from Error to Exception

Comment on lines +101 to 102
docid := syncDryRunPayload.DocID
if syncDryRunPayload.Doc == nil && docid == "" {
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

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

The variable docid uses inconsistent naming. The payload field is DocID (camelCase with capitalized ID), but the variable is docid (lowercase). Consider renaming to docID for consistency with Go naming conventions where acronyms should be consistently capitalized.

Copilot uses AI. Check for mistakes.
Comment on lines +233 to 234
docid := importFilterPayload.DocID
// Cannot pass both doc_id and body in the request body
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

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

The variable docid uses inconsistent naming. The payload field is DocID (camelCase with capitalized ID), but the variable is docid (lowercase). Consider renaming to docID for consistency with Go naming conventions where acronyms should be consistently capitalized.

Copilot uses AI. Check for mistakes.
@bbrks bbrks merged commit 38880ea into main Jan 16, 2026
44 checks passed
@bbrks bbrks deleted the CBG-5103 branch January 16, 2026 14:36
RIT3shSapata added a commit that referenced this pull request Jan 21, 2026
RIT3shSapata added a commit that referenced this pull request Jan 21, 2026
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.

3 participants