@ravshansbox/pi-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 +4 -4
- package/package.json +1 -1
- package/src/answer.ts +3 -12
- package/src/protocol.ts +0 -1
package/README.md
CHANGED
|
@@ -24,11 +24,11 @@ When an issue waits for a person, with the `needsHuman` label of the [config](..
|
|
|
24
24
|
|
|
25
25
|
Run `/next-issue answer` to go through the waiting questions one at a time. Pi suggests `answer` as you type after `/next-issue `. Each shows the issue, the title and the reason of the hand-over. Choose:
|
|
26
26
|
|
|
27
|
-
- **Retry**: takes the `needsHuman` label off the issue
|
|
28
|
-
- **Retry with guidance**: asks for text, posts it as a comment
|
|
29
|
-
- **Give up**: takes the `needsHuman` label off the issue and
|
|
27
|
+
- **Retry**: takes the `needsHuman` label off the issue, so the next run resumes it.
|
|
28
|
+
- **Retry with guidance**: asks for text, posts it as a comment on the issue, where the worker reads it, then takes the `needsHuman` label off.
|
|
29
|
+
- **Give up**: takes the `needsHuman` label off the issue and adds the `skip` label.
|
|
30
30
|
|
|
31
|
-
Press Escape, or leave the guidance empty, to stop. Pi reads the list again before each question, so it skips a question answered elsewhere in the meantime. The worker sends the repository
|
|
31
|
+
Press Escape, or leave the guidance empty, to stop. Pi reads the list again before each question, so it skips a question answered elsewhere in the meantime. The worker sends the repository and the label names with each question, from `next-issue.config.json` and its `remote`. Pi uses `gh` for the comment and the labels.
|
|
32
32
|
|
|
33
33
|
## Create an issue
|
|
34
34
|
|
package/package.json
CHANGED
package/src/answer.ts
CHANGED
|
@@ -12,11 +12,6 @@ const GIVE_UP = 'Give up';
|
|
|
12
12
|
|
|
13
13
|
type Answer = { choice: string; guidance: string };
|
|
14
14
|
|
|
15
|
-
function threadsOf(question: Question): Array<[string, number]> {
|
|
16
|
-
const issue: [string, number] = ['issue', question.issue];
|
|
17
|
-
return question.pr === undefined ? [issue] : [issue, ['pr', question.pr]];
|
|
18
|
-
}
|
|
19
|
-
|
|
20
15
|
function promptOf(question: Question): string {
|
|
21
16
|
return `#${question.issue} ${question.title}\n\n${question.reason || 'No reason given.'}`;
|
|
22
17
|
}
|
|
@@ -36,19 +31,15 @@ async function reply(
|
|
|
36
31
|
question: Question,
|
|
37
32
|
{ choice, guidance }: Answer,
|
|
38
33
|
): Promise<void> {
|
|
39
|
-
const
|
|
34
|
+
const issue = String(question.issue);
|
|
40
35
|
const repo = ['--repo', question.repo];
|
|
41
36
|
if (choice === GUIDE) {
|
|
42
|
-
|
|
43
|
-
await gh([kind, 'comment', String(number), ...repo, '--body-file', '-'], {
|
|
37
|
+
await gh(['issue', 'comment', issue, ...repo, '--body-file', '-'], {
|
|
44
38
|
cwd: root,
|
|
45
39
|
input: guidance,
|
|
46
40
|
});
|
|
47
41
|
}
|
|
48
|
-
|
|
49
|
-
for (const [kind, number] of threads) {
|
|
50
|
-
await gh([kind, 'edit', String(number), ...repo, ...labels], { cwd: root });
|
|
51
|
-
}
|
|
42
|
+
await gh(['issue', 'edit', issue, ...repo, ...labelsOf(question, choice)], { cwd: root });
|
|
52
43
|
}
|
|
53
44
|
|
|
54
45
|
async function ask(ui: ExtensionContext['ui'], question: Question): Promise<Answer | undefined> {
|