next-issue 12.2.0 → 12.3.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 +1 -1
- package/dist/start.mjs +6 -2
- package/dist/worker-client.mjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -34,7 +34,7 @@ flowchart TD
|
|
|
34
34
|
|
|
35
35
|
Before each issue, fetch the open issues again and take the oldest one not yet seen in this run. An issue seen once in a run is not tried again in that run while its labels stay as the first fetch after its attempt found them. When its labels change, for example once a person answers a hand-over or makes a skipped issue ready, the next fetch claims it again in the usual order. An issue that is done, or that failed with an error and was not handed over, is not tried again in that run. The run ends when no unseen issue is left. When the fetch fails, the run claims no new issue, ends once the running issues end, writes the summary of the issues it handled and exits with code 1.
|
|
36
36
|
|
|
37
|
-
`next-issue start` runs the work in the worker of the repository, see [Worker](#worker). It connects to the worker, or starts one in the background (`next-issue serve` of the same version, with its output in `.next-issue/worker.log`) when none answers, and then starts the run there with its flags. It prints the output of the run on standard error and the summary on standard output, and exits with the exit code of the run. When the terminal closes or the command ends some other way, the run keeps going in the worker, and pi and `next-issue logs` still show it. pi shows the run in `/next-issue` and the dashboard, and its Stop, Watch, Hunt and Refresh work on it. When the worker is older than `start` and no run is going, it closes and `start` starts a new one. When a newer client, such as a newer pi, connects while a run of `start` watches, the worker upgrades it between issues like any other run (see [Worker](#worker)): the run stops after its running issues and starts again on the newer worker with watching on and its `--hunt` setting. `start` follows it across the upgrade: it connects to the newer worker, prints `next-issue: the worker was updated from <old> to <new>` once on standard error, goes on printing the output of the run, keeps `Ctrl-C` working (a press while it moves to the newer worker reaches the run there) and exits only when the run ends, with exit code 1 when an issue needed a person or failed before or after the upgrade. Lines that the run prints on the newer worker before `start` connects go only to `.next-issue/worker.log`. When the run does not go on in the newer worker within 30 seconds, `start` fails with `the worker closed the connection, and the run did not go on in the newer worker` and exits with 1. A run that does not watch is not upgraded: the worker upgrades once it ends. When a run is going in the worker already, `start` exits with code 1 and the error `a run is going in this repository already
|
|
37
|
+
`next-issue start` runs the work in the worker of the repository, see [Worker](#worker). It connects to the worker, or starts one in the background (`next-issue serve` of the same version, with its output in `.next-issue/worker.log`) when none answers, and then starts the run there with its flags. It prints the output of the run on standard error and the summary on standard output, and exits with the exit code of the run. When the terminal closes or the command ends some other way, the run keeps going in the worker, and pi and `next-issue logs` still show it. pi shows the run in `/next-issue` and the dashboard, and its Stop, Watch, Hunt and Refresh work on it. When the worker is older than `start` and no run is going, it closes and `start` starts a new one. When a newer client, such as a newer pi, connects while a run of `start` watches, the worker upgrades it between issues like any other run (see [Worker](#worker)): the run stops after its running issues and starts again on the newer worker with watching on and its `--hunt` setting. `start` follows it across the upgrade: it connects to the newer worker, prints `next-issue: the worker was updated from <old> to <new>` once on standard error, goes on printing the output of the run, keeps `Ctrl-C` working (a press while it moves to the newer worker reaches the run there) and exits only when the run ends, with exit code 1 when an issue needed a person or failed before or after the upgrade. Lines that the run prints on the newer worker before `start` connects go only to `.next-issue/worker.log`. When the run does not go on in the newer worker within 30 seconds, `start` fails with `the worker closed the connection, and the run did not go on in the newer worker` and exits with 1. A run that does not watch is not upgraded: the worker upgrades once it ends. `start` tells the worker its version each time it connects, as pi does. When a run is going in the worker already, `start` exits with code 1 and the error `a run is going in this repository already`. When that worker is older, the error adds `; the worker updates to <version> after the running issues`: a watching run stops after its running issues and starts again on the newer worker, as for pi; a run that does not watch is upgraded once it ends. `start` ignores `--force`, as before.
|
|
38
38
|
|
|
39
39
|
Only one worker goes at a time in a repository. It holds the lock `.next-issue/worker.lock`, with the process id and the start time of that process, for its whole life. A run that the worker starts takes no lock of its own, since the worker runs at most one run at a time. When a process that does not take connections on the worker socket holds the lock for more than 2 seconds, `start` starts a worker anyway, which exits with `another worker is running`, so `start` claims no issue and exits with code 1 and the error `the next-issue worker exited before it listened: exit code 1 (see .next-issue/worker.log)`. A lock whose process is gone, or started at another time, is stale and taken over.
|
|
40
40
|
|
package/dist/start.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { randomUUID } from 'node:crypto';
|
|
2
2
|
import { NOTES, onPresses } from './interrupt.mjs';
|
|
3
|
+
import { isNewer, } from './protocol.mjs';
|
|
3
4
|
import { formatSummary } from './summary.mjs';
|
|
4
5
|
import { packageVersion } from './version.mjs';
|
|
5
6
|
import { CLOSED, going, reachWorker, rejoinRun } from './worker-client.mjs';
|
|
@@ -20,10 +21,13 @@ function firstNote(message) {
|
|
|
20
21
|
return message.hunting ? NOTES.hunt : NOTES.wait;
|
|
21
22
|
}
|
|
22
23
|
export async function startInWorker(root, args, argv) {
|
|
23
|
-
const
|
|
24
|
+
const version = await packageVersion();
|
|
25
|
+
const connection = await reachWorker(root, version);
|
|
24
26
|
if (going(connection.runs[root])) {
|
|
25
27
|
connection.close();
|
|
26
|
-
throw new Error(
|
|
28
|
+
throw new Error(isNewer(version, connection.version)
|
|
29
|
+
? `${RUN_GOING}; the worker updates to ${version} after the running issues`
|
|
30
|
+
: RUN_GOING);
|
|
27
31
|
}
|
|
28
32
|
const out = output();
|
|
29
33
|
const code = await follow(connection, root, args, argv, out);
|
package/dist/worker-client.mjs
CHANGED
|
@@ -73,7 +73,7 @@ function open(socketPath, version) {
|
|
|
73
73
|
else if (message.type === 'runs') {
|
|
74
74
|
ready = true;
|
|
75
75
|
clearTimeout(timer);
|
|
76
|
-
if (version !== undefined
|
|
76
|
+
if (version !== undefined) {
|
|
77
77
|
socket.send(JSON.stringify({ type: 'hello', version, launch: ownLaunch() }));
|
|
78
78
|
}
|
|
79
79
|
resolve({
|