next-issue 7.8.16 → 7.8.17
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/README.md +4 -2
- package/dist/pipeline.mjs +2 -1
- package/dist/review.mjs +8 -5
- package/dist/state.mjs +6 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -118,8 +118,10 @@ the run handles one issue. For each issue:
|
|
|
118
118
|
checked out, the harness checks out the issue branch again at its commit
|
|
119
119
|
from before the review. It does the same when the reviewer times out or
|
|
120
120
|
fails. The state file keeps that commit while the reviewer runs, so when
|
|
121
|
-
the run stops during the review, the
|
|
122
|
-
branch back at that commit,
|
|
121
|
+
the run stops during the review, the next run that resumes the issue first
|
|
122
|
+
puts the issue branch back at that commit, before the setup command, and
|
|
123
|
+
the diff it reads holds no reviewer commit. A commit that a person adds to
|
|
124
|
+
the branch after a hand-over stays on it.
|
|
123
125
|
The first reviewer also gets the reply of the implementer, and raises a
|
|
124
126
|
finding when a behaviour change has no failing run of its test. A later
|
|
125
127
|
reviewer gets the reply of the last review fixer instead, who quotes the
|
package/dist/pipeline.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { runStopped } from './children.mjs';
|
|
|
4
4
|
import { claimedError, dropClosed, finishClosing, stop, stopNow } from './handover.mjs';
|
|
5
5
|
import { implement } from './implement.mjs';
|
|
6
6
|
import { openJob } from './open-job.mjs';
|
|
7
|
-
import { reviewRound } from './review.mjs';
|
|
7
|
+
import { reviewRound, settleReview } from './review.mjs';
|
|
8
8
|
import { skipReport, unclaimedError } from './skip.mjs';
|
|
9
9
|
import { hasLabel } from './labels.mjs';
|
|
10
10
|
import { newState, readState, resetState, } from './state.mjs';
|
|
@@ -71,6 +71,7 @@ function startState(context, issue, saved, handedOver) {
|
|
|
71
71
|
async function work(context, issue, log, state, start, handedOver, pending) {
|
|
72
72
|
const { job, setup } = await beforeBaseSettled(state, context.base, async () => {
|
|
73
73
|
const opened = await openJob(context, issue, log, state, start, handedOver, pending);
|
|
74
|
+
await settleReview(opened);
|
|
74
75
|
return { job: opened, setup: await setUp(opened) };
|
|
75
76
|
});
|
|
76
77
|
if (setup.done) {
|
package/dist/review.mjs
CHANGED
|
@@ -71,11 +71,9 @@ function recordVerdict(job, verdict, open) {
|
|
|
71
71
|
async function runReviewer(job, earlier) {
|
|
72
72
|
const { context, issue, log, state, worktree, comments } = job;
|
|
73
73
|
const { config, ports } = context;
|
|
74
|
-
const before =
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
await writeState(context.repo, state);
|
|
78
|
-
}
|
|
74
|
+
const before = await ports.revision(worktree);
|
|
75
|
+
state.reviewing = before;
|
|
76
|
+
await writeState(context.repo, state);
|
|
79
77
|
if (await ports.discardChanges(worktree, before, job.branch)) {
|
|
80
78
|
log.event('review.clean', { round: state.reviewRounds }, 'quiet');
|
|
81
79
|
}
|
|
@@ -103,6 +101,11 @@ async function runReviewer(job, earlier) {
|
|
|
103
101
|
}
|
|
104
102
|
return review.text;
|
|
105
103
|
}
|
|
104
|
+
export async function settleReview(job) {
|
|
105
|
+
if (job.state.reviewing !== undefined) {
|
|
106
|
+
await undoReview(job, job.state.reviewing);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
106
109
|
async function undoReview(job, before) {
|
|
107
110
|
const { context, log, state, worktree } = job;
|
|
108
111
|
if (await context.ports.discardChanges(worktree, before, job.branch)) {
|
package/dist/state.mjs
CHANGED
|
@@ -87,13 +87,16 @@ export function newState(issue, branch) {
|
|
|
87
87
|
return { issue, phase: 'claimed', branch, ciFixes: 0, reviewRounds: 0, reviewLog: [] };
|
|
88
88
|
}
|
|
89
89
|
/**
|
|
90
|
-
* Drops the budgets and findings; a hand-over (`handedOver`) also cancels an approval and the
|
|
90
|
+
* Drops the budgets and findings; a hand-over (`handedOver`) also cancels an approval, the closing mark and the review start,
|
|
91
91
|
* so a resume that stops before it finishes is resumed again rather than closed as done.
|
|
92
92
|
*/
|
|
93
93
|
export function resetState(state, handedOver = false) {
|
|
94
|
-
const { handedOver: _handedOver, pendingHandOver: _pending, closing, ...rest } = state;
|
|
94
|
+
const { handedOver: _handedOver, pendingHandOver: _pending, closing, reviewing, ...rest } = state;
|
|
95
95
|
const phase = handedOver && rest.phase === 'approved' ? 'review' : rest.phase;
|
|
96
|
-
const kept =
|
|
96
|
+
const kept = {
|
|
97
|
+
...(!handedOver && closing !== undefined ? { closing } : {}),
|
|
98
|
+
...(!handedOver && reviewing !== undefined ? { reviewing } : {}),
|
|
99
|
+
};
|
|
97
100
|
return { ...rest, ...kept, phase, ciFixes: 0, commitFixes: 0, reviewRounds: 0, reviewLog: [] };
|
|
98
101
|
}
|
|
99
102
|
export async function writeState(repo, state) {
|