Skip to content

112: 正式下线 bi_share 口令分享功能(方案 A) - #163

Merged
micln merged 1 commit into
masterfrom
agent/112
Sep 27, 2026
Merged

micln merged 1 commit into
masterfrom
agent/112

Conversation

@micln

@micln micln commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

做了什么

按 issue #112 人工确认的**方案 A(全部下线)**收束 bi_share「半下线」中间态:前端入口早已无、后端端点与级联软删仍全量在册,且 /share/:token 的 302 落地页指向 BrowserRouter 不识别的 /#/share/...(历史分享链接实为坏链)。

怎么做

  • 先解除依赖:删除图表/数据集/数据源三处级联软删对 bi_share 的 UPDATE(否则删表会让删除操作在事务内报错回滚)。
  • 后端下线:删 handler/share.go、service/share/、entity/share.go、model.Share、四份 /api/shares* 端点、/share/:token 公开视图;SetupRoutes 随之去掉仅服务该视图的 serveWebUI 形参。
  • 前端下线:删 pages/Share.tsx、pages/ShareView.tsx、/shares 与 /share/:token 路由、sharesApi、store.createShare,及全部 share.* / shareView.* / nav.shares i18n 文案(zh/en 同步,由 messages.test 守卫)。
  • 契约同步:api/openapi.yaml 移除 share paths/schemas/params,重跑双端 api-gen(gen_types.go / gen_types.ts)。前端生成物用仓库外 openapi-typescript@7.13.0 + typescript@5.9.3 跑法(仓内 typescript@7 缺 ts.factory),并先用未改动 openapi 逐字节复现已入库生成物再套用本次改动。
  • 迁移 00008:只给 bi_share 打 RETIRED 注释、不 DROP(保留历史行比删更安全,软删体系本就绝不物理删除)。

测试证据

  • 三处 soft_delete_test 改为断言级联不再触碰 bi_share。
  • go test -race ./... 全绿;vitest 690 passed;biome check + tsc --noEmit 干净。
  • 真实浏览器 E2E(单进程 :24452 + PG 192.168.10.70):
    • 顶部导航无「分享」项(仪表盘/图表/分析/数据集/数据源);
    • 图表列表页正常加载真实数据、布局健康;
    • /shares、/share/abc123 仅渲染 SPA 外壳,不再出分享管理页/密码页,无应用级 console 错误;
    • 建→删一个临时图表走通级联路径(code 20000 status ok,删后 20300 not found)。

Closes #112

前端入口早已移除、后端端点与级联软删仍全量在册,且 /share 的 302 落地页
指向 BrowserRouter 不识别的 hash 路径(历史分享链接实为坏链)。按人工确认的
「全部下线」方案 A 收束这一半下线中间态:

- 先解除删除图表/数据集/数据源三处级联软删对 bi_share 的依赖(否则删表会让
  删除操作在事务内回滚);
- 删除 handler / service / entity / model / 四份 /api/shares 端点 / /share/:token
  公开视图;SetupRoutes 随之去掉仅服务该视图的 serveWebUI 形参;
- 删除前端 Share.tsx / ShareView.tsx、/shares 与 /share/:token 路由、sharesApi、
  store.createShare,及全部 share.* / shareView.* / nav.shares i18n 文案;
- 契约同步:openapi.yaml 移除 share paths/schemas/params,重跑双端 api-gen
  (gen_types.go / gen_types.ts);
- 迁移 00008 只给 bi_share 打 RETIRED 注释、不 DROP(保留历史行比删更安全)。

测试:
- 三处 soft_delete_test 改为断言级联不再触碰 bi_share;
- go test -race ./... 全绿;vitest 690 通过;biome + tsc 干净;
- 真实浏览器 E2E(单进程 :24452 + PG):导航无「分享」、图表页正常、/shares 与
  /share/:token 仅渲染 SPA 外壳不再出分享页、建删图表走通级联路径。
@micln micln added the needs-review Agent 已提交 PR,等待评审 Agent 做 Review + E2E label Sep 27, 2026
@micln
micln merged commit e2ecb6b into master Sep 27, 2026
2 checks passed
@micln
micln deleted the agent/112 branch September 27, 2026 16:55
@micln micln removed the needs-review Agent 已提交 PR,等待评审 Agent 做 Review + E2E label Sep 27, 2026
@micln

micln commented Sep 27, 2026

Copy link
Copy Markdown
Contributor Author

✅ Review Agent 复核通过:代码 review + 本地构建/单测(前后端)+ 内置浏览器端到端实测(golden path 已验证),已合并。

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.

[Architect] bi_share 遗留链路:无 UI 入口但端点与级联软删仍在,302 落地页与 BrowserRouter 不匹配

1 participant