Skip to content

ops: split source and release deployment entrypoints#190

Merged
liujuanjuan1984 merged 4 commits intomainfrom
ops/issues-178-188-release-followup
Mar 17, 2026
Merged

ops: split source and release deployment entrypoints#190
liujuanjuan1984 merged 4 commits intomainfrom
ops/issues-178-188-release-followup

Conversation

@liujuanjuan1984
Copy link
Collaborator

@liujuanjuan1984 liujuanjuan1984 commented Mar 17, 2026

变更概览

本 PR 完成 #178 / #188 的收尾实现,核心目标是把“用户安装入口”和“正式部署入口”都收口到 release/tag 语义,同时保留 source-based 路径用于开发与调试。

在此前已完成 tag 派生版本、PyPI 发布链路和 v0.1.0 首发的基础上,这个 PR 进一步把脚本与文档拆分为 source/release 两条明确路径,避免正式部署继续默认依赖源码 checkout,并补齐 release-based 真机 smoke test 方案文档。

按模块说明

1. source / release 双路径脚本拆分

  • 保留 init_system.sh / deploy.sh 作为 source-based 路径,用于开发、调试、验证未发布改动
  • 新增 init_release_system.sh / deploy_release.sh 作为 release-based 路径,用于正式 systemd 部署
  • 新增 deploy/install_release_runtime.shdeploy/update_a2a_release.sh,把已发布的 opencode-a2a-server 安装到共享 uv tool 运行时,而不是 repo 内 .venv

2. 正式部署默认入口切换

  • README 现在面向用户,明确 released CLI 是默认安装入口
  • 长期运行的 systemd 部署默认推荐 release-based 脚本,而不是源码路径
  • source-based 部署仍然保留,但明确降级为 contributor/debugging 用途

3. bootstrap 与失败保护

  • source bootstrap 继续显式以 repo/ref 为边界,不再混淆为 release 默认入口
  • release bootstrap 通过 init_release_system.sh 单独实现,避免 clone repo 与 source .venv
  • 修复 ref 解析/checkout 失败时可能继续沿默认 branch 执行后续步骤的回退风险,避免悄悄退回到 main/默认分支头

4. 文档结构重组

  • README:用户安装、升级、发布版部署入口
  • scripts/init_release_system_readme.md:release-based host bootstrap
  • scripts/deploy_release_readme.md:release-based systemd deploy
  • scripts/init_system_readme.md / scripts/deploy_readme.md:source-based bootstrap / deploy
  • docs/agent_deploy_sop.md:统一解释三条路径 deploy_release.sh / deploy.sh / deploy_light.sh
  • docs/release_deploy_smoke_test.md:release-based 真机部署 smoke test checklist

5. 约束测试与契约更新

  • 更新 tests/test_init_system_security.py,覆盖 source/release bootstrap 的默认行为与失败保护逻辑
  • 更新 tests/test_deploy_security_contract.py,约束 release/source 双路径脚本与 README/SOP 文案

本地验证

已完成:

  • uv run pre-commit run --all-files
  • uv run pytest

补充说明:

  • 新增和修改的 shell 脚本已通过 bash syntax check
  • 真实 systemd + sudo + root-owned /opt 的端到端部署 smoke test 方案已经补到仓库文档,但本地未执行真实主机演练

相关提交

  • 504bc56 docs: finish release entrypoints for bootstrap and CLI usage #178 #188
  • 8ebed34 ops: avoid fallback to default branch during release bootstrap #178 #188
  • 50edd9d ops: split source and release deployment entrypoints #178 #188
  • d69895d docs: add release deploy smoke test checklist #178 #188

代码审查结论

本 PR 引入的变动整体合理,没有发现需要阻塞合并的剩余实现问题。

本轮实现较好地解决了此前的结构性问题:

  • 已发布包与正式部署路径不再继续耦合到源码 checkout
  • source-based 与 release-based 职责已经分离,边界比此前清晰
  • README 更明确地转向面向用户,而不是默认把用户带去源码运行路径
  • release-based 真机 smoke test 已经有明确 checklist,不再是“无验证方案”状态

残余风险主要是执行层面的:

  • release-based systemd 路径虽然已经通过文本契约测试、shell 语法检查和全量 pytest,并补齐了真机 smoke test 方案,但还没有在真实 host/systemd 环境下完成一次端到端演练

与 issue 的关系

@liujuanjuan1984 liujuanjuan1984 changed the title docs: align bootstrap and CLI entrypoints with release-based distribution ops: split source and release deployment entrypoints Mar 17, 2026
@liujuanjuan1984 liujuanjuan1984 marked this pull request as ready for review March 17, 2026 12:47
@liujuanjuan1984 liujuanjuan1984 merged commit 25510e8 into main Mar 17, 2026
3 checks passed
@liujuanjuan1984 liujuanjuan1984 deleted the ops/issues-178-188-release-followup branch March 17, 2026 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant