@spaceflow/review-summary 0.22.0 → 0.23.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 +44 -0
- package/package.json +3 -3
- package/src/review-summary.service.ts +134 -18
- package/src/types.ts +35 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,49 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.22.0](https://github.com/Lydanne/spaceflow/compare/@spaceflow/review-summary@0.21.0...@spaceflow/review-summary@0.22.0) (2026-03-02)
|
|
4
|
+
|
|
5
|
+
### 新特性
|
|
6
|
+
|
|
7
|
+
* **core:** Gitea适配器支持通过标签名称创建Issue ([cf10eda](https://github.com/Lydanne/spaceflow/commit/cf10eda5d025c560cc0d8e3826dad40716020d5c))
|
|
8
|
+
* **review-summary:** commit-based 评分新增修复问题加分机制,支持从 review 模块精确提取问题统计 ([304bf81](https://github.com/Lydanne/spaceflow/commit/304bf81ab475b280ab5f4011159bc697861bddf6))
|
|
9
|
+
* **review-summary:** 支持为周期统计报告 Issue 配置自定义标签 ([df1cc61](https://github.com/Lydanne/spaceflow/commit/df1cc61167851ff7106104914319f43f73ba8902))
|
|
10
|
+
* **review-summary:** 支持通过配置文件自定义评分权重 ([53e1a37](https://github.com/Lydanne/spaceflow/commit/53e1a371288aea6ceac63b03fda99eea1739be4b))
|
|
11
|
+
* **review-summary:** 新增 commit-based 评分策略,支持按有效 commit 累计计分 ([111c0d6](https://github.com/Lydanne/spaceflow/commit/111c0d6b9d87d12096e0edb69a11eceff55b79c1))
|
|
12
|
+
* **review:** 为行级评论 Review 添加统计信息摘要 ([58d5b37](https://github.com/Lydanne/spaceflow/commit/58d5b37ba54daa24bd2f8396318fedc87f388c74))
|
|
13
|
+
* **review:** 优化问题统计展示,按 severity 分级显示 error/warn 数量 ([bcb2608](https://github.com/Lydanne/spaceflow/commit/bcb26086589a67e815db075f3001209904572926))
|
|
14
|
+
* **review:** 保留历史行级评论,为每轮 Review 生成独立评论并添加上轮回顾 ([de431a0](https://github.com/Lydanne/spaceflow/commit/de431a09b4e3b5e1ada9ee5f1ee65786d22b6ff9))
|
|
15
|
+
* **review:** 支持用户手动 resolve 评论并在报告中区分 AI 修复与手动解决 ([c968b65](https://github.com/Lydanne/spaceflow/commit/c968b65c850bc68de3f4409aa3b5294e5a0311ff))
|
|
16
|
+
* **review:** 新增 MCP 工具支持从目录批量加载代码审查规则 ([289a836](https://github.com/Lydanne/spaceflow/commit/289a83650f1e222482fcbaaa69fb5ea562c5a4c2))
|
|
17
|
+
* **review:** 新增解决率统计指标,区分修复率和解决率的计算维度 ([436541f](https://github.com/Lydanne/spaceflow/commit/436541fce605319da562445a81242a8feb257df9))
|
|
18
|
+
|
|
19
|
+
### 修复BUG
|
|
20
|
+
|
|
21
|
+
* **review:** 修复率计算仅统计 AI 修复的问题,排除手动解决的问题 ([12b3415](https://github.com/Lydanne/spaceflow/commit/12b3415749c9d8523e8b23365fbb39fc7657ff1d))
|
|
22
|
+
* **review:** 修正 PR 评论标题中的 emoji 显示问题 ([bcdc946](https://github.com/Lydanne/spaceflow/commit/bcdc9467bf7970c9acd3ea00303bcae5eaff131f))
|
|
23
|
+
|
|
24
|
+
### 代码重构
|
|
25
|
+
|
|
26
|
+
* **review:** 抽取规则加载和问题验证逻辑为独立方法,优化代码复用性 ([7ea02ba](https://github.com/Lydanne/spaceflow/commit/7ea02ba86e369bc130c69c561195634072cc060a))
|
|
27
|
+
|
|
28
|
+
### 文档更新
|
|
29
|
+
|
|
30
|
+
* **docs:** 为 review-summary 命令文档补充 Issue 输出配置说明 ([196fa94](https://github.com/Lydanne/spaceflow/commit/196fa94ad1ed2dbadbdcb332ef26cf1fe7fcd8d7))
|
|
31
|
+
* **review-summary:** 完善文档,新增时间预设、评分算法及输出示例说明 ([fb04685](https://github.com/Lydanne/spaceflow/commit/fb04685dde4157f0a1a2f8edaf1fb3c125280e27))
|
|
32
|
+
* **review:** 完善 review 命令文档,新增审查流程、多轮审查、问题生命周期等核心机制说明 ([d6b2a20](https://github.com/Lydanne/spaceflow/commit/d6b2a20802ab98e5ddb01937c0fe8b268c403c6f))
|
|
33
|
+
|
|
34
|
+
### 其他修改
|
|
35
|
+
|
|
36
|
+
* **core:** released version 0.20.0 [no ci] ([b7ed239](https://github.com/Lydanne/spaceflow/commit/b7ed239455244cd96f2b59ef67886dd0bfc057a8))
|
|
37
|
+
* **publish:** released version 0.44.0 [no ci] ([5b29159](https://github.com/Lydanne/spaceflow/commit/5b29159b2f0129d2ce81329cf48734d3d56b226e))
|
|
38
|
+
* **review:** released version 0.54.0 [no ci] ([252269a](https://github.com/Lydanne/spaceflow/commit/252269a299f9e580b858e04814e7d9a13fed7736))
|
|
39
|
+
* **review:** released version 0.55.0 [no ci] ([0245743](https://github.com/Lydanne/spaceflow/commit/02457439788dd70925b91118f7d5936a61d0e0de))
|
|
40
|
+
* **review:** released version 0.56.0 [no ci] ([2481dec](https://github.com/Lydanne/spaceflow/commit/2481dec141b0d5f444b5815ab9598378ac3e0b12))
|
|
41
|
+
* **review:** released version 0.57.0 [no ci] ([238a831](https://github.com/Lydanne/spaceflow/commit/238a83165fa1810a9429b8d6a66a1f75c477ce22))
|
|
42
|
+
* **scripts:** released version 0.21.0 [no ci] ([1f0a213](https://github.com/Lydanne/spaceflow/commit/1f0a2139d155807451dc968de8213bafe2e4edb8))
|
|
43
|
+
* **scripts:** released version 0.22.0 [no ci] ([f482504](https://github.com/Lydanne/spaceflow/commit/f48250486906016b414a7b00aabac342c1399045))
|
|
44
|
+
* **shell:** released version 0.21.0 [no ci] ([b619af7](https://github.com/Lydanne/spaceflow/commit/b619af741e16053868a2eedd41f56d50134954d8))
|
|
45
|
+
* **shell:** released version 0.22.0 [no ci] ([e716369](https://github.com/Lydanne/spaceflow/commit/e716369f57bfa20e710d354245c54d3a80e701f4))
|
|
46
|
+
|
|
3
47
|
## [0.21.0](https://github.com/Lydanne/spaceflow/compare/@spaceflow/review-summary@0.20.0...@spaceflow/review-summary@0.21.0) (2026-03-02)
|
|
4
48
|
|
|
5
49
|
### 修复BUG
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spaceflow/review-summary",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.0",
|
|
4
4
|
"description": "Spaceflow 审查统计命令,根据时间范围统计 PR 贡献情况,按人员汇总并排序",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Lydanne",
|
|
@@ -15,14 +15,14 @@
|
|
|
15
15
|
"type": "module",
|
|
16
16
|
"main": "./dist/index.js",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@spaceflow/review": "0.
|
|
18
|
+
"@spaceflow/review": "0.58.0"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@types/node": "^22.15.0",
|
|
22
22
|
"@spaceflow/cli": "0.38.0"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"@spaceflow/core": "0.
|
|
25
|
+
"@spaceflow/core": "0.21.0"
|
|
26
26
|
},
|
|
27
27
|
"spaceflow": {
|
|
28
28
|
"type": "flow",
|
|
@@ -14,6 +14,8 @@ import type {
|
|
|
14
14
|
TimePreset,
|
|
15
15
|
WeightedScoreWeights,
|
|
16
16
|
CommitBasedWeights,
|
|
17
|
+
IssueBasedWeights,
|
|
18
|
+
DefectRateWeights,
|
|
17
19
|
ReviewSummaryConfig,
|
|
18
20
|
ScoreStrategy,
|
|
19
21
|
} from "./types";
|
|
@@ -38,6 +40,24 @@ const DEFAULT_COMMIT_BASED_WEIGHTS: Required<CommitBasedWeights> = {
|
|
|
38
40
|
minCommitLines: 5,
|
|
39
41
|
};
|
|
40
42
|
|
|
43
|
+
/** issue-based 模式默认权重 */
|
|
44
|
+
const DEFAULT_ISSUE_BASED_WEIGHTS: Required<IssueBasedWeights> = {
|
|
45
|
+
minBase: 60,
|
|
46
|
+
maxBase: 100,
|
|
47
|
+
capLines: 1000,
|
|
48
|
+
errorDeduction: 8,
|
|
49
|
+
warnDeduction: 3,
|
|
50
|
+
errorFixedBonus: 5,
|
|
51
|
+
warnFixedBonus: 2,
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/** defect-rate 模式默认权重 */
|
|
55
|
+
const DEFAULT_DEFECT_RATE_WEIGHTS: Required<DefectRateWeights> = {
|
|
56
|
+
errorPenalty: 0.3,
|
|
57
|
+
warnPenalty: 0.1,
|
|
58
|
+
fixedDiscount: 0.05,
|
|
59
|
+
};
|
|
60
|
+
|
|
41
61
|
/**
|
|
42
62
|
* 周期统计服务
|
|
43
63
|
*/
|
|
@@ -64,7 +84,7 @@ export class PeriodSummaryService {
|
|
|
64
84
|
const ciConf = this.config.get<CiConfig>("ci");
|
|
65
85
|
const repository = ciConf?.repository;
|
|
66
86
|
if (!repository) {
|
|
67
|
-
throw new Error("缺少仓库配置,请通过 --repository 参数或环境变量 GITHUB_REPOSITORY 指定");
|
|
87
|
+
throw new Error("缺少仓库配置,请通过 --repository 参数或环境变量 GITHUB_REPOSITORY / GITEA_REPOSITORY 指定");
|
|
68
88
|
}
|
|
69
89
|
const parts = repository.split("/");
|
|
70
90
|
owner = parts[0];
|
|
@@ -370,6 +390,15 @@ export class PeriodSummaryService {
|
|
|
370
390
|
const strategy: ScoreStrategy = config.strategy ?? "weighted";
|
|
371
391
|
for (const userStats of userMap.values()) {
|
|
372
392
|
switch (strategy) {
|
|
393
|
+
case "defect-rate": {
|
|
394
|
+
const rate = this.calculateDefectRate(userStats, config);
|
|
395
|
+
userStats.defectRate = rate;
|
|
396
|
+
userStats.score = Math.round((100 - rate) * 10) / 10;
|
|
397
|
+
break;
|
|
398
|
+
}
|
|
399
|
+
case "issue-based":
|
|
400
|
+
userStats.score = this.calculateIssueBasedScore(userStats, config);
|
|
401
|
+
break;
|
|
373
402
|
case "commit-based":
|
|
374
403
|
userStats.score = this.calculateCommitBasedScore(userStats, config);
|
|
375
404
|
break;
|
|
@@ -398,6 +427,62 @@ export class PeriodSummaryService {
|
|
|
398
427
|
return Math.max(0, Math.round(totalScore * 10) / 10);
|
|
399
428
|
}
|
|
400
429
|
|
|
430
|
+
/**
|
|
431
|
+
* issue-based 模式:逐 PR 计算基础分(对数缩放) + 问题扣分/修复加分
|
|
432
|
+
*/
|
|
433
|
+
protected calculateIssueBasedScore(stats: UserStats, config: ReviewSummaryConfig): number {
|
|
434
|
+
const weights = { ...DEFAULT_ISSUE_BASED_WEIGHTS, ...config.issueBasedWeights };
|
|
435
|
+
let totalScore = 0;
|
|
436
|
+
for (const pr of stats.prs) {
|
|
437
|
+
const baseScore = this.calculatePrBaseScore(
|
|
438
|
+
pr.additions + pr.deletions,
|
|
439
|
+
weights.minBase,
|
|
440
|
+
weights.maxBase,
|
|
441
|
+
weights.capLines,
|
|
442
|
+
);
|
|
443
|
+
const deduction =
|
|
444
|
+
pr.errorCount * weights.errorDeduction + pr.warnCount * weights.warnDeduction;
|
|
445
|
+
const bonus =
|
|
446
|
+
pr.fixedErrors * weights.errorFixedBonus + pr.fixedWarns * weights.warnFixedBonus;
|
|
447
|
+
totalScore += Math.max(0, baseScore - deduction + bonus);
|
|
448
|
+
}
|
|
449
|
+
return Math.round(totalScore * 10) / 10;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
/**
|
|
453
|
+
* 计算单个 PR 的基础分(对数缩放,映射到 [minBase, maxBase] 区间)
|
|
454
|
+
*/
|
|
455
|
+
protected calculatePrBaseScore(
|
|
456
|
+
totalLines: number,
|
|
457
|
+
minBase: number,
|
|
458
|
+
maxBase: number,
|
|
459
|
+
capLines: number,
|
|
460
|
+
): number {
|
|
461
|
+
if (totalLines <= 0) return minBase;
|
|
462
|
+
const ratio = Math.min(1, Math.log2(1 + totalLines) / Math.log2(1 + capLines));
|
|
463
|
+
return minBase + (maxBase - minBase) * ratio;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
/**
|
|
467
|
+
* defect-rate 模式:基于问题密度(每百行代码)计算缺陷率
|
|
468
|
+
*/
|
|
469
|
+
protected calculateDefectRate(stats: UserStats, config: ReviewSummaryConfig): number {
|
|
470
|
+
const weights = { ...DEFAULT_DEFECT_RATE_WEIGHTS, ...config.defectRateWeights };
|
|
471
|
+
if (stats.prs.length === 0) return 0;
|
|
472
|
+
let complianceSum = 0;
|
|
473
|
+
for (const pr of stats.prs) {
|
|
474
|
+
const totalLines = pr.additions + pr.deletions;
|
|
475
|
+
const per100 = Math.max(1, totalLines / 100);
|
|
476
|
+
const penalty =
|
|
477
|
+
(pr.errorCount * weights.errorPenalty + pr.warnCount * weights.warnPenalty) / per100;
|
|
478
|
+
const recovery = (pr.fixedErrors + pr.fixedWarns) * weights.fixedDiscount;
|
|
479
|
+
const compliance = Math.min(1, Math.max(0, 1 - penalty + recovery));
|
|
480
|
+
complianceSum += compliance;
|
|
481
|
+
}
|
|
482
|
+
const avgCompliance = complianceSum / stats.prs.length;
|
|
483
|
+
return Math.round((1 - avgCompliance) * 1000) / 10;
|
|
484
|
+
}
|
|
485
|
+
|
|
401
486
|
/**
|
|
402
487
|
* 分数累计模式:按有效 commit 加分,按 error/warn 扣分
|
|
403
488
|
*/
|
|
@@ -417,6 +502,12 @@ export class PeriodSummaryService {
|
|
|
417
502
|
* 按分数排序用户统计
|
|
418
503
|
*/
|
|
419
504
|
protected sortUserStats(userMap: Map<string, UserStats>): UserStats[] {
|
|
505
|
+
const config = this.getStrategyConfig();
|
|
506
|
+
if (config.strategy === "defect-rate") {
|
|
507
|
+
return Array.from(userMap.values()).sort(
|
|
508
|
+
(a, b) => (a.defectRate ?? 0) - (b.defectRate ?? 0),
|
|
509
|
+
);
|
|
510
|
+
}
|
|
420
511
|
return Array.from(userMap.values()).sort((a, b) => b.score - a.score);
|
|
421
512
|
}
|
|
422
513
|
|
|
@@ -551,18 +642,32 @@ export class PeriodSummaryService {
|
|
|
551
642
|
lines.push("");
|
|
552
643
|
lines.push(`🏆 贡献者排名`);
|
|
553
644
|
lines.push(`${"─".repeat(60)}`);
|
|
554
|
-
const
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
645
|
+
const isDefectRate = result.userStats.some((u) => u.defectRate !== undefined);
|
|
646
|
+
const header = isDefectRate
|
|
647
|
+
? [
|
|
648
|
+
"排名".padEnd(4),
|
|
649
|
+
"用户".padEnd(15),
|
|
650
|
+
"PR数".padStart(5),
|
|
651
|
+
"新增".padStart(8),
|
|
652
|
+
"删除".padStart(8),
|
|
653
|
+
"问题".padStart(5),
|
|
654
|
+
"缺陷率".padStart(8),
|
|
655
|
+
].join(" │ ")
|
|
656
|
+
: [
|
|
657
|
+
"排名".padEnd(4),
|
|
658
|
+
"用户".padEnd(15),
|
|
659
|
+
"PR数".padStart(5),
|
|
660
|
+
"新增".padStart(8),
|
|
661
|
+
"删除".padStart(8),
|
|
662
|
+
"问题".padStart(5),
|
|
663
|
+
"分数".padStart(8),
|
|
664
|
+
].join(" │ ");
|
|
563
665
|
lines.push(header);
|
|
564
666
|
lines.push("─".repeat(60));
|
|
565
667
|
result.userStats.forEach((user, index) => {
|
|
668
|
+
const lastCol = isDefectRate
|
|
669
|
+
? `${(user.defectRate ?? 0).toFixed(1)}%`.padStart(8)
|
|
670
|
+
: user.score.toFixed(1).padStart(8);
|
|
566
671
|
const row = [
|
|
567
672
|
`#${index + 1}`.padEnd(4),
|
|
568
673
|
user.username.slice(0, 15).padEnd(15),
|
|
@@ -570,7 +675,7 @@ export class PeriodSummaryService {
|
|
|
570
675
|
`+${user.totalAdditions}`.padStart(8),
|
|
571
676
|
`-${user.totalDeletions}`.padStart(8),
|
|
572
677
|
String(user.totalIssues).padStart(5),
|
|
573
|
-
|
|
678
|
+
lastCol,
|
|
574
679
|
].join(" │ ");
|
|
575
680
|
lines.push(row);
|
|
576
681
|
});
|
|
@@ -603,13 +708,24 @@ export class PeriodSummaryService {
|
|
|
603
708
|
lines.push("");
|
|
604
709
|
lines.push(`## 🏆 贡献者排名`);
|
|
605
710
|
lines.push("");
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
lines.push(
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
711
|
+
const isDefectRate = result.userStats.some((u) => u.defectRate !== undefined);
|
|
712
|
+
if (isDefectRate) {
|
|
713
|
+
lines.push(`| 排名 | 用户 | PR数 | 新增 | 删除 | 问题 | 缺陷率 |`);
|
|
714
|
+
lines.push(`|------|------|------|------|------|------|--------|`);
|
|
715
|
+
result.userStats.forEach((user, index) => {
|
|
716
|
+
lines.push(
|
|
717
|
+
`| #${index + 1} | ${user.username} | ${user.prCount} | +${user.totalAdditions} | -${user.totalDeletions} | ${user.totalIssues} | ${(user.defectRate ?? 0).toFixed(1)}% |`,
|
|
718
|
+
);
|
|
719
|
+
});
|
|
720
|
+
} else {
|
|
721
|
+
lines.push(`| 排名 | 用户 | PR数 | 新增 | 删除 | 问题 | 分数 |`);
|
|
722
|
+
lines.push(`|------|------|------|------|------|------|------|`);
|
|
723
|
+
result.userStats.forEach((user, index) => {
|
|
724
|
+
lines.push(
|
|
725
|
+
`| #${index + 1} | ${user.username} | ${user.prCount} | +${user.totalAdditions} | -${user.totalDeletions} | ${user.totalIssues} | ${user.score.toFixed(1)} |`,
|
|
726
|
+
);
|
|
727
|
+
});
|
|
728
|
+
}
|
|
613
729
|
lines.push("");
|
|
614
730
|
lines.push(`## 📋 功能摘要`);
|
|
615
731
|
lines.push("");
|
package/src/types.ts
CHANGED
|
@@ -113,6 +113,8 @@ export interface UserStats {
|
|
|
113
113
|
totalValidCommits: number;
|
|
114
114
|
/** 综合分数 */
|
|
115
115
|
score: number;
|
|
116
|
+
/** 缺陷率(0-100),0 表示零缺陷,100 表示全部违规,仅 defect-rate 策略时填充 */
|
|
117
|
+
defectRate?: number;
|
|
116
118
|
/** 功能摘要列表 */
|
|
117
119
|
features: string[];
|
|
118
120
|
/** 该用户的 PR 列表 */
|
|
@@ -120,7 +122,7 @@ export interface UserStats {
|
|
|
120
122
|
}
|
|
121
123
|
|
|
122
124
|
/** 评分策略类型 */
|
|
123
|
-
export type ScoreStrategy = "weighted" | "commit-based";
|
|
125
|
+
export type ScoreStrategy = "weighted" | "commit-based" | "issue-based" | "defect-rate";
|
|
124
126
|
|
|
125
127
|
/** 加权模式权重配置 */
|
|
126
128
|
export interface WeightedScoreWeights {
|
|
@@ -157,6 +159,34 @@ export interface CommitBasedWeights {
|
|
|
157
159
|
/** @deprecated 使用 WeightedScoreWeights 代替 */
|
|
158
160
|
export type ScoreWeights = WeightedScoreWeights;
|
|
159
161
|
|
|
162
|
+
/** issue-based 模式权重配置 */
|
|
163
|
+
export interface IssueBasedWeights {
|
|
164
|
+
/** PR 基础分下限,默认 60 */
|
|
165
|
+
minBase?: number;
|
|
166
|
+
/** PR 基础分上限,默认 100 */
|
|
167
|
+
maxBase?: number;
|
|
168
|
+
/** 代码量封顶行数(additions + deletions),超过此值基础分为 maxBase,默认 1000 */
|
|
169
|
+
capLines?: number;
|
|
170
|
+
/** 每个 error 问题的扣分,默认 8 */
|
|
171
|
+
errorDeduction?: number;
|
|
172
|
+
/** 每个 warn 问题的扣分,默认 3 */
|
|
173
|
+
warnDeduction?: number;
|
|
174
|
+
/** 修复一个 error 问题的加分,默认 5 */
|
|
175
|
+
errorFixedBonus?: number;
|
|
176
|
+
/** 修复一个 warn 问题的加分,默认 2 */
|
|
177
|
+
warnFixedBonus?: number;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/** defect-rate 模式权重配置 */
|
|
181
|
+
export interface DefectRateWeights {
|
|
182
|
+
/** 每百行代码 1 个 error 降低的合规度,默认 0.3 */
|
|
183
|
+
errorPenalty?: number;
|
|
184
|
+
/** 每百行代码 1 个 warn 降低的合规度,默认 0.1 */
|
|
185
|
+
warnPenalty?: number;
|
|
186
|
+
/** 修复 1 个问题恢复的合规度,默认 0.05 */
|
|
187
|
+
fixedDiscount?: number;
|
|
188
|
+
}
|
|
189
|
+
|
|
160
190
|
/** review-summary 扩展配置 */
|
|
161
191
|
export interface ReviewSummaryConfig {
|
|
162
192
|
/** 评分策略,默认 "weighted" */
|
|
@@ -165,6 +195,10 @@ export interface ReviewSummaryConfig {
|
|
|
165
195
|
scoreWeights?: WeightedScoreWeights;
|
|
166
196
|
/** 分数累计模式权重配置(strategy 为 "commit-based" 时生效) */
|
|
167
197
|
commitBasedWeights?: CommitBasedWeights;
|
|
198
|
+
/** issue-based 模式权重配置(strategy 为 "issue-based" 时生效) */
|
|
199
|
+
issueBasedWeights?: IssueBasedWeights;
|
|
200
|
+
/** defect-rate 模式权重配置(strategy 为 "defect-rate" 时生效) */
|
|
201
|
+
defectRateWeights?: DefectRateWeights;
|
|
168
202
|
/** 创建 Issue 时添加的标签名称,默认 "report" */
|
|
169
203
|
issueLabel?: string;
|
|
170
204
|
}
|