@spaceflow/core 0.17.0 → 0.18.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/package.json
CHANGED
|
@@ -497,8 +497,30 @@ export class GiteaAdapter implements GitProvider {
|
|
|
497
497
|
await this.request<void>("DELETE", `/repos/${owner}/${repo}/pulls/comments/${commentId}`);
|
|
498
498
|
}
|
|
499
499
|
|
|
500
|
-
async listResolvedThreads(): Promise<ResolvedThread[]> {
|
|
501
|
-
|
|
500
|
+
async listResolvedThreads(owner: string, repo: string, index: number): Promise<ResolvedThread[]> {
|
|
501
|
+
const result: ResolvedThread[] = [];
|
|
502
|
+
try {
|
|
503
|
+
const reviews = await this.listPullReviews(owner, repo, index);
|
|
504
|
+
for (const review of reviews) {
|
|
505
|
+
if (!review.id) continue;
|
|
506
|
+
const comments = await this.listPullReviewComments(owner, repo, index, review.id);
|
|
507
|
+
for (const comment of comments) {
|
|
508
|
+
if (!comment.resolver) continue;
|
|
509
|
+
result.push({
|
|
510
|
+
path: comment.path,
|
|
511
|
+
line: comment.position,
|
|
512
|
+
resolvedBy: {
|
|
513
|
+
id: comment.resolver.id,
|
|
514
|
+
login: comment.resolver.login,
|
|
515
|
+
},
|
|
516
|
+
body: comment.body,
|
|
517
|
+
});
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
} catch {
|
|
521
|
+
// 获取失败时返回空数组,不影响主流程
|
|
522
|
+
}
|
|
523
|
+
return result;
|
|
502
524
|
}
|
|
503
525
|
|
|
504
526
|
// ============ Reaction 操作 ============
|
|
@@ -37,7 +37,7 @@ interface GraphQLReviewThread {
|
|
|
37
37
|
resolvedBy?: { login: string; databaseId: number } | null;
|
|
38
38
|
path?: string | null;
|
|
39
39
|
line?: number | null;
|
|
40
|
-
comments: { nodes: Array<{ databaseId: number }> };
|
|
40
|
+
comments: { nodes: Array<{ databaseId: number; body?: string }> };
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
/**
|
|
@@ -838,12 +838,14 @@ export class GithubAdapter implements GitProvider {
|
|
|
838
838
|
const result: ResolvedThread[] = [];
|
|
839
839
|
for (const thread of threads) {
|
|
840
840
|
if (!thread.isResolved) continue;
|
|
841
|
+
const firstComment = thread.comments.nodes[0];
|
|
841
842
|
result.push({
|
|
842
843
|
path: thread.path ?? undefined,
|
|
843
844
|
line: thread.line ?? undefined,
|
|
844
845
|
resolvedBy: thread.resolvedBy
|
|
845
846
|
? { id: thread.resolvedBy.databaseId, login: thread.resolvedBy.login }
|
|
846
847
|
: null,
|
|
848
|
+
body: firstComment?.body,
|
|
847
849
|
});
|
|
848
850
|
}
|
|
849
851
|
return result;
|
|
@@ -868,7 +870,7 @@ export class GithubAdapter implements GitProvider {
|
|
|
868
870
|
path
|
|
869
871
|
line
|
|
870
872
|
comments(first: 1) {
|
|
871
|
-
nodes { databaseId }
|
|
873
|
+
nodes { databaseId body }
|
|
872
874
|
}
|
|
873
875
|
}
|
|
874
876
|
}
|