next-issue 7.8.22 → 7.8.23
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 +2 -1
- package/dist/hand-over-comments.mjs +6 -5
- package/dist/skip.mjs +2 -2
- package/dist/state.mjs +3 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -940,7 +940,8 @@ affect another. The worker:
|
|
|
940
940
|
ends, and when a client sends `{ "type": "questions", "root": "<path>" }`.
|
|
941
941
|
An issue that no longer has the label leaves the list, and so does an issue
|
|
942
942
|
whose hand-over has an answer from a writer, the same answer that lets a run
|
|
943
|
-
claim it. An issue with the
|
|
943
|
+
claim it. An issue that a person holds with the label stays in the list,
|
|
944
|
+
even when an earlier hand-over has an answer. An issue with the
|
|
944
945
|
label but no hand-over comment is in the list with an empty reason and url.
|
|
945
946
|
The issues are read one at a time. A client never gets an older list after
|
|
946
947
|
a newer one. When the client adds an `"id"` to its message, the list that
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { repoArg } from './gh.mjs';
|
|
2
|
-
import { readState } from './state.mjs';
|
|
2
|
+
import { heldByPerson, readState } from './state.mjs';
|
|
3
3
|
export const HAND_OVER = 'next-issue needs help:';
|
|
4
4
|
const HARNESS_HEADINGS = [HAND_OVER, '### Review:', '### Fixer:'];
|
|
5
5
|
function fromHarness(comment) {
|
|
@@ -67,9 +67,9 @@ function answerCandidates(comments, last, pending) {
|
|
|
67
67
|
async function replyAfter(comments, last, writer, pending) {
|
|
68
68
|
return writerQuotes(answerCandidates(comments, last, pending).filter((comment) => !fromHarness(comment)), writer);
|
|
69
69
|
}
|
|
70
|
-
async function
|
|
70
|
+
async function savedState(repo, issue) {
|
|
71
71
|
try {
|
|
72
|
-
return
|
|
72
|
+
return await readState(repo, issue);
|
|
73
73
|
}
|
|
74
74
|
catch {
|
|
75
75
|
return undefined;
|
|
@@ -77,8 +77,9 @@ async function pendingHandOver(repo, issue) {
|
|
|
77
77
|
}
|
|
78
78
|
async function waitingQuestion(repo, config, ports, writer, issue) {
|
|
79
79
|
const { comments, last } = await handOverThread(repo, ports, writer, issue.number);
|
|
80
|
-
const
|
|
81
|
-
|
|
80
|
+
const saved = await savedState(repo, issue.number);
|
|
81
|
+
const pending = saved?.pendingHandOver;
|
|
82
|
+
if (!heldByPerson(saved) && (await replyAfter(comments, last, writer, pending)).length > 0) {
|
|
82
83
|
return undefined;
|
|
83
84
|
}
|
|
84
85
|
const latest = comments[last];
|
package/dist/skip.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { message } from './errors.mjs';
|
|
|
4
4
|
import { handOverReply } from './hand-over-comments.mjs';
|
|
5
5
|
import { stopNow } from './handover.mjs';
|
|
6
6
|
import { hasLabel } from './labels.mjs';
|
|
7
|
-
import { writeState } from './state.mjs';
|
|
7
|
+
import { heldByPerson, writeState } from './state.mjs';
|
|
8
8
|
import { heldOnBase } from './unsettled.mjs';
|
|
9
9
|
export function skipReason(issue, config, resuming, answered = false) {
|
|
10
10
|
const has = (name) => hasLabel(issue.labels, name);
|
|
@@ -74,7 +74,7 @@ async function hasAnswer(context, issue, saved) {
|
|
|
74
74
|
if (!hasLabel(issue.labels, context.config.labels.needsHuman)) {
|
|
75
75
|
return false;
|
|
76
76
|
}
|
|
77
|
-
if (saved
|
|
77
|
+
if (heldByPerson(saved)) {
|
|
78
78
|
return false;
|
|
79
79
|
}
|
|
80
80
|
return (await handOverReply(context, issue.number, saved?.pendingHandOver)).length > 0;
|
package/dist/state.mjs
CHANGED
|
@@ -83,6 +83,9 @@ export async function savedIssues(repo) {
|
|
|
83
83
|
return match === null ? [] : [Number(match[1])];
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
|
+
export function heldByPerson(saved) {
|
|
87
|
+
return saved !== undefined && saved.handedOver !== true && saved.pendingHandOver === undefined;
|
|
88
|
+
}
|
|
86
89
|
export function newState(issue, branch) {
|
|
87
90
|
return { issue, phase: 'claimed', branch, ciFixes: 0, reviewRounds: 0, reviewLog: [] };
|
|
88
91
|
}
|