Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/bug-server-pr-bundle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ permissions:

jobs:
build-pr-bundle:
if: github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/bug-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
workflow_dispatch:
inputs:
pr_number:
description: 'PR number to test (including fork PRs)'
description: 'Fork PR number to test'
required: true
type: string
head_sha:
Expand All @@ -22,9 +22,10 @@ permissions:

jobs:
build:
if: github.event_name != 'workflow_dispatch'
if: >-
github.event_name == 'push' ||
(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Use Node.js 24.x
Expand Down
36 changes: 18 additions & 18 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion common/config/rush/version-policies.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"definitionName":"lockStepVersion","policyName":"vrenderMain","version":"1.1.11","nextBump":"patch"}]
[{"definitionName":"lockStepVersion","policyName":"vrenderMain","version":"1.1.12","nextBump":"patch"}]
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@visactor/vchart": "1.3.0",
"@visactor/vutils": "~1.0.12",
"@visactor/vgrammar": "~0.5.7",
"@visactor/vrender": "workspace:1.1.11",
"@visactor/vrender": "workspace:1.1.12",
"markdown-it": "^13.0.0",
"highlight.js": "^11.8.0",
"axios": "^1.4.0",
Expand Down
36 changes: 36 additions & 0 deletions docs/superpowers/plans/2026-09-17-bug-server-pr-routing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Bug Server PR 来源分流实现计划

**目标:** 消除同一 PR 在 Bug Server CI 与 Bug Server PR Bundle 中的重复构建。

**架构:** 按 PR head 仓库完整名称与当前仓库名称比较,在两个构建 job 上设置互斥条件。仓库内 PR 自动构建和测试,fork PR 构建产物后由维护者通过现有手动入口提交测试。

**技术栈:** GitHub Actions、actionlint、Node.js、Python。

## 约束

- 基于最新 `develop` 创建 `codex/bugserver-pr-routing`,向 `develop` 提交 PR。
- PR 目标分支维持 `main`、`develop`、`dev/**`,保留 `main` push 和手动入口。
- 维持现有构建命令、Node.js 24、Ubuntu runner、权限和产物校验边界。
- 分流采用 job 级条件;另一构建 job 显示 `skipped`,不启动 runner。

## 任务 1:修改 workflow 与说明

文件:`.github/workflows/bug-server.yml`、`.github/workflows/bug-server-pr-bundle.yml`、`tools/bugserver-trigger/README.md`、`docs/superpowers/specs/2026-09-17-bug-server-dispatch-design.md`。

- [x] 将 CI 的 `build.if` 改为 `github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)`。
- [x] 为 `build-pr-bundle` 增加 `if: github.event.pull_request.head.repo.full_name != github.repository`。
- [x] 说明手动入口依赖 fork PR 的 bundle,仓库内 PR 应重跑 CI;同步输入描述和执行边界。

## 任务 2:验证与提交

- [x] 读取实际 YAML 条件,校验仓库内 PR、外部 fork PR、同组织不同仓库 PR、`main` push、手动触发共 5 种场景。
- [x] 运行 `node --test .github/scripts/bug-server-dispatch.test.cjs`、`python3 -B -m unittest discover -s .github/scripts -p 'test_extract_bug_server_bundle.py'`、两个 workflow 的 actionlint、Prettier 与 `git diff --check`。

提交阶段通过仓库推送钩子,创建面向 `develop` 的 PR,并核对 PR 的分支及线上检查启动状态;发布结果记录在 PR 说明中。

## 本地验证结果

- 5 种事件场景通过,PR 目标分支过滤和手动提交依赖保持正确。
- Node 来源校验测试 36 项、Python ZIP 校验测试 6 项全部通过。
- actionlint 1.7.12、Prettier 和 `git diff --check` 通过。
- 未修改构建命令和测试客户端,本次不重复完整构建。线上回归结果以 PR 检查为准。
12 changes: 10 additions & 2 deletions docs/superpowers/specs/2026-09-17-bug-server-dispatch-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,21 @@

## 数据流与权限边界

