next-issue 2.21.0 → 2.21.2

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/dist/pipeline.mjs CHANGED
@@ -33,6 +33,7 @@ export async function pendingIssues(context) {
33
33
  const labels = ready.length === 0 ? [] : [ready, inProgress, inReview];
34
34
  const issues = await ports.openIssues(repo, config.issueLimit, labels);
35
35
  const listed = new Set(issues.map((issue) => issue.number));
36
+ let openCount = issues.length;
36
37
  for (const number of await savedIssues(repo)) {
37
38
  if (listed.has(number)) {
38
39
  continue;
@@ -43,6 +44,9 @@ export async function pendingIssues(context) {
43
44
  }
44
45
  try {
45
46
  const { open, ...issue } = await ports.viewIssue(repo, number);
47
+ if (open) {
48
+ openCount += 1;
49
+ }
46
50
  if (saved === 'broken' ||
47
51
  open ||
48
52
  (saved.pr !== undefined && (await ports.prMerged(repo, saved.pr)))) {
@@ -55,6 +59,7 @@ export async function pendingIssues(context) {
55
59
  .event('issue.error', { error: message(error) }, 'quiet');
56
60
  }
57
61
  }
62
+ context.recorder.event('issues', { open: openCount }, 'quiet');
58
63
  return issues.sort((a, b) => a.createdAt.localeCompare(b.createdAt));
59
64
  }
60
65
  export async function processIssue(context, issue) {
package/dist/progress.mjs CHANGED
@@ -53,7 +53,8 @@ export function applyEvent(progress, record) {
53
53
  }
54
54
  if (kind === 'issue.end' || kind === 'issue.error') {
55
55
  const outcome = kind === 'issue.error' ? 'error' : record['outcome'];
56
- const handled = outcome === 'done' || outcome === 'needs-human' || outcome === 'error'
56
+ const repeated = progress.handled.some((item) => item.issue === issue && item.outcome === outcome);
57
+ const handled = !repeated && (outcome === 'done' || outcome === 'needs-human' || outcome === 'error')
57
58
  ? [...progress.handled, { issue, outcome }]
58
59
  : progress.handled;
59
60
  const issues = progress.issues.filter((current) => current.issue !== issue);
package/dist/run.mjs CHANGED
@@ -61,11 +61,7 @@ async function handle(args, config, repo, recorder, controls) {
61
61
  log: recorder.logFile,
62
62
  }, 'quiet');
63
63
  const loop = {
64
- issues: async () => {
65
- const issues = await pendingIssues(context);
66
- recorder.event('issues', { open: issues.length }, 'quiet');
67
- return issues;
68
- },
64
+ issues: () => pendingIssues(context),
69
65
  process: (issue) => processIssue(context, issue),
70
66
  stop: interrupts.afterIssue,
71
67
  concurrency: config.concurrency,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-issue",
3
- "version": "2.21.0",
3
+ "version": "2.21.2",
4
4
  "description": "Autonomous issue harness driven by the pi SDK",
5
5
  "keywords": [
6
6
  "github",