next-issue 2.7.0 → 2.9.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 CHANGED
@@ -379,14 +379,16 @@ silent skip.
379
379
 
380
380
  ## Retry an issue that waits for a person
381
381
 
382
- A hand-over leaves the state file with the used budgets in it, so the next run
383
- would hand the issue over again at once. To give the issue another try, take the
384
- `status:needs-human` label off and run with `--reset`. The flag puts the budgets
385
- and the findings back to zero and keeps the branch, the pull request and the
386
- step that the last run reached, so the work carries on where it stopped. A
387
- commit that you pushed to the pull request in the meantime is fetched first.
388
- The flag touches only an issue that the run handles, so the state of an issue
389
- that a label still holds back stays as it was.
382
+ A hand-over marks the state file as handed over. To give the issue another try,
383
+ take the `status:needs-human` label off. The next run that claims the issue puts
384
+ the budgets and the findings back to zero, clears the mark and keeps the branch,
385
+ the pull request and the step that the last run reached, so the work carries on
386
+ where it stopped. A commit that you pushed to the pull request in the meantime
387
+ is fetched first. An issue that still has the label is not claimed.
388
+
389
+ The `--reset` flag does the same for any issue that the run handles, whether or
390
+ not it was handed over. It touches only an issue that the run handles, so the
391
+ state of an issue that a label still holds back stays as it was.
390
392
 
391
393
  ## Commands and options
392
394
 
package/dist/handover.mjs CHANGED
@@ -55,7 +55,7 @@ export async function cleanUp(context, log, branch) {
55
55
  }
56
56
  export async function handOver(context, log, issue, state, reason) {
57
57
  log.event('hand-over', { reason }, 'quiet');
58
- await writeState(context.repo, state);
58
+ await writeState(context.repo, { ...state, handedOver: true });
59
59
  await setStatus(context, issue, state.pr, context.config.labels.needsHuman);
60
60
  const body = `next-issue needs help: ${reason}`;
61
61
  if (state.pr === undefined) {
package/dist/pipeline.mjs CHANGED
@@ -106,7 +106,11 @@ export async function processIssue(context, issue) {
106
106
  reviewRounds: 0,
107
107
  reviewLog: [],
108
108
  };
109
- const state = saved === undefined ? fresh : context.reset ? resetState(saved) : saved;
109
+ const state = saved === undefined
110
+ ? fresh
111
+ : context.reset || saved.handedOver === true
112
+ ? resetState(saved)
113
+ : saved;
110
114
  try {
111
115
  const report = await work(context, issue, log, state, saved === undefined);
112
116
  log.event('issue.end', { outcome: report.outcome, reason: report.reason, ms: report.ms }, 'quiet');
package/dist/state.mjs CHANGED
@@ -60,7 +60,8 @@ function isState(value) {
60
60
  (value.baseFix === undefined || isBaseFix(value.baseFix)) &&
61
61
  typeof value.reviewRounds === 'number' &&
62
62
  Array.isArray(value.reviewLog) &&
63
- value.reviewLog.every(isReviewRound));
63
+ value.reviewLog.every(isReviewRound) &&
64
+ (value.handedOver === undefined || typeof value.handedOver === 'boolean'));
64
65
  }
65
66
  export async function savedIssues(repo) {
66
67
  let names;
@@ -79,7 +80,8 @@ export async function savedIssues(repo) {
79
80
  });
80
81
  }
81
82
  export function resetState(state) {
82
- return { ...state, ciFixes: 0, commitFixes: 0, reviewRounds: 0, reviewLog: [] };
83
+ const { handedOver: _handedOver, ...rest } = state;
84
+ return { ...rest, ciFixes: 0, commitFixes: 0, reviewRounds: 0, reviewLog: [] };
83
85
  }
84
86
  export async function writeState(repo, state) {
85
87
  await mkdir(dir(repo), { recursive: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-issue",
3
- "version": "2.7.0",
3
+ "version": "2.9.0",
4
4
  "description": "Autonomous issue harness driven by the pi SDK",
5
5
  "keywords": [
6
6
  "github",