Skip to content
Closed
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
75 changes: 37 additions & 38 deletions .trae/jobs/auto-flow.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,66 +15,64 @@ parameters:
bumpType: auto
notCommit: true
head: ''
mode: auto
commitBeforeFlow: true
mode: browser
commitAllowEmpty: false
pushAfterCommit: true
commitMessageStrategy: auto
enforceCommit: true
commitRetry: 1
flowStep: 1
required_parameters: []
outputs:
- autotest_report
- rush_change_entries
- pr_url
- commit_message
- pushed_branch
- compare_url
- next_step_hint
success_criteria:
- flow_completed
- flow_step_completed
---

# Auto Flow Job(分支单测变更日志 →PR 串行编排
# Auto Flow Job(单步执行:单测变更日志提交 → PR

## 参数检查

- 分支参数 `head` 可选:若未提供,将通过 `git rev-parse --abbrev-ref HEAD` 推导当前分支
- 建议提供 `topic` 以优化 PR 标题;未提供时将回退为当前分支名
- 原则:不覆盖子 Job 默认参数;仅透传用户显式提供的参数

## 步骤

1. 分支预检查
## 单步模式说明

- 运行 `git rev-parse --abbrev-ref HEAD` 获取当前分支作为 `head`
- 确认当前分支不是 `main`/`develop`,且工作树状态符合提交规范
- 人工检查点:如不在开发分支,请先自行创建并切换到正确分支
- 本 Job 每次仅执行一个步骤,由 `parameters.flowStep` 指定(取值:`1|2|3|4`)。
- 步骤完成后进入人工暂停,返回 `next_step_hint` 提示你在对话中输入“执行下一步”推进到下一步。

1.1 自动提交未提交变更(当 `commitBeforeFlow==true`)

- 检查工作树:`git status --porcelain`
- 若存在未提交变更:
- `git add --all`
- 生成提交信息(按 `commitMessageStrategy`):
- `auto`:类型 `chore`;作用域为顶层或包名(如 `vchart`);主题为 `sync changes before Auto Flow`
- 最终示例:`chore(vchart): sync changes before Auto Flow`
- 运行 `git commit {{#commitAllowEmpty}}--allow-empty{{/commitAllowEmpty}} -m "<auto_message>"`
- 若 `pushAfterCommit==true`:`git push -u origin {{head}}`
- 提交后校验(当 `enforceCommit==true`):
- 运行 `git status --porcelain`,若非空则视为失败;进行最多 `commitRetry` 次重试(`git add --all && git commit -m '<auto_message>'`),仍失败则中止流程并提示处理
- 若 `commitBeforeFlow==false` 且存在未提交变更:直接失败并提示先完成提交
## 步骤

2. 运行差异驱动单测
1. 差异驱动单测(flowStep=1)

- 执行 Job:`.trae/jobs/auto-test.md`
- 传参:`sinceBranch={{baseBranch}}`(其余沿用默认)
- 传参:`sinceBranch={{baseBranch}}`
- 接收输出:`autotest_report=.trae/output/autotest.report.local.md`
- 人工检查点:打开临时报告,确认新增/更新测试与覆盖率
- 人工检查点:打开临时报告,确认新增/更新测试与覆盖率是否合理

3. 生成 Rush 变更日志
2. 生成 Rush 变更日志(flowStep=2)

- 执行 Job:`.trae/jobs/changelog-rush-smart.md`
- 传参:`sinceBranch={{baseBranch}}`、`message={{message}}`、`bumpType={{bumpType}}`、`notCommit={{notCommit}}`
- 接收输出:`rush_change_entries`
- 人工检查点:检查 `common/changes/**` 条目与摘要
- 说明:仅透传用户显式提供的参数,未提供时不传,使用子 Job 默认值
- 接收输出:`rush_change_entries`、`computed_bump_type`、`final_message`
- 人工检查点:检查 `common/changes/**` 条目与摘要是否合理

3. 智能提交(flowStep=3)

- 执行 Job:`.trae/jobs/commit-smart.md`
- 传参:
- `head={{head || (git rev-parse --abbrev-ref HEAD)}}`
- `message={{message}}`(为空时使用步骤 2 的 `final_message`)
- 说明:除 `head` 与 `message` 外,其余参数不强制设置;未提供时使用子 Job 默认值
- 接收输出:`commit_message`、`pushed_branch`
- 人工检查点:确认提交信息与推送分支是否正确

4. 创建 PR
4. 创建 PR(flowStep=4)

