edsger 0.4.3 → 0.4.4
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.
|
@@ -50,10 +50,24 @@ async function fetchUnresolvedReviewThreads(octokit, owner, repo, prNumber, verb
|
|
|
50
50
|
prNumber,
|
|
51
51
|
});
|
|
52
52
|
const allThreads = result?.repository?.pullRequest?.reviewThreads?.nodes || [];
|
|
53
|
-
// Filter for unresolved threads
|
|
54
|
-
|
|
53
|
+
// Filter for truly unresolved threads
|
|
54
|
+
// - Exclude resolved threads (isResolved = true)
|
|
55
|
+
// - Exclude outdated threads (isOutdated = true) - these mean code has changed, should auto-resolve
|
|
56
|
+
const unresolvedThreads = allThreads.filter((thread) => !thread.isResolved && !thread.isOutdated);
|
|
57
|
+
// Separate outdated threads that should be auto-resolved
|
|
58
|
+
const outdatedThreads = allThreads.filter((thread) => !thread.isResolved && thread.isOutdated);
|
|
55
59
|
if (verbose) {
|
|
56
60
|
logInfo(`📊 Found ${unresolvedThreads.length} unresolved review threads (out of ${allThreads.length} total)`);
|
|
61
|
+
if (outdatedThreads.length > 0) {
|
|
62
|
+
logInfo(`📊 Found ${outdatedThreads.length} outdated threads (code changed, will auto-resolve)`);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
// Auto-resolve outdated threads
|
|
66
|
+
if (outdatedThreads.length > 0) {
|
|
67
|
+
const markedCount = await resolveReviewThreads(octokit, outdatedThreads, verbose);
|
|
68
|
+
if (verbose) {
|
|
69
|
+
logInfo(`✅ Auto-resolved ${markedCount} outdated threads`);
|
|
70
|
+
}
|
|
57
71
|
}
|
|
58
72
|
return unresolvedThreads;
|
|
59
73
|
}
|
|
@@ -65,6 +79,7 @@ async function fetchUnresolvedReviewThreads(octokit, owner, repo, prNumber, verb
|
|
|
65
79
|
}
|
|
66
80
|
/**
|
|
67
81
|
* Analyze why a comment thread is unresolved and provide specific reason
|
|
82
|
+
* Note: Outdated threads are auto-resolved, so this only analyzes truly unresolved threads
|
|
68
83
|
*/
|
|
69
84
|
function analyzeUnresolvedThread(thread) {
|
|
70
85
|
const firstComment = thread.comments.nodes[0];
|
|
@@ -72,13 +87,8 @@ function analyzeUnresolvedThread(thread) {
|
|
|
72
87
|
return 'Comment thread exists but has no comments';
|
|
73
88
|
}
|
|
74
89
|
const reasons = [];
|
|
75
|
-
//
|
|
76
|
-
|
|
77
|
-
reasons.push('Code has changed since comment was made, but thread not marked as resolved');
|
|
78
|
-
}
|
|
79
|
-
else {
|
|
80
|
-
reasons.push('Code at this location has not been modified to address the feedback');
|
|
81
|
-
}
|
|
90
|
+
// Since outdated threads are filtered out, remaining threads need code changes
|
|
91
|
+
reasons.push('Code at this location has not been modified to address the feedback');
|
|
82
92
|
// Check if there are multiple comments (discussion ongoing)
|
|
83
93
|
if (thread.comments.totalCount > 1) {
|
|
84
94
|
reasons.push(`Discussion ongoing (${thread.comments.totalCount} comments in thread)`);
|