summaryrefslogtreecommitdiff
path: root/internal/executor/executor.go
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-03-24 23:01:22 +0000
committerPeter Stone <thepeterstone@gmail.com>2026-03-24 23:01:22 +0000
commit4a47ec318c92cc899ee7392bb200cf9ee482e0da (patch)
treee2c2d7f37c6a971f344f11344e9df53e271df290 /internal/executor/executor.go
parentf6041b8d1c1bf7e776973e2cc6ddac8ecaab3cfa (diff)
feat: merge story branch to master before deploy, add doot project to registry
- triggerStoryDeploy: fetch/checkout/merge --no-ff/push before running deploy script (ADR-007) - executor_test: TestPool_StoryDeploy_MergesStoryBranch proves merge happens - seed.go: add doot project with deploy script; wire claudomator deploy script Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'internal/executor/executor.go')
-rw-r--r--internal/executor/executor.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/internal/executor/executor.go b/internal/executor/executor.go
index 4183ab0..7213b34 100644
--- a/internal/executor/executor.go
+++ b/internal/executor/executor.go
@@ -512,6 +512,22 @@ func (p *Pool) triggerStoryDeploy(ctx context.Context, storyID string) {
if proj.DeployScript == "" {
return
}
+ // Merge story branch to master before deploying (ADR-007).
+ if story.BranchName != "" && proj.LocalPath != "" {
+ mergeSteps := [][]string{
+ {"git", "-C", proj.LocalPath, "fetch", "origin"},
+ {"git", "-C", proj.LocalPath, "checkout", "master"},
+ {"git", "-C", proj.LocalPath, "merge", "--no-ff", story.BranchName, "-m", "Merge " + story.BranchName},
+ {"git", "-C", proj.LocalPath, "push", "origin", "master"},
+ }
+ for _, args := range mergeSteps {
+ if mergeOut, mergeErr := exec.CommandContext(ctx, args[0], args[1:]...).CombinedOutput(); mergeErr != nil {
+ p.logger.Error("triggerStoryDeploy: merge failed", "cmd", args, "output", string(mergeOut), "error", mergeErr)
+ return
+ }
+ }
+ p.logger.Info("story branch merged to master", "storyID", storyID, "branch", story.BranchName)
+ }
out, err := exec.CommandContext(ctx, proj.DeployScript).CombinedOutput()
if err != nil {
p.logger.Error("triggerStoryDeploy: deploy script failed", "storyID", storyID, "script", proj.DeployScript, "output", string(out), "error", err)