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
55 changes: 55 additions & 0 deletions .github/scripts/bug-server-gray-scope.test.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
const test = require('node:test');
const assert = require('node:assert/strict');
const fs = require('node:fs');
const os = require('node:os');
const path = require('node:path');
const { spawnSync } = require('node:child_process');
const source = fs.readFileSync(path.join(__dirname, '../workflows/bug-server.yml'), 'utf8');
const gate = / gray-scope:\n([\s\S]*?)\n build:/.exec(source)?.[1];
assert(gate, '缺少独立交接 job');
assert.match(gate, /permissions: \{\}/);
assert.doesNotMatch(gate, /uses:|checkout/);
assert.match(source, / build:\n needs: gray-scope\n if: (?:>-\n )?needs.gray-scope.outputs.skip != 'true'/);
const script = / run: \|\n([\s\S]*)/.exec(gate)[1].replace(/^ /gm, '');
const repository = 'VisActor/VRender';
const original = { EVENT_NAME:'pull_request', HEAD_REF:'fix/normal', HEAD_REPOSITORY:repository, BASE_REPOSITORY:repository,
BASE_REF:'develop', REPOSITORY:repository, HEAD_REPOSITORY_ID:'649514587', BASE_REPOSITORY_ID:'649514587', CREATED_AT:'2026-10-29T08:00:01Z', INTERNAL_SINCE:'' };
const cutoff = String(Date.parse('2026-10-29T08:00:00Z'));

// 直接执行 workflow 的真实 Bash/Python,临时输出在每次调用后回收。
function runGate(env) {
const directory = fs.mkdtempSync(path.join(os.tmpdir(), 'photo-ci-handoff-'));
try {
const output = path.join(directory,'output'); fs.writeFileSync(output,'');
const result = spawnSync('/bin/bash',['--noprofile','--norc','-e','-c',script],{encoding:'utf8',timeout:10000,env:{PATH:'/usr/bin:/bin',...original,...env,GITHUB_OUTPUT:output}});
return { status:result.status, output:fs.readFileSync(output,'utf8'), stderr:result.stderr };
} finally { fs.rmSync(directory,{recursive:true,force:true}); }
}

test('仅新内部 PR 交接;起点未配置、历史、fork、push 和人工入口保持旧流程', () => {
for (const [env,skip] of [
[{},false], [{INTERNAL_SINCE:cutoff},true],
...['main','dev/test','Develop',''].map(BASE_REF => [{INTERNAL_SINCE:cutoff,BASE_REF},false]),
[{INTERNAL_SINCE:cutoff,CREATED_AT:'2026-10-29T08:00:00Z'},false],
[{INTERNAL_SINCE:cutoff,CREATED_AT:'2026-10-29T07:59:59Z'},false],
[{INTERNAL_SINCE:cutoff,DRAFT:'true'},true],
[{INTERNAL_SINCE:cutoff,HEAD_REPOSITORY:'contributor/repo'},false],
[{INTERNAL_SINCE:cutoff,HEAD_REPOSITORY:repository.toUpperCase()},false],
[{INTERNAL_SINCE:cutoff,BASE_REPOSITORY:'contributor/repo'},false],
[{INTERNAL_SINCE:cutoff,REPOSITORY:'contributor/repo'},false],
[{INTERNAL_SINCE:'invalid',EVENT_NAME:'push'},false],
[{INTERNAL_SINCE:'invalid',EVENT_NAME:'workflow_dispatch'},false],
]) {
const result=runGate(env); assert.equal(result.status,0,result.stderr); assert.equal(result.output,`skip=${skip}\n`);
}
});

test('已配置内部交接却元数据或起点非法时停止旧构建,避免重复派发', () => {
for (const env of [
{INTERNAL_SINCE:'invalid'}, {INTERNAL_SINCE:'0'}, {INTERNAL_SINCE:'8640000000000001'},
{INTERNAL_SINCE:'1e12'}, {INTERNAL_SINCE:'1793257200000;echo injected'},
{HEAD_REPOSITORY_ID:'124'}, {BASE_REPOSITORY_ID:'123',HEAD_REPOSITORY_ID:'123'}, {BASE_REPOSITORY_ID:'0',HEAD_REPOSITORY_ID:'0'},
{CREATED_AT:''}, {CREATED_AT:'2026-02-30T08:00:00Z'}, {CREATED_AT:'2026-10-29T08:00:01'},
{CREATED_AT:'2026-10-29T08:00:01+00:00'},
]) { const result=runGate({INTERNAL_SINCE:cutoff,...env}); assert.notEqual(result.status,0); assert.equal(result.output,''); }
});
50 changes: 48 additions & 2 deletions .github/workflows/bug-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,56 @@ permissions:
contents: read