1. `bug-server-pr-bundle.yml` 仅由 `pull_request` 触发。在只读仓库权限、无持久化 checkout 凭据、无 Bug Server token 的 runner 上检出准确 head SHA,执行 Rush 构建。缓存写入作用域属于该 PR,不属于默认分支。产物名为 `bug-server-pr-<number>-<sha>`,保留 7 天。
1. `bug-server-pr-bundle.yml` 仅在外部 fork 的 `pull_request` 中执行构建。在只读仓库权限、无持久化 checkout 凭据、无 Bug Server token 的 runner 上检出准确 head SHA,执行 Rush 构建。缓存写入作用域属于该 PR,不属于默认分支。产物名为 `bug-server-pr-<number>-<sha>`,保留 7 天。
2. `bug-server.yml` 的手动入口只允许默认分支,保留 `pr_number`、`head_sha`。可信脚本校验输入、base 仓库及 PR 当前 head,再从指定 PR bundle workflow 查找成功运行。
3. 来源校验绑定 workflow ID/路径、事件、运行状态、base/head 仓库 ID、源分支及 run head SHA。fork 的运行记录可能没有 PR 列表,不能因此拒绝所有外部 PR;如列表存在则还需匹配 PR 编号。
4. 选择最新匹配运行中唯一且未过期的命名产物,复核 artifact API 的 run ID、仓库 ID 与 SHA。失败时要求先成功运行 PR bundle 工作流,不回退到其他提交或较旧运行。
5. 提交 job 只检出 `github.workflow_sha` 对应的可信脚本。通过 artifact ID 下载 ZIP,只接受一个名为 `index.js` 的普通文件,最大 64 MiB。可信 Python 脚本只把文件字节写入固定位置,不按 ZIP 路径解压,不执行产物。
6. 可信 TypeScript 客户端的依赖独立安装且禁用 lifecycle scripts。仅最后的 API 调用 step 注入 `BUG_SERVER_TOKEN`;PR 元数据与产物来源由可信校验 job 提供。summary 记录 PR、SHA 和来源构建。
7. 两个 workflow 默认 `contents: read`;查询 PR 需要 `pull-requests: read`,查询/下载 artifact 需要 `actions: read`。原有 push / pull_request 自动 Bug Server 步骤保持原来的构建和测试行为。
7. 两个 workflow 默认 `contents: read`;查询 PR 需要 `pull-requests: read`,查询/下载 artifact 需要 `actions: read`。`main` push 和仓库内 PR 保留自动构建和测试。

## 按 PR 来源分流

对于目标分支为 `main`、`develop`、`dev/**` 的 PR,比较 `github.event.pull_request.head.repo.full_name` 与 `github.repository`:相等时仅执行 **Bug Server CI** 的 `build` job,不相等时仅执行 **Bug Server PR Bundle** 的 `build-pr-bundle` job。每个 PR 事件只实际构建一次;同组织的其他仓库也属于外部来源。

`pull_request` 事件过滤器不能按来源仓库过滤,因此使用 job 级 `if`。两个 workflow 仍可能出现运行记录,但另一构建 job 会显示 `skipped`,不启动 runner。`main` push 继续自动构建和测试;手动入口仍然只校验并提交 fork PR 的已有产物。仓库内 PR 需要重测时重跑 CI,不再生成手动入口需要的 bundle。

验证仓库内 PR、外部 fork PR、同组织不同仓库 PR、`main` push 和手动触发的执行矩阵,并运行 actionlint、既有 Node/Python 测试及仓库提交、推送检查。

## 维护者操作变化

