next-issue 0.12.3 → 0.12.4
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 +3 -1
- package/dist/git.mjs +2 -2
- package/dist/pipeline.mjs +5 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -28,7 +28,9 @@ For each open issue, oldest first:
|
|
|
28
28
|
3. Fetch the remote, fast-forward the local copy of the default branch when
|
|
29
29
|
that is safe, then add a git worktree at `../<repo>-issue-<n>` on the
|
|
30
30
|
`issue-<n>` branch. A branch that exists on the remote is the start, and a
|
|
31
|
-
local branch that fell behind the remote is fast-forwarded.
|
|
31
|
+
local branch that fell behind the remote is fast-forwarded. A fast-forward
|
|
32
|
+
of the base that is not safe leaves the local base branch as it is and
|
|
33
|
+
writes a `base.behind` event. A new branch then starts from the remote base.
|
|
32
34
|
4. Let the implementer agent do the work, then commit and push.
|
|
33
35
|
5. Open a draft pull request that closes the issue.
|
|
34
36
|
6. Wait for the checks, once the pull request shows the pushed commit. A
|
package/dist/git.mjs
CHANGED
|
@@ -32,7 +32,7 @@ export async function addWorktree(repo, issue, base, remote) {
|
|
|
32
32
|
const branch = branchName(issue);
|
|
33
33
|
const upstream = `${remote}/${branch}`;
|
|
34
34
|
await must("git", ["fetch", remote], { cwd: repo.root });
|
|
35
|
-
await updateBase(repo, base, remote);
|
|
35
|
+
const baseUpdated = await updateBase(repo, base, remote);
|
|
36
36
|
await must("git", ["worktree", "prune"], { cwd: repo.root });
|
|
37
37
|
const pushed = await hasBranch(repo, upstream, "--remotes");
|
|
38
38
|
if (!(await hasWorktree(repo, path))) {
|
|
@@ -44,7 +44,7 @@ export async function addWorktree(repo, issue, base, remote) {
|
|
|
44
44
|
if (pushed) {
|
|
45
45
|
await run("git", ["merge", "--ff-only", upstream], { cwd: path });
|
|
46
46
|
}
|
|
47
|
-
return path;
|
|
47
|
+
return { path, baseUpdated };
|
|
48
48
|
}
|
|
49
49
|
async function hasBranch(repo, name, ...flags) {
|
|
50
50
|
const list = await must("git", ["branch", "--list", ...flags, name], { cwd: repo.root });
|
package/dist/pipeline.mjs
CHANGED
|
@@ -102,7 +102,11 @@ async function work(context, issue, log, state) {
|
|
|
102
102
|
await writeState(repo, state);
|
|
103
103
|
});
|
|
104
104
|
const comments = await log.step("comments", {}, () => ports.issueComments(repo, issue.number));
|
|
105
|
-
const
|
|
105
|
+
const added = await log.step("worktree", { branch }, () => ports.addWorktree(repo, issue.number, context.base, config.remote));
|
|
106
|
+
const worktree = added.path;
|
|
107
|
+
if (!added.baseUpdated) {
|
|
108
|
+
log.event("base.behind", { base: context.base }, "quiet");
|
|
109
|
+
}
|
|
106
110
|
const job = { context, issue, log, state, branch, worktree, comments };
|
|
107
111
|
const escalate = (reason) => handOver(context, log, issue.number, state, reason);
|
|
108
112
|
const finish = async (outcome, reason) => {
|