fix(#308): git clone basePath修正 - CM_ROOT_DIRを使用するよう変更#311
Merged
Conversation
…mp/repos - Inject getEnv().CM_ROOT_DIR as basePath in clone/route.ts and [jobId]/route.ts - Add resolveDefaultBasePath() with WORKTREE_BASE_PATH deprecation warning - Fix info disclosure: remove basePath/targetPath from error messages (D4-001/D4-003) - Add targetDir type validation to prevent injection (D4-002) - Add basePath resolution tests and security tests - Update .env.example to document clone directory role Resolves #308 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove unused imports (CloneResult, UrlNormalizer, getRepositoryByNormalizedUrl) from clone-manager.test.ts and add @returns JSDoc tag to resolveDefaultBasePath() for improved code documentation consistency. Quality Metrics: - Unit tests: 47 passed - Integration tests: 12 passed - TypeScript errors: 0 - ESLint errors: 0 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add design policy document with 4-stage review results - Add issue review reports (8-stage multi-stage review) - Add multi-stage design review reports (stages 1-4) - Add work plan for implementation - Add pm-auto-dev progress reports - Update CLAUDE.md with Issue #308 module descriptions Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
CM_ROOT_DIRを参照するように変更getEnv().CM_ROOT_DIRをbasePath としてDIパターンで注入WORKTREE_BASE_PATHの非推奨化(console.warn警告付き後方互換維持)targetDirパラメータの型検証を追加(D4-002)変更内容
バグ修正
src/lib/clone-manager.ts:resolveDefaultBasePath()メソッドを追加し、basePath優先順位をconfig.basePath>WORKTREE_BASE_PATH(非推奨) >process.cwd()に変更src/app/api/repositories/clone/route.ts:getEnv().CM_ROOT_DIRを取得しbasePath として渡すsrc/app/api/repositories/clone/[jobId]/route.ts: 同様にbasePath を渡す(一貫性維持)セキュリティ修正
targetDirパラメータのtypeof型検証を追加(D4-002)テスト
tests/unit/lib/clone-manager.test.ts: basePath resolution関連テスト9件追加(47 tests total)tests/integration/api-clone.test.ts: getEnvモック追加、型検証テスト追加(12 tests total)Test plan
npx tsc --noEmit— 0 errorsnpm run lint— 0 errorsnpx vitest run tests/unit/lib/clone-manager.test.ts— 47/47 passednpx vitest run tests/integration/api-clone.test.ts— 12/12 passedCloses #308
🤖 Generated with Claude Code