next-issue 6.6.9 → 6.6.11
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 -5
- package/dist/agent-reply.mjs +2 -2
- package/dist/config-fields.mjs +9 -3
- package/dist/config.mjs +10 -7
- package/dist/durations.mjs +6 -2
- package/dist/poll.mjs +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -391,12 +391,12 @@ because no pull request is opened.
|
|
|
391
391
|
| `maxCiFixes` | `5` | The budget for check fixes per issue |
|
|
392
392
|
| `maxCommitFixes` | `10` | The budget for fixes of a commit that a git hook stopped, per issue |
|
|
393
393
|
| `maxReviewRounds` | `5` | The budget for review rounds per issue |
|
|
394
|
-
| `checkIntervalSeconds` | `15` | The time between two check states
|
|
394
|
+
| `checkIntervalSeconds` | `15` | The time between two check states, at most `2147483` |
|
|
395
395
|
| `checkGraceSeconds` | `60` | The time to wait for the first check to show |
|
|
396
|
-
| `checkTimeoutMinutes` | `60` | The limit for one check wait
|
|
397
|
-
| `agentTimeoutMinutes` | `30` | The limit for one agent call
|
|
398
|
-
| `setupTimeoutMinutes` | `15` | The limit for the setup command
|
|
399
|
-
| `commandTimeoutMinutes` | `10` | The limit for one `git` or `gh` command
|
|
396
|
+
| `checkTimeoutMinutes` | `60` | The limit for one check wait, at most `35791` |
|
|
397
|
+
| `agentTimeoutMinutes` | `30` | The limit for one agent call, at most `35791` |
|
|
398
|
+
| `setupTimeoutMinutes` | `15` | The limit for the setup command, at most `35791` |
|
|
399
|
+
| `commandTimeoutMinutes` | `10` | The limit for one `git` or `gh` command, at most `35791` |
|
|
400
400
|
| `logMaxChars` | `20000` | The maximum length of the failed job logs, shared between the failed jobs |
|
|
401
401
|
| `diffMaxChars` | `60000` | The maximum length of the diff that the reviewer reads |
|
|
402
402
|
| `keepRunDays` | `7` | The number of days to keep the run files; `0` keeps them all |
|
package/dist/agent-reply.mjs
CHANGED
|
@@ -3,11 +3,11 @@ function lastMatch(text, pattern) {
|
|
|
3
3
|
}
|
|
4
4
|
const PLACEHOLDERS = new Set(['', 'none', 'n/a', '-']);
|
|
5
5
|
export function parseUnrelated(text) {
|
|
6
|
-
const note = lastMatch(text, /^unrelated
|
|
6
|
+
const note = lastMatch(text, /^unrelated:[^\S\r\n]*(.+)$/gim);
|
|
7
7
|
return note === undefined || PLACEHOLDERS.has(note.toLowerCase()) ? undefined : note;
|
|
8
8
|
}
|
|
9
9
|
export function parseResolved(text) {
|
|
10
|
-
const note = lastMatch(text, /^resolved
|
|
10
|
+
const note = lastMatch(text, /^resolved:[^\S\r\n]*(.+)$/gim);
|
|
11
11
|
return note === '' ? undefined : note;
|
|
12
12
|
}
|
|
13
13
|
export function parseCommitSubject(text, fallback) {
|
package/dist/config-fields.mjs
CHANGED
|
@@ -13,12 +13,18 @@ export function rejectUnknown(value, known, what) {
|
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
-
export function whole(value, field, least) {
|
|
17
|
-
if (typeof value !== 'number' ||
|
|
18
|
-
|
|
16
|
+
export function whole(value, field, least, most) {
|
|
17
|
+
if (typeof value !== 'number' ||
|
|
18
|
+
!Number.isInteger(value) ||
|
|
19
|
+
value < least ||
|
|
20
|
+
(most !== undefined && value > most)) {
|
|
21
|
+
throw new Error(`${CONFIG_FILE}: ${field} must be a whole number ${range(least, most)}.`);
|
|
19
22
|
}
|
|
20
23
|
return value;
|
|
21
24
|
}
|
|
25
|
+
function range(least, most) {
|
|
26
|
+
return most === undefined ? `of ${least} or more` : `from ${least} to ${most}`;
|
|
27
|
+
}
|
|
22
28
|
export function text(value, field, allowEmpty) {
|
|
23
29
|
if (typeof value !== 'string' || (!allowEmpty && value.length === 0)) {
|
|
24
30
|
throw new Error(`${CONFIG_FILE}: ${field} must be ${allowEmpty ? 'text' : 'text that is not empty'}.`);
|
package/dist/config.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { mkdir, readFile, rename } from 'node:fs/promises';
|
|
2
2
|
import { dirname, join } from 'node:path';
|
|
3
3
|
import { CONFIG_FILE, OLD_CONFIG_FILE, record, rejectUnknown, text, whole, } from './config-fields.mjs';
|
|
4
|
+
import { MAX_TIMER_MS } from './durations.mjs';
|
|
4
5
|
import { hasCode, message, parseJson } from './errors.mjs';
|
|
5
6
|
import { readTextIfPresent, unlessMissing, writeJson } from './files.mjs';
|
|
6
7
|
const DEFAULTS = {
|
|
@@ -35,6 +36,8 @@ function defaults() {
|
|
|
35
36
|
return { ...DEFAULTS, models: { ...DEFAULTS.models }, labels: { ...DEFAULTS.labels } };
|
|
36
37
|
}
|
|
37
38
|
const FIELDS = [...Object.keys(DEFAULTS), 'setupCommand'];
|
|
39
|
+
const MAX_MINUTES = Math.floor(MAX_TIMER_MS / 60_000);
|
|
40
|
+
const MAX_SECONDS = Math.floor(MAX_TIMER_MS / 1000);
|
|
38
41
|
const WHOLE_FIELDS = [
|
|
39
42
|
['issueLimit', 1],
|
|
40
43
|
['concurrency', 1],
|
|
@@ -42,12 +45,12 @@ const WHOLE_FIELDS = [
|
|
|
42
45
|
['maxCiFixes', 0],
|
|
43
46
|
['maxCommitFixes', 0],
|
|
44
47
|
['maxReviewRounds', 1],
|
|
45
|
-
['checkIntervalSeconds', 1],
|
|
48
|
+
['checkIntervalSeconds', 1, MAX_SECONDS],
|
|
46
49
|
['checkGraceSeconds', 0],
|
|
47
|
-
['checkTimeoutMinutes', 1],
|
|
48
|
-
['agentTimeoutMinutes', 1],
|
|
49
|
-
['setupTimeoutMinutes', 1],
|
|
50
|
-
['commandTimeoutMinutes', 1],
|
|
50
|
+
['checkTimeoutMinutes', 1, MAX_MINUTES],
|
|
51
|
+
['agentTimeoutMinutes', 1, MAX_MINUTES],
|
|
52
|
+
['setupTimeoutMinutes', 1, MAX_MINUTES],
|
|
53
|
+
['commandTimeoutMinutes', 1, MAX_MINUTES],
|
|
51
54
|
['logMaxChars', 1],
|
|
52
55
|
['diffMaxChars', 1],
|
|
53
56
|
['keepRunDays', 0],
|
|
@@ -127,9 +130,9 @@ function parseConfig(value) {
|
|
|
127
130
|
if (file.remote !== undefined) {
|
|
128
131
|
config.remote = text(file.remote, 'remote', false);
|
|
129
132
|
}
|
|
130
|
-
for (const [field, least] of WHOLE_FIELDS) {
|
|
133
|
+
for (const [field, least, most] of WHOLE_FIELDS) {
|
|
131
134
|
if (file[field] !== undefined) {
|
|
132
|
-
config[field] = whole(file[field], field, least);
|
|
135
|
+
config[field] = whole(file[field], field, least, most);
|
|
133
136
|
}
|
|
134
137
|
}
|
|
135
138
|
if (file.setupCommand !== undefined) {
|
package/dist/durations.mjs
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
export const MAX_TIMER_MS = 2_147_483_647;
|
|
2
|
+
export function timerMs(ms) {
|
|
3
|
+
return Math.min(ms, MAX_TIMER_MS);
|
|
4
|
+
}
|
|
1
5
|
export function minutesToMs(minutes) {
|
|
2
6
|
return minutes * 60_000;
|
|
3
7
|
}
|
|
@@ -14,7 +18,7 @@ export function deadline(ms, onExpire) {
|
|
|
14
18
|
: setTimeout(() => {
|
|
15
19
|
timedOut = true;
|
|
16
20
|
onExpire();
|
|
17
|
-
}, ms);
|
|
21
|
+
}, timerMs(ms));
|
|
18
22
|
return { timedOut: () => timedOut, clear: () => clearTimeout(timer) };
|
|
19
23
|
}
|
|
20
24
|
export function elapsedMs(started) {
|
|
@@ -31,7 +35,7 @@ export function wakeableSleep(sleeper, ms, stopped) {
|
|
|
31
35
|
sleeper.wake = undefined;
|
|
32
36
|
resolve(slept);
|
|
33
37
|
};
|
|
34
|
-
const timer = setTimeout(() => settle(true), ms);
|
|
38
|
+
const timer = setTimeout(() => settle(true), timerMs(ms));
|
|
35
39
|
sleeper.wake = () => settle(false);
|
|
36
40
|
});
|
|
37
41
|
}
|
package/dist/poll.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { setTimeout as delay } from 'node:timers/promises';
|
|
2
|
-
import { secondsToMs } from './durations.mjs';
|
|
2
|
+
import { secondsToMs, timerMs } from './durations.mjs';
|
|
3
3
|
export const REAL_CLOCK = {
|
|
4
4
|
now: () => Date.now(),
|
|
5
5
|
sleep: (ms) => delay(ms),
|
|
6
6
|
};
|
|
7
7
|
export function pause(clock, options, rest) {
|
|
8
|
-
return clock.sleep(Math.min(secondsToMs(options.intervalSeconds), rest));
|
|
8
|
+
return clock.sleep(timerMs(Math.min(secondsToMs(options.intervalSeconds), rest)));
|
|
9
9
|
}
|