-
Notifications
You must be signed in to change notification settings - Fork 2.1k
fix: validate sharepoint connector with validate_connector_settings #5199
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
fix: validate sharepoint connector with validate_connector_settings #5199
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Greptile Summary
This PR implements the validate_connector_settings
method for the SharePoint connector to prevent a configuration issue where users could create a connector that doesn't index any content. The SharePoint connector has two main content types it can process: site documents and site pages, controlled by include_site_documents
and include_site_pages
flags respectively.
The validation ensures that at least one of these content types is enabled by checking if both flags are false and raising a ConnectorValidationError
with a descriptive message if so. This follows the established validation pattern seen in other connectors like the GitHub connector, which also uses validate_connector_settings
to verify configuration validity before operations begin.
The method is properly integrated into the connector's initialization flow and uses the standard exception types from the connector framework. This prevents a silent failure scenario where the connector would appear to run successfully but wouldn't actually retrieve any content, which would waste resources and confuse users.
Confidence score: 5/5
- This PR is safe to merge with minimal risk as it only adds validation logic without changing existing functionality
- Score reflects the simple, well-tested validation pattern and clear business logic that prevents configuration errors
- No files require special attention as the change is isolated and follows established patterns
1 file reviewed, no comments
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.
cubic analysis
No issues found across 1 file. Review in cubic
…nyx-dot-app#5199) * validate sharepoint connector with validate_connector_settings * fix test * fix tests
Description
title + running tests for comm. prs
How Has This Been Tested?
[Describe the tests you ran to verify your changes]
Backporting (check the box to trigger backport action)
Note: You have to check that the action passes, otherwise resolve the conflicts manually and tag the patches.
Summary by cubic
Added a validate_connector_settings() method to the SharePoint connector to check that at least one content type is enabled and raise an error if not.