jobs:
gray-scope:
# 无权限、不检出仓库;仅以 GitHub 事件元数据和受控起点交接旧 Photo。
runs-on: ubuntu-latest
permissions: {}
outputs:
skip: ${{ steps.scope.outputs.skip }}
steps:
- id: scope
shell: bash
env:
EVENT_NAME: ${{ github.event_name }}
HEAD_REPOSITORY: ${{ github.event.pull_request.head.repo.full_name }}
BASE_REPOSITORY: ${{ github.event.pull_request.base.repo.full_name }}
BASE_REF: ${{ github.event.pull_request.base.ref }}
HEAD_REPOSITORY_ID: ${{ github.event.pull_request.head.repo.id }}
BASE_REPOSITORY_ID: ${{ github.event.pull_request.base.repo.id }}
CREATED_AT: ${{ github.event.pull_request.created_at }}
REPOSITORY: ${{ github.repository }}
INTERNAL_SINCE: ${{ vars.VISACTOR_WORKFLOW_INTERNAL_SINCE }}
run: |
# 仅交接目标 develop;其他分支保留旧 Photo,新 Draft 等待 ready。
skip=$(python3 - <<'PY'
import os, re
from datetime import datetime
e = os.environ
skip = False
if (e['EVENT_NAME'] == 'pull_request' and e['REPOSITORY'] == 'VisActor/VRender'
and e['HEAD_REPOSITORY'] == e['BASE_REPOSITORY'] == e['REPOSITORY']
and e['BASE_REF'] == 'develop' and e['INTERNAL_SINCE']):
# 已配置交接却缺失可信元数据时停止旧构建,避免两套 Photo 同时执行。
since = e['INTERNAL_SINCE']
if not re.fullmatch(r'[1-9][0-9]{0,15}', since) or int(since) > 8640000000000000:
raise SystemExit('Invalid VISACTOR_WORKFLOW_INTERNAL_SINCE')
if e['BASE_REPOSITORY_ID'] != '649514587' or e['HEAD_REPOSITORY_ID'] != e['BASE_REPOSITORY_ID']:
raise SystemExit('Invalid internal repository identity')
created = e['CREATED_AT']
if not re.fullmatch(r'[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z', created):
raise SystemExit('Invalid PR creation time')
skip = int(datetime.fromisoformat(created.replace('Z', '+00:00')).timestamp() * 1000) > int(since)
print('true' if skip else 'false')
PY
)
echo "skip=$skip" >> "$GITHUB_OUTPUT"

build:
needs: gray-scope
if: >-
github.event_name == 'push' ||
(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)
needs.gray-scope.outputs.skip != 'true' &&
(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
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ jobs:
# run: |
# fc-list

- name: Photo CI handoff contract tests
run: node --test .github/scripts/bug-server-gray-scope.test.cjs

# Install rush
- name: Install native deps for node-canvas (macOS)
if: runner.os == 'macOS'
Expand All @@ -41,6 +44,8 @@ jobs:
run: node common/scripts/install-run-rush.js update --bypass-policy
- name: Install rush
run: node common/scripts/install-run-rush.js install --bypass-policy
- name: Visual runner contract tests
run: node --test packages/vrender/scripts/visual-test.test.mjs
- name: Source tests (without build artifacts)
run: node common/scripts/install-run-rush.js test --only tag:package
- run: node common/scripts/install-run-rush.js build --only tag:package
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,6 @@ spec-types
*.tsbuildinfo
.omx/
.worktrees/

# 本地视觉运行产物
.vrender-visual/
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,7 @@ Small streams converge to make great rivers and seas!
# License

[MIT License](./LICENSE)

## Playwright 视觉回归

首批用例、运行命令、报告协议和维护说明见[本地视觉回归指南](packages/vrender/__tests__/visual/README.md)。该入口不改变现有 Photo CI 或生产工作流启用范围。
4 changes: 4 additions & 0 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,7 @@ st.defaultLayer.add(sy);
# 许可证

[MIT 协议](./LICENSE)

## Playwright 视觉回归

首批用例、运行命令、报告协议和维护说明见[本地视觉回归指南](packages/vrender/__tests__/visual/README.md)。该入口不改变现有 Photo CI 或生产工作流启用范围。
70 changes: 50 additions & 20 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.14","nextBump":"patch"}]
[{"definitionName":"lockStepVersion","policyName":"vrenderMain","version":"1.1.15","nextBump":"patch"}]
14 changes: 14 additions & 0 deletions docs/assets/changelog/en/changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# v1.1.14

2026-11-02


**What's Changed**

* fix(datazoom): preserve dragging across equivalent delay updates by @xile611 in https://github.com/VisActor/VRender/pull/2150


**Full Changelog**: https://github.com/VisActor/VRender/compare/v1.1.13...v1.1.14

[more detail about v1.1.14](https://github.com/VisActor/VRender/releases/tag/v1.1.14)

# v1.1.13

2026-10-30
Expand Down
Loading
Loading