Expand Down
6 changes: 6 additions & 0 deletions packages/react-vrender-utils/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"name": "@visactor/react-vrender-utils",
"entries": [
{
"version": "1.1.12",
"tag": "@visactor/react-vrender-utils_v1.1.12",
"date": "Tue, 13 Oct 2026 08:17:49 GMT",
"comments": {}
},
{
"version": "1.1.11",
"tag": "@visactor/react-vrender-utils_v1.1.11",
Expand Down
7 changes: 6 additions & 1 deletion packages/react-vrender-utils/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Change Log - @visactor/react-vrender-utils

This log was last generated on Thu, 17 Sep 2026 07:31:09 GMT and should not be manually modified.
This log was last generated on Tue, 13 Oct 2026 08:17:49 GMT and should not be manually modified.

## 1.1.12
Tue, 13 Oct 2026 08:17:49 GMT

_Version update only_

## 1.1.11
Thu, 17 Sep 2026 07:31:09 GMT
Expand Down
6 changes: 3 additions & 3 deletions packages/react-vrender-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@visactor/react-vrender-utils",
"version": "1.1.11",
"version": "1.1.12",
"description": "",
"sideEffects": false,
"main": "cjs/index.js",
Expand All @@ -27,8 +27,8 @@
"react-dom": "^18.2.0"
},
"dependencies": {
"@visactor/vrender": "workspace:1.1.11",
"@visactor/react-vrender": "workspace:1.1.11",
"@visactor/vrender": "workspace:1.1.12",
"@visactor/react-vrender": "workspace:1.1.12",
"@visactor/vutils": "~1.0.12",
"react-reconciler": "^0.29.0",
"tslib": "^2.3.1"
Expand Down
6 changes: 6 additions & 0 deletions packages/react-vrender/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"name": "@visactor/react-vrender",
"entries": [
{
"version": "1.1.12",
"tag": "@visactor/react-vrender_v1.1.12",
"date": "Tue, 13 Oct 2026 08:17:48 GMT",
"comments": {}
},
{
"version": "1.1.11",
"tag": "@visactor/react-vrender_v1.1.11",
Expand Down
7 changes: 6 additions & 1 deletion packages/react-vrender/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Change Log - @visactor/react-vrender

This log was last generated on Thu, 17 Sep 2026 07:31:09 GMT and should not be manually modified.
This log was last generated on Tue, 13 Oct 2026 08:17:49 GMT and should not be manually modified.

## 1.1.12
Tue, 13 Oct 2026 08:17:48 GMT

_Version update only_

## 1.1.11
Thu, 17 Sep 2026 07:31:09 GMT
Expand Down
4 changes: 2 additions & 2 deletions packages/react-vrender/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@visactor/react-vrender",
"version": "1.1.11",
"version": "1.1.12",
"description": "",
"sideEffects": false,
"main": "cjs/index.js",
Expand All @@ -26,7 +26,7 @@
"react": "^18.2.0"
},
"dependencies": {
"@visactor/vrender": "workspace:1.1.11",
"@visactor/vrender": "workspace:1.1.12",
"@visactor/vutils": "~1.0.12",
"react-reconciler": "^0.29.0",
"tslib": "^2.3.1"
Expand Down
6 changes: 6 additions & 0 deletions packages/vrender-animate/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"name": "@visactor/vrender-animate",
"entries": [
{
"version": "1.1.12",
"tag": "@visactor/vrender-animate_v1.1.12",
"date": "Tue, 13 Oct 2026 08:17:49 GMT",
"comments": {}
},
{
"version": "1.1.11",
"tag": "@visactor/vrender-animate_v1.1.11",
Expand Down
7 changes: 6 additions & 1 deletion packages/vrender-animate/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Change Log - @visactor/vrender-animate

This log was last generated on Thu, 17 Sep 2026 07:31:09 GMT and should not be manually modified.
This log was last generated on Tue, 13 Oct 2026 08:17:49 GMT and should not be manually modified.

## 1.1.12
Tue, 13 Oct 2026 08:17:49 GMT

_Version update only_

## 1.1.11
Thu, 17 Sep 2026 07:31:09 GMT
Expand Down
4 changes: 2 additions & 2 deletions packages/vrender-animate/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@visactor/vrender-animate",
"version": "1.1.11",
"version": "1.1.12",
"description": "",
"sideEffects": false,
"main": "cjs/index.js",
Expand Down Expand Up @@ -37,7 +37,7 @@
},
"dependencies": {
"@visactor/vutils": "~1.0.12",
"@visactor/vrender-core": "workspace:1.1.11"
"@visactor/vrender-core": "workspace:1.1.12"
},
"devDependencies": {
"@internal/bundler": "workspace:*",
Expand Down
6 changes: 6 additions & 0 deletions packages/vrender-components/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"name": "@visactor/vrender-components",
"entries": [
{
"version": "1.1.12",
"tag": "@visactor/vrender-components_v1.1.12",
"date": "Tue, 13 Oct 2026 08:17:49 GMT",
"comments": {}
},
{
"version": "1.1.11",
"tag": "@visactor/vrender-components_v1.1.11",
Expand Down
7 changes: 6 additions & 1 deletion packages/vrender-components/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Change Log - @visactor/vrender-components

This log was last generated on Thu, 17 Sep 2026 07:31:09 GMT and should not be manually modified.
This log was last generated on Tue, 13 Oct 2026 08:17:49 GMT and should not be manually modified.

## 1.1.12
Tue, 13 Oct 2026 08:17:49 GMT

_Version update only_

## 1.1.11
Thu, 17 Sep 2026 07:31:09 GMT
Expand Down
8 changes: 4 additions & 4 deletions packages/vrender-components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@visactor/vrender-components",
"version": "1.1.11",
"version": "1.1.12",
"description": "components library for dp visualization",
"sideEffects": false,
"main": "cjs/index.js",
Expand Down Expand Up @@ -69,9 +69,9 @@
"dependencies": {
"@visactor/vutils": "~1.0.12",
"@visactor/vscale": "~1.0.12",
"@visactor/vrender-core": "workspace:1.1.11",
"@visactor/vrender-kits": "workspace:1.1.11",
"@visactor/vrender-animate": "workspace:1.1.11"
"@visactor/vrender-core": "workspace:1.1.12",
"@visactor/vrender-kits": "workspace:1.1.12",
"@visactor/vrender-animate": "workspace:1.1.12"
},
"devDependencies": {
"@internal/bundler": "workspace:*",
Expand Down
Loading
Loading