@spaceflow/review 0.58.0 → 0.60.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +66 -0
- package/dist/index.js +6 -6
- package/package.json +2 -2
- package/src/issue-verify.service.ts +2 -2
- package/src/review.service.ts +15 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,71 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.59.0](https://github.com/Lydanne/spaceflow/compare/@spaceflow/review@0.58.0...@spaceflow/review@0.59.0) (2026-03-02)
|
|
4
|
+
|
|
5
|
+
### 新特性
|
|
6
|
+
|
|
7
|
+
* **review-summary:** 实现 review-summary 命令核心功能 ([5964eec](https://github.com/Lydanne/spaceflow/commit/5964eec0e2ee4ac46f74808466429b0edc0cbaa1))
|
|
8
|
+
* **review-summary:** 新增文件过滤功能并优化缺陷率计算 ([9655f82](https://github.com/Lydanne/spaceflow/commit/9655f828cec77c4a7db29ae1cda59fd3ea10ceab))
|
|
9
|
+
|
|
10
|
+
### 修复BUG
|
|
11
|
+
|
|
12
|
+
* **actions:** 修正 GitHub Actions 路径并优化命令行选项 ([50a9946](https://github.com/Lydanne/spaceflow/commit/50a99464633afe234ef56d4a081c6d04686b3e57))
|
|
13
|
+
|
|
14
|
+
### 代码重构
|
|
15
|
+
|
|
16
|
+
* **core:** 统一插件配置中的 'extensions' 为 'skills' ([50646a0](https://github.com/Lydanne/spaceflow/commit/50646a061f66ec6935c66199d78915b9d7896bd3))
|
|
17
|
+
|
|
18
|
+
### 文档更新
|
|
19
|
+
|
|
20
|
+
* **docs:** 统一扩展类型命名:extension 改为 skill ([96db479](https://github.com/Lydanne/spaceflow/commit/96db47948981c0c2b5860c2835f86dec77736cf0))
|
|
21
|
+
* 更新 MCP 架构为 Meta-tool 代理模式并统一导出类型命名 ([f60c53b](https://github.com/Lydanne/spaceflow/commit/f60c53b103f24e8a4123e4c4ec850885cb40f7d7))
|
|
22
|
+
* 简化 MCP 工具声明方式并完善扩展系统文档 ([9cdcab9](https://github.com/Lydanne/spaceflow/commit/9cdcab986559bd34c75e48b6c380c74516adb05c))
|
|
23
|
+
|
|
24
|
+
### 其他修改
|
|
25
|
+
|
|
26
|
+
* **core:** released version 0.22.0 [no ci] ([68aa47d](https://github.com/Lydanne/spaceflow/commit/68aa47df425eb9d1ceac1237fee3cc1b29de668f))
|
|
27
|
+
* **publish:** released version 0.46.0 [no ci] ([68ebfc3](https://github.com/Lydanne/spaceflow/commit/68ebfc32bfb5b39354947f08b73306b5f8512fdf))
|
|
28
|
+
* **review-summary:** released version 0.23.0 [no ci] ([f6681ec](https://github.com/Lydanne/spaceflow/commit/f6681ecdcd8f8036da3c4ac7778e5cc75af59c9f))
|
|
29
|
+
* **review-summary:** released version 0.24.0 [no ci] ([690e9ed](https://github.com/Lydanne/spaceflow/commit/690e9ed64b197f50e201afe73dc55e866867a7fd))
|
|
30
|
+
* **review-summary:** released version 0.25.0 [no ci] ([4eaca03](https://github.com/Lydanne/spaceflow/commit/4eaca0397411585112697e6800b66484bd73ffde))
|
|
31
|
+
* **review-summary:** released version 0.26.0 [no ci] ([5e8dedf](https://github.com/Lydanne/spaceflow/commit/5e8dedf10cb7104dcc15550d7f5ba05f10cae7d3))
|
|
32
|
+
* **scripts:** released version 0.23.0 [no ci] ([2f18d22](https://github.com/Lydanne/spaceflow/commit/2f18d2274e83b65ce006dceed47a985942c8dd1d))
|
|
33
|
+
* **shell:** released version 0.23.0 [no ci] ([0668aa9](https://github.com/Lydanne/spaceflow/commit/0668aa97671ca235509bef547503c301237324f9))
|
|
34
|
+
|
|
35
|
+
## [0.58.0](https://github.com/Lydanne/spaceflow/compare/@spaceflow/review@0.57.0...@spaceflow/review@0.58.0) (2026-03-02)
|
|
36
|
+
|
|
37
|
+
### 新特性
|
|
38
|
+
|
|
39
|
+
* **actions:** 增强对 Gitea 平台的环境变量支持 ([21ba3da](https://github.com/Lydanne/spaceflow/commit/21ba3daa182083ecaec0113de91caf2ab1068000))
|
|
40
|
+
* **actions:** 支持 Gitea 作为 Git Provider ([4c88b36](https://github.com/Lydanne/spaceflow/commit/4c88b36d97ab49a322bac571385b0e57029676ff))
|
|
41
|
+
* **core:** 增强对 Gitea 平台的支持并修复类型转换 ([bfbb45c](https://github.com/Lydanne/spaceflow/commit/bfbb45c521035c80f0e81f5572d5aa1b554405f7))
|
|
42
|
+
* **publish:** 支持 Gitea 环境变量作为 CI 配置来源 ([cd1ba77](https://github.com/Lydanne/spaceflow/commit/cd1ba778617731ef85f9851883122175a99d72ac))
|
|
43
|
+
* **review-summary:** 新增 defect-rate 缺陷率评分策略 ([2777f4d](https://github.com/Lydanne/spaceflow/commit/2777f4da6d364cbc801792f4fa7ac6323da5e1bc))
|
|
44
|
+
* **review-summary:** 新增 issue-based 评分策略并更新文档 ([b6d923e](https://github.com/Lydanne/spaceflow/commit/b6d923e060aafd0b298a39d6fdc3e2f76facf1f3))
|
|
45
|
+
* **review:** 支持从 Gitea Actions 事件文件解析 PR 编号 ([09e2e58](https://github.com/Lydanne/spaceflow/commit/09e2e58d84f773b8a3184feb73b90cb110993ebd))
|
|
46
|
+
|
|
47
|
+
### 文档更新
|
|
48
|
+
|
|
49
|
+
* **docs:** 更新 review-summary 命令的 CI 配置示例 ([8b2b2c5](https://github.com/Lydanne/spaceflow/commit/8b2b2c55ed497619cbb91bd4fd2e5124b6f5ac37))
|
|
50
|
+
* **docs:** 更新 review-summary 命令的 CI 集成示例 ([60c5b70](https://github.com/Lydanne/spaceflow/commit/60c5b70695aa6a4c9cae1e3936670b34d5486792))
|
|
51
|
+
* **docs:** 更新环境变量参考文档,增加 GitLab 支持并优化 Gitea 说明 ([a02f8e0](https://github.com/Lydanne/spaceflow/commit/a02f8e0309368334bc77a331f65338435657eddb))
|
|
52
|
+
* **review-summary:** 更新错误信息以支持 Gitea 环境变量 ([cd02818](https://github.com/Lydanne/spaceflow/commit/cd028183fe7e14d993566e8dc49849b07d2540d9))
|
|
53
|
+
* **scripts:** 更新错误信息以支持 Gitea 环境变量 ([9a9d7f2](https://github.com/Lydanne/spaceflow/commit/9a9d7f20a63bea4cc13d284ed41bc9c4f4aa6595))
|
|
54
|
+
* **shell:** 更新错误信息以支持 Gitea 环境变量 ([72c51d7](https://github.com/Lydanne/spaceflow/commit/72c51d792c140d44d8aa3cb05666de72d170a185))
|
|
55
|
+
* 修复 GitHub Actions 配置示例的 Markdown 渲染问题 ([01daec5](https://github.com/Lydanne/spaceflow/commit/01daec551f2e23ab70357f88b7789897922064a7))
|
|
56
|
+
|
|
57
|
+
### 测试用例
|
|
58
|
+
|
|
59
|
+
* **core:** 修复测试用例中的导入和模拟函数实现 ([0137d4b](https://github.com/Lydanne/spaceflow/commit/0137d4b400f272ce7f7ba74fc5b37fcc453ed717))
|
|
60
|
+
|
|
61
|
+
### 其他修改
|
|
62
|
+
|
|
63
|
+
* **core:** released version 0.21.0 [no ci] ([7fa4381](https://github.com/Lydanne/spaceflow/commit/7fa438124cc27316ad5f37d5cbacc848ebd3b9df))
|
|
64
|
+
* **publish:** released version 0.45.0 [no ci] ([9bd3bbe](https://github.com/Lydanne/spaceflow/commit/9bd3bbe725a3362f762a1407c6a92a993359dfe5))
|
|
65
|
+
* **review-summary:** released version 0.22.0 [no ci] ([e0fde59](https://github.com/Lydanne/spaceflow/commit/e0fde59b23109f8323bd247ab2c1f553812284e1))
|
|
66
|
+
* **scripts:** released version 0.22.0 [no ci] ([f482504](https://github.com/Lydanne/spaceflow/commit/f48250486906016b414a7b00aabac342c1399045))
|
|
67
|
+
* **shell:** released version 0.22.0 [no ci] ([e716369](https://github.com/Lydanne/spaceflow/commit/e716369f57bfa20e710d354245c54d3a80e701f4))
|
|
68
|
+
|
|
3
69
|
## [0.57.0](https://github.com/Lydanne/spaceflow/compare/@spaceflow/review@0.56.0...@spaceflow/review@0.57.0) (2026-03-02)
|
|
4
70
|
|
|
5
71
|
### 新特性
|
package/dist/index.js
CHANGED
|
@@ -3822,8 +3822,8 @@ ${fileChanges || "无"}`;
|
|
|
3822
3822
|
// 将变更文件的历史 issue 标记为无效
|
|
3823
3823
|
let invalidatedCount = 0;
|
|
3824
3824
|
const updatedIssues = issues.map((issue)=>{
|
|
3825
|
-
// 如果 issue
|
|
3826
|
-
if (issue.fixed || issue.valid === "false") {
|
|
3825
|
+
// 如果 issue 已修复、已解决或已无效,不需要处理
|
|
3826
|
+
if (issue.fixed || issue.resolved || issue.valid === "false") {
|
|
3827
3827
|
return issue;
|
|
3828
3828
|
}
|
|
3829
3829
|
// 如果 issue 所在文件有变更,标记为无效
|
|
@@ -3863,8 +3863,8 @@ ${fileChanges || "无"}`;
|
|
|
3863
3863
|
let updatedCount = 0;
|
|
3864
3864
|
let invalidatedCount = 0;
|
|
3865
3865
|
const updatedIssues = issues.map((issue)=>{
|
|
3866
|
-
// 如果 issue
|
|
3867
|
-
if (issue.fixed || issue.valid === "false") {
|
|
3866
|
+
// 如果 issue 已修复、已解决或无效,不需要更新行号
|
|
3867
|
+
if (issue.fixed || issue.resolved || issue.valid === "false") {
|
|
3868
3868
|
return issue;
|
|
3869
3869
|
}
|
|
3870
3870
|
const patch = filePatchMap.get(issue.file);
|
|
@@ -4123,7 +4123,7 @@ class IssueVerifyService {
|
|
|
4123
4123
|
continue;
|
|
4124
4124
|
}
|
|
4125
4125
|
// valid === 'false' 的问题跳过复查(已确认无效的问题无需再次验证)
|
|
4126
|
-
if (issue.valid ===
|
|
4126
|
+
if (issue.valid === FALSE) {
|
|
4127
4127
|
if (shouldLog(verbose, 1)) {
|
|
4128
4128
|
console.log(` ⏭️ 跳过无效问题: ${issue.file}:${issue.line} (${issue.ruleId})`);
|
|
4129
4129
|
}
|
|
@@ -4213,7 +4213,7 @@ class IssueVerifyService {
|
|
|
4213
4213
|
if (result) {
|
|
4214
4214
|
const updatedIssue = {
|
|
4215
4215
|
...issue,
|
|
4216
|
-
valid: result.valid ? TRUE : FALSE
|
|
4216
|
+
valid: issue.fixed || issue.resolved ? TRUE : result.valid ? TRUE : FALSE
|
|
4217
4217
|
};
|
|
4218
4218
|
if (result.fixed) {
|
|
4219
4219
|
if (shouldLog(verbose, 1)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spaceflow/review",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.60.0",
|
|
4
4
|
"description": "Spaceflow 代码审查插件,使用 LLM 对 PR 代码进行自动审查",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Lydanne",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@spaceflow/cli": "0.38.0"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"@spaceflow/core": "0.
|
|
31
|
+
"@spaceflow/core": "0.23.0"
|
|
32
32
|
},
|
|
33
33
|
"spaceflow": {
|
|
34
34
|
"type": "flow",
|
|
@@ -92,7 +92,7 @@ export class IssueVerifyService {
|
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
// valid === 'false' 的问题跳过复查(已确认无效的问题无需再次验证)
|
|
95
|
-
if (issue.valid ===
|
|
95
|
+
if (issue.valid === FALSE) {
|
|
96
96
|
if (shouldLog(verbose, 1)) {
|
|
97
97
|
console.log(` ⏭️ 跳过无效问题: ${issue.file}:${issue.line} (${issue.ruleId})`);
|
|
98
98
|
}
|
|
@@ -201,7 +201,7 @@ export class IssueVerifyService {
|
|
|
201
201
|
if (result) {
|
|
202
202
|
const updatedIssue: ReviewIssue = {
|
|
203
203
|
...issue,
|
|
204
|
-
valid: result.valid ? TRUE : FALSE,
|
|
204
|
+
valid: issue.fixed || issue.resolved ? TRUE : result.valid ? TRUE : FALSE,
|
|
205
205
|
};
|
|
206
206
|
|
|
207
207
|
if (result.fixed) {
|
package/src/review.service.ts
CHANGED
|
@@ -696,12 +696,10 @@ export class ReviewService {
|
|
|
696
696
|
|
|
697
697
|
// 验证历史问题是否已修复
|
|
698
698
|
if (context.verifyFixes) {
|
|
699
|
-
existingIssues = await this.verifyAndUpdateIssues(
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
{ specs, fileContents },
|
|
704
|
-
);
|
|
699
|
+
existingIssues = await this.verifyAndUpdateIssues(context, existingIssues, commits, {
|
|
700
|
+
specs,
|
|
701
|
+
fileContents,
|
|
702
|
+
});
|
|
705
703
|
} else {
|
|
706
704
|
if (shouldLog(verbose, 1)) {
|
|
707
705
|
console.log(` ⏭️ 跳过历史问题验证 (verifyFixes=false)`);
|
|
@@ -917,9 +915,7 @@ export class ReviewService {
|
|
|
917
915
|
preloaded?: { specs: ReviewSpec[]; fileContents: FileContentsMap },
|
|
918
916
|
): Promise<ReviewIssue[]> {
|
|
919
917
|
const { owner, repo, prNumber, llmMode, specSources, verbose } = context;
|
|
920
|
-
const unfixedIssues = issues.filter(
|
|
921
|
-
(i) => i.valid !== "false" && !i.fixed,
|
|
922
|
-
);
|
|
918
|
+
const unfixedIssues = issues.filter((i) => i.valid !== "false" && !i.fixed);
|
|
923
919
|
|
|
924
920
|
if (unfixedIssues.length === 0) {
|
|
925
921
|
return issues;
|
|
@@ -2520,7 +2516,9 @@ ${fileChanges || "无"}`;
|
|
|
2520
2516
|
if (issues.length === 0) {
|
|
2521
2517
|
parts.push(`> ✅ 未发现新问题`);
|
|
2522
2518
|
} else {
|
|
2523
|
-
parts.push(
|
|
2519
|
+
parts.push(
|
|
2520
|
+
`> **${issues.length}** 个新问题 · **${fileCount}** 个文件${badges.length > 0 ? " · " + badges.join(" ") : ""}`,
|
|
2521
|
+
);
|
|
2524
2522
|
}
|
|
2525
2523
|
|
|
2526
2524
|
// 上轮回顾
|
|
@@ -2532,7 +2530,9 @@ ${fileChanges || "无"}`;
|
|
|
2532
2530
|
const prevInvalid = prevIssues.filter((i) => i.valid === "false").length;
|
|
2533
2531
|
const prevPending = prevIssues.length - prevFixed - prevResolved - prevInvalid;
|
|
2534
2532
|
parts.push("");
|
|
2535
|
-
parts.push(
|
|
2533
|
+
parts.push(
|
|
2534
|
+
`<details><summary>📊 Round ${round - 1} 回顾 (${prevIssues.length} 个问题)</summary>\n`,
|
|
2535
|
+
);
|
|
2536
2536
|
parts.push(`| 状态 | 数量 |`);
|
|
2537
2537
|
parts.push(`|------|------|`);
|
|
2538
2538
|
if (prevFixed > 0) parts.push(`| ✅ 已修复 | ${prevFixed} |`);
|
|
@@ -2644,8 +2644,8 @@ ${fileChanges || "无"}`;
|
|
|
2644
2644
|
// 将变更文件的历史 issue 标记为无效
|
|
2645
2645
|
let invalidatedCount = 0;
|
|
2646
2646
|
const updatedIssues = issues.map((issue) => {
|
|
2647
|
-
// 如果 issue
|
|
2648
|
-
if (issue.fixed || issue.valid === "false") {
|
|
2647
|
+
// 如果 issue 已修复、已解决或已无效,不需要处理
|
|
2648
|
+
if (issue.fixed || issue.resolved || issue.valid === "false") {
|
|
2649
2649
|
return issue;
|
|
2650
2650
|
}
|
|
2651
2651
|
|
|
@@ -2691,8 +2691,8 @@ ${fileChanges || "无"}`;
|
|
|
2691
2691
|
let updatedCount = 0;
|
|
2692
2692
|
let invalidatedCount = 0;
|
|
2693
2693
|
const updatedIssues = issues.map((issue) => {
|
|
2694
|
-
// 如果 issue
|
|
2695
|
-
if (issue.fixed || issue.valid === "false") {
|
|
2694
|
+
// 如果 issue 已修复、已解决或无效,不需要更新行号
|
|
2695
|
+
if (issue.fixed || issue.resolved || issue.valid === "false") {
|
|
2696
2696
|
return issue;
|
|
2697
2697
|
}
|
|
2698
2698
|
|