next-issue 7.8.24 → 7.8.26

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
@@ -218,7 +218,16 @@ the run handles one issue. For each issue:
218
218
  and commit status whose name is in `ignoredChecks`: it does not wait for
219
219
  it, its result does not fail the checks and its logs do not go to the
220
220
  fixer. With `ignoredChecks` set, the harness judges each workflow run by
221
- its other jobs, so a run whose only failed job is ignored passes. A
221
+ its other jobs, so a run whose only failed job is ignored passes when
222
+ every other job passes. When an ignored job fails and GitHub cancels
223
+ another job of the same run, for example through the default
224
+ `strategy.fail-fast` of a matrix, that job never finished: the harness
225
+ hands the issue to a person with the reason `main checks cut short` and
226
+ halts, and the issue stays open. Set `fail-fast: false` on a matrix
227
+ with an ignored job to avoid this. The same goes when an ignored job
228
+ fails and another job of the same run ends `skipped`, for example
229
+ because it `needs` the ignored job; a skipped job in a run with no
230
+ failed job still passes. A
222
231
  failed or errored commit status, or a workflow run or check run that
223
232
  ends with `failure`, `timed_out` or
224
233
  `action_required`, fails the checks. The harness does not rerun a
@@ -409,8 +418,8 @@ review.
409
418
 
410
419
  A halt that leaves a commit on the base, or a push or revert that may be on
411
420
  it, with checks nobody awaited (`checks error`, `push unknown`,
412
- `main checks timeout`, `main checks cancelled`, an error or a failed setup
413
- on such a resume before the base is checked, or a stop or kill while the run
421
+ `main checks timeout`, `main checks cancelled`, `main checks cut short`, an
422
+ error or a failed setup on such a resume before the base is checked, or a stop or kill while the run
414
423
  pushes a change to the base, waits for the checks of a commit it landed, or
415
424
  fixes the failed checks of that commit before the fix lands or the revert of
416
425
  that commit ends) is
@@ -669,30 +678,30 @@ because no pull request is opened.
669
678
  }
