Skip to content

CBG-4412: Add ability to pass custom import filter into diagnostic API#7935

Merged
bbrks merged 15 commits intomainfrom
CBG-4412
Jan 6, 2026
Merged

CBG-4412: Add ability to pass custom import filter into diagnostic API#7935
bbrks merged 15 commits intomainfrom
CBG-4412

Conversation

@RIT3shSapata
Copy link
Copy Markdown
Contributor

@RIT3shSapata RIT3shSapata commented Dec 19, 2025

CBG-4412

Describe your PR here...

  • Upstream PR for CBG-4411
  • Adds ability to pass custom import filter into diagnostic API
  • Refactor unit tests

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)

  • Link upstream PRs
  • Update Go module dependencies when merged

Integration Tests

@RIT3shSapata RIT3shSapata self-assigned this Dec 19, 2025
@RIT3shSapata RIT3shSapata marked this pull request as ready for review December 23, 2025 12:15
@RIT3shSapata RIT3shSapata requested a review from bbrks December 23, 2025 12:15
@RIT3shSapata RIT3shSapata assigned bbrks and unassigned RIT3shSapata Dec 23, 2025
Copy link
Copy Markdown
Member

@bbrks bbrks left a comment

Choose a reason for hiding this comment

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

Mostly looks good 👍

Comment thread rest/diagnostic_doc_api.go Outdated
Comment thread rest/diagnostic_doc_api.go Outdated
Comment thread rest/diagnostic_doc_api.go Outdated
Comment thread base/error.go Outdated
@RIT3shSapata RIT3shSapata requested a review from bbrks December 24, 2025 07:46
Base automatically changed from CBG-4411 to main December 24, 2025 10:38
Copilot AI review requested due to automatic review settings December 24, 2025 11:27
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Dec 24, 2025

Redocly previews

Copy link
Copy Markdown
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 adds the ability to pass a custom import filter function to the diagnostic API's /_import_filter endpoint, allowing users to test import filter behavior with different filter implementations without modifying the database configuration.

Key changes:

  • Changed the HTTP method from GET to POST for the /_import_filter endpoint to support request body
  • Added support for custom import filter functions via the request body
  • Refactored and expanded unit tests to cover various scenarios with and without custom import filters

Reviewed changes

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

Show a summary per file
File Description
rest/routing.go Changed HTTP method from GET to POST for the /_import_filter endpoint
rest/diagnostic_doc_api_test.go Removed old test function and added comprehensive table-driven tests for import filter dry run
rest/diagnostic_doc_api.go Refactored handler to accept custom import filter in request body and improved error handling
docs/api/paths/diagnostic/keyspace-import_filter.yaml Updated API specification to reflect POST method and document new request body parameters
db/import.go Modified ImportFilterDryRun to accept custom import filter function and handle both default and custom filters
base/error.go Added new error type ImportFilterDryRunError for import filter dry run errors

Comment thread base/error.go Outdated
Comment thread db/import.go Outdated
Comment thread db/import.go Outdated
Comment thread db/import.go Outdated
Comment thread db/import.go Outdated
Comment thread db/import.go Outdated
Comment thread db/import.go Outdated
Comment thread db/import.go Outdated
Comment thread db/import.go Outdated
Comment thread db/import.go Outdated
Comment thread db/import.go Outdated
@RIT3shSapata RIT3shSapata requested a review from bbrks December 29, 2025 10:04
Copy link
Copy Markdown
Member

@bbrks bbrks left a comment

Choose a reason for hiding this comment

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

Mostly looks good. See inline comments for specific changes/comments.

Comment thread rest/diagnostic_doc_api.go
Comment thread rest/diagnostic_doc_api.go Outdated
Comment thread rest/diagnostic_doc_api_test.go Outdated
Comment thread rest/diagnostic_doc_api_test.go
Comment thread db/import.go Outdated
Comment thread db/import.go Outdated
@bbrks bbrks assigned RIT3shSapata and unassigned bbrks Jan 5, 2026
@RIT3shSapata RIT3shSapata requested a review from bbrks January 6, 2026 12:43
@RIT3shSapata RIT3shSapata assigned bbrks and unassigned RIT3shSapata Jan 6, 2026
Copy link
Copy Markdown
Member

@bbrks bbrks left a comment

Choose a reason for hiding this comment

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

LGTM 👍 thanks!

@bbrks bbrks enabled auto-merge (squash) January 6, 2026 12:46
@bbrks bbrks merged commit 982f271 into main Jan 6, 2026
45 of 46 checks passed
@bbrks bbrks deleted the CBG-4412 branch January 6, 2026 12:52
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