Skip to content

ci: run the full matrix on release/** integration branches - #386

Merged
Sunrisepeak merged 2 commits into
release/0.4.70from
ci/release-branch-triggers
Jul 26, 2026
Merged

Sunrisepeak merged 2 commits into
release/0.4.70from
ci/release-branch-triggers

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

Problem

0.4.70 采用单一 release/0.4.70 集成分支模型(见 #385 的实施计划),但六个 CI workflow 全部只在 main/master 上触发 —— push 和 pull_request 两个事件都是:

on:
  push:
    branches: [main, master]
  pull_request:
    branches: [main, master]

后果:base 为 release/0.4.70 的 PR 完全不跑 CI。 #385 实测 no checks reported。

这让集成分支模型无法运转 —— 工作只会在抵达 main 时才被验证,也就是整列车已经组装完毕之后。而这个模型的全部意义恰恰是"每个 PR 上车时就验证,整列车验证通过后才提交给 main"。

Change

给六个 workflow 的 push 与 pull_request 分支过滤器加上 release/**:

workflow 之前 之后
xlings-ci-linux [main, master] [main, master, 'release/**']
xlings-ci-linux-root [main, master] [main, master, 'release/**']
xlings-ci-linux-e2e [main, master] [main, master, 'release/**']
xlings-ci-macos [main, master] [main, master, 'release/**']
xlings-ci-windows [main, master] [main, master, 'release/**']
xlings-ci-aarch64 [ main ] [ main, 'release/**' ]

用通配 release/** 而非硬编码 release/0.4.70,这样后续版本的集成分支无需再改 workflow。仓库里已有 release/0.4.3、release/0.4.14 等历史分支,命名惯例一致。

未改动:release.yml / mirror-binaries.yml(workflow_dispatch)、gitee-sync.yml(只同步 main)、xlings-ci-archlinux.yml(按 paths 触发)—— 都不应跟随集成分支。

Verification

  • 六个文件 YAML 解析通过,触发条件符合预期
  • 本 PR 自身的 checks 出现即验证生效(当前 base 分支尚无此配置,以合入后的表现为准)

Note

本 PR 是集成分支模型的前置条件,需先于 #384 与后续 P0–P4 的 PR 合入。

另有一个独立的、先于本 PR 存在的问题:#384 在 base 还是 main 时六平台 CI 均失败于 error: fetch '[email protected]' failed (exit 1),重跑不恢复。compat.bzip2 是 compat.libarchive 的传递依赖,不在 mcpp.lock 中(lock 只锁直接依赖),因此受上游 registry 变动影响。该问题与本 PR 无关,将单独处理。

All six workflows only triggered on main/master, for both push and
pull_request. A PR targeting release/0.4.70 therefore got no checks at
all, which makes the release-train model unusable: work would only be
verified at the point it reaches main, i.e. after the whole train is
already assembled.

Add 'release/**' to the push and pull_request branch filters so an
integration branch is gated exactly like main -- each PR is verified
when it lands on the train, and the train itself is verified on every
push before it is proposed to main.
Every workflow restores an ~800 MB mcpp cache and then immediately runs
'rm -rf $HOME/.mcpp/registry', which also deletes registry/data/xpkgs --
the downloaded and extracted package payloads. The cache was therefore
almost worthless, and every run had to re-fetch every transitive source
from its upstream host.

That made CI fail wholesale whenever a single upstream host was
unreachable. Today all six workflows fail on

  error: fetch '[email protected]' failed (exit 1)

compat.bzip2 is a transitive dependency of compat.libarchive and is
absent from mcpp.lock, which only pins direct dependencies, so it is
re-resolved and re-downloaded from sourceware.org on every run.

Prune only what actually has to be re-resolved for GLOBAL -- the indexes
and the mirror config -- and keep data/xpkgs. Payloads are sha256-pinned
by their recipe, so retaining them cannot leak a CN artifact into a
GLOBAL build.

This does not remove the upstream dependency; a cold cache still needs
the source hosts. It removes the guarantee of hitting them every time.
@Sunrisepeak

Copy link
Copy Markdown
Member Author

追加:修掉一个先于本 PR 存在的 CI 脆弱点

第一次提交后实测:release/** 触发已生效(六个 check 全部跑起来了),但六个全部失败于

error: fetch '[email protected]' failed (exit 1)

对照实验确认这与改动无关 —— 本 PR 第一次提交只改 workflow 触发条件,叠在 origin/main 上,同样失败。main 今天也是坏的。

根因

日志显示(macOS 那次为例):

Cache mcpp sandbox and project packages
  Cache hit ... Cache Size: ~809 MB
  Cache restored successfully
Reinitialize mcpp registry (GLOBAL)
  rm -rf "$HOME/.mcpp/registry"        ← 809MB 刚恢复,立刻删掉

registry/data/xpkgs 正是已下载/解压的 payload 存放处。所以:

  1. 那份 ~800MB 缓存实际上毫无作用
  2. 每次运行都必须从各个上游主机重新拉取所有传递依赖的源码
  3. 任何一个上游主机不可达 → 整个 CI 全线失败

compat.bzip2 是 compat.libarchive 的传递依赖,且不在 mcpp.lock 里(lock 只锁直接依赖),每次都要从 sourceware.org 重新解析下载。今天该主机对 runner 不可用(本地实测 URL 可达但需 7.1s,偏慢)。

修复

只清理真正需要为 GLOBAL 重新解析的部分(各索引 + mirror 配置),保留 data/xpkgs:

prune_registry() {
  [ -d "$1" ] || return 0
  find "$1" -mindepth 1 -maxdepth 1 ! -name data -exec rm -rf {} +
  [ -d "$1/data" ] || return 0
  find "$1/data" -mindepth 1 -maxdepth 1 ! -name xpkgs -exec rm -rf {} +
}

payload 由 recipe 的 sha256 固定,与 mirror 无关,保留它不可能把 CN 产物混进 GLOBAL 构建。

已应用于 linux / linux-root / linux-e2e / macos / windows(pwsh) / release.yml。

验证

  • 10 个 workflow YAML 全部解析通过
  • prune_registry 本地行为验证:构造 registry/{bin,config,subos,data/{xpkgs,mcpplibs,xim-index-repos,xim-pkgindex,local-indexrepo,runtimedir}},执行后只剩 data/xpkgs 及其内容,payload 字节完好;对不存在的路径安全返回
  • 全仓无遗留的 rm -rf .../mcpp/registry
  • 六平台 CI 转绿

未解决的部分

这不消除对上游主机的依赖 —— 冷缓存仍需访问 sourceware.org 等。它消除的是"每次都必须访问"。

durable 的修法在上游 mcpp registry:给 compat.bzip2 的 GLOBAL 源加一个可靠镜像(该 recipe 的 CN 源已经指向 gitcode.com/mcpp-res/bzip2,GLOBAL 侧缺同等镜像)。这属于 mcpp-community 仓,单独处理。

@Sunrisepeak

Copy link
Copy Markdown
Member Author

缓存修复已验证有效 —— 但今天有独立的上游拉取故障

修复生效的证据

macOS build-and-test 从失败转为 通过(run 30190829077),日志关键行:

Cache mcpp sandbox and project packages   Cache restored successfully
Reinitialize mcpp registry (GLOBAL)       prune_registry ...
Build and run unit tests                  Cached compat.libarchive v3.8.7    ← 复用,无 Downloading

即:保留下来的 payload 被直接复用,不再触网。这正是本 PR 要达到的效果。

但 CI 仍未全绿 —— 原因是上游,不是本 PR

失败点从 compat.bzip2 换成了别的包:

job 失败包
e2e [email protected]
build-and-test ×2 [email protected]
aarch64 cross [email protected]

这些 job 的缓存键各不相同(e2e 用 musl-gcc、aarch64 用交叉依赖),缓存里没有它们需要的 payload,只能走上游 —— 而今天多个互不相关的上游拉取都在失败。

排除过的可能:

  • ❌ 索引仓 URL 失效 —— github.com/mcpplibs/mcpp-index.git 本地 git ls-remote 正常返回 HEAD
  • ❌ bzip2 源失效 —— sourceware.org 与 gitcode.com 两个 URL 本地均 HTTP 200
  • ❌ 本 PR 引入 —— 第一次提交(仅改触发条件)叠在 origin/main 上同样六平台全失败,main 今天也是坏的

结论:GitHub runner 侧今天对多个上游主机的拉取不稳定。本 PR 把"每次都必须触网"降级为"只有冷缓存才触网",是正确方向且已见效,但无法在上游恢复前让全平台转绿。

建议

本 PR 与 #389 可以先审阅。CI 转绿需要等上游恢复后重跑 —— 届时缓存会逐步填充,抗性也会随之提高。

durable 修法仍在上游 mcpp registry:给这些包的 GLOBAL 源补可靠镜像(CN 侧已有 gitcode.com/mcpp-res/*,GLOBAL 侧缺同等镜像)。

Sunrisepeak added a commit that referenced this pull request Jul 26, 2026
The plan assumed a PR landing on the integration branch would be gated
by CI. It was not: all six workflows only triggered on main/master, so a
PR based on release/0.4.70 got no checks at all. A second, pre-existing
problem surfaced next -- every workflow restored an ~800 MB mcpp cache
and then deleted the payload directory it had just restored.

Add P-1 covering both (fixed in #386) plus the unresolved upstream fetch
instability, and note that it gates R.3's three-platform-green
requirement without changing that requirement.
@Sunrisepeak
Sunrisepeak merged commit 73295a7 into release/0.4.70 Jul 26, 2026
2 of 7 checks passed
Sunrisepeak added a commit that referenced this pull request Jul 26, 2026
* docs(agents): xvm group transaction review, design and plan

Add the PR #384 review, the target architecture, and the staged
implementation plan for the 0.4.70 release train.

- review: verify the five root causes against origin/main, record two
  silent regressions (includedir no longer written, headers never
  carry a group), the removal-fallback coherence gap, and the
  before/after user-experience comparison
- design: three-layer state model (Catalog / Selection / Materialization),
  group promoted to a top-level table, commit-then-reconcile so the
  filesystem stops participating in the transaction, doctor as the
  reconciler
- plan: single release/0.4.70 integration branch, P0-P4 plus an R
  integration stage, 18 scenario-level acceptance assertions, and a
  seamless-upgrade contract (U1-U7) including downgrade safety

* docs(agents): record the CI prerequisites the plan had assumed

The plan assumed a PR landing on the integration branch would be gated
by CI. It was not: all six workflows only triggered on main/master, so a
PR based on release/0.4.70 got no checks at all. A second, pre-existing
problem surfaced next -- every workflow restored an ~800 MB mcpp cache
and then deleted the payload directory it had just restored.

Add P-1 covering both (fixed in #386) plus the unresolved upstream fetch
instability, and note that it gates R.3's three-platform-green
requirement without changing that requirement.

* docs(agents): bound the merge exception during the upstream outage

CI cannot go green while P-1.3 lasts, and review of intermediate PRs is
delegated. Both facts need a written boundary so 'upstream is broken'
does not become a general waiver.

Allow a PR to land on the integration branch only when the local build
and test suite are green AND the CI failure carries the known upstream
fetch signature, before any of this repo's code is compiled. Any other
failure signature still blocks. R.3 is unchanged: the branch has to be
re-run green on all three platforms before it is proposed to main, so
this defers verification rather than skipping it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant