Skip to content

Conversation

wenxi-onyx
Copy link
Member

@wenxi-onyx wenxi-onyx commented Aug 14, 2025

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.

  • This PR should be backported (make sure to check that the backport attempt succeeds)
  • [Optional] Override Linear Check

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.

@wenxi-onyx wenxi-onyx requested a review from a team as a code owner August 14, 2025 22:26
Copy link

vercel bot commented Aug 14, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
internal-search Ready Preview Comment Aug 14, 2025 11:31pm

Copy link
Contributor

@greptile-apps greptile-apps bot left a 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

Edit Code Review Bot Settings | Greptile

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a 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

@wenxi-onyx wenxi-onyx enabled auto-merge August 14, 2025 22:35
@wenxi-onyx wenxi-onyx added this pull request to the merge queue Aug 15, 2025
Merged via the queue into main with commit 6863fbe Aug 15, 2025
15 checks passed
@wenxi-onyx wenxi-onyx deleted the bugfix/sharepoint_implement_validate_settings branch August 15, 2025 01:52
AnkitTukatek pushed a commit to TukaTek/onyx that referenced this pull request Sep 23, 2025
…nyx-dot-app#5199)

* validate sharepoint connector with validate_connector_settings

* fix test

* fix tests
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.

2 participants