Skip to content

feat(server): add resources-only WebDAV adapter#1435

Open
yeyitech wants to merge 2 commits intovolcengine:mainfrom
yeyitech:feat/webdav-resources-phase1
Open

feat(server): add resources-only WebDAV adapter#1435
yeyitech wants to merge 2 commits intovolcengine:mainfrom
yeyitech:feat/webdav-resources-phase1

Conversation

@yeyitech
Copy link
Copy Markdown
Contributor

Summary

Supported Methods

  • OPTIONS
  • PROPFIND
  • GET
  • HEAD
  • PUT
  • DELETE
  • MKCOL
  • MOVE

Phase 1 Limits

  • only resources is exposed
  • PUT accepts UTF-8 text content only
  • .abstract.md, .overview.md, .relations.json, and .path.ovlock stay hidden

Validation

  • ruff check openviking/server/routers/webdav.py openviking/server/app.py openviking/server/routers/__init__.py tests/server/test_api_webdav.py docs/en/api/03-filesystem.md docs/zh/api/03-filesystem.md
  • python -m compileall openviking/server/routers/webdav.py openviking/server/app.py openviking/server/routers/__init__.py tests/server/test_api_webdav.py
  • manual ASGI smoke test covering WebDAV CRUD, MOVE, and hidden internal files
  • pytest is still blocked in this repo by the existing pytest-asyncio collection error: AttributeError: 'Package' object has no attribute 'obj'

Refs #1101

@github-actions
Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

1101 - Partially compliant

Compliant requirements:

  • 添加了WebDAV适配器在/webdav/resources
  • 隐藏了内部语义侧边文件
  • 支持基本的WebDAV方法(OPTIONS, PROPFIND, GET, HEAD, PUT, DELETE, MKCOL, MOVE)
  • 支持UTF-8文本写入

Non-compliant requirements:

  • 未实现其他远程文件协议(如ftp)
  • 未实现完全的WebDAV方法

Requires further human verification:

  • 验证与其他软件的文件级交互(如vscode、obsidian等)
⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🏅 Score: 85
🧪 PR contains tests
🔒 No security concerns identified
✅ No TODO sections
🔀 No multiple PR themes
⚡ Recommended focus areas for review

Inconsistent Write API Usage

The put handler uses different write APIs for create vs replace:

  • Replace uses service.fs.write with wait=False
  • Create uses service.viking_fs.write_file plus explicit service.resources.summarize
    This inconsistency may lead to unexpected behavior differences between create and replace paths.
    await service.fs.write(uri=uri, content=content, ctx=_ctx, mode="replace", wait=False)
    return FastAPIResponse(status_code=204, headers=_webdav_headers())

await service.viking_fs.write_file(uri, content, ctx=_ctx)
await service.resources.summarize([uri], ctx=_ctx)
Async Write Without Waiting

When replacing an existing file, the handler uses wait=False on service.fs.write and returns immediately. This means semantic refresh happens in the background, which may surprise users expecting the operation to complete before the response is returned.

await service.fs.write(uri=uri, content=content, ctx=_ctx, mode="replace", wait=False)
return FastAPIResponse(status_code=204, headers=_webdav_headers())

@github-actions
Copy link
Copy Markdown

PR Code Suggestions ✨

No code suggestions found for the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant