@spaceflow/review 0.66.0 → 0.68.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 +38 -0
- package/dist/index.js +18 -7
- package/package.json +3 -3
- package/src/review.service.ts +20 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,43 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.67.0](https://github.com/Lydanne/spaceflow/compare/@spaceflow/review@0.66.0...@spaceflow/review@0.67.0) (2026-03-03)
|
|
4
|
+
|
|
5
|
+
### 新特性
|
|
6
|
+
|
|
7
|
+
* **shared:** 新增获取扩展依赖函数,过滤内部包 ([86f4864](https://github.com/Lydanne/spaceflow/commit/86f48646c790285797b53c63a463d5134f7ac6b6))
|
|
8
|
+
|
|
9
|
+
### 代码重构
|
|
10
|
+
|
|
11
|
+
* **cli:** 重构外部扩展包读取逻辑,使用专用函数 ([d15054d](https://github.com/Lydanne/spaceflow/commit/d15054d81335a3b0c55db1acd169a2d9edf32a94))
|
|
12
|
+
* **core:** 统一依赖获取函数命名,将 getDependencies 重命名为 getExtensionDependencies ([ff78202](https://github.com/Lydanne/spaceflow/commit/ff78202be9975ce6721e4ecbbd6b1e02f8a57b70))
|
|
13
|
+
|
|
14
|
+
### 其他修改
|
|
15
|
+
|
|
16
|
+
* **cli:** released version 0.40.0 [no ci] ([bec5724](https://github.com/Lydanne/spaceflow/commit/bec5724745e8d33a06a00be452ec647bd82be934))
|
|
17
|
+
* **core:** released version 0.26.0 [no ci] ([cc597b0](https://github.com/Lydanne/spaceflow/commit/cc597b000bae00885de32eb2ad4287805de7ce5a))
|
|
18
|
+
* **publish:** released version 0.50.0 [no ci] ([8020040](https://github.com/Lydanne/spaceflow/commit/802004073c276705868ffbef4d5daae6a0068d39))
|
|
19
|
+
* **review-summary:** released version 0.34.0 [no ci] ([3565bc4](https://github.com/Lydanne/spaceflow/commit/3565bc426469fa8215d70fb3bbd2a9ee9c128916))
|
|
20
|
+
* **scripts:** released version 0.27.0 [no ci] ([8c4111a](https://github.com/Lydanne/spaceflow/commit/8c4111a73c472fab084030d547656ba5784e05b2))
|
|
21
|
+
* **shared:** released version 0.8.0 [no ci] ([c3fe353](https://github.com/Lydanne/spaceflow/commit/c3fe3536ba0adca45f610fa2e8697bfccf842efe))
|
|
22
|
+
* **shell:** released version 0.27.0 [no ci] ([c4501c2](https://github.com/Lydanne/spaceflow/commit/c4501c284de780c97a5a1cfc5b413ae8393acb91))
|
|
23
|
+
|
|
24
|
+
## [0.66.0](https://github.com/Lydanne/spaceflow/compare/@spaceflow/review@0.65.0...@spaceflow/review@0.66.0) (2026-03-03)
|
|
25
|
+
|
|
26
|
+
### 新特性
|
|
27
|
+
|
|
28
|
+
* **core:** 在安装过程中记录并提示 @spaceflow/core 版本变更 ([1992129](https://github.com/Lydanne/spaceflow/commit/19921299bf77b98b150ba6522c1b37ac872f431e))
|
|
29
|
+
* **shared:** 优化获取 core 版本逻辑,支持 .spaceflowrc 显式指定 ([916a87d](https://github.com/Lydanne/spaceflow/commit/916a87d5b7a7fc8c8dba3f959f3379fee26e0017))
|
|
30
|
+
|
|
31
|
+
### 其他修改
|
|
32
|
+
|
|
33
|
+
* **cli:** released version 0.39.0 [no ci] ([9de7c35](https://github.com/Lydanne/spaceflow/commit/9de7c35db100e482baa78059ecd3176c7942e16b))
|
|
34
|
+
* **core:** released version 0.25.0 [no ci] ([28d6b6d](https://github.com/Lydanne/spaceflow/commit/28d6b6dcfbaf0dfa7b986f8c880b47bd4962eac8))
|
|
35
|
+
* **publish:** released version 0.49.0 [no ci] ([5e66528](https://github.com/Lydanne/spaceflow/commit/5e66528ae3833a3da66178cc45aaf3a2e8e12fc9))
|
|
36
|
+
* **review-summary:** released version 0.33.0 [no ci] ([ca07fa3](https://github.com/Lydanne/spaceflow/commit/ca07fa33f9418147a6a511d0a2699159d01b892c))
|
|
37
|
+
* **scripts:** released version 0.26.0 [no ci] ([e757eba](https://github.com/Lydanne/spaceflow/commit/e757eba5ae1cdbea428d4cc1c6de6e7e68e546ff))
|
|
38
|
+
* **shared:** released version 0.7.0 [no ci] ([e9ade7e](https://github.com/Lydanne/spaceflow/commit/e9ade7e8caefd9f5ee4603b52b3a350ae604dfea))
|
|
39
|
+
* **shell:** released version 0.26.0 [no ci] ([753cf30](https://github.com/Lydanne/spaceflow/commit/753cf3044ee7d09ea3f1f9150bf045395703c712))
|
|
40
|
+
|
|
3
41
|
## [0.65.0](https://github.com/Lydanne/spaceflow/compare/@spaceflow/review@0.64.0...@spaceflow/review@0.65.0) (2026-03-03)
|
|
4
42
|
|
|
5
43
|
### 新特性
|
package/dist/index.js
CHANGED
|
@@ -2515,7 +2515,7 @@ class ReviewService {
|
|
|
2515
2515
|
existingResult.issues = await this.fillIssueAuthors(existingResult.issues, commits, owner, repo, verbose);
|
|
2516
2516
|
// 3. 同步已解决的评论状态
|
|
2517
2517
|
await this.syncResolvedComments(owner, repo, prNumber, existingResult);
|
|
2518
|
-
// 4. 同步评论 reactions
|
|
2518
|
+
// 4. 同步评论 reactions(👍/👎/☹️)
|
|
2519
2519
|
await this.syncReactionsToIssues(owner, repo, prNumber, existingResult, verbose);
|
|
2520
2520
|
// 5. LLM 验证历史问题是否已修复
|
|
2521
2521
|
try {
|
|
@@ -3431,7 +3431,7 @@ ${fileChanges || "无"}`;
|
|
|
3431
3431
|
}
|
|
3432
3432
|
// 获取已解决的评论,同步 resolve 状态(在更新 review 之前)
|
|
3433
3433
|
await this.syncResolvedComments(owner, repo, prNumber, result);
|
|
3434
|
-
// 获取评论的 reactions
|
|
3434
|
+
// 获取评论的 reactions,同步状态(☹️ 标记无效,👎 标记未解决)
|
|
3435
3435
|
await this.syncReactionsToIssues(owner, repo, prNumber, result, verbose);
|
|
3436
3436
|
// 查找已有的 AI 评论(Issue Comment),可能存在多个重复评论
|
|
3437
3437
|
if (shouldLog(verbose, 2)) {
|
|
@@ -3619,7 +3619,8 @@ ${fileChanges || "无"}`;
|
|
|
3619
3619
|
* 从旧的 AI review 评论中获取 reactions 和回复,同步到 result.issues
|
|
3620
3620
|
* - 存储所有 reactions 到 issue.reactions 字段
|
|
3621
3621
|
* - 存储评论回复到 issue.replies 字段
|
|
3622
|
-
* - 如果评论有
|
|
3622
|
+
* - 如果评论有 ☹️ (confused) reaction,将对应的问题标记为无效
|
|
3623
|
+
* - 如果评论有 👎 (-1) reaction,将对应的问题标记为未解决
|
|
3623
3624
|
*/ async syncReactionsToIssues(owner, repo, prNumber, result, verbose) {
|
|
3624
3625
|
try {
|
|
3625
3626
|
const reviews = await this.gitProvider.listPullReviews(owner, repo, prNumber);
|
|
@@ -3710,12 +3711,22 @@ ${fileChanges || "无"}`;
|
|
|
3710
3711
|
content,
|
|
3711
3712
|
users
|
|
3712
3713
|
}));
|
|
3713
|
-
// 检查是否有评审人的
|
|
3714
|
+
// 检查是否有评审人的 ☹️ (confused) reaction,标记为无效
|
|
3715
|
+
const confusedUsers = reactionMap.get("confused") || [];
|
|
3716
|
+
const reviewerConfused = confusedUsers.filter((u)=>reviewers.has(u));
|
|
3717
|
+
if (reviewerConfused.length > 0 && matchedIssue.valid !== "false") {
|
|
3718
|
+
matchedIssue.valid = "false";
|
|
3719
|
+
console.log(`☹️ 问题已标记为无效: ${matchedIssue.file}:${matchedIssue.line} (by 评审人: ${reviewerConfused.join(", ")})`);
|
|
3720
|
+
}
|
|
3721
|
+
// 检查是否有评审人的 👎 (-1) reaction,标记为未解决
|
|
3714
3722
|
const thumbsDownUsers = reactionMap.get("-1") || [];
|
|
3715
3723
|
const reviewerThumbsDown = thumbsDownUsers.filter((u)=>reviewers.has(u));
|
|
3716
|
-
if (reviewerThumbsDown.length > 0 && matchedIssue.
|
|
3717
|
-
matchedIssue.
|
|
3718
|
-
|
|
3724
|
+
if (reviewerThumbsDown.length > 0 && (matchedIssue.resolved || matchedIssue.fixed)) {
|
|
3725
|
+
matchedIssue.resolved = undefined;
|
|
3726
|
+
matchedIssue.resolvedBy = undefined;
|
|
3727
|
+
matchedIssue.fixed = undefined;
|
|
3728
|
+
matchedIssue.fixedBy = undefined;
|
|
3729
|
+
console.log(`👎 问题已标记为未解决: ${matchedIssue.file}:${matchedIssue.line} (by 评审人: ${reviewerThumbsDown.join(", ")})`);
|
|
3719
3730
|
}
|
|
3720
3731
|
} catch {
|
|
3721
3732
|
// 单个评论获取 reactions 失败,继续处理其他评论
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spaceflow/review",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.68.0",
|
|
4
4
|
"description": "Spaceflow 代码审查插件,使用 LLM 对 PR 代码进行自动审查",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Lydanne",
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
"@vitest/coverage-v8": "^4.0.18",
|
|
26
26
|
"unplugin-swc": "^1.5.9",
|
|
27
27
|
"vitest": "^4.0.18",
|
|
28
|
-
"@spaceflow/cli": "0.
|
|
28
|
+
"@spaceflow/cli": "0.40.0"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"@spaceflow/core": "0.
|
|
31
|
+
"@spaceflow/core": "0.26.0"
|
|
32
32
|
},
|
|
33
33
|
"spaceflow": {
|
|
34
34
|
"type": "flow",
|
package/src/review.service.ts
CHANGED
|
@@ -956,7 +956,7 @@ export class ReviewService {
|
|
|
956
956
|
// 3. 同步已解决的评论状态
|
|
957
957
|
await this.syncResolvedComments(owner, repo, prNumber, existingResult);
|
|
958
958
|
|
|
959
|
-
// 4. 同步评论 reactions
|
|
959
|
+
// 4. 同步评论 reactions(👍/👎/☹️)
|
|
960
960
|
await this.syncReactionsToIssues(owner, repo, prNumber, existingResult, verbose);
|
|
961
961
|
|
|
962
962
|
// 5. LLM 验证历史问题是否已修复
|
|
@@ -2078,7 +2078,7 @@ ${fileChanges || "无"}`;
|
|
|
2078
2078
|
// 获取已解决的评论,同步 resolve 状态(在更新 review 之前)
|
|
2079
2079
|
await this.syncResolvedComments(owner, repo, prNumber, result);
|
|
2080
2080
|
|
|
2081
|
-
// 获取评论的 reactions
|
|
2081
|
+
// 获取评论的 reactions,同步状态(☹️ 标记无效,👎 标记未解决)
|
|
2082
2082
|
await this.syncReactionsToIssues(owner, repo, prNumber, result, verbose);
|
|
2083
2083
|
|
|
2084
2084
|
// 查找已有的 AI 评论(Issue Comment),可能存在多个重复评论
|
|
@@ -2307,7 +2307,8 @@ ${fileChanges || "无"}`;
|
|
|
2307
2307
|
* 从旧的 AI review 评论中获取 reactions 和回复,同步到 result.issues
|
|
2308
2308
|
* - 存储所有 reactions 到 issue.reactions 字段
|
|
2309
2309
|
* - 存储评论回复到 issue.replies 字段
|
|
2310
|
-
* - 如果评论有
|
|
2310
|
+
* - 如果评论有 ☹️ (confused) reaction,将对应的问题标记为无效
|
|
2311
|
+
* - 如果评论有 👎 (-1) reaction,将对应的问题标记为未解决
|
|
2311
2312
|
*/
|
|
2312
2313
|
protected async syncReactionsToIssues(
|
|
2313
2314
|
owner: string,
|
|
@@ -2429,13 +2430,25 @@ ${fileChanges || "无"}`;
|
|
|
2429
2430
|
content,
|
|
2430
2431
|
users,
|
|
2431
2432
|
}));
|
|
2432
|
-
// 检查是否有评审人的
|
|
2433
|
+
// 检查是否有评审人的 ☹️ (confused) reaction,标记为无效
|
|
2434
|
+
const confusedUsers = reactionMap.get("confused") || [];
|
|
2435
|
+
const reviewerConfused = confusedUsers.filter((u) => reviewers.has(u));
|
|
2436
|
+
if (reviewerConfused.length > 0 && matchedIssue.valid !== "false") {
|
|
2437
|
+
matchedIssue.valid = "false";
|
|
2438
|
+
console.log(
|
|
2439
|
+
`☹️ 问题已标记为无效: ${matchedIssue.file}:${matchedIssue.line} (by 评审人: ${reviewerConfused.join(", ")})`,
|
|
2440
|
+
);
|
|
2441
|
+
}
|
|
2442
|
+
// 检查是否有评审人的 👎 (-1) reaction,标记为未解决
|
|
2433
2443
|
const thumbsDownUsers = reactionMap.get("-1") || [];
|
|
2434
2444
|
const reviewerThumbsDown = thumbsDownUsers.filter((u) => reviewers.has(u));
|
|
2435
|
-
if (reviewerThumbsDown.length > 0 && matchedIssue.
|
|
2436
|
-
matchedIssue.
|
|
2445
|
+
if (reviewerThumbsDown.length > 0 && (matchedIssue.resolved || matchedIssue.fixed)) {
|
|
2446
|
+
matchedIssue.resolved = undefined;
|
|
2447
|
+
matchedIssue.resolvedBy = undefined;
|
|
2448
|
+
matchedIssue.fixed = undefined;
|
|
2449
|
+
matchedIssue.fixedBy = undefined;
|
|
2437
2450
|
console.log(
|
|
2438
|
-
`👎
|
|
2451
|
+
`👎 问题已标记为未解决: ${matchedIssue.file}:${matchedIssue.line} (by 评审人: ${reviewerThumbsDown.join(", ")})`,
|
|
2439
2452
|
);
|
|
2440
2453
|
}
|
|
2441
2454
|
} catch {
|