Skip to content

fix: canary prerelease-skip + dispatch ref default (#1811) - #1832

Merged
ranxianglei merged 2 commits into
masterfrom
2026-10-01_canary-prerelease-skip
Oct 1, 2026
Merged

ranxianglei merged 2 commits into
masterfrom
2026-10-01_canary-prerelease-skip

Conversation

@ranxianglei

@ranxianglei ranxianglei commented Oct 1, 2026 •

Copy link
Copy Markdown
Owner

Follow-up fixes for the release-canary pipeline added in #1814. Two independent, clearly-labeled commits; both keep the green = "delivery pipe works" signal honest.

1. Skip prerelease/dev tags instead of failing at import

The merged #1814 added a stableVersion guard, but it was computed after the module-load patchMinus() calls in tests/e2e/e2e-release-canary.test.ts. patchMinus() throws on any non-x.y.z, so those consts crashed at import time (the whole test file failed to load) before the guard could ever run. Since the trigger is release.published and release.yml creates a GitHub Release even for dev versions, every prerelease/dev release would have false-red'd the canary.

Fix: compute stableVersion before the two guarded calls and make both conditional (falling back to NEW_VERSION, which is unused once the test skips). Stable x.y.z with patch ≥ 2 behaves byte-for-byte identically.

Verified locally: typecheck green; 0.1.179-dev.1 → graceful skip (fail 0); full stable 0.1.178 end-to-end green (~26s).

2. Manual-dispatch default → default branch, not "latest release"

The Resolve ref step's fallback auto-resolved gh api releases/latest. That is a trap during bootstrap: a released tag only contains the canary code after a release is cut from a tree that already has it, so right now "latest release" = v0.1.178, which predates the canary merge by ~87 min → any no-ref manual dispatch false-reds with Could not find tests/e2e/e2e-release-canary.test.ts until v0.1.179 ships.

Fix: no-ref manual dispatch now checks out the default branch (current canary code); the release.published event still pins its own released tag (validates exact shipped bytes, works from v0.1.179 onward); explicit inputs.ref still targets any historical tag for regression runs. This also drops the now-unused gh api lookup and its GH_TOKEN from the resolve step.

Verified: YAML parses; branch-selection simulated across all four trigger cases (release / dispatch+ref / dispatch-no-ref × default-branch names).

Config surface

None. No new env/config/CLI fields; only workflow ref-resolution semantics and a test-file guard order change.

Refs #1814, #1811.

…1811)

The release canary computed OLD_VERSION/STALE_VERSION via patchMinus() at
module load, BEFORE the stableVersion guard. patchMinus() throws on any non
x.y.z input, so a prerelease/dev tag (0.1.x-dev.N, 0.1.x-beta.N) — or a patch
part < 2 — made the whole test file fail to import instead of skipping
gracefully. The workflow triggers on release.published, which release.yml also
emits for dev releases, so every dev release would red-light the delivery-pipe
check with a false alarm rather than a clean skip.

Compute stableVersion first and guard both patchMinus() calls on it; when the
version is out of range the consts fall back to NEW_VERSION (unused, since the
test then skips via skipReason). Behavior for a stable x.y.z with patch >= 2
is byte-for-byte unchanged.

Verified locally: typecheck green; prerelease 0.1.179-dev.1 now skips with a
clear reason (fail 0); full stable-path run at 0.1.178 green end-to-end (~26s).

Supplements the merged canary in #1814; review finding raised in #1811.
@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-01_canary-prerelease-skip (50c9a5c)

Option A — Install this exact build (recommended)

npm install -g billion-context@0.0.1813-pr.1832.f554da5

This exact version is immutable and reproducible. The rolling pr tag tracks the newest test build across all PRs.

Option B — Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr1832.tgz
npm install -g package

Install instructions are refreshed on each push.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 [PR] #1832 核验结论(review / verify,非重做)

这是带 ework-agent-pr 标记的已完成工作,按规范做「拉分支核对代码 + 确认 CI + 报告结论」,未重做。已独立复现验证,结论:可合(mergeable)。

