Repository navigation
fix(design-lab): use the current product name in the homepage preview - #3377
Open
czs914893385 wants to merge 1 commit into
Open
czs914893385 wants to merge 1 commit into
czs914893385 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Symptom
main'sCIworkflow is red at the Frontend Build job, step Check repository hygiene(
run: pnpm run check:repo-hygiene). That step runs beforepnpm install, so once it fails everylater step of the job is skipped:
Install dependencies,Lint web UI,Run web UI tests,Build web UIand the mobile checks never run. SinceFrontend Buildis part of the required CI set,every open PR inherits the red check and no PR can see its own lint / test / build results.
On
mainthe last green push run wasc39bfb33; the two runs after it are red. This failure is notintroduced by any PR under review.
Root cause
check:repo-hygieneis a chain of six commands. Its first link,product:identity:audit(
node scripts/product-identity-audit.mjs), exits 1 with 6 findings, all of them in one file,all
retired product name (retired-product-name):design-system/apps/design-lab/src/pages/OverviewPage.tsx:94:12{ id: "bitfun", icon: "folder", name: "BitFun" },design-system/apps/design-lab/src/pages/OverviewPage.tsx:94:44namefielddesign-system/apps/design-lab/src/pages/OverviewPage.tsx:95:12{ id: "bitfun-session", indent: true, name: "New Code Session" },design-system/apps/design-lab/src/pages/OverviewPage.tsx:96:12{ id: "bitfun-welcome", indent: true, ... },design-system/apps/design-lab/src/pages/OverviewPage.tsx:97:12{ id: "bitfun-more", name: t("design.homePreview.showMore"), ... },design-system/apps/design-lab/src/pages/OverviewPage.tsx:187:118<Button ... variant="text">BitFun</Button>Raw output on
main:The rule lives in
scripts/product-identity-audit.mjs: the retired token is banned in productionsources (matched as
(?<!open)bitfun, case-insensitive). Its allowlist covers only thedata-directory ignore entry, the one-time migration documents / host deploy files and two external
GitHub identifiers.
design-systemis deliberately not allowlisted, and it should stay that way:this file is a picture of the product's own UI, so the canonical name is the correct copy.
The lines were introduced by
5d27431c(
feat(design-lab): Cover every surface and unify the Lab's chrome type). The same audit passes onthat commit's parent.
The change
One file, 5 lines:
design-system/apps/design-lab/src/pages/OverviewPage.tsx.The demo row
idvalues are renamed together with the display strings, because the audit matches theretired token anywhere on the line, not just in user-visible copy. No other line is touched: no
reformatting, no reordering, no unrelated edits.
Before renaming, the whole repository was searched for the affected demo ids
(
bitfun,bitfun-session,bitfun-welcome,bitfun-more) and for the retired display string.No test, snapshot, e2e spec or sibling component references these ids - the only hits are the flagged
lines themselves (plus already-canonical
openbitfun-session-*names and the allowlistedlegacy-migration data). So this stays a one-file change.
Verification (on a clone of
mainat base sha7ac47e65, patch applied)node scripts/product-identity-audit.mjs8767 text files scanned, 9100 repository files checked)pnpm run check:repo-hygiene(the CI step)pnpm --dir design-system/apps/design-lab run type-checkpnpm --dir design-system/apps/design-lab run buildpnpm --dir design-system/apps/design-lab run testpnpm run lint:webgit status --porcelaindesign-system/apps/design-lab/src/pages/OverviewPage.tsxThe other five links of the hygiene chain were also run individually on pristine
main, to make surethe audit was the only blocker:
product:identity:audit:testexit 0,release:version:checkexit 0,check-repo-hygiene.test.mjsexit 0,check-repo-hygiene.mjsexit 0,update-models-dev-snapshot.mjs --checkexit 0. With the rename applied, the full chain exits 0end to end, so the CI step passes and the job finally reaches
pnpm installand the steps after it.CI evidence on this PR
Run:
https://github.com/GCWing/OpenBitFun/actions/runs/38443072449, head shab49b7686,Frontend Build job
115454553765.Check repository hygieneInstall dependenciesValidate interactive capability contractTest core boundary contractsCheck core boundariesmain, different check)Check repository hygieneis green and the job now runs past it, so the step that was blocking the CIof every open PR is fixed by this change.
The job then stops at
Check core boundaries, which is a different check thatmainitselfcurrently fails: the contract reports
src/crates/execution/agent-runtime/src/agents.rs:1: agent-runtime builtin agent catalog must own latest-main mode/subagent categories, visibility, and default model facts; missing GeneralPurpose runtime default model mapping. That finding is absent ataed8c001andaff65fa6and present at7ac47e65(the newest commit onmain,fix(agents): expose swarm configuration and align subagent defaults, which also last touched that file). It is a separate inherited defect, unrelated to productidentity, so this PR deliberately does not touch it. Until it is fixed separately, the lint / test /
build steps of that job stay skipped - but they now skip after the hygiene gate instead of before
dependency installation.
Note on the preview copy
This page renders a preview of the product's own home surface, so a user of the real app sees
OpenBitFunthere; the retired spelling was stale demo data. The canonical name is therefore theright copy, and the
idvalues now match it. If the design-lab authors would rather use differentwording or ids (for example a neutral placeholder), we are happy to adapt - the only hard requirement
is that the retired product token does not reappear in production sources.
Out of scope (reported, deliberately not changed here)
pnpm --dir design-system/apps/design-lab run testhas one failing subtest,flow-chat-mock-contract.test.mjs-conversation bubble geometry and color stay aligned with production:.flow-chat-mock__user-bubblesetsbackground: var(--openbitfun-color-action-quiet-hover)while the product's
.user-message-itemusestransparent. It fails identically on a pristineworktree of base sha
7ac47e65, so it is pre-existing and unrelated to this rename. It is not part ofthe CI gate (no workflow references
design-systemat all), and fixing it would be an unrelateddesign-system change, so it is left untouched.
中文说明
症状
main的CI在 Frontend Build 任务的 Check repository hygiene(pnpm run check:repo-hygiene)一步变红。该步骤在
pnpm install之前执行,因此它一失败,同一个 job 里后面的步骤(安装依赖、Lint web UI、Web UI 测试、Web UI 构建、移动端检查)全部被跳过。由于这个 job 属于必需检查,
所有 open PR 都会继承这条红叉,任何 PR 都看不到自己的 lint / 测试 / 构建结果。
main上最近一次绿色的 push 运行是c39bfb33,之后两次都是红的。该失败与任何在审 PR 无关。根因
check:repo-hygiene是一条由六条命令组成的链,第一条product:identity:audit(
node scripts/product-identity-audit.mjs)就以 6 条 finding 退出 1,全部集中在同一个文件,类型都是
retired product name (retired-product-name):OverviewPage.tsx的:94:12、:94:44、:95:12、:96:12、:97:12、:187:118(上表已按行列出行内容)。规则位于
scripts/product-identity-audit.mjs:旧 token 在生产源码中被禁(匹配(?<!open)bitfun,大小写不敏感),白名单只放行数据目录忽略项、一次性数据迁移文档 / host 部署文件,以及两个外部 GitHub 标识。
design-system不在白名单里,而且也不应该进去:这个文件是产品自身界面的预览图,正式产品名才是正确的文案。这些行由
5d27431c(feat(design-lab): Cover every surface and unify the Lab's chrome type)引入,其父提交上同一审计是通过的。
改动
只改一个文件、5 行:
design-system/apps/design-lab/src/pages/OverviewPage.tsx。演示行的id与显示名一起改成正式名
OpenBitFun/openbitfun-*,因为审计是按 token 匹配整行,id里的旧 token 同样会命中。没有重新格式化、没有调整顺序、没有触碰无关行。
改名前已对全仓库检索这些演示 id(
bitfun、bitfun-session、bitfun-welcome、bitfun-more)与旧显示名:没有任何测试、快照、e2e 用例或兄弟组件引用它们,命中的只有被标记的那几行本身,
因此本次改动保持单文件。
验证
在
main(base sha7ac47e65)的克隆上加补丁:node scripts/product-identity-audit.mjs由 exit 1变为 exit 0;完整 CI 步骤
pnpm run check:repo-hygiene由 exit 1 变为 exit 0;design-lab的type-check与build均为 exit 0,lint:web为 0 error / 10 个既有 warning;git status --porcelain只剩这一个预期文件。链条其余五条命令在干净main上单独跑也都是 exit 0,说明唯一阻塞点就是产品身份审计;补丁之后整条链全部通过,CI 将能够走到安装依赖与后续的 lint / 测试 / 构建步骤。
CI 实测结果
运行:
https://github.com/GCWing/OpenBitFun/actions/runs/38443072449(head shab49b7686,Frontend Build job
115454553765)。第 5 步Check repository hygiene已 success,第 6 步
Install dependencies、第 7 / 8 步也均 success,说明原先阻断所有 PR 的关卡已经修好。job 随后停在第 9 步
Check core boundaries——这是另一条检查,main自身当前也不通过:src/crates/execution/agent-runtime/src/agents.rs:1缺少 GeneralPurpose 的 runtime 默认模型映射。该问题在
aed8c001、aff65fa6上不存在,只出现在main最新提交7ac47e65(
fix(agents): expose swarm configuration and align subagent defaults,也正是最后改动该文件的提交)。它属于另一类遗留缺陷、与产品身份无关,因此本 PR 有意不动它;在它被单独修复前,
该 job 的 lint / 测试 / 构建步骤仍会被跳过,但跳过的位置已经变成"卫生关卡之后、依赖安装之后"。
说明
该页面预览的是产品自有界面的样子,真实应用里用户看到的就是
OpenBitFun,旧拼写属于过期的演示数据。如果 design-lab 的作者更希望用别的措辞或 id(例如中性的占位名),我们很乐意配合调整,
唯一硬性要求是旧产品 token 不要重新出现在生产源码中。
本次不处理(已报告)
design-lab的测试里有 1 个既有失败(flow-chat-mock-contract.test.mjs:.flow-chat-mock__user-bubble的 background 与产品侧
.user-message-item不一致),在 base sha7ac47e65的干净工作树上同样失败,与本次改名无关,也不在 CI 关卡范围(没有任何 workflow 引用
design-system),故保持原样、不在本 PR 扩大范围。