next-issue 7.8.28 → 7.8.29
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/budget.mjs +2 -1
- package/dist/review.mjs +14 -1
- package/package.json +1 -1
package/dist/budget.mjs
CHANGED
|
@@ -22,9 +22,10 @@ export async function refundBudget(job, budget) {
|
|
|
22
22
|
await writeState(context.repo, state);
|
|
23
23
|
}
|
|
24
24
|
/** Gives the spent budget back if the process is killed (third Ctrl-C) while `body` runs. */
|
|
25
|
-
export async function refundOnKill(job, budget, body) {
|
|
25
|
+
export async function refundOnKill(job, budget, body, undo) {
|
|
26
26
|
const { context, state } = job;
|
|
27
27
|
const forget = onKill(() => {
|
|
28
|
+
undo?.();
|
|
28
29
|
state[budget] = Math.max(0, state[budget] - 1);
|
|
29
30
|
writeStateNow(context.repo, state);
|
|
30
31
|
});
|
package/dist/review.mjs
CHANGED
|
@@ -52,7 +52,20 @@ async function changesRequestedRound(job, open, earlier) {
|
|
|
52
52
|
const findings = formatFindings(open);
|
|
53
53
|
state.reviewLog.push({ round: state.reviewRounds, findings });
|
|
54
54
|
await writeState(job.context.repo, state);
|
|
55
|
-
const
|
|
55
|
+
const forget = () => {
|
|
56
|
+
state.reviewLog.pop();
|
|
57
|
+
};
|
|
58
|
+
let fix;
|
|
59
|
+
try {
|
|
60
|
+
fix = await refundOnKill(job, 'reviewRounds', () => fixRound(job, 'The reviewer requested changes.', findings, earlier, 'review'), forget);
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
if (runStopped()) {
|
|
64
|
+
forget();
|
|
65
|
+
await refundBudget(job, 'reviewRounds');
|
|
66
|
+
}
|
|
67
|
+
throw error;
|
|
68
|
+
}
|
|
56
69
|
if (!fix.committed) {
|
|
57
70
|
return unfixedRound(job, fix);
|
|
58
71
|
}
|