Skip to content

feat: new tos connector args - #4129

Merged
myysy merged 7 commits into
mainfrom
feat/tos_resource_api
Aug 21, 2026
Merged

feat: new tos connector args#4129
myysy merged 7 commits into
mainfrom
feat/tos_resource_api

Conversation

@zihengli-bytedance

@zihengli-bytedance zihengli-bytedance commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

Description

完善 Connector 模式下的 TOS 资源导入与 Watch 周期同步能力:

  • 支持通过 args.tos_prefix 导入多个 TOS 路径,并通过 args.exclude 排除指定路径,同时兼容原有单路径和 bucket 根路径导入。
  • 支持 TOS、Git Connector 配置 watch_interval > 0,加密持久化周期同步所需的鉴权和请求参数。
  • 首次远端导入成功后创建或更新 Watch,周期刷新时等待 Connector 任务完成。
  • 收敛 Connector 日志和异常信息,并调整 CLI skills 集成测试。

Related Issue

N/A

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Refactoring
  • Performance improvement
  • Test update

Changes Made

TOS 资源导入

  • 新增 args.tos_prefixargs.exclude
  • path 必须等于 tos_prefix 第一项;exclude 只能与 tos_prefix 配合使用。
  • 顶层 excludeargs.exclude 不能同时使用。
  • 多路径参数通过 Connector param_config 传递。
  • 未指定 tos_prefix 时继续使用原有 tos_path
  • TOS 参数识别、校验和转换收敛到 Connector 层。

Connector Watch

  • TOS、Git Connector 支持 watch_interval > 0
  • API Key、Account ID、add_type、来源路径和 Connector 参数通过 VikingFS Encryptor 加密持久化。
  • 私有 auth_state 不通过 Watch API 返回,并绑定 Account ID 和来源路径。
  • WatchScheduler 恢复鉴权和参数后调用 refresh_resource,并等待远端任务进入终态。
  • 目标 Viking URI 删除后自动停用 Watch。
  • 首次导入成功后创建或更新 Watch,失败时不留下无效 Watch。
  • 提交前检查已有 active Watch,最终创建或更新时再次校验冲突。
  • 同一来源、同一目标可更新已有 Watch;已停用 Watch 可重新启用。

安全与测试

  • Connector 日志不再输出完整来源路径或原始网络异常。
  • 未预期的轮询错误返回统一信息。
  • Connector Watch 参数仅保存在加密私有状态中。
  • CLI skills 测试改用 ov skills list/show,不再操作 viking://user/skills
  • 补充 TOS 参数校验、单路径兼容、Watch 加密恢复、任务生命周期和日志脱敏测试。

Testing

  • I have added tests that prove my changes are effective
  • New and existing targeted tests pass locally
  • Tested on Linux and macOS

Test results:

  • tests/service/test_resource_service_connector.py: 112 passed
  • Ruff check: passed
  • Python syntax compilation: passed
  • git diff --check: passed
  • 完整 API & CLI Integration Tests 由 CI 执行

Checklist

  • My code follows the project's coding style
  • I have performed a self-review
  • I have added or updated tests
  • I have updated the documentation
  • My changes generate no new warnings

Screenshots

N/A

Additional Notes

  • Connector Watch 需要启用 VikingFS 文件加密。
  • 首次 Connector 导入沿用现有后台任务生命周期,本 PR 不新增远端任务的跨重启恢复能力。
  • 本提交未包含对应的用户文档更新。

Comment thread openviking/service/resource_service.py
@myysy
myysy merged commit 00bc962 into main Aug 21, 2026
6 checks passed
@myysy
myysy deleted the feat/tos_resource_api branch August 21, 2026 03:00
@github-project-automation github-project-automation Bot moved this from Backlog to Done in OpenViking project Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants