refactor: make Gitea the sole CI authority

This commit is contained in:
pikastech
2026-07-21 17:18:48 +02:00
parent 1115f134fd
commit 5115460df2
23 changed files with 337 additions and 214 deletions
@@ -23,7 +23,7 @@
| 上级规格 | [PJ2026-0106 平台运维](PJ2026-0106-platform-ops.md) |
| 规格治理索引 | [规格治理](spec-governance.md) |
本文采用 ISO/IEC/IEEE 29148 需求规格模板的项目裁剪版:正文只保留 Git mirror、source commit authority、GitOps 分支、artifact catalog、bundle/mirror URL 和运行面源码真相的通用稳定使命、范围、术语、系统边界、内部分工和原子需求。
本文采用 ISO/IEC/IEEE 29148 需求规格模板的项目裁剪版:正文只保留 Gitea source authority、source commit、GitOps 分支、artifact catalog、bundle URL 和运行面源码真相的通用稳定使命、范围、术语、系统边界、内部分工和原子需求。
## 2. 目的和范围
@@ -33,11 +33,11 @@
### 2.2 范围内
- G14、D601 和平台运行面使用的 Git mirror read/write URL、mirror cache、source branch 和固定 worktree 规则。
- Gitea source/GitOps read-write URL、source branch 和固定 worktree 规则。
- HWLAB 各服务的 source branch、source worktree、GitOps branch、artifact catalog 和 runtime path 的通用 source truth 关系。
- RuntimeAssembly `ResourceBundleRef.kind="gitbundle"` 所需的 repo URL、ref、actual commitbundle 摘要和 mirror 改写边界
- RuntimeAssembly `ResourceBundleRef.kind="gitbundle"` 所需的 Gitea repo URL、ref、actual commitbundle 摘要。
- GitOps desired state 与 source branch 分离,promotion 只写 artifact catalog 和 rendered manifests,不把运行副本变成源码真相。
- 运行面、CLI 和发布输出中的 source revision、artifact catalog、bundle/mirror URL 和 commit 摘要可见性。
- 运行面、CLI 和发布输出中的 source revision、artifact catalog、Gitea URL 和 commit 摘要可见性。
### 2.3 范围外
@@ -52,7 +52,7 @@
| 术语 | 定义 |
| --- | --- |
| source truth | 某服务或资源装配的权威 Git 来源,包括 repo URL、branch/ref、commit 和必要的 GitOps artifact。 |
| Git mirror | 为目标运行面提供 Git read/write 缓存和 source sync 的平台基础设施。 |
| Gitea authority | 为 source branch、GitOps branch、artifact catalog 和运行时 checkout 提供唯一 read/write Git 真相的受控 Gitea 仓库。 |
| source worktree | 固定在目标节点上的 source branch 工作区,只作为预检、同步和直接轻量文档交付入口。 |
| GitOps branch | 与 source branch 分离的 desired state 分支,只保存渲染后运行面资源和 artifact catalog。 |
| artifact catalog | 记录 image、env identity、source commit、runtime path 和 manifest 摘要的发布产物索引。 |
@@ -66,35 +66,39 @@
| 边界项 | 内容 |
| --- | --- |
| 外部使用者 | 发布流水、Runtime装配、agent runner、服务维护者、平台运维 CLI 和业务模块。 |
| 外部输入 | Git remote、source branch、requested ref、commitId、GitOps branch、bundle paths、mirror target、promotion 请求和 source status 查询。 |
| 受控资源 | Git mirror、source worktree、GitOps branch、artifact catalog、gitbundle checkoutactual commit 摘要和 bundle/mirror URL。 |
| 外部输出 | source revision、mirror URL、actual commit、tree/bundle 摘要、artifact catalog path、GitOps revision 和 source sync 状态。 |
| 外部输入 | Git remote、source branch、requested ref、commitId、GitOps branch、bundle paths、Gitea target、promotion 请求和 source status 查询。 |
| 受控资源 | Gitea repository、source worktree、GitOps branch、artifact catalog、gitbundle checkoutactual commit 摘要。 |
| 外部输出 | source revision、Gitea URL、actual commit、tree/bundle 摘要、artifact catalog path、GitOps revision 和 source sync 状态。 |
| 用户接口 | UniDesk CLI、服务自有 CLI source/status 输出、发布流水状态、RuntimeAssembly result/event 摘要。 |
| 系统边界 | 源码同步负责 Git 来源和 artifact 来源可追溯;不执行模型任务,不决定发布是否通过,不把运行面副本或临时目录提升为 source truth。 |
## 5. 内部分工与规格索引
本规格前四个 L3 只承载服务无关的通用源码规则。AgentRun 固定 source branch、fixed worktree、GitOps branchartifact catalog 和 mirror 细则只在 AgentRun 专项 L3 中展开,通用源码同步条款只保留可复用的 source truth 边界。
本规格前四个 L3 只承载服务无关的通用源码规则。AgentRun 固定 source branch、fixed worktree、GitOps branchartifact catalog 细则只在 AgentRun 专项 L3 中展开,通用源码同步条款只保留可复用的 source truth 边界。
| 编号 | 模块或课题 | 规格文档 | 主责边界 | 上游依赖 | 下游支撑 |
| --- | --- | --- | --- | --- | --- |
| PJ2026-01060201 | Mirror同步 | 本规格 6.1 | Git mirror read/write URL、mirror cache 和 source branch 同步 | Git remote、平台网络 | 发布流水、Runtime装配 |
| PJ2026-01060202 | SourceTruth | 本规格 6.2 | fixed worktree、source branch、remote、clean/ff-only 状态 | Git mirror、项目仓库 | 服务 source 预检 |
| PJ2026-01060201 | Gitea同步 | 本规格 6.1 | Gitea read/write URL 和 source branch 同步 | Git remote、平台网络 | 发布流水、Runtime装配 |
| PJ2026-01060202 | SourceTruth | 本规格 6.2 | fixed worktree、source branch、remote、clean/ff-only 状态 | Gitea、项目仓库 | 服务 source 预检 |
| PJ2026-01060203 | GitOps目录 | 本规格 6.3 | GitOps branch、artifact catalog、runtime path 和 desired state | 发布流水 promotion | Argo sync、runtime 发布 |
| PJ2026-01060204 | GitBundle来源 | 本规格 6.4 | repoUrl/ref/actual commit/bundles 摘要和 mirror 改写 | Runtime装配、Git mirror | Agent runner、skills/tools |
| PJ2026-01060205 | AgentRun源码 | [PJ2026-01060205 AgentRun源码真相](PJ2026-01060205-agentrun-v01-source-truth.md) | AgentRun `v0.1` source branch、fixed worktree、GitOps branchartifact catalog 和 mirror 细则 | Git mirror、发布流水 | AgentRun runtime、Runtime装配 |
| PJ2026-01060204 | GitBundle来源 | 本规格 6.4 | Gitea repoUrl/ref/actual commit/bundles 摘要 | Runtime装配、Gitea | Agent runner、skills/tools |
| PJ2026-01060205 | AgentRun源码 | [PJ2026-01060205 AgentRun源码真相](PJ2026-01060205-agentrun-v01-source-truth.md) | AgentRun `v0.1` source branch、fixed worktree、GitOps branchartifact catalog 细则 | Gitea、发布流水 | AgentRun runtime、Runtime装配 |
## 6. 原子需求
### 6.1 OPS-SOURCE-REQ-001 Git Mirror 同步
### 6.1 OPS-SOURCE-REQ-001 Gitea 同步
| 编号 | 短名 | 主责模块 | 关联模块 |
| --- | --- | --- | --- |
| OPS-SOURCE-REQ-001 | Mirror同步 | PJ2026-01060201 Mirror同步 | [发布流水](PJ2026-010601-controlled-release.md)、[Runtime装配](PJ2026-010202-runtime-assembly.md) |
| OPS-SOURCE-REQ-001 | Gitea同步 | PJ2026-01060201 Gitea同步 | [发布流水](PJ2026-010601-controlled-release.md)、[Runtime装配](PJ2026-010202-runtime-assembly.md) |
源码同步应提供 Git mirror read/write 能力,使 CI/CD、RuntimeAssembly 和目标运行面优先通过平台 mirror 获取 GitHub 资源,避免把外网直连失败或临时 clone 作为源码阻塞
源码同步应 Gitea 作为 source branch、GitOps branch 和 artifact catalog 的唯一运行时 Git authority,并通过 owning YAML 声明的 read/write URL 与 SecretRef 完成受控同步
mirror 输出应能说明 owner/repo、read URL、write URL、cache 状态和同步来源,但不得输出 Git credential、SSH private key 或可复制 token。
- PaC、Tekton、Argo 和 runtime checkout 必须读取同一 Gitea 仓库中的对应 branch
- GitOps promotion 必须通过 Gitea SecretRef 写回同一仓库,禁止再写 legacy `git-mirror`
- `git-mirror-http``git-mirror-write`、mirror cache、sync/flush Job 和相关运行时入口必须退役,不得作为 fallback、缓存或第二 authority 保留;
- GitHub 只作为上游 source 输入,不能被 Pipeline 或 runtime 直接提升为第二 GitOps authority
- 输出应说明 owner/repo、read URL、write URL 和同步来源,但不得输出 Git credential、SSH private key 或可复制 token。
### 6.2 OPS-SOURCE-REQ-002 Source Truth 预检
@@ -128,4 +132,4 @@ GitOps branch 只保存目标运行面 desired state 和 artifact catalog,不
源码同步应为 gitbundle 装配提供 source authority,使 `ResourceBundleRef.repoUrl`、requested ref、actual commit、tree、bundles、promptRefs、tools 和 skills 的来源可验证。
runner materialization 可以按平台规则把 GitHub URL 改写到 G14 git mirror,但不得让 prompt、payload、host path、Secret volume、用户上传目录或运行时临时文件成为 gitbundle 的权威来源。event/result 只输出路径、hash、bytes、commit 和 bundle 摘要,不输出文件全文或凭据。
runner materialization 必须把上游 GitHub identity 解析到 owning YAML 声明的 Gitea repository,并从该唯一 authority 读取 requested ref。不得回退到 legacy git-mirror、GitHub 直连、host path、Secret volume、用户上传目录或运行时临时文件。event/result 只输出路径、hash、bytes、commit 和 bundle 摘要,不输出文件全文或凭据。