[PR #137] [MERGED] feat(sharepoint): add path option to sync a single library folder #127

Closed
opened 2026-10-18 21:14:35 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/oikb/pull/137
Author: @pakalov
Created: 10/2/2026
Status: ✅ Merged
Merged: 10/10/2026
Merged by: @tjbck

Base: main ← Head: feature/sharepoint-root-path


📝 Commits (1)

  • 419a66d feat(sharepoint): add path option to sync a single library folder

📊 Changes

4 files changed (+124 additions, -3 deletions)

View changed files

📝 docs/guide.md (+13 -0)
📝 src/oikb/cli.py (+1 -1)
📝 src/oikb/connectors/sharepoint.py (+4 -2)
➕ tests/test_sharepoint.py (+106 -0)

📄 Description

Summary

The SharePoint connector always scans from the library root. The path option that the GitHub, GitLab, S3 and similar connectors support for choosing a subfolder is ignored for sharepoint: sources.

This adds an optional root_path to SharePointConnector, wired to the existing path: key in .oikb.yaml and to --source-path. When set:

  • The scan starts in that folder, so uploaded paths are relative to it and the folder name is not included.
  • read_file prefixes the root again, so downloads still resolve correctly.
  • Filters match paths relative to path.

Behaviour is unchanged when path is not set.

sources:
  - name: exceptions
    source: sharepoint:contoso.sharepoint.com/sites/Team/Docs
    path: Exceptions        # Exceptions/report.xlsx -> report.xlsx
    kb-id: abc123
    filter:
      include: ["*.xlsx"]

Without this, a library folder can only be synced as Exceptions/... inside the KB. A source URL such as .../Docs/Exceptions does not work either, because the parser treats the third segment as the library name.

Notes

  • Existing KBs that were synced with the folder prefix will see a delete and re-add of those files when switching to path:.
  • Docs are updated in docs/guide.md.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/oikb/pull/137 **Author:** [@pakalov](https://github.com/pakalov) **Created:** 10/2/2026 **Status:** ✅ Merged **Merged:** 10/10/2026 **Merged by:** [@tjbck](https://github.com/tjbck) **Base:** `main` ← **Head:** `feature/sharepoint-root-path` --- ### 📝 Commits (1) - [`419a66d`](https://github.com/open-webui/oikb/commit/419a66de79c6cc8bb465e8988e29645e72c5f4d7) feat(sharepoint): add path option to sync a single library folder ### 📊 Changes **4 files changed** (+124 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `docs/guide.md` (+13 -0) 📝 `src/oikb/cli.py` (+1 -1) 📝 `src/oikb/connectors/sharepoint.py` (+4 -2) ➕ `tests/test_sharepoint.py` (+106 -0) </details> ### 📄 Description ## Summary The SharePoint connector always scans from the library root. The `path` option that the GitHub, GitLab, S3 and similar connectors support for choosing a subfolder is ignored for `sharepoint:` sources. This adds an optional `root_path` to `SharePointConnector`, wired to the existing `path:` key in `.oikb.yaml` and to `--source-path`. When set: - The scan starts in that folder, so uploaded paths are relative to it and the folder name is not included. - `read_file` prefixes the root again, so downloads still resolve correctly. - Filters match paths relative to `path`. Behaviour is unchanged when `path` is not set. ```yaml sources: - name: exceptions source: sharepoint:contoso.sharepoint.com/sites/Team/Docs path: Exceptions # Exceptions/report.xlsx -> report.xlsx kb-id: abc123 filter: include: ["*.xlsx"] ``` Without this, a library folder can only be synced as `Exceptions/...` inside the KB. A source URL such as `.../Docs/Exceptions` does not work either, because the parser treats the third segment as the library name. ## Notes - Existing KBs that were synced with the folder prefix will see a delete and re-add of those files when switching to `path:`. - Docs are updated in `docs/guide.md`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-18 21:14:35 +00:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
open-webui/oikb#127
No description provided.