next-issue 7.8.8 → 7.8.10

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
@@ -161,7 +161,10 @@ the run handles one issue. For each issue:
161
161
  `merge conflict`. When `checks` lists commands, the harness then runs
162
162
  each one in the worktree, in order, with `bash -c` and stderr merged
163
163
  into stdout, each for at most `checksTimeoutMinutes`. Their output goes
164
- to the run log (`check.output`, and `check.fail` for a failure). A
164
+ to the run log (`check.output`, and `check.fail` for a failure). After
165
+ each command, the harness resets the worktree to the commit it checked
166
+ and removes untracked files that git does not ignore, so a file that a
167
+ command writes never lands on the base. A
165
168
  command that fails or does not finish stops the landing before the push:
166
169
  the fixer gets the command and the tail of its output (at most
167
170
  `logMaxChars`) from the check budget, `maxCiFixes`, and its fix is
@@ -383,15 +386,17 @@ review.
383
386
 
384
387
  A halt that leaves a commit on the base, or a push or revert that may be on
385
388
  it, with checks nobody awaited (`checks error`, `push unknown`,
386
- `main checks timeout`, `main checks cancelled`, or an error or a failed setup
387
- on such a resume before the base is checked) is saved in the state file of
388
- its issue. The issue waits for a person, so later runs skip it, but no
389
- later run lands another change meanwhile: an issue that reaches the
390
- landing ends `stopped` with the reason `base unchecked`, keeps its state,
391
- branch and labels, and the run claims no more issues; the log holds a
392
- `land.blocked` event with the waiting issues. Runs take such a halted issue
393
- before the others, and a running one still resumes, so an older issue that
394
- reaches the landing first does not keep it from checking the base. Once a person answers or
389
+ `main checks timeout`, `main checks cancelled`, an error or a failed setup
390
+ on such a resume before the base is checked, or a stop or kill while the run
391
+ waits for the checks of a commit it landed) is saved in the state file of
392
+ its issue. A stopped issue resumes in the next run; any other waits for a
393
+ person, so later runs skip it. Either way, no later run lands another change
394
+ meanwhile: an issue that reaches the landing ends `stopped` with the reason
395
+ `base unchecked`, keeps its state, branch and labels, and the run claims no
396
+ more issues; the log holds a `land.blocked` event with the waiting issues.
397
+ Runs take such a halted issue before the others, and a running one still
398
+ resumes, so an older issue that reaches the landing first does not keep it
399
+ from checking the base. Once a person answers or
395
400
  takes the label off, the issue resumes, checks the base and waits for the
396
401
  checks of its commit; when those are known (the issue is done, or its
397
402
  commits are reverted or found not on the base), the issue drops the halt
package/dist/gate.mjs CHANGED
@@ -21,7 +21,10 @@ export async function checkGate(job, sha) {
21
21
  return unreadChecks(job, error);
22
22
  }
23
23
  // The checks are known now, so an earlier halt on this issue no longer holds back other landings.
24
- delete job.state.halted;
24
+ if (job.state.halted === true) {
25
+ delete job.state.halted;
26
+ await writeState(job.context.repo, job.state);
27
+ }
25
28
  if (checks === 'pass' || checks === 'none') {
26
29
  return GATE_PASSED;
27
30
  }
package/dist/land.mjs CHANGED
@@ -140,6 +140,7 @@ async function pushChange(job) {
140
140
  state.pushing = undefined;
141
141
  if (pushed) {
142
142
  state.landed = [...(state.landed ?? []), sha];
143
+ state.halted = true;
143
144
  }
144
145
  await writeState(repo, state);
145
146
  if (pushed) {
@@ -1,5 +1,5 @@
1
1
  import { budgetUse, refundBudget, refundOnKill } from './budget.mjs';
2
- import { refuseWhenStopped, runStopped } from './children.mjs';
2
+ import { evenWhenStopped, refuseWhenStopped, runStopped } from './children.mjs';
3
3
  import { minutesToMs } from './durations.mjs';
4
4
  import { succeeded } from './exec.mjs';
5
5
  import { escalateCheckFix, fixRound } from './fix.mjs';
@@ -15,8 +15,10 @@ const COMMENT_OUTPUT_CHARS = 3000;
15
15
  export async function localChecks(job) {
16
16
  const { context, log, worktree } = job;
17
17
  const { config, ports } = context;
18
+ const head = await ports.revision(worktree);
18
19
  for (const command of config.checks) {
19
20
  const result = await log.step('check', { cmd: command }, () => ports.runCheck(command, worktree, minutesToMs(config.checksTimeoutMinutes), config.logMaxChars));
21
+ await evenWhenStopped(() => ports.discardChanges(worktree, head));
20
22
  // A stop kills the command, so its failure is no finding: the next run checks again.
21
23
  refuseWhenStopped();
22
24
  log.event('check.output', { cmd: command, code: result.code, timedOut: result.timedOut, output: result.output }, 'verbose');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-issue",
3
- "version": "7.8.8",
3
+ "version": "7.8.10",
4
4
  "description": "Autonomous issue harness driven by the pi SDK",
5
5
  "keywords": [
6
6
  "github",