Skip to content

ci(create-objectstack): scaffold-E2E gate + registry canary + release-time template dep sync - #2912

Merged
os-zhuang merged 1 commit into
mainfrom
claude/third-party-dev-docs-0t5256
Jul 14, 2026
Merged

ci(create-objectstack): scaffold-E2E gate + registry canary + release-time template dep sync#2912
os-zhuang merged 1 commit into
mainfrom
claude/third-party-dev-docs-0t5256

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

Fixes #2908

背景

#2907 修掉了模板落后 8 个大版本的事故并加了两层防线(生成时依赖同步、提交时一致性棘轮)。本 PR 补齐剩余三层,让这类腐化在每个环节都有机器拦截:

变更

1. .github/workflows/scaffold-e2e.yml(新 workflow,双 job)

scaffold-local(PR 触发,paths 限定脚手架/examples/docker/workflow 自身):

registry-canary(nightly cron 23 3 * * * + 手动触发):

  • npx create-objectstack@latest已发布包跑同样流程,matrix 覆盖注册表全部 6 个模板(blank + 5 个远程模板);远程模板跑到 build 门禁(它们没有 validate 脚本),blank 额外做启动探测。
  • 这是"真实新用户第一次运行"的金丝雀 —— 发布管线或 templates 仓库坏了,第二天就红,而不是等用户踩坑。

2. scripts/sync-template-versions.mjs + version 链

发版时(changesets/action 调 pnpm run version)自动把 blank 模板的 @objectstack/* 区间改写为脚手架自身的 major —— 与既有 sync-protocol-version.mjs 完全同构,理由也相同:changesets 开的 release PR 用默认 token 不触发 CI,棘轮测试拦不住它,version 时刻是唯一绕不过去的位置

防线全景(本 PR 后)

时机 机制 拦截的失效模式
生成时 脚手架依赖改写(#2907 用户拿到旧版
提交时 一致性棘轮测试(#2907 模板 major 与包不一致
PR 时 scaffold-local E2E(本 PR) 模板代码与已发布 API 不兼容、docker 打包损坏
发版时 sync-template-versions.mjs(本 PR) 升版忘改模板字面量
每日 registry-canary(本 PR) 发布产物/远程模板腐化

验证

  • 两个 job 中所有能在 Actions 之外执行的步骤均已本地实跑:本地 dist 脚手架 → npm install(3 分钟,442 包)→ validate ✓build ✓os start + health/ready 探测 ✓、validate-script 检测单行 ✓、latest 回退改写 ✓。
  • 同步脚本双路径验证:幂等(已是 ^14.0.0 时不写文件)与改写(伪造 ^13.0.0 → 正确改回并逐行打印)。
  • workflow YAML 语法解析通过;check-role-word / ESLint 通过。
  • 仅 workflow/脚本变更,不发包,无需 changeset。
  • 局限:workflow 在 Actions 环境的首次真实运行要等本 PR 的 pull_request 触发(paths 含 workflow 自身,本 PR 会触发 scaffold-local),nightly job 则在合并后次日凌晨首跑。

🤖 Generated with Claude Code

https://claude.ai/code/session_01Em3ky9uu6zw2cYzVhqCij2


Generated by Claude Code

…-time template dep sync

Close the remaining template-staleness gaps behind #2907 (fixes #2908):

- .github/workflows/scaffold-e2e.yml
  - scaffold-local (PRs touching the scaffolder / examples/docker): scaffold
    with the repo-built dist, install from the registry (with a latest
    fallback for the unpublished-version window right after a bump),
    validate + build the generated project, boot it from the artifact and
    probe /api/v1/health + /ready, then docker build/run the examples/docker
    packaging against the same probes — the docker files finally get CI
    coverage.
  - registry-canary (nightly + manual): npx create-objectstack@latest across
    every template in the registry (blank + 5 remote), gate each generated
    project, full boot probe for blank — catches registry/publish breakage
    the way a real first-run user would.
- scripts/sync-template-versions.mjs, chained into the root `version`
  script after sync-protocol-version.mjs: rewrites the blank template's
  @objectstack/* ranges to the scaffolder's own version at release time, so
  a bump can never ship a stale template. Release PRs from changesets/action
  skip CI (default-token anti-recursion), so version time is the one spot
  that cannot be bypassed — same rationale as sync-protocol-version.mjs.

Every step of both jobs that can run outside Actions was executed locally:
scaffold → npm install → validate → build → boot + health/ready probes, the
validate-script detection, the latest-fallback rewrite, and both sync-script
paths (idempotent + rewrite).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Em3ky9uu6zw2cYzVhqCij2
@vercel

vercel Bot commented Jul 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment Jul 14, 2026 11:21am

Request Review

@github-actions github-actions Bot added ci/cd dependencies Pull requests that update a dependency file size/m labels Jul 14, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review July 14, 2026 11:55
@os-zhuang
os-zhuang merged commit 2fbf03e into main Jul 14, 2026
18 checks passed
@os-zhuang
os-zhuang deleted the claude/third-party-dev-docs-0t5256 branch July 14, 2026 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/cd dependencies Pull requests that update a dependency file size/m

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI: build the examples/docker reference image against a freshly scaffolded project

2 participants