next-issue 2.7.0 → 2.9.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/README.md +10 -8
- package/dist/handover.mjs +1 -1
- package/dist/pipeline.mjs +5 -1
- package/dist/state.mjs +4 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -379,14 +379,16 @@ silent skip.
|
|
|
379
379
|
|
|
380
380
|
## Retry an issue that waits for a person
|
|
381
381
|
|
|
382
|
-
A hand-over
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
382
|
+
A hand-over marks the state file as handed over. To give the issue another try,
|
|
383
|
+
take the `status:needs-human` label off. The next run that claims the issue puts
|
|
384
|
+
the budgets and the findings back to zero, clears the mark and keeps the branch,
|
|
385
|
+
the pull request and the step that the last run reached, so the work carries on
|
|
386
|
+
where it stopped. A commit that you pushed to the pull request in the meantime
|
|
387
|
+
is fetched first. An issue that still has the label is not claimed.
|
|
388
|
+
|
|
389
|
+
The `--reset` flag does the same for any issue that the run handles, whether or
|
|
390
|
+
not it was handed over. It touches only an issue that the run handles, so the
|
|
391
|
+
state of an issue that a label still holds back stays as it was.
|
|
390
392
|
|
|
391
393
|
## Commands and options
|
|
392
394
|
|
package/dist/handover.mjs
CHANGED
|
@@ -55,7 +55,7 @@ export async function cleanUp(context, log, branch) {
|
|
|
55
55
|
}
|
|
56
56
|
export async function handOver(context, log, issue, state, reason) {
|
|
57
57
|
log.event('hand-over', { reason }, 'quiet');
|
|
58
|
-
await writeState(context.repo, state);
|
|
58
|
+
await writeState(context.repo, { ...state, handedOver: true });
|
|
59
59
|
await setStatus(context, issue, state.pr, context.config.labels.needsHuman);
|
|
60
60
|
const body = `next-issue needs help: ${reason}`;
|
|
61
61
|
if (state.pr === undefined) {
|
package/dist/pipeline.mjs
CHANGED
|
@@ -106,7 +106,11 @@ export async function processIssue(context, issue) {
|
|
|
106
106
|
reviewRounds: 0,
|
|
107
107
|
reviewLog: [],
|
|
108
108
|
};
|
|
109
|
-
const state = saved === undefined
|
|
109
|
+
const state = saved === undefined
|
|
110
|
+
? fresh
|
|
111
|
+
: context.reset || saved.handedOver === true
|
|
112
|
+
? resetState(saved)
|
|
113
|
+
: saved;
|
|
110
114
|
try {
|
|
111
115
|
const report = await work(context, issue, log, state, saved === undefined);
|
|
112
116
|
log.event('issue.end', { outcome: report.outcome, reason: report.reason, ms: report.ms }, 'quiet');
|
package/dist/state.mjs
CHANGED
|
@@ -60,7 +60,8 @@ function isState(value) {
|
|
|
60
60
|
(value.baseFix === undefined || isBaseFix(value.baseFix)) &&
|
|
61
61
|
typeof value.reviewRounds === 'number' &&
|
|
62
62
|
Array.isArray(value.reviewLog) &&
|
|
63
|
-
value.reviewLog.every(isReviewRound)
|
|
63
|
+
value.reviewLog.every(isReviewRound) &&
|
|
64
|
+
(value.handedOver === undefined || typeof value.handedOver === 'boolean'));
|
|
64
65
|
}
|
|
65
66
|
export async function savedIssues(repo) {
|
|
66
67
|
let names;
|
|
@@ -79,7 +80,8 @@ export async function savedIssues(repo) {
|
|
|
79
80
|
});
|
|
80
81
|
}
|
|
81
82
|
export function resetState(state) {
|
|
82
|
-
|
|
83
|
+
const { handedOver: _handedOver, ...rest } = state;
|
|
84
|
+
return { ...rest, ciFixes: 0, commitFixes: 0, reviewRounds: 0, reviewLog: [] };
|
|
83
85
|
}
|
|
84
86
|
export async function writeState(repo, state) {
|
|
85
87
|
await mkdir(dir(repo), { recursive: true });
|