co-maintainer 0.7.5-beta.1 → 0.7.5-beta.2
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/dist/package.json +1 -1
- package/dist/src/services/review.js +17 -4
- package/package.json +1 -1
package/dist/package.json
CHANGED
|
@@ -474,6 +474,21 @@ async function updateCheck(client, job, checkRunId, body, log) {
|
|
|
474
474
|
log("info", `GitHub Check Run update failed: ${redact(String(error))}`);
|
|
475
475
|
}
|
|
476
476
|
}
|
|
477
|
+
/** A review stopped from the dashboard: nothing is posted, and its check run
|
|
478
|
+
* closes as cancelled so the pull request does not wait on it forever. */
|
|
479
|
+
async function stoppedReview(client, job, reviewId, checkRunId, log) {
|
|
480
|
+
setReviewStatus(reviewId, "canceled");
|
|
481
|
+
await updateCheck(client, job, checkRunId, {
|
|
482
|
+
status: "completed",
|
|
483
|
+
conclusion: "cancelled",
|
|
484
|
+
completed_at: new Date().toISOString(),
|
|
485
|
+
output: {
|
|
486
|
+
title: "Review stopped from the dashboard.",
|
|
487
|
+
summary: "This commit was not reviewed. Nothing was posted.",
|
|
488
|
+
},
|
|
489
|
+
}, log);
|
|
490
|
+
log("info", "stopped, nothing was posted");
|
|
491
|
+
}
|
|
477
492
|
async function finishCheck(client, job, checkRunId, conclusion, title, findings, log) {
|
|
478
493
|
// A closed finding was fixed. Counting it would report work that is done.
|
|
479
494
|
const open = findings.filter((finding) => finding.state !== "closed");
|
|
@@ -894,8 +909,7 @@ async function runReviewJobCore(job, log, client, ai, signal) {
|
|
|
894
909
|
// one, and the pull request gets one note pointing at the dashboard.
|
|
895
910
|
// A Stop is not a failure: nothing is posted.
|
|
896
911
|
if (signal?.aborted) {
|
|
897
|
-
|
|
898
|
-
log("info", "stopped during the review, nothing was posted");
|
|
912
|
+
await stoppedReview(github, job, reviewId, checkRunId, log);
|
|
899
913
|
return;
|
|
900
914
|
}
|
|
901
915
|
await recordFailedReview(github, job, reviewId, costTally, log);
|
|
@@ -905,8 +919,7 @@ async function runReviewJobCore(job, log, client, ai, signal) {
|
|
|
905
919
|
// nothing is posted or stored. Extensions it cut short would read as failed.
|
|
906
920
|
// The remote job returns the same way.
|
|
907
921
|
if (signal?.aborted) {
|
|
908
|
-
|
|
909
|
-
log("info", "stopped before posting, nothing was posted");
|
|
922
|
+
await stoppedReview(github, job, reviewId, checkRunId, log);
|
|
910
923
|
return;
|
|
911
924
|
}
|
|
912
925
|
guideBuiltAt = response.guideBuiltAt;
|