670
679
  ```
671
680
 
672
- | Field | Default | Effect |
673
- | ----------------------- | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
674
- | `remote` | `origin` | The git remote for the repository and the branches |
675
- | `issueLimit` | `100` | The maximum number of open issues to read. With `labels.ready` set, only issues with the ready, in-progress or in-review label count |
676
- | `concurrency` | `1` | The most issues that a run handles at the same time |
677
- | `huntCap` | `1` | With `--hunt`, the hunter hunts only while fewer ready issues than this wait besides the running ones |
678
- | `maxCiFixes` | `5` | The budget for check fixes per issue |
679
- | `maxCommitFixes` | `10` | The budget for fixes of a commit that a git hook stopped, per issue |
680
- | `maxReviewRounds` | `5` | The budget for review rounds per issue |
681
- | `checkIntervalSeconds` | `15` | The time between two check states, at most `2147483` |
682
- | `checkGraceSeconds` | `60` | The time to wait for the first check to show, and for more checks after they all pass; the grace ends at the `checkTimeoutMinutes` limit, where checks that all pass, or no checks, still count as a pass |
683
- | `checkTimeoutMinutes` | `60` | The limit for one check wait, at most `35791` |
684
- | `agentTimeoutMinutes` | `30` | The limit for one agent call, at most `35791` |
685
- | `setupTimeoutMinutes` | `15` | The limit for the setup command, at most `35791` |
686
- | `commandTimeoutMinutes` | `10` | The limit for one `git` or `gh` command, at most `35791` |
687
- | `logMaxChars` | `20000` | The maximum length of the failed job logs, shared between the failed GitHub Actions runs (failed external checks are listed by name and link only) |
688
- | `diffMaxChars` | `60000` | The maximum length of the diff that the reviewer reads |
689
- | `keepRunDays` | `7` | The number of days to keep the run files; `0` keeps them all |
690
- | `checks` | `[]` | Shell commands that must pass in the worktree, in order, before an approved change is pushed; a failure goes to the fixer |
691
- | `checksTimeoutMinutes` | `30` | The limit for one command in `checks`, at most `35791` |
692
- | `ignoredChecks` | `[]` | Names of GitHub Actions jobs, check runs and commit statuses, such as `release`, that the checks on the base branch do not wait for and whose failure does not count |
693
- | `setupCommand` | from the lock file | A shell command to run in a new worktree, before the implementer, and after each merge of the base before the `checks` |
694
- | `models` | `null` per role | The pi model per agent role, as `provider/model`: `implementer`, `reviewer`, `fixer` |
695
- | `labels` | see above | The names of the labels that the harness reads and sets |
681
+ | Field | Default | Effect |
682
+ | ----------------------- | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
683
+ | `remote` | `origin` | The git remote for the repository and the branches |
684
+ | `issueLimit` | `100` | The maximum number of open issues to read. With `labels.ready` set, only issues with the ready, in-progress or in-review label count |
685
+ | `concurrency` | `1` | The most issues that a run handles at the same time |
686
+ | `huntCap` | `1` | With `--hunt`, the hunter hunts only while fewer ready issues than this wait besides the running ones |
687
+ | `maxCiFixes` | `5` | The budget for check fixes per issue |
688
+ | `maxCommitFixes` | `10` | The budget for fixes of a commit that a git hook stopped, per issue |
689
+ | `maxReviewRounds` | `5` | The budget for review rounds per issue |
690
+ | `checkIntervalSeconds` | `15` | The time between two check states, at most `2147483` |
691
+ | `checkGraceSeconds` | `60` | The time to wait for the first check to show, and for more checks after they all pass; the grace ends at the `checkTimeoutMinutes` limit, where checks that all pass, or no checks, still count as a pass |
692
+ | `checkTimeoutMinutes` | `60` | The limit for one check wait, at most `35791` |
693
+ | `agentTimeoutMinutes` | `30` | The limit for one agent call, at most `35791` |
694
+ | `setupTimeoutMinutes` | `15` | The limit for the setup command, at most `35791` |
695
+ | `commandTimeoutMinutes` | `10` | The limit for one `git` or `gh` command, at most `35791` |
696
+ | `logMaxChars` | `20000` | The maximum length of the failed job logs, shared between the failed GitHub Actions runs (failed external checks are listed by name and link only) |
697
+ | `diffMaxChars` | `60000` | The maximum length of the diff that the reviewer reads |
698
+ | `keepRunDays` | `7` | The number of days to keep the run files; `0` keeps them all |
699
+ | `checks` | `[]` | Shell commands that must pass in the worktree, in order, before an approved change is pushed; a failure goes to the fixer |
700
+ | `checksTimeoutMinutes` | `30` | The limit for one command in `checks`, at most `35791` |
701
+ | `ignoredChecks` | `[]` | Names of GitHub Actions jobs, check runs and commit statuses, such as `release`, that the checks on the base branch do not wait for and whose failure does not count, unless GitHub cancels or skips another job of its run |
702
+ | `setupCommand` | from the lock file | A shell command to run in a new worktree, before the implementer, and after each merge of the base before the `checks` |
703
+ | `models` | `null` per role | The pi model per agent role, as `provider/model`: `implementer`, `reviewer`, `fixer` |
704
+ | `labels` | see above | The names of the labels that the harness reads and sets |
696
705
 
697
706
  The hunter adds `labels.hunt` to each issue it files, so you can tell those
698
707
  issues apart from your own and filter them.
@@ -10,6 +10,7 @@ const ACTIONS_APP = 'github-actions';
10
10
  const FAILED_STATES = new Set(['failure', 'error']);
11
11
  const AWAITS_APPROVAL = 'action_required';
12
12
  const FAILED_CONCLUSIONS = new Set(['failure', 'timed_out', 'startup_failure', AWAITS_APPROVAL]);
13
+ const CUT = 'cut';
13
14
  function jsonLines(raw) {
14
15
  return raw
15
16
  .split('\n')
@@ -38,7 +39,12 @@ async function withoutIgnored(repo, run, ignored) {
38
39
  if (!kept.every(completedJob)) {
39
40
  return { ...run, status: 'in_progress', conclusion: '', jobs: kept };
40
41
  }
41
- const judged = { ...run, status: 'completed', conclusion: jobsConclusion(kept), jobs: kept };
42
+ const judged = {
43
+ ...run,
44
+ status: 'completed',
45
+ conclusion: jobsConclusion(kept, run.conclusion !== 'cancelled' && jobs.some(failedRun)),
46
+ jobs: kept,
47
+ };
42
48
  if (run.status !== 'completed' && rerunnable(judged)) {
43
49
  return { ...run, status: 'in_progress', conclusion: '', jobs: kept };
44
50
  }
@@ -47,11 +53,14 @@ async function withoutIgnored(repo, run, ignored) {
47
53
  function completedJob(job) {
48
54
  return job.status === 'completed';
49
55
  }
50
- function jobsConclusion(jobs) {
51
- if (jobs.some(failedRun)) {
56
+ function jobsConclusion(kept, anyFailed) {
57
+ if (kept.some(failedRun)) {
52
58
  return 'failure';
53
59
  }
54
- return jobs.some((job) => job.conclusion === 'cancelled') ? 'cancelled' : 'success';
60
+ if (!kept.some((job) => job.conclusion === 'cancelled')) {
61
+ return anyFailed && kept.some((job) => job.conclusion === 'skipped') ? CUT : 'success';
62
+ }
63
+ return anyFailed ? CUT : 'cancelled';
55
64
  }
56
65
  async function externalChecks(repo, sha, ignored) {
57
66
  const [runs, statuses] = await Promise.all([
@@ -102,7 +111,10 @@ function baseState(runs, external) {
102
111
  if (checks.some(failedRun)) {
103
112
  return 'fail';
104
113
  }
105
- return checks.some((entry) => entry.conclusion === 'cancelled') ? 'cancelled' : 'pass';
114
+ if (checks.some((entry) => entry.conclusion === 'cancelled')) {
115
+ return 'cancelled';
116
+ }
117
+ return checks.some((entry) => entry.conclusion === CUT) ? 'cut' : 'pass';
106
118
  }
107
119
  export function waitForBaseChecks(repo, sha, branch, options, restarted = [], ignored = []) {
108
120
  let read = {
package/dist/gate.mjs CHANGED
@@ -36,6 +36,9 @@ export async function checkGate(job, sha) {
36
36
  if (checks === 'cancelled') {
37
37
  return escalateAndFinish(job, `The checks on ${base} were cancelled before they finished. ${HALT_NOTE}`, 'main checks cancelled');
38
38
  }
39
+ if (checks === 'cut') {
40
+ return escalateAndFinish(job, `A job in \`ignoredChecks\` failed on ${base} and GitHub cancelled or skipped another job of its workflow run before it finished, for example through \`strategy.fail-fast\` or a \`needs\` on the ignored job. Rerun the cancelled or skipped job, or set \`fail-fast: false\` and drop the \`needs\` so an ignored job no longer stops the others. ${HALT_NOTE}`, 'main checks cut short');
41
+ }
39
42
  if (checks !== 'fail') {
40
43
  return escalateAndFinish(job, `The checks on ${base} did not finish in time. ${HALT_NOTE}`, 'main checks timeout');
41
44
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-issue",
3
- "version": "7.8.24",
3
+ "version": "7.8.26",
4
4
  "description": "Autonomous issue harness driven by the pi SDK",
5
5
  "keywords": [
6
6
  "github",