Files
pikasTech-unidesk/.agents/skills/unidesk-cicd/references/git-mirror.md
T
2026-07-11 11:42:16 +02:00

2.7 KiB
Raw Blame History

Git Mirror Authority

默认只读入口

Gitea/PaC migrated consumer 的 mirror、authority branch、immutable snapshot 与 GitOps publication 全由 GitHub PR merge 自动链拥有。默认只允许读取:

bun scripts/cli.ts platform-infra gitea mirror status --target <NODE>
bun scripts/cli.ts platform-infra gitea mirror webhook status --target <NODE>
bun scripts/cli.ts hwlab nodes git-mirror status --node <NODE> --lane <lane>
bun scripts/cli.ts agentrun git-mirror status --node <NODE> --lane <lane>

已迁移或 unknown authority 必须在远端调用或异步 Job 创建前 fail-closed。状态和失败 Next 只能指向 status/history 与自动链修复引用,不得建议 mirror sync/flush、直接 Gitea push、host git、fixed workspace 或第二套 source resolver。

自动链故障必须修 config/platform-infra/gitea.yamlconfig/platform-infra/pipelines-as-code.yaml、webhook bridge、受控 mirror worker 或源码,并通过修复 PR 合并产生的新正常事件验收。不得使用 branch-follower、人工 PipelineRun 或 legacy mirror mutation 补齐当前交付。

Legacy scope

Git mirror mutation 只属于 owning YAML 精确解析为 legacy-manual 的 lane,并且只能从显式 scoped help 发现:

bun scripts/cli.ts hwlab nodes git-mirror legacy-ops --help
bun scripts/cli.ts agentrun git-mirror legacy-ops --help

Legacy scope 仍须遵守:

  • source selection 只使用 YAML 声明的 immutable snapshot,不读取 host worktree、.worktree/* 或可变 branch ref
  • GitHub transport、proxy、Secret sourceRef 与 snapshot prefix 全部来自 owning YAML
  • syncflush 与 apply 只服务明确 legacy lane,不能作为 PaC 恢复手段;
  • 验收使用只读 status 证明 mirror、GitOps、Argo、runtime 与目标 source commit 对齐,不能只看 PipelineRun terminal。

退役状态清理

Branch-follower 已退役。旧状态清理不属于 mirror 自动链,也不使用默认 cleanup-state。确需清理时使用 cicd branch-follower retired-maintenance --help 中的受控入口;固定 canonical owning YAML,先列候选,再显式确认。

D601 legacy transport

D601 legacy lane 的 GitHub upstream transport 由 YAML 固定为 SSH over ssh.github.com:443HTTP proxy 仅承担 SSH CONNECT。输出若漂移为 HTTPS token、host env 或未声明 transport,修 owning YAML 和平台配置,不增加 fallback。

Legacy mirror status 中的 GitHub 字段可能来自 refs/mirror-stage/... cache,必须标记来源。push 已成功但 post-push fetch 因 transient 失败时,CLI 可以在同一个 legacy 受控实现内做一次有界 recheck;这项行为不得复制到 migrated PaC consumer 的 operator Next。