next-issue 2.5.3 → 2.5.5
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/dist/pipeline.mjs +4 -2
- package/dist/run.mjs +14 -17
- package/package.json +1 -1
package/dist/pipeline.mjs
CHANGED
|
@@ -73,13 +73,15 @@ export async function pendingIssues(context) {
|
|
|
73
73
|
if (listed.has(number)) {
|
|
74
74
|
continue;
|
|
75
75
|
}
|
|
76
|
-
const saved = await readState(repo, number).catch(() =>
|
|
76
|
+
const saved = await readState(repo, number).catch(() => 'broken');
|
|
77
77
|
if (saved === undefined) {
|
|
78
78
|
continue;
|
|
79
79
|
}
|
|
80
80
|
try {
|
|
81
81
|
const { open, ...issue } = await ports.viewIssue(repo, number);
|
|
82
|
-
if (
|
|
82
|
+
if (saved === 'broken' ||
|
|
83
|
+
open ||
|
|
84
|
+
(saved.pr !== undefined && (await ports.prMerged(repo, saved.pr)))) {
|
|
83
85
|
issues.push(issue);
|
|
84
86
|
}
|
|
85
87
|
}
|
package/dist/run.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
1
2
|
import { writeFile } from 'node:fs/promises';
|
|
2
|
-
import { join
|
|
3
|
+
import { join } from 'node:path';
|
|
3
4
|
import { loadConfig } from './config.mjs';
|
|
4
5
|
import { setCommandObserver, setDefaultTimeout } from './exec.mjs';
|
|
5
6
|
import { detectRepo } from './git.mjs';
|
|
@@ -9,21 +10,19 @@ import { message, pruneRuns, Recorder } from './observe.mjs';
|
|
|
9
10
|
import { pendingIssues, PORTS, processIssue } from './pipeline.mjs';
|
|
10
11
|
import { STATE_DIR } from './state.mjs';
|
|
11
12
|
import { packageVersion } from './version.mjs';
|
|
12
|
-
const
|
|
13
|
+
const commandRecorder = new AsyncLocalStorage();
|
|
13
14
|
setCommandObserver((record) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
ms: record.ms,
|
|
22
|
-
stderr: record.stderr.length > 0 ? record.stderr : undefined,
|
|
23
|
-
timedOut: record.timedOut ? true : undefined,
|
|
24
|
-
}, record.code === 0 ? 'verbose' : 'quiet');
|
|
25
|
-
}
|
|
15
|
+
commandRecorder.getStore()?.event(record.code === 0 ? 'command' : 'command.fail', {
|
|
16
|
+
cmd: `${record.command} ${record.args.join(' ')}`,
|
|
17
|
+
code: record.code,
|
|
18
|
+
ms: record.ms,
|
|
19
|
+
stderr: record.stderr.length > 0 ? record.stderr : undefined,
|
|
20
|
+
timedOut: record.timedOut ? true : undefined,
|
|
21
|
+
}, record.code === 0 ? 'verbose' : 'quiet');
|
|
26
22
|
});
|
|
23
|
+
export function recordCommands(recorder, work) {
|
|
24
|
+
return commandRecorder.run(recorder, work);
|
|
25
|
+
}
|
|
27
26
|
export async function runRepo(root, args, controls) {
|
|
28
27
|
const config = await loadConfig(root);
|
|
29
28
|
setDefaultTimeout(config.commandTimeoutMinutes * 60_000);
|
|
@@ -33,12 +32,10 @@ export async function runRepo(root, args, controls) {
|
|
|
33
32
|
if (pruned > 0) {
|
|
34
33
|
recorder.event('runs.pruned', { files: pruned, keepDays: config.keepRunDays }, 'verbose');
|
|
35
34
|
}
|
|
36
|
-
recorders.set(repo.root, recorder);
|
|
37
35
|
try {
|
|
38
|
-
return await handle(args, config, repo, recorder, controls);
|
|
36
|
+
return await recordCommands(recorder, () => handle(args, config, repo, recorder, controls));
|
|
39
37
|
}
|
|
40
38
|
finally {
|
|
41
|
-
recorders.delete(repo.root);
|
|
42
39
|
await recorder.close();
|
|
43
40
|
}
|
|
44
41
|
}
|