next-issue 6.6.71 → 6.6.72

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.
Files changed (2) hide show
  1. package/dist/skip.mjs +14 -2
  2. package/package.json +1 -1
package/dist/skip.mjs CHANGED
@@ -1,6 +1,8 @@
1
+ import { runStopped } from './children.mjs';
1
2
  import { elapsedMs } from './durations.mjs';
2
3
  import { message } from './errors.mjs';
3
4
  import { handOverReply } from './hand-over-comments.mjs';
5
+ import { stopNow } from './handover.mjs';
4
6
  import { hasLabel } from './labels.mjs';
5
7
  export function skipReason(issue, config, resuming, answered = false) {
6
8
  const has = (name) => hasLabel(issue.labels, name);
@@ -26,7 +28,7 @@ export async function skipReport(context, log, issue, saved, started) {
26
28
  answered = await hasAnswer(context, issue);
27
29
  }
28
30
  catch (error) {
29
- return unclaimedError(log, issue, error, started);
31
+ return readError(log, issue, saved, error, started);
30
32
  }
31
33
  const skip = skipReason(issue, context.config, saved !== undefined, answered);
32
34
  if (skip !== undefined) {
@@ -41,7 +43,7 @@ export async function skipReport(context, log, issue, saved, started) {
41
43
  blockers = await context.ports.openBlockers(context.repo, issue.number);
42
44
  }
43
45
  catch (error) {
44
- return unclaimedError(log, issue, error, started);
46
+ return readError(log, issue, saved, error, started);
45
47
  }
46
48
  if (blockers.length > 0) {
47
49
  log.event('issue.skip', { title: issue.title, reason: 'blocked', blockers });
@@ -55,6 +57,16 @@ async function hasAnswer(context, issue) {
55
57
  }
56
58
  return (await handOverReply(context, issue.number)).length > 0;
57
59
  }
60
+ function readError(log, issue, saved, error, started) {
61
+ if (!runStopped()) {
62
+ return unclaimedError(log, issue, error, started);
63
+ }
64
+ if (saved !== undefined) {
65
+ return stopNow(log, issue, saved, started);
66
+ }
67
+ log.event('issue.stop', {}, 'quiet');
68
+ return { ...skipped(issue), outcome: 'stopped', ms: elapsedMs(started) };
69
+ }
58
70
  export function unclaimedError(log, issue, error, started) {
59
71
  const { reason, ms } = logIssueError(log, error, started);
60
72
  return { ...skipped(issue), outcome: 'error', reason, ms };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-issue",
3
- "version": "6.6.71",
3
+ "version": "6.6.72",
4
4
  "description": "Autonomous issue harness driven by the pi SDK",
5
5
  "keywords": [
6
6
  "github",