Conversation
- isWorktreeValid() 메서드가 디렉토리만 존재하면 항상 true를 반환하던 문제 수정 - .git 파일이 존재하고 유효한 gitdir 참조를 포함할 때만 true 반환하도록 변경 - 초기 셋팅 시 리포지토리가 clone되지 않았을 때 발생하던 오류 해결 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- validateEnvironment()에서 worktree가 유효하지 않으면 false를 반환하도록 수정 - 기존에는 worktree 검증 실패 시에도 true를 반환하여 초기 셋팅 시 오류 발생 - workspace-manager.test.ts에 BUG #40 재현 테스트 추가 - workspace-setup.test.ts에 worktree 검증 실패 시 테스트 추가 Related: #40 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
초기 셋팅 시 repository clone이 아직 이루어지지 않았는데 worktree 검증을 시도하는 문제를 수정했습니다. 주요 변경 사항: - workspace-setup.ts의 validateEnvironment() 메서드에서 worktreeCreated 플래그를 확인하여 초기 셋팅 시 worktree 검증을 건너뜀 - worktreeCreated가 false일 때는 디렉토리 존재 여부만 확인 - worktreeCreated가 true일 때만 Git worktree 유효성 검증 수행 - 초기 셋팅 시나리오를 위한 테스트 케이스 추가 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
초기 셋팅 시 리포지토리 clone 버그는 이전 커밋들(a82ca33, 89420bc, 9f42f0d)에서 이미 수정되었으나, 통합 테스트에서 잘못된 기대값으로 인해 실패하고 있었습니다. 주요 변경 사항: - TaskAssignmentValidator 테스트: 디렉토리만 있고 .git 파일이 없으면 isWorktreeValid()가 false를 반환해야 함 (기존: true 기대) - canAssignIdleWorkerToTask 테스트: 유효한 worktree를 위해 .git 파일 생성 추가 - 우선순위 시스템 테스트: 유효한 worktree를 위해 .git 파일 생성 추가 테스트 결과: - workspace 관련 테스트 50개 모두 통과 - 버그 수정 검증 완료 Closes #40 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Repository owner
deleted a comment from
wlgns5376
Oct 9, 2025
Collaborator
|
아래 에러가 발생하는데 원인을 분석해주고 관련된 테스트 코드가 있는지 검토하고 있다면 왜 이 에러를 감지하지 못했는지 검토해줘 |
## 문제
- Git clone 실행 시 `protocol '"https' is not supported` 에러 발생
- safeExec 메서드가 명령어를 split(' ')로 파싱하면서 따옴표가 인자에 포함됨
- spawn에 전달될 때 따옴표가 제거되지 않아 Git이 프로토콜을 인식하지 못함
## 해결
- parseCommand() 메서드 추가: 따옴표를 고려한 명령어 파싱
- 따옴표 안의 공백을 구분자로 인식하지 않도록 처리
- URL, 경로 등에 공백이나 특수문자가 있어도 올바르게 처리
## 테스트
- 따옴표가 포함된 URL 파싱 테스트 추가
- 공백이 포함된 경로 파싱 테스트 추가
- 여러 인자가 있는 명령어 파싱 테스트 추가
- 총 9개 테스트 모두 통과
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Owner
Author
|
@woody-kang 리뷰 피드백이 반영되었습니다. 문제 원인
근본 원인: 해결 방법
테스트 보완기존 테스트는 정상적인 URL만 테스트했고, 따옴표가 포함된 인자 처리를 검증하지 않았습니다. 추가된 테스트:
모든 테스트(총 9개) 통과했습니다. 재검토 부탁드립니다. |
woody-kang
approved these changes
Oct 10, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
초기 셋팅 시 리포지토리가 clone되지 않은 상태에서 worktree 검증이 실패하는 버그를 수정했습니다.
Problem
초기 셋팅 시 repository clone을 먼저 실행해야 하는데 worktree가 존재한다고 체크되어 오류가 발생하는 문제가 있었습니다.
Root Cause
이로 인해:
setupWorktree()에서 유효한 worktree로 인식하여 early returnensureRepository()호출이 스킵됨addWorktree()호출 시 "Repository not found" 오류 발생Solution
Phase 1: workspace-manager.ts 수정
isWorktreeValid()메서드의 로직 개선true반환.git파일이 존재하고 유효한gitdir:참조를 포함할 때만true반환Phase 2: workspace-setup.ts 수정 (이번 커밋)
validateEnvironment()메서드에서worktreeCreated플래그 검증 추가Changes
src/services/worker/workspace-setup.ts
validateEnvironment()메서드에worktreeCreated플래그 검증 로직 추가src/services/manager/workspace-manager.ts
isWorktreeValid()메서드의 검증 로직 개선.git파일의gitdir:참조 검증 추가tests/unit/services/worker/workspace-setup.test.ts
worktreeCreated플래그에 따른 검증 로직 테스트Test Results
Test Plan
Closes #40
🤖 Generated with Claude Code