Skip to content

fix(devx): objectui pin changeset comes from declared changesets, not commit types (#4731) - #4842

Merged
xuyushun441-sys merged 2 commits into
mainfrom
claude/issue-4731-objectui-pin-changeset-from-changesets
Aug 3, 2026
Merged

fix(devx): objectui pin changeset comes from declared changesets, not commit types (#4731)#4842
xuyushun441-sys merged 2 commits into
mainfrom
claude/issue-4731-objectui-pin-changeset-from-changesets

Conversation

@xuyushun441-sys

Copy link
Copy Markdown
Contributor

Fixes #4731

为什么改判据,而不是补猜法

bump-objectui.sh 写这个 changeset 的唯一理由,是补 #3340 那个洞:pin 一动、前端改动却在平台发布记录里查无此人。但它判断「这条提交算不算前端改动」用的是提交标题的 conventional-commit 类型 —— 一个

脚本真正要回答的问题是「这条提交在 objectui 侧发不发版」,而 objectui 已经声明了答案:每个发版 PR 都带一个 .changeset/*.md,frontmatter 里有包名才发版,空 frontmatter 就是 changesets 自己的 release-nothing 写法,级别(major/minor/patch)也是现成的。所以本 PR 取 issue 的建议 1:git log --diff-filter=A -- .changeset/ 拿到区间内新增的 changeset,清单和 bump 级别都从声明来,^feat 那一路推断整条删掉。声明即依据,与本仓 contract-first 的方向一致(Prime Directive #12)。建议 2(放行 ! + 排除 ci scope + 补截断尾标)是在猜法上打补丁:能修掉这次实测到的三个后果,但下一种猜错的形态还会再来。

实测:7d9734d5e321..785b8a5d432c(53 个非 merge 提交)

用真实 objectui 检出跑新旧两套逻辑,对同一区间:

旧(类型猜测) 新(读声明)
清单条数 34(head -40 用掉 85%,无尾标) 44 条 releasing changeset(区间内新增 48 个,4 个 release-nothing)
bump 级别 minor(grep -ciE '^feat' 有命中) major(区间内声明的最高级别;RC pre-mode 下原样保留)
漏收 13 条发版提交被类型过滤挡在门外 0
误收 5 条不发版提交(含 2 条 fix(ci)) 0

旧过滤器漏掉的 13 条里,包含全部 6 条破坏性 refactor(...)! —— refactor(layout)!: delete PageNodeRenderer(objectui#3225)、burn ledger batch 6/7(objectui#3220 / #3224)、batch 2/4/5 —— 另有 3 条非破坏性 refactorchore(deps): lockstep the @objectstack family onto 17.0.0-rc.1(objectui#3189),以及两条 test(console)、一条 wip(它们各自都带发版 changeset)。误收的 5 条:fix(ci) objectui#3198(压根没有 changeset)、fix(ci) objectui#3186(有 changeset,但 frontmatter 是空的 —— release-nothing)、fix(app-shell) #3187fix(charts) #3138fix(i18n) #3132(同为 release-nothing)。新逻辑对这 18 条的判断全部正确。

与 issue 里 ground truth 的两处出入(核对过原始 git 历史,是 issue 的描述略有偏差,不是实现偏差):

  1. issue 说「被过滤掉的有 8 条 refactor(...)!」。区间内实际是 9 条 refactor,其中带 !6 条;9 条全部被旧过滤器丢掉,issue 点名的两个例子(test(authz): e2e-prove the MCP HTTP surface is identity-admitted; upgrade the matrix row to high-risk (#3167) #3225The managedBy: 'system' bucket is overloaded (engine-only vs. admin-writable) — split the taxonomy; don't guard it wholesale #3220/feat(spec): compile-check skills/ TypeScript examples (anti-drift, #3094) #3224)都在其中。带 ! 的提交区间内共 11 条,另外 5 条是 feat!/fix!,本来就能通过类型过滤。
  2. issue 说两条 fix(ci)「在 objectui 侧连 changeset 都没有」。objectui#3198 确实没有;objectui#3186 .changeset/fix-cross-repo-closer-require.md,但 frontmatter 是空的,正文写着 "Release-nothing: touches .github/workflows/ only"。结论相同(两条都被正确排除),但排除的机制值得记下来:空 frontmatter 是 objectui 明确说出的「不发版」,读声明的做法连这一层都能读懂,而类型猜测两条都会误收。

截断必须出声

  • 默认没有截断:清单就是区间里声明发版的那些,不做 head
  • 仍保留一个上限(CONSOLE_CHANGES_MAX,默认 100)防止极端区间写出失控的文件;一旦触发就出声,尾标带真实数量:…and N more releasing changesets in this range (list capped at 100; …)。self-test 用 --max 1 专门验这条。
  • release-nothing 的 changeset 数、完全没有 changeset 的提交数,都写进正文的计数行,而不是无声丢掉。
  • 区间走不通时(浅克隆、首次 pin)退化到 tip 提交标题的老路仍在,但产物里显式标注 ⚠️ **Degraded list** 并说明原因 —— 退化清单和完整清单在成品里必须长得不一样。

一处需要维护者过目的判断:声明的 major 怎么落到 console 上

bump 级别取区间内声明的最高级别。但 @objectstack/console 在 changesets 的 fixed lockstep 组里,一个 major 会把整个 monorepo 顶上去,而 scripts/check-changeset-no-major.mjs 正是为此存在的门禁 —— objectui 例行把符号改名标成 major,机械地透传会让每次常规 pin 刷新都撞门。

所以这里照抄那个门禁自己的判据:仓库处于 changesets pre-release(RC)模式时,major 原样保留(RC 窗口本就是攒破坏性变更的地方 —— 当前 main 正在 rc,上面实测区间因此落 major);不在 pre-mode 时降为 minor,遵循该门禁写明的 launch-window 惯例(「breaking 以 minor 发」),并在产物正文里出声说明降级及原因,破坏性条目本身一条不删。CONSOLE_BUMP 仍可强制覆盖。若维护者更希望无条件透传 major(靠 allow-major label 放行),删掉 inPreMode() 那一个分支即可。

落点与验证

  • scripts/bump-objectui.sh —— 驱动;判据外移。
  • scripts/objectui-changeset-digest.mjs(新)—— 读声明、算级别、渲染正文;带 --self-test,是本仓 scripts/ 的既有测试惯例。
  • pnpm check:objectui-changeset 接进 Lint & Type Check
  • changeset:空 frontmatter(tooling-only,不发版)。

self-test 造两个一次性 git 仓库,复刻这次区间里的五种形态(releasing feat、破坏性 refactor(...)!、releasing chore(deps)、空 frontmatter 的 fix(ci)、无 changeset 的 fix(ci)),再跑真正的 bump-objectui.sh 断言产物 —— 20 条断言,含截断出声、退化出声、pre-mode 与非 pre-mode 两种级别落法、CONSOLE_BUMP 覆盖。

未改 packages/**,未碰 content/docs/releases/


🤖 Generated with Claude Code

https://claude.ai/code/session_018iARDqtrhQgz6fVHDeDkbQ


Generated by Claude Code

… commit types (#4731)

The @objectstack/console changeset written on an objectui pin bump used to
guess which frontend commits belonged in the platform release record from
conventional-commit types on the subject line, and guess the bump level the
same way. On the real range 7d9734d5e321..785b8a5d432c (53 non-merge commits)
the guess dropped all 13 releasing non-feat/fix commits — every breaking
`refactor(...)!` among them — pulled in 5 commits that release nothing, and
truncated at `head -40` in silence.

objectui already declares the answer: every releasing PR carries a
`.changeset/*.md`, an empty frontmatter block is changesets' own
release-nothing marker, and the declared level is the bump. The new
`scripts/objectui-changeset-digest.mjs` reads those declarations over the
range; `bump-objectui.sh` writes what it produces. Nothing is capped by
default, a cap that fires names the real remainder, omissions are counted in
the body, and an unwalkable range emits a list labelled degraded. Guarded by
`pnpm check:objectui-changeset` in Lint & Type Check.
@vercel

vercel Bot commented Aug 3, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
objectstack Ignored Ignored Aug 3, 2026 10:08am

Request Review

…ectui-pin-changeset-from-changesets

# Conflicts:
#	.github/workflows/lint.yml
@xuyushun441-sys
xuyushun441-sys added this pull request to the merge queue Aug 3, 2026
Merged via the queue into main with commit 59568ce Aug 3, 2026
21 checks passed
@xuyushun441-sys
xuyushun441-sys deleted the claude/issue-4731-objectui-pin-changeset-from-changesets branch August 3, 2026 10:38
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 documentation Improvements or additions to documentation size/l tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bump-objectui.sh 的 pin changeset 只收 feat|fix 且静默截断到 40 条 —— 破坏性 refactor! 进不了前端发布记录

2 participants