next-issue 6.6.62 → 6.6.64
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 +4 -2
- package/dist/github.mjs +3 -0
- package/dist/hand-over-comments.mjs +14 -5
- package/dist/hunt.mjs +17 -6
- package/dist/ports.mjs +2 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -619,7 +619,7 @@ With `--hunt`, which turns on `--watch`, the harness runs a hunter agent at the
|
|
|
619
619
|
- files up to `huntCap` less that count, worked out just before the hunt, its most serious findings first, each with the `labels.ready` label, the `labels.hunt` label and the sections of the [issue format](#issue-format), after a search for duplicates. It files and searches with `gh --repo <owner>/<name>` of the configured `remote`, so another GitHub remote, such as `upstream` in a fork, never gets its issues. The `labels.hunt` label, `source:hunt` by default, marks the issue as one the hunter filed. The harness creates the `labels.ready` and `labels.hunt` labels before the hunt when they are missing. It compares label names without case, as GitHub does, so a label that exists in another case, such as `Source:Hunt`, counts as there and keeps its name. When the create fails, it reads the labels again, so a label that someone else created meanwhile counts as there too. It files nothing when it finds no real problem or a duplicate exists;
|
|
620
620
|
- runs no test suite and changes no file. It gets the tools of the reviewer.
|
|
621
621
|
|
|
622
|
-
With `huntCap` at 1 and no ready issue, a hunt files at most one issue. The hunter ends its reply with one `issue:` line for each issue it filed, or one `issue: none` line; a url that is not an issue of the repository of `remote` does not count as filed,
|
|
622
|
+
With `huntCap` at 1 and no ready issue, a hunt files at most one issue. The hunter ends its reply with one `issue:` line for each issue it filed, or one `issue: none` line; a url that is not an issue of the repository of `remote` does not count as filed. When the `remote` url holds an old owner or name that GitHub redirects after a rename or transfer, the harness asks GitHub for the new one, so an issue url with the new name counts too. The run log holds one `hunt.issue` event with the `url` for each, or one with `none`. A hunt that fails writes a `hunt.error` event and the watch goes on. The hunter then waits before the next hunt, with a `hunt.wait` event and the same back-off, so a failure, or a hunt that files nothing, that repeats waits 1, 2, 3, 5, 10, then 10 minutes, and the back-off goes back to 1 minute after a hunt that files at least one issue. The next pass claims the new issues like any other. At the first `Ctrl-C` the hunter stops after its current hunt, and the watch ends once the hunt and the running issues end. A first `Ctrl-C` during the watch wait tells you so while a hunt runs, and the third press stops the hunter at once. The hunter stops too when the watch ends for another reason.
|
|
623
623
|
|
|
624
624
|
## Worker
|
|
625
625
|
|
|
@@ -668,7 +668,9 @@ affect another. The worker:
|
|
|
668
668
|
from GitHub, so the list is the same after a restart. It sends them when a
|
|
669
669
|
client connects, for its repository, after each issue of a run
|
|
670
670
|
ends, and when a client sends `{ "type": "questions", "root": "<path>" }`.
|
|
671
|
-
An issue that no longer has the label leaves the list
|
|
671
|
+
An issue that no longer has the label leaves the list, and so does an issue
|
|
672
|
+
whose hand-over has an answer from a writer, the same answer that lets a run
|
|
673
|
+
claim it. An issue with the
|
|
672
674
|
label but no hand-over comment is in the list with an empty reason and url.
|
|
673
675
|
The issues are read one at a time. A client never gets an older list after
|
|
674
676
|
a newer one. When the client adds an `"id"` to its message, the list that
|
package/dist/github.mjs
CHANGED
|
@@ -74,6 +74,9 @@ export async function openBlockers(repo, issue) {
|
|
|
74
74
|
return prefix === undefined ? ref : ref.slice(prefix.length - 1);
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
|
+
export async function repositorySlug(repo) {
|
|
78
|
+
return repeatable(repo, ['api', `repos/${slug(repo)}`, '--jq', '.full_name']);
|
|
79
|
+
}
|
|
77
80
|
export async function reopenIssue(repo, issue) {
|
|
78
81
|
await gh(repo, ['issue', 'reopen', String(issue)]);
|
|
79
82
|
}
|
|
@@ -46,12 +46,24 @@ export async function waitingQuestions(repo, config, ports) {
|
|
|
46
46
|
const issues = await ports.openIssues(repo, config.issueLimit, [config.labels.needsHuman]);
|
|
47
47
|
const questions = [];
|
|
48
48
|
for (const issue of issues) {
|
|
49
|
-
|
|
49
|
+
const question = await waitingQuestion(repo, config, ports, writer, issue);
|
|
50
|
+
if (question) {
|
|
51
|
+
questions.push(question);
|
|
52
|
+
}
|
|
50
53
|
}
|
|
51
54
|
return questions;
|
|
52
55
|
}
|
|
56
|
+
async function replyAfter(comments, last, writer) {
|
|
57
|
+
if (last === -1) {
|
|
58
|
+
return [];
|
|
59
|
+
}
|
|
60
|
+
return writerQuotes(comments.slice(last + 1).filter((comment) => !fromHarness(comment)), writer);
|
|
61
|
+
}
|
|
53
62
|
async function waitingQuestion(repo, config, ports, writer, issue) {
|
|
54
63
|
const { comments, last } = await handOverThread(repo, ports, writer, issue.number);
|
|
64
|
+
if ((await replyAfter(comments, last, writer)).length > 0) {
|
|
65
|
+
return undefined;
|
|
66
|
+
}
|
|
55
67
|
const comment = comments[last];
|
|
56
68
|
return {
|
|
57
69
|
issue: issue.number,
|
|
@@ -71,8 +83,5 @@ export async function handOverReply(context, issue) {
|
|
|
71
83
|
const { repo, ports } = context;
|
|
72
84
|
const writer = writers(repo, ports);
|
|
73
85
|
const { comments, last } = await handOverThread(repo, ports, writer, issue);
|
|
74
|
-
|
|
75
|
-
return [];
|
|
76
|
-
}
|
|
77
|
-
return writerQuotes(comments.slice(last + 1).filter((comment) => !fromHarness(comment)), writer);
|
|
86
|
+
return replyAfter(comments, last, writer);
|
|
78
87
|
}
|
package/dist/hunt.mjs
CHANGED
|
@@ -27,9 +27,22 @@ export async function huntWorktree(repo, base, remote) {
|
|
|
27
27
|
}
|
|
28
28
|
return path;
|
|
29
29
|
}
|
|
30
|
-
function
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
function issueSlug(url) {
|
|
31
|
+
return /^https:\/\/github\.com\/([^/]+\/[^/]+)\/issues\/\d+\/?$/i.exec(url)?.[1]?.toLowerCase();
|
|
32
|
+
}
|
|
33
|
+
async function issuesOf(context, urls) {
|
|
34
|
+
const found = urls.flatMap((url) => {
|
|
35
|
+
const repository = issueSlug(url);
|
|
36
|
+
return repository === undefined ? [] : [{ url, repository }];
|
|
37
|
+
});
|
|
38
|
+
const slugs = [slug(context.repo).toLowerCase()];
|
|
39
|
+
if (found.some(({ repository }) => !slugs.includes(repository))) {
|
|
40
|
+
const canonical = await context.ports.repositorySlug(context.repo).catch(() => undefined);
|
|
41
|
+
if (canonical !== undefined) {
|
|
42
|
+
slugs.push(canonical.trim().toLowerCase());
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return found.filter(({ repository }) => slugs.includes(repository)).map(({ url }) => url);
|
|
33
46
|
}
|
|
34
47
|
export async function hunt(context, count) {
|
|
35
48
|
const { repo, config, base, recorder, ports } = context;
|
|
@@ -48,9 +61,7 @@ export async function hunt(context, count) {
|
|
|
48
61
|
profile: REVIEWING,
|
|
49
62
|
timeoutMs: minutesToMs(config.agentTimeoutMinutes),
|
|
50
63
|
});
|
|
51
|
-
const urls = [...result.text.matchAll(FILED)]
|
|
52
|
-
.map((match) => match[1])
|
|
53
|
-
.filter((url) => isIssueOf(repo, url));
|
|
64
|
+
const urls = await issuesOf(context, [...result.text.matchAll(FILED)].map((match) => match[1]));
|
|
54
65
|
for (const url of urls.length === 0 ? ['none'] : urls) {
|
|
55
66
|
recorder.event('hunt.issue', { url }, 'quiet');
|
|
56
67
|
}
|
package/dist/ports.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { commitAll } from './git-commit.mjs';
|
|
|
5
5
|
import { pushToBase, reapplyRevert, revertOnBase, squashOnto } from './git-land.mjs';
|
|
6
6
|
import { abortMerge, commitMerge, startMerge } from './git-merge.mjs';
|
|
7
7
|
import { deleteBranch, diff, discardChanges, disputeBranches, isDirty, isLanded, isOnBase, latestSubject, push, resetToBase, revision, setAside, } from './git.mjs';
|
|
8
|
-
import { canWrite, closeIssue, commentOnIssue, issueComments, openBlockers, openIssues, reopenIssue, threadComments, viewIssue, } from './github.mjs';
|
|
8
|
+
import { canWrite, closeIssue, commentOnIssue, issueComments, openBlockers, openIssues, reopenIssue, repositorySlug, threadComments, viewIssue, } from './github.mjs';
|
|
9
9
|
import { huntWorktree } from './hunt.mjs';
|
|
10
10
|
import { ensureLabel, setLabel } from './labels.mjs';
|
|
11
11
|
import { detectSetupCommand } from './setup.mjs';
|
|
@@ -43,6 +43,7 @@ export const PORTS = {
|
|
|
43
43
|
reapplyRevert,
|
|
44
44
|
removeWorktree,
|
|
45
45
|
reopenIssue,
|
|
46
|
+
repositorySlug,
|
|
46
47
|
rerunFailedBase,
|
|
47
48
|
resetToBase,
|
|
48
49
|
revertOnBase,
|