- 执行 Job:`.trae/jobs/pr-create.md`
- 传参:
Expand All @@ -85,11 +83,12 @@ success_criteria:
- `labels={{labels}}`
- `message={{message}}`(用于正文摘要)
- `bumpType={{bumpType}}`
- `mode={{mode}}`(auto 优先 gh → token → 浏览器 URL)
- `commitBeforeCreate=false`(已在 1.1 阶段完成自动提交)
- 接收输出:`pr_url`
- 人工检查点:最终确认并提交
- `mode={{mode}}`(交互默认 `browser`,生成 Compare URL 与本地正文)
- `localBodyFile=true`
- 说明:仅透传上述必要编排参数,不改变子 Job 输出;未提供的可选项不透传,使用子 Job 默认值
- 接收输出:`compare_url`、`generated_body_preview`
- 人工检查点:在浏览器页面完成最终提交

5. 完成

- 标记 `flow_completed`,返回 `autotest_report`、`rush_change_entries` 与 `pr_url`
- 标记 `flow_step_completed`,返回本步骤对应输出与 `next_step_hint`
13 changes: 9 additions & 4 deletions .trae/jobs/auto-test.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ parameters:
onlyNew: false
reportFormat: md
applyManualOverrides: true
replaceAutogen: true
replaceAutogen: false
dryRun: false
preview: false
stopOnError: true
focusChangedOnly: false
snapshotStrategy: combined
tempReportPath: .trae/output/autotest.report.local.md
includeWorkingTree: true
mockDefaults:
time: fixed(2020-01-01T00:00:00Z)
random: seed(42)
Expand All @@ -43,11 +44,15 @@ manual_overrides: []

## 步骤

1. 差异采集
1. 差异采集(含未提交内容,当 `includeWorkingTree==true`)

- 运行 `git fetch --all --prune`
- 运行 `git diff --name-status --diff-filter=AMR {{sinceBranch}}...HEAD`
- 对每个变更文件,运行 `git diff --unified=0 {{sinceBranch}}...HEAD <file>` 获取行级差异
- 收集已提交差异:`git diff --name-status --diff-filter=AMR {{sinceBranch}}...HEAD`
- 收集工作树差异:`git status --porcelain`
- 行级差异:
- 已提交:`git diff --unified=0 {{sinceBranch}}...HEAD <file>`
- 暂存未提交:`git diff --cached --unified=0 -- <file>`
- 未暂存:`git diff --unified=0 -- <file>`

2. 影响分析

Expand Down
54 changes: 54 additions & 0 deletions .trae/jobs/commit-smart.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
job: commit-smart
intent: git-commit-push
version: v1
domain: git
runner: trae-solo
parameters:
head: ''
commitAllowEmpty: false
pushAfterCommit: true
commitMessageStrategy: auto
message: ''
required_parameters: []
outputs:
- commit_message
- pushed_branch
success_criteria:
- commit_created_or_skipped
---

# Commit Job(智能提交与推送)

## 步骤

1. 推导分支

- 若 `parameters.head` 为空:`git rev-parse --abbrev-ref HEAD`

2. 工作树检查

- `git status --porcelain`;若无变更且 `commitAllowEmpty==false`,返回 `commit_created_or_skipped`(跳过)

3. 生成提交信息(策略 `auto`)

- 类型:按路径前缀判定(含 `docs/` → `docs`;含 `__tests__/`/`*.test.*` → `test`;否则 `chore|fix|feat` 依据 `common/changes/**` 的 `type`,缺省 `chore`)
- 作用域:`packages/<name>` 或顶层目录
- 主题:若 `message` 非空用其首行,否则:
- 有 `common/changes/**`:取最新条目的 `comment`
- 否则:`sync changes before PR (N files)`

4. 执行提交与推送

- `git add --all`
- `git commit {{#commitAllowEmpty}}--allow-empty{{/commitAllowEmpty}} -m "<auto message>"`
- 若 `pushAfterCommit==true`:`git push -u origin {{head}}`

5. 输出

- `commit_message` 与 `pushed_branch`

## 人工检查点

- 返回提交信息与结果,待确认后继续 PR 步骤。

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"comment": "chore(auto-flow): optimize auto flow",
"type": "none",
"packageName": "@visactor/vchart"
}
],
"packageName": "@visactor/vchart",
"email": "[email protected]"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"comment": "fix: fix default lineWidth for heatmap label\n\n",
"type": "none",
"packageName": "@visactor/vchart"
}
],
"packageName": "@visactor/vchart",
"email": "[email protected]"
}
2 changes: 1 addition & 1 deletion packages/vchart/src/series/heatmap/heatmap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export class HeatmapSeries<T extends IHeatmapSeriesSpec = IHeatmapSeriesSpec> ex
return;
}
this.setMarkStyle(textMark, {
fill: this.getColorAttribute(),
fill: this._spec.cell?.style?.fill ?? this.getColorAttribute(),
text: (datum: Datum) => {
return datum[this.getMeasureField()[0]];
}
Expand Down
5 changes: 5 additions & 0 deletions packages/vchart/src/theme/builtin/common/series/heatmap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,10 @@ export const heatmap: IHeatmapSeriesTheme = {
},
cellBackground: {
visible: false
},
label: {
style: {
lineWidth: 2
}
}
};
Loading