next-issue 2.11.0 → 2.12.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 +5 -2
- package/dist/handover.mjs +3 -0
- package/dist/serve.mjs +9 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -471,14 +471,17 @@ to it. The worker:
|
|
|
471
471
|
issues;
|
|
472
472
|
- sends every client a `questions` message for each repository: the open
|
|
473
473
|
issues with the `needsHuman` label, each with its number, title, the reason
|
|
474
|
-
of the hand-over
|
|
474
|
+
of the hand-over, the url of the comment that holds it, the `owner/name`
|
|
475
|
+
repository, the pull request when there is one, and the `needsHuman` and
|
|
476
|
+
`skip` labels. It reads them
|
|
475
477
|
from GitHub, so the list is the same after a restart. It sends them when a
|
|
476
478
|
client connects, for each repository it knows, after each issue of a run
|
|
477
479
|
ends, and when a client sends `{ "type": "questions", "root": "<path>" }`.
|
|
478
480
|
An issue that no longer has the label leaves the list. An issue with the
|
|
479
481
|
label but no hand-over comment is in the list with an empty reason and url.
|
|
480
482
|
The issues are read one at a time. A client never gets an older list after
|
|
481
|
-
a newer one. When the
|
|
483
|
+
a newer one. When the client adds an `"id"` to its message, the list that
|
|
484
|
+
answers it carries the same `id` and is read after the message arrived. When the list cannot be read, the client gets
|
|
482
485
|
`{ "type": "questions-error", "root": "<path>", "message": "<text>" }`;
|
|
483
486
|
- stops a run, when a client asks, like a second `Ctrl-C`: after the current
|
|
484
487
|
round, with the state kept;
|
package/dist/handover.mjs
CHANGED
|
@@ -33,6 +33,9 @@ export async function waitingQuestions(repo, config, ports) {
|
|
|
33
33
|
title: issue.title,
|
|
34
34
|
reason: comment?.body.slice(HAND_OVER.length).trim() ?? '',
|
|
35
35
|
url: comment?.url ?? '',
|
|
36
|
+
repo: `${repo.owner}/${repo.name}`,
|
|
37
|
+
...(pr === undefined ? {} : { pr }),
|
|
38
|
+
labels: { needsHuman: config.labels.needsHuman, skip: config.labels.skip },
|
|
36
39
|
});
|
|
37
40
|
}
|
|
38
41
|
return questions;
|
package/dist/serve.mjs
CHANGED
|
@@ -113,7 +113,7 @@ export async function startWorker(options) {
|
|
|
113
113
|
send(socket, value);
|
|
114
114
|
}
|
|
115
115
|
};
|
|
116
|
-
const sendQuestions = async (root, targets) => {
|
|
116
|
+
const sendQuestions = async (root, targets, id) => {
|
|
117
117
|
remember(root);
|
|
118
118
|
const read = (reads.get(root) ?? 0) + 1;
|
|
119
119
|
reads.set(root, read);
|
|
@@ -126,10 +126,14 @@ export async function startWorker(options) {
|
|
|
126
126
|
}
|
|
127
127
|
for (const socket of targets()) {
|
|
128
128
|
const seen = delivered.get(socket) ?? new Map();
|
|
129
|
-
|
|
130
|
-
|
|
129
|
+
const last = seen.get(root);
|
|
130
|
+
if (last === undefined || last.read < read) {
|
|
131
|
+
seen.set(root, { read, value });
|
|
131
132
|
delivered.set(socket, seen);
|
|
132
|
-
send(socket, value);
|
|
133
|
+
send(socket, id === undefined ? value : { ...value, id });
|
|
134
|
+
}
|
|
135
|
+
else if (id !== undefined) {
|
|
136
|
+
send(socket, { ...last.value, id });
|
|
133
137
|
}
|
|
134
138
|
}
|
|
135
139
|
};
|
|
@@ -240,7 +244,7 @@ export async function startWorker(options) {
|
|
|
240
244
|
stop(value.root);
|
|
241
245
|
}
|
|
242
246
|
else if (value.type === 'questions') {
|
|
243
|
-
void sendQuestions(value.root, () => [socket]);
|
|
247
|
+
void sendQuestions(value.root, () => [socket], value.id);
|
|
244
248
|
}
|
|
245
249
|
});
|
|
246
250
|
});
|