next-issue 6.6.122 → 6.6.123
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 +6 -4
- package/dist/pending.mjs +28 -6
- package/dist/run.mjs +0 -2
- package/package.json +1 -1
- package/dist/git-version.mjs +0 -22
package/README.md
CHANGED
|
@@ -348,7 +348,12 @@ keeps the commits, so taking the `skip` label off later resumes the issue
|
|
|
348
348
|
and checks them. Such a resume is not held back
|
|
349
349
|
by another halted issue while it only checks its commit already on the
|
|
350
350
|
base; a fix it has to land waits like any other change. The hand-over
|
|
351
|
-
comment says so.
|
|
351
|
+
comment says so. A halted issue that was deleted or moved to another
|
|
352
|
+
repository can no longer be answered or given up, so the next run that gets
|
|
353
|
+
a not-found error when it reads the issue releases it the same way: it drops
|
|
354
|
+
the halt from the state, keeps the commits and logs a `land.released` event
|
|
355
|
+
with the reason `issue not found`. Any other read error (for example a
|
|
356
|
+
network error) keeps the block for that run.
|
|
352
357
|
|
|
353
358
|
The fixer sees the findings of all earlier rounds, not only the last one, with
|
|
354
359
|
its own disputes next to them. From round two, the reviewer judges only the
|
|
@@ -494,9 +499,6 @@ Three levels of console output:
|
|
|
494
499
|
## Requirements
|
|
495
500
|
|
|
496
501
|
- 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.
|
|
500
502
|
- `gh`, authenticated with write access to the repository
|
|
501
503
|
- a `remote` on GitHub: `github.com`, or a GitHub Enterprise host. Every `gh`
|
|
502
504
|
call names the host of the remote url (`--repo <host>/<owner>/<name>`,
|
package/dist/pending.mjs
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import { message } from './errors.mjs';
|
|
2
|
-
import { readState, savedIssues } from './state.mjs';
|
|
3
|
-
import { blocksLanding } from './unsettled.mjs';
|
|
1
|
+
import { errorMatches, message } from './errors.mjs';
|
|
2
|
+
import { readState, savedIssues, writeState } from './state.mjs';
|
|
3
|
+
import { blocksLanding, heldOnBase } from './unsettled.mjs';
|
|
4
|
+
/**
|
|
5
|
+
* What `gh issue view` says for an issue that was deleted or moved to another repository. Its GraphQL
|
|
6
|
+
* `repository.issue` lookup does not follow a transfer (only REST does), so a moved issue fails like a deleted one.
|
|
7
|
+
*/
|
|
8
|
+
const ISSUE_GONE = /Could not resolve to an issue or pull request|HTTP 404/;
|
|
4
9
|
export async function pendingIssues(context) {
|
|
5
10
|
const { repo, config, ports } = context;
|
|
6
11
|
const { ready, inProgress, inReview } = config.labels;
|
|
@@ -52,9 +57,26 @@ async function savedIssue(context, number) {
|
|
|
52
57
|
return { open, issue: { ...issue, closed: true } };
|
|
53
58
|
}
|
|
54
59
|
catch (error) {
|
|
55
|
-
context.recorder
|
|
56
|
-
|
|
57
|
-
|
|
60
|
+
const log = context.recorder.scope({ issue: number });
|
|
61
|
+
log.event('issue.unreadable', { error: message(error) }, 'quiet');
|
|
62
|
+
if (saved !== 'broken' && errorMatches(error, ISSUE_GONE)) {
|
|
63
|
+
await releaseGone(context, saved);
|
|
64
|
+
}
|
|
58
65
|
return { open: false };
|
|
59
66
|
}
|
|
60
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* A halted issue that was deleted or moved never resumes or gets the skip label, so its halt would block every
|
|
70
|
+
* landing for good: drop it like a given-up issue. The state keeps what is on the base. A passing read failure
|
|
71
|
+
* (a network error) keeps the halt.
|
|
72
|
+
*/
|
|
73
|
+
async function releaseGone(context, saved) {
|
|
74
|
+
if (!blocksLanding(saved, context.base)) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
delete saved.halted;
|
|
78
|
+
await writeState(context.repo, saved);
|
|
79
|
+
context.recorder
|
|
80
|
+
.scope({ issue: saved.issue })
|
|
81
|
+
.event('land.released', { held: heldOnBase(saved, context.base), reason: 'issue not found' });
|
|
82
|
+
}
|
package/dist/run.mjs
CHANGED
|
@@ -8,7 +8,6 @@ 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';
|
|
12
11
|
import { defaultBranch } from './github.mjs';
|
|
13
12
|
import { hunter } from './hunt.mjs';
|
|
14
13
|
import { lock, lockHolder } from './lock.mjs';
|
|
@@ -44,7 +43,6 @@ export async function runRepo(root, args, controls) {
|
|
|
44
43
|
return withDefaultTimeout(minutesToMs(config.commandTimeoutMinutes), () => runWithConfig(root, args, controls, config));
|
|
45
44
|
}
|
|
46
45
|
async function runWithConfig(root, args, controls, config) {
|
|
47
|
-
await checkGitVersion();
|
|
48
46
|
const repo = await detectRepo(root, config.remote);
|
|
49
47
|
const recorder = await Recorder.create(repo.root, args.level, controls.onEvent);
|
|
50
48
|
const pruned = await pruneRuns(repo.root, config.keepRunDays);
|
package/package.json
CHANGED
package/dist/git-version.mjs
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
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
|
-
}
|