Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/domain/phase.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ var PhaseDefinitions = map[string]*PhaseDefinition{
ExecutionLabel: LabelReviewing,
ExecutionType: ExecutionTypeCommand,
RequiresPane: true,
RequiresWorktree: false,
RequiresWorktree: true,
CompletionLabels: map[string]NextAction{
LabelDone: { // レビュー承認
RemoveLabel: LabelReviewing,
Expand Down
2 changes: 1 addition & 1 deletion internal/domain/phase_definition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func TestPhaseDefinitions(t *testing.T) {
expectedExecution: domain.LabelReviewing,
expectedType: domain.ExecutionTypeCommand,
expectedPane: true,
expectedWorktree: false,
expectedWorktree: true,
expectedCompletions: map[string]bool{
domain.LabelDone: true,
domain.LabelRequiresChanges: true,
Expand Down
22 changes: 20 additions & 2 deletions internal/service/workflow_executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,14 +181,32 @@ func TestWorkflowExecutor_ExecutePhase(t *testing.T) {
wantErr: false,
},
{
name: "Error when updating labels",
name: "Execute review phase with worktree",
issueNumber: 999,
phase: domain.PhaseReview,
currentLabel: domain.LabelReviewRequested,
nextLabel: domain.LabelReviewing,
setupMocks: func(tmux *MockTmuxClient, workspace *MockWorkspaceManager, processor *MockIssueProcessorUpdater) {
processor.On("Configure", mock.Anything).Return(nil)
processor.On("UpdateLabels", mock.Anything, 999, domain.LabelReviewRequested, domain.LabelReviewing).
processor.On("UpdateLabels", mock.Anything, 999, domain.LabelReviewRequested, domain.LabelReviewing).Return(nil)
workspace.On("PrepareWorkspace", 999).Return(nil) // Reviewフェーズでもworktree準備
tmux.On("SessionExists", "soba-test-repo").Return(true)
tmux.On("WindowExists", "soba-test-repo", "issue-999").Return(false, nil)
tmux.On("CreateWindow", "soba-test-repo", "issue-999").Return(nil)
tmux.On("GetLastPaneIndex", "soba-test-repo", "issue-999").Return(0, nil)
tmux.On("SendCommand", "soba-test-repo", "issue-999", 0, `cd /tmp/soba/worktrees/issue-999 && echo "Review"`).Return(nil)
},
wantErr: false,
},
{
name: "Error when updating labels",
issueNumber: 888,
phase: domain.PhaseReview,
currentLabel: domain.LabelReviewRequested,
nextLabel: domain.LabelReviewing,
setupMocks: func(tmux *MockTmuxClient, workspace *MockWorkspaceManager, processor *MockIssueProcessorUpdater) {
processor.On("Configure", mock.Anything).Return(nil)
processor.On("UpdateLabels", mock.Anything, 888, domain.LabelReviewRequested, domain.LabelReviewing).
Return(errors.New("failed to update labels"))
},
wantErr: true,
Expand Down
Loading