next-issue 3.0.0 → 4.0.0
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 +1 -1
- package/dist/github.mjs +0 -3
- package/dist/hand-over-comments.mjs +5 -8
- package/dist/handover.mjs +1 -7
- package/dist/open-job.mjs +1 -1
- package/dist/ports.mjs +1 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -497,7 +497,7 @@ of one repository never affect another. The worker:
|
|
|
497
497
|
- sends every client a `questions` message for each repository: the open
|
|
498
498
|
issues with the `needsHuman` label, each with its number, title, the reason
|
|
499
499
|
of the hand-over, the url of the comment that holds it, the `owner/name`
|
|
500
|
-
repository,
|
|
500
|
+
repository, and the `needsHuman` and
|
|
501
501
|
`skip` labels. It reads them
|
|
502
502
|
from GitHub, so the list is the same after a restart. It sends them when a
|
|
503
503
|
client connects, for its repository, after each issue of a run
|
package/dist/github.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { slug } from './gh.mjs';
|
|
2
|
-
import { readState } from './state.mjs';
|
|
3
2
|
export const HAND_OVER = 'next-issue needs help:';
|
|
4
3
|
const HARNESS_HEADINGS = [HAND_OVER, '### Review:', '### Fixer:'];
|
|
5
4
|
function fromHarness(comment) {
|
|
@@ -38,8 +37,8 @@ async function lastHandOver(comments, writer) {
|
|
|
38
37
|
}
|
|
39
38
|
return -1;
|
|
40
39
|
}
|
|
41
|
-
async function handOverThread(repo, ports, writer,
|
|
42
|
-
const comments = await ports.threadComments(repo,
|
|
40
|
+
async function handOverThread(repo, ports, writer, issue) {
|
|
41
|
+
const comments = await ports.threadComments(repo, issue);
|
|
43
42
|
return { comments, last: await lastHandOver(comments, writer) };
|
|
44
43
|
}
|
|
45
44
|
export async function waitingQuestions(repo, config, ports) {
|
|
@@ -52,8 +51,7 @@ export async function waitingQuestions(repo, config, ports) {
|
|
|
52
51
|
return questions;
|
|
53
52
|
}
|
|
54
53
|
async function waitingQuestion(repo, config, ports, writer, issue) {
|
|
55
|
-
const
|
|
56
|
-
const { comments, last } = await handOverThread(repo, ports, writer, pr ?? issue.number);
|
|
54
|
+
const { comments, last } = await handOverThread(repo, ports, writer, issue.number);
|
|
57
55
|
const comment = comments[last];
|
|
58
56
|
return {
|
|
59
57
|
issue: issue.number,
|
|
@@ -61,7 +59,6 @@ async function waitingQuestion(repo, config, ports, writer, issue) {
|
|
|
61
59
|
reason: comment?.body.slice(HAND_OVER.length).trim() ?? '',
|
|
62
60
|
url: comment?.url ?? '',
|
|
63
61
|
repo: slug(repo),
|
|
64
|
-
...(pr === undefined ? {} : { pr }),
|
|
65
62
|
labels: { needsHuman: config.labels.needsHuman, skip: config.labels.skip },
|
|
66
63
|
};
|
|
67
64
|
}
|
|
@@ -70,10 +67,10 @@ export async function writerComments(context, log, issue) {
|
|
|
70
67
|
const comments = (await ports.issueComments(repo, issue)).filter((comment) => !fromHarness(comment));
|
|
71
68
|
return writerQuotes(comments, writers(repo, ports), (comment) => log.event('comment.skip', { author: comment.author }, 'quiet'));
|
|
72
69
|
}
|
|
73
|
-
export async function handOverReply(context, issue
|
|
70
|
+
export async function handOverReply(context, issue) {
|
|
74
71
|
const { repo, ports } = context;
|
|
75
72
|
const writer = writers(repo, ports);
|
|
76
|
-
const { comments, last } = await handOverThread(repo, ports, writer,
|
|
73
|
+
const { comments, last } = await handOverThread(repo, ports, writer, issue);
|
|
77
74
|
if (last === -1) {
|
|
78
75
|
return [];
|
|
79
76
|
}
|
package/dist/handover.mjs
CHANGED
|
@@ -77,13 +77,7 @@ async function handOver(context, log, issue, state, reason) {
|
|
|
77
77
|
log.event('hand-over', { reason }, 'quiet');
|
|
78
78
|
await writeState(repo, { ...state, handedOver: true });
|
|
79
79
|
await setStatus(context, issue, state.pr, config.labels.needsHuman);
|
|
80
|
-
|
|
81
|
-
if (state.pr === undefined) {
|
|
82
|
-
await ports.commentOnIssue(repo, issue, body);
|
|
83
|
-
}
|
|
84
|
-
else {
|
|
85
|
-
await ports.commentOnPr(repo, state.pr, body);
|
|
86
|
-
}
|
|
80
|
+
await ports.commentOnIssue(repo, issue, `${HAND_OVER} ${reason}`);
|
|
87
81
|
}
|
|
88
82
|
export async function claimedError(context, log, issue, state, error, started) {
|
|
89
83
|
const { reason } = logIssueError(log, error, started);
|
package/dist/open-job.mjs
CHANGED
|
@@ -12,7 +12,7 @@ export async function openJob(context, issue, log, state, start, handedOver) {
|
|
|
12
12
|
});
|
|
13
13
|
const comments = await log.step('comments', {}, () => writerComments(context, log, issue.number));
|
|
14
14
|
const reply = handedOver
|
|
15
|
-
? await log.step('reply', {}, () => handOverReply(context, issue.number
|
|
15
|
+
? await log.step('reply', {}, () => handOverReply(context, issue.number))
|
|
16
16
|
: [];
|
|
17
17
|
const worktree = await openWorktree(context, issue, log, branch, start);
|
|
18
18
|
return {
|
package/dist/ports.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { commitAll } from './git-commit.mjs';
|
|
|
6
6
|
import { pushToBase, revertOnBase, squashOnto } from './git-land.mjs';
|
|
7
7
|
import { abortMerge, commitMerge, startMerge } from './git-merge.mjs';
|
|
8
8
|
import { deleteBranch, diff, discardChanges, disputeBranches, isDirty, latestSubject, push, resetToBase, revision, setAside, } from './git.mjs';
|
|
9
|
-
import { canWrite, closeIssue, commentOnIssue,
|
|
9
|
+
import { canWrite, closeIssue, commentOnIssue, issueComments, openBlockers, openIssues, reopenIssue, threadComments, viewIssue, } from './github.mjs';
|
|
10
10
|
import { setLabel } from './labels.mjs';
|
|
11
11
|
import { createPr, findPr, markPrReady, mergeCommit, mergePr, prConflicts, prMerged, } from './pull-requests.mjs';
|
|
12
12
|
import { detectSetupCommand } from './setup.mjs';
|
|
@@ -20,7 +20,6 @@ export const PORTS = {
|
|
|
20
20
|
canWrite,
|
|
21
21
|
closeIssue,
|
|
22
22
|
commentOnIssue,
|
|
23
|
-
commentOnPr,
|
|
24
23
|
commitAll,
|
|
25
24
|
commitMerge,
|
|
26
25
|
createPr,
|