next-issue 6.6.82 → 6.6.83

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 CHANGED
@@ -602,6 +602,17 @@ The `--reset` flag does the same for any issue that the run handles, whether or
602
602
  not it was handed over. It touches only an issue that the run handles, so the
603
603
  state of an issue that a label still holds back stays as it was.
604
604
 
605
+ To drop an issue instead, close it. The next run that finds a saved state for an
606
+ issue that a person closed removes that state file, the `<n>` branch, the
607
+ `<n>-dispute-*` branches and the worktree of the issue. This holds for an issue
608
+ that waits for a person and for one that a stop left behind. The run starts no
609
+ agent and makes no push, revert, label change, close or comment, so a change
610
+ that already landed stays on the base branch. A worktree or branch that cannot be
611
+ removed stays, and the run log says so. The issue shows as `skipped` (`closed`)
612
+ in the summary and does not count for `--max` or `--once`. A `--watch` run does
613
+ not claim an issue again once it ended in `error` in that run, so it leaves such
614
+ an issue for the next run to clean up.
615
+
605
616
  ## Commands and options
606
617
 
607
618
  | Argument | Effect |
package/dist/handover.mjs CHANGED
@@ -53,6 +53,25 @@ export async function finishClosing(context, issue, log, state, started) {
53
53
  };
54
54
  return (await finishDone(job)).report;
55
55
  }
56
+ export async function dropClosed(context, log, issue, branch) {
57
+ log.event('issue.drop', { title: issue.title, reason: 'closed' }, 'quiet');
58
+ try {
59
+ await cleanUp(context, log, branch);
60
+ await deleteBranches(context, log, branch);
61
+ await dropState(context.repo, issue.number);
62
+ }
63
+ catch (error) {
64
+ log.event('drop.error', { error: message(error) }, 'quiet');
65
+ }
66
+ return {
67
+ issue: issue.number,
68
+ outcome: 'skipped',
69
+ reason: 'closed',
70
+ ciFixes: 0,
71
+ reviewRounds: 0,
72
+ ms: 0,
73
+ };
74
+ }
56
75
  async function updateLocalBase(job) {
57
76
  const { context, log } = job;
58
77
  const { repo, ports, config, base } = context;
package/dist/pending.mjs CHANGED
@@ -33,10 +33,7 @@ async function savedIssue(context, number) {
33
33
  if (saved === 'broken' || open) {
34
34
  return { open, issue };
35
35
  }
36
- if (saved?.closing === true && saved.handedOver !== true) {
37
- return { open, issue: { ...issue, closed: true } };
38
- }
39
- return { open };
36
+ return { open, issue: { ...issue, closed: true } };
40
37
  }
41
38
  catch (error) {
42
39
  context.recorder
package/dist/pipeline.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { enterReview } from './enter-review.mjs';
2
2
  import { branchName } from './git.mjs';
3
3
  import { runStopped } from './children.mjs';
4
- import { claimedError, finishClosing, stop, stopNow } from './handover.mjs';
4
+ import { claimedError, dropClosed, finishClosing, stop, stopNow } from './handover.mjs';
5
5
  import { implement } from './implement.mjs';
6
6
  import { openJob } from './open-job.mjs';
7
7
  import { reviewRound } from './review.mjs';
@@ -20,6 +20,9 @@ export async function processIssue(context, issue, claimed = () => undefined) {
20
20
  return unclaimedError(log, issue, error, started);
21
21
  }
22
22
  const closing = saved?.closing === true && saved.handedOver !== true;
23
+ if (issue.closed === true && !closing) {
24
+ return dropClosed(context, log, issue, saved?.branch ?? branchName(issue.number));
25
+ }
23
26
  const skip = closing ? undefined : await skipReport(context, log, issue, saved, started);
24
27
  if (skip !== undefined) {
25
28
  return skip;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-issue",
3
- "version": "6.6.82",
3
+ "version": "6.6.83",
4
4
  "description": "Autonomous issue harness driven by the pi SDK",
5
5
  "keywords": [
6
6
  "github",