next-issue 5.3.0 → 5.4.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 +14 -10
- package/dist/hand-over-comments.mjs +1 -1
- package/dist/skip.mjs +18 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -48,7 +48,8 @@ the run handles one issue. For each issue:
|
|
|
48
48
|
1. Claim the issue only when it holds the `status:todo` label and holds no
|
|
49
49
|
`status:in-progress` or `status:in-review` label. A `status:done`,
|
|
50
50
|
`status:needs-human` or `status:blocked` label always stops the claim, a
|
|
51
|
-
resume too
|
|
51
|
+
resume too, except a `status:needs-human` issue with an answer to its
|
|
52
|
+
hand-over. An issue that GitHub lists as blocked by an open issue waits,
|
|
52
53
|
because its blocker closes only when the change of the blocker lands.
|
|
53
54
|
An issue with saved state under `.next-issue/` resumes instead, whatever its
|
|
54
55
|
other labels and blockers.
|
|
@@ -419,19 +420,22 @@ the prompt asks them to keep only what still holds. The reviewer only reads it.
|
|
|
419
420
|
## Retry an issue that waits for a person
|
|
420
421
|
|
|
421
422
|
A hand-over marks the state file as handed over. To give the issue another try,
|
|
422
|
-
take the `status:needs-human` label off. The next run
|
|
423
|
-
the budgets and the findings back to zero, clears
|
|
424
|
-
and the step that the last run reached, so the
|
|
425
|
-
stopped. After a revert, the branch holds the change
|
|
426
|
-
revert, so the change goes back to the review. An issue
|
|
423
|
+
take the `status:needs-human` label off, or answer the hand-over. The next run
|
|
424
|
+
that claims the issue puts the budgets and the findings back to zero, clears
|
|
425
|
+
the mark and keeps the branch and the step that the last run reached, so the
|
|
426
|
+
work carries on where it stopped. After a revert, the branch holds the change
|
|
427
|
+
again on top of the revert, so the change goes back to the review. An issue
|
|
428
|
+
that still has the label is not claimed, unless it has an answer to the
|
|
429
|
+
hand-over: then the run claims it and takes the label off.
|
|
427
430
|
|
|
428
431
|
To give guidance, answer the hand-over with a comment on the issue. When the run
|
|
429
432
|
resumes the issue, it reads the comments posted after its last
|
|
430
433
|
`next-issue needs help:` comment there. Only comments from users with write
|
|
431
|
-
access to the repository count, for the hand-over comment too.
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
434
|
+
access to the repository count, for the hand-over comment too. A comment that
|
|
435
|
+
starts with one of the headings of the harness never counts as an answer. The
|
|
436
|
+
implementer and every fixer of that run get them in their prompt, under the
|
|
437
|
+
heading `Answer of a person to the hand-over`. A short reply such as "ready,
|
|
438
|
+
take it" is enough. With no such comment, the run resumes with no guidance.
|
|
435
439
|
|
|
436
440
|
The `--reset` flag does the same for any issue that the run handles, whether or
|
|
437
441
|
not it was handed over. It touches only an issue that the run handles, so the
|
package/dist/skip.mjs
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { elapsedMs } from './durations.mjs';
|
|
2
2
|
import { message } from './errors.mjs';
|
|
3
|
-
|
|
3
|
+
import { handOverReply } from './hand-over-comments.mjs';
|
|
4
|
+
export function skipReason(issue, config, resuming, answered = false) {
|
|
4
5
|
const labels = new Set(issue.labels);
|
|
5
6
|
const names = config.labels;
|
|
6
|
-
|
|
7
|
+
const waiting = labels.has(names.needsHuman) && !answered;
|
|
8
|
+
if (labels.has(names.done) || waiting || labels.has(names.skip)) {
|
|
7
9
|
return 'stop-label';
|
|
8
10
|
}
|
|
9
11
|
if (resuming) {
|
|
@@ -18,7 +20,14 @@ export function skipReason(issue, config, resuming) {
|
|
|
18
20
|
return undefined;
|
|
19
21
|
}
|
|
20
22
|
export async function skipReport(context, log, issue, saved, started) {
|
|
21
|
-
|
|
23
|
+
let answered;
|
|
24
|
+
try {
|
|
25
|
+
answered = await hasAnswer(context, issue);
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
return unclaimedError(log, issue, error, started);
|
|
29
|
+
}
|
|
30
|
+
const skip = skipReason(issue, context.config, saved !== undefined, answered);
|
|
22
31
|
if (skip !== undefined) {
|
|
23
32
|
log.event('issue.skip', { title: issue.title, reason: skip });
|
|
24
33
|
return skipped(issue);
|
|
@@ -39,6 +48,12 @@ export async function skipReport(context, log, issue, saved, started) {
|
|
|
39
48
|
}
|
|
40
49
|
return undefined;
|
|
41
50
|
}
|
|
51
|
+
async function hasAnswer(context, issue) {
|
|
52
|
+
if (!issue.labels.includes(context.config.labels.needsHuman)) {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
return (await handOverReply(context, issue.number)).length > 0;
|
|
56
|
+
}
|
|
42
57
|
export function unclaimedError(log, issue, error, started) {
|
|
43
58
|
const { reason, ms } = logIssueError(log, error, started);
|
|
44
59
|
return { ...skipped(issue), outcome: 'error', reason, ms };
|