核查证据(本地独立跑,非复述作者描述)

  • CI @ head 7429668b:13 项 check-run 全绿(build-artifact / e2e / hermetic registry e2e / real codex·pi·opencode·dsh lanes / test ubuntu 22·24 + windows 22·24 / version-guard),mergeable_state: clean。
  • diff 仅一个文件 tests/e2e/e2e-release-canary.test.ts(+4/−2),每行都服务于本修复,无无关改动 / 空白 churn / 锁文件连带。
  • 本地 A/B(装依赖 + 构建 dist 后):
    • master base @ 0.1.179-dev.1:import 期抛 cannot step version down @ tests/e2e/e2e-release-canary.test.ts:45 → fail 1, skipped 0(= 原 bug)。
    • PR head @ 0.1.179-dev.1:优雅跳过(reason: needs a stable version with patch ≥ 2 … prerelease/dev tags skip)→ fail 0, skipped 1, exit 0。
    • PR head @ 0.1.178(stable):完整 drill pass 1, fail 0(~23.5s)。
    • npm run typecheck 绿。(注:其 tsconfig.build.json 只覆盖 src/**、不含测试文件;本文件由 CI 的 tsx 运行时转译 + 改动本身平凡——两个 string 上的三元——保证无类型风险。)

结构化七问

  1. 是什么问题:release-canary e2e 在模块加载期就用 patchMinus() 算 OLD_VERSION/STALE_VERSION,而它对非 x.y.z(dev/prerelease tag)或 patch<2 会抛错——于是 dev 发布让整份测试文件 import 失败而非干净跳过;delivery-pipe 的 canary 检查对每次 dev 发布都误报红灯。
  2. 什么原因导致的:顺序缺陷——无条件在模块加载执行的 patchMinus 调用(line 45)跑在了决定跳过的 stableVersion 守卫之前;patchMinus 本身是「不能往下减就抛」的 fail-fast,却被提前调用、未被守卫拦下。触发面来自 workflow 监听 release.published,而 release.yml 对 dev 发布也发该事件,所以 throw 直接变成假红灯而非设计内的 skip。
  3. 怎么修复的:把决策点提到会抛错的计算之前——先算 stableVersion,再用三元守卫两次 patchMinus,越界时回退到 NEW_VERSION(因随后经 skipReason 跳过,回退值不会被用到)。属「在源头/决策点修」,不是把症状在传输层抹掉。
  4. 是否有回归问题:无。逐项清点该 canary 测试既有行为:①未设 ACP_TEST_CANARY → 恒跳过,不变;②stable x.y.z 且 patch≥2 + run → 完整 drill,逐字节等价且实测 pass 1;③越界版本 + run → 旧为意外的 import 崩溃、新为设计内优雅跳过(即本次修复,见下方披露)。未触碰任何 proxy/pipeline/wire/message-shape/时序/阈值代码,两种压缩模式都不受影响(diff 只动被 gate 的 e2e 测试文件,无 src/** 变更)。无 fail-fast 变吞错之虞:被移除的 throw 是缺陷而非有意 fail-fast。
  5. 是否破坏缓存:不涉及(纯测试文件,未触碰缓存/重试/增量游标/去重键)。
  6. 是否改了设计方向:否。机制、lane、skip 契约均不变,仅调整既有 gated 测试里两处模块加载计算的先后。
  7. 是否引入了新的配置:无。未新增/改名/改语义任何 config 字段、env、默认值。

行为变更披露(旧值→新值 + 原因)

  • 越界版本(dev/prerelease tag 或 x.y.<2)下的 OLD_VERSION/STALE_VERSION:旧 = import 期抛错、整份文件加载失败、测试红灯;新 = 回退为 NEW_VERSION(不实际使用)并优雅跳过,skip reason 打印具体版本号。原因:该 throw 是对「本应直接跳过的版本类」的意外 import 崩溃,属缺陷而非有意 fail-fast,转为设计内的 skip 路径即修复。
  • stable x.y.z 且 patch≥2:完全不变(检视逐字节等价 + 实测通过,双重确认)。

判定:可合。 这是我先前贡献的客观复核,无需返工;合并请人工执行(Agent 依规不合并):#1832

@ranxianglei ranxianglei changed the title fix: canary skips prerelease/dev tags instead of failing at import (#1811) fix: canary prerelease-skip + dispatch ref default (#1811) Oct 1, 2026
@ranxianglei
ranxianglei merged commit 1c87a6b into master Oct 1, 2026
13 checks passed
@ranxianglei
ranxianglei deleted the 2026-10-01_canary-prerelease-skip branch October 15, 2026 05:32
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