next-issue 7.8.14 → 7.8.15

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
@@ -160,8 +160,13 @@ the run handles one issue. For each issue:
160
160
  harness undoes the merge and hands the issue to a person with the reason
161
161
  `merge conflict`. When `checks` lists commands, the harness then runs
162
162
  the setup command again in the worktree, so the checks use the
163
- dependencies of the merged base. A setup that fails or does not finish
164
- in `setupTimeoutMinutes` stops the landing before the push and hands the
163
+ dependencies of the merged base. It runs the setup after it makes the
164
+ change one commit, and adds what the setup writes, unless git ignores
165
+ it, to that commit without hooks. Every check runs on that commit, and
166
+ the base gets the same files that the checks passed on. A change that
167
+ the base already holds is an `empty change` before the setup runs. A
168
+ setup that fails or does not finish in `setupTimeoutMinutes` keeps the
169
+ merged commit, stops the landing before the push and hands the
165
170
  issue to a person with the reason `setup failed` or `setup timeout`. The
166
171
  harness then runs each command in `checks` in the worktree, in order,
167
172
  with `bash -c` and stderr merged into stdout, each for at most
package/dist/git.mjs CHANGED
@@ -107,6 +107,14 @@ export async function saveEdits(cwd, commitMessage) {
107
107
  await git(cwd, ['commit', '--no-verify', '-m', commitMessage]);
108
108
  return true;
109
109
  }
110
+ /** Adds every edit in the worktree to the last commit, with no hooks. */
111
+ export async function amendEdits(cwd) {
112
+ if (!(await isDirty(cwd))) {
113
+ return;
114
+ }
115
+ await git(cwd, ['add', '-A']);
116
+ await git(cwd, ['commit', '--amend', '--no-edit', '--no-verify']);
117
+ }
110
118
  export async function setAside(cwd, target, branch) {
111
119
  await git(cwd, ['branch', branch]);
112
120
  if (await isDirty(cwd)) {
@@ -23,6 +23,7 @@ export async function localChecks(job) {
23
23
  if (setup !== undefined) {
24
24
  return setup;
25
25
  }
26
+ await ports.amendEdits(worktree);
26
27
  const head = await ports.revision(worktree);
27
28
  for (const command of config.checks) {
28
29
  const result = await log.step('check', { cmd: command }, () => ports.runCheck(command, worktree, minutesToMs(config.checksTimeoutMinutes), config.logMaxChars));
package/dist/ports.mjs CHANGED
@@ -4,7 +4,7 @@ import { run } from './exec.mjs';
4
4
  import { commitAll } from './git-commit.mjs';
5
5
  import { pushToBase, reapplyRevert, revertOnBase, squashOnto } from './git-land.mjs';
6
6
  import { abortMerge, commitMerge, startMerge } from './git-merge.mjs';
7
- import { changedFiles, deleteBranch, diff, discardChanges, disputeBranches, isDirty, isLanded, isOnBase, latestSubject, push, resetToBase, revision, saveEdits, setAside, } from './git.mjs';
7
+ import { amendEdits, changedFiles, deleteBranch, diff, discardChanges, disputeBranches, isDirty, isLanded, isOnBase, latestSubject, push, resetToBase, revision, saveEdits, setAside, } from './git.mjs';
8
8
  import { canWrite, closeIssue, commentOnIssue, editIssueBody, issueComments, openBlockers, openIssues, reopenIssue, repositorySlug, threadComments, viewIssue, } from './github.mjs';
9
9
  import { huntWorktree } from './hunt.mjs';
10
10
  import { ensureLabel, setLabel } from './labels.mjs';
@@ -20,6 +20,7 @@ async function runCheck(command, cwd, timeoutMs, tailChars) {
20
20
  }
21
21
  export const PORTS = {
22
22
  abortMerge,
23
+ amendEdits,
23
24
  addWorktree,
24
25
  canWrite,
25
26
  changedFiles,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-issue",
3
- "version": "7.8.14",
3
+ "version": "7.8.15",
4
4
  "description": "Autonomous issue harness driven by the pi SDK",
5
5
  "keywords": [
6
6
  "github",