next-issue 6.6.120 → 6.6.122
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 +7 -0
- package/dist/config.mjs +17 -0
- package/dist/git-version.mjs +22 -0
- package/dist/run.mjs +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -494,6 +494,9 @@ Three levels of console output:
|
|
|
494
494
|
## Requirements
|
|
495
495
|
|
|
496
496
|
- Node 24 or later
|
|
497
|
+
- git 2.40 or later (every commit runs `git hook run`, every conflict with the
|
|
498
|
+
base runs `git check-attr --source`). A run or `serve` run on an older git
|
|
499
|
+
stops before it claims an issue, with an error that names both versions.
|
|
497
500
|
- `gh`, authenticated with write access to the repository
|
|
498
501
|
- a `remote` on GitHub: `github.com`, or a GitHub Enterprise host. Every `gh`
|
|
499
502
|
call names the host of the remote url (`--repo <host>/<owner>/<name>`,
|
|
@@ -596,6 +599,10 @@ because no pull request is opened.
|
|
|
596
599
|
The hunter adds `labels.hunt` to each issue it files, so you can tell those
|
|
597
600
|
issues apart from your own and filter them.
|
|
598
601
|
|
|
602
|
+
The names in `labels.ready`, `inProgress`, `inReview`, `done`, `needsHuman`
|
|
603
|
+
and `skip` must be distinct, also when case is ignored; two equal names stop
|
|
604
|
+
the run with an error that names both fields. `labels.hunt` may share a name.
|
|
605
|
+
|
|
599
606
|
An empty `labels.ready` turns the ready requirement off. The harness then
|
|
600
607
|
claims every open issue that no other label holds back.
|
|
601
608
|
|
package/dist/config.mjs
CHANGED
|
@@ -166,8 +166,25 @@ function parseLabels(value, defaultLabels) {
|
|
|
166
166
|
parsed[name] = text(labels[name], `labels.${name}`, name === 'ready');
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
|
+
rejectSameLabels(parsed);
|
|
169
170
|
return parsed;
|
|
170
171
|
}
|
|
172
|
+
// Label checks ignore case, so two status labels that match without case would
|
|
173
|
+
// make the harness read one status as another.
|
|
174
|
+
function rejectSameLabels(labels) {
|
|
175
|
+
const seen = new Map();
|
|
176
|
+
for (const name of LABEL_NAMES) {
|
|
177
|
+
if (name === 'hunt' || labels[name] === '') {
|
|
178
|
+
continue;
|
|
179
|
+
}
|
|
180
|
+
const key = labels[name].toLowerCase();
|
|
181
|
+
const other = seen.get(key);
|
|
182
|
+
if (other !== undefined) {
|
|
183
|
+
throw new Error(`${CONFIG_FILE}: labels.${other} and labels.${name} must be different labels, but both are ${labels[name]} when case is ignored.`);
|
|
184
|
+
}
|
|
185
|
+
seen.set(key, name);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
171
188
|
export function managedLabels(config) {
|
|
172
189
|
return LABEL_NAMES.filter((name) => name !== 'skip' && name !== 'hunt').map((name) => config.labels[name]);
|
|
173
190
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { must } from './exec.mjs';
|
|
2
|
+
// `git hook run` (every commit) needs 2.36, `git check-attr --source` (every conflict) needs 2.40.
|
|
3
|
+
export const MIN_GIT = [2, 40];
|
|
4
|
+
export function gitVersionError(output) {
|
|
5
|
+
const match = /^git version (\d+)\.(\d+)(?:\.(\d+))?/.exec(output.trim());
|
|
6
|
+
if (match === null) {
|
|
7
|
+
return `cannot read the git version from "${output.trim()}"`;
|
|
8
|
+
}
|
|
9
|
+
const [major, minor] = [Number(match[1]), Number(match[2])];
|
|
10
|
+
const [needMajor, needMinor] = MIN_GIT;
|
|
11
|
+
if (major > needMajor || (major === needMajor && minor >= needMinor)) {
|
|
12
|
+
return undefined;
|
|
13
|
+
}
|
|
14
|
+
const found = match[3] === undefined ? `${major}.${minor}` : `${major}.${minor}.${match[3]}`;
|
|
15
|
+
return `git ${found} is too old: next-issue needs git ${needMajor}.${needMinor} or later`;
|
|
16
|
+
}
|
|
17
|
+
export async function checkGitVersion() {
|
|
18
|
+
const error = gitVersionError(await must('git', ['--version']));
|
|
19
|
+
if (error !== undefined) {
|
|
20
|
+
throw new Error(error);
|
|
21
|
+
}
|
|
22
|
+
}
|
package/dist/run.mjs
CHANGED
|
@@ -8,6 +8,7 @@ import { withDefaultTimeout } from './exec.mjs';
|
|
|
8
8
|
import { writeJson } from './files.mjs';
|
|
9
9
|
import { slug } from './gh.mjs';
|
|
10
10
|
import { detectRepo } from './git.mjs';
|
|
11
|
+
import { checkGitVersion } from './git-version.mjs';
|
|
11
12
|
import { defaultBranch } from './github.mjs';
|
|
12
13
|
import { hunter } from './hunt.mjs';
|
|
13
14
|
import { lock, lockHolder } from './lock.mjs';
|
|
@@ -43,6 +44,7 @@ export async function runRepo(root, args, controls) {
|
|
|
43
44
|
return withDefaultTimeout(minutesToMs(config.commandTimeoutMinutes), () => runWithConfig(root, args, controls, config));
|
|
44
45
|
}
|
|
45
46
|
async function runWithConfig(root, args, controls, config) {
|
|
47
|
+
await checkGitVersion();
|
|
46
48
|
const repo = await detectRepo(root, config.remote);
|
|
47
49
|
const recorder = await Recorder.create(repo.root, args.level, controls.onEvent);
|
|
48
50
|
const pruned = await pruneRuns(repo.root, config.keepRunDays);
|