Commit 6ff239ee moved the remediate resume into daemon worktree
preparation and deleted StageResumeWorktree together with the Dir/Resume
pair it called, but nothing in the workflow replaced the binding it did:
TaskContext.Dir and Branch stayed empty for a whole run, so
remediate-build ran the builder with no workspace and
remediate-commit-push called CommitAll/Push with an empty dir and branch.
Extend the workflow-side Trees seam with the prepare target, mirroring
the daemon's mode-aware worktree.Manager.Prepare: PrepareFresh lands on
base, a non-empty target is the branch a resume continues. Remediate now
stages StagePrepareWorktreeOnBranch before any agent stage, binding the
same directory the daemon prepared and the task's PR branch, and failing
closed when the task has no branch rather than preparing base. The
container adapter returns the requested resume target verbatim.
Refs archie-core-h4tk
20 lines
891 B
Go
20 lines
891 B
Go
package workflow
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/samcharles93/archie-core/internal/worktree"
|
|
)
|
|
|
|
// realTrees adapts a real worktree.Manager to the workflow's Trees contract for
|
|
// the tests that drive a stage against a real clone. The workflow's PrepareTarget
|
|
// and the manager's worktree.Target are the same choice spelled in two packages
|
|
// (workflow cannot import infrastructure), so the adapter maps one onto the
|
|
// other. Embedding keeps every other method; these tests never call Prepare,
|
|
// they only need the manager's git reads (Diff, ChangedFiles, ChangedFileStats).
|
|
type realTrees struct{ *worktree.Manager }
|
|
|
|
func (t realTrees) Prepare(ctx context.Context, owner, repo, base string, issue int, title, body, labels string, target PrepareTarget) (string, string, error) {
|
|
return t.Manager.Prepare(ctx, owner, repo, base, issue, title, body, labels, worktree.Target(target))
|
|
}
|