Skip to content

feat/microsoft-sharepoint: add region parameter to MSSharePointRetriever - #3722

Merged
bogdankostic merged 7 commits into
deepset-ai:mainfrom
SyedShahmeerAli12:feat/sharepoint-region-param
Aug 4, 2026
Merged

feat/microsoft-sharepoint: add region parameter to MSSharePointRetriever#3722
bogdankostic merged 7 commits into
deepset-ai:mainfrom
SyedShahmeerAli12:feat/sharepoint-region-param

Conversation

@SyedShahmeerAli12

@SyedShahmeerAli12 SyedShahmeerAli12 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #3673

  • Added region: str | None = None init parameter to MSSharePointRetriever
  • When set, the region field is included in the Microsoft Search API request body
  • Required when using app-only (client credentials) authentication without it the API returns 400: Region is required when request with application permission
  • Omitted from the request body when None (default), preserving existing delegated-auth behavior
  • Serialized correctly via to_dict / from_dict

Test plan

  • test_defaults asserts region is None by default
  • test_to_dict asserts region: None in serialized output
  • test_to_dict_with_region asserts region: "US" serializes correctly
  • test_region_included_in_request_body_when_set verifies region appears in the HTTP POST body
  • test_region_omitted_from_request_body_when_none —verifies region key is absent when not set
  • TestLiveAppOnly integration test class for real app-only auth (skipped unless MS_SHAREPOINT_TENANT_ID, MS_SHAREPOINT_CLIENT_ID, MS_SHAREPOINT_CLIENT_SECRET env vars are set)
  • All 81 unit tests pass
  • Lint clean (ruff check + ruff format)

@SyedShahmeerAli12
SyedShahmeerAli12 requested a review from a team as a code owner August 3, 2026 13:26
@SyedShahmeerAli12
SyedShahmeerAli12 requested review from julian-risch and removed request for a team August 3, 2026 13:26
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Hi @SyedShahmeerAli12, thanks for your interest in contributing to Haystack! 🙏

⚠️ You currently have 4 open pull requests in this repository (#3565, #3483, #3254 and this one). Our review capacity is limited, so please hold off opening more PRs until we've had a chance to review your first 2 open PRs. This helps us give each contribution the attention it deserves. Thank you!

This is an automated message to help us keep the review queue healthy.

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Heads-up for maintainers

This PR is from a fork and touches integrations whose integration tests require API keys.
Those tests are skipped in CI because fork PRs don't have access to repo secrets for security reasons.

Affected integrations:

  • microsoft_sharepoint

Please run the integration tests locally (hatch run test:integration inside each folder) before approving.

@github-actions github-actions Bot added the type:documentation Improvements or additions to documentation label Aug 3, 2026
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Coverage report (microsoft_sharepoint)

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  integrations/microsoft_sharepoint/src/haystack_integrations/components/retrievers/microsoft_sharepoint
  retriever.py
Project Total  

This report was generated by python-coverage-comment-action

@julian-risch
julian-risch requested review from bogdankostic and removed request for julian-risch August 4, 2026 07:12

@bogdankostic bogdankostic left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @SyedShahmeerAli12! Looks good in general, just a few minor comments.

Comment thread integrations/microsoft_sharepoint/tests/test_retriever.py
Comment thread integrations/microsoft_sharepoint/tests/test_retriever.py Outdated

@bogdankostic bogdankostic left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good, thanks for addressing the feedback so quickly @SyedShahmeerAli12!

@bogdankostic
bogdankostic merged commit 76ed288 into deepset-ai:main Aug 4, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration:microsoft-sharepoint type:documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MSSharePointFetcher - Allow specifying region as request parameter (needed when using application permissions).

2 participants