From 8c04fbb0546bdd445757ae84994324ba910171fb Mon Sep 17 00:00:00 2001 From: yoon Date: Fri, 3 Oct 2025 16:09:49 +0900 Subject: [PATCH 1/5] =?UTF-8?q?GitHub=20=EC=84=A4=EC=A0=95=20=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=EB=93=A4=20=EC=B6=94=EA=B0=80:=20=EC=9B=8C=ED=81=AC?= =?UTF-8?q?=ED=94=8C=EB=A1=9C=EC=9A=B0,=20=EC=9D=B4=EC=8A=88/PR=20?= =?UTF-8?q?=ED=85=9C=ED=94=8C=EB=A6=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/ISSUE_TEMPLATE/bug_report.md | 27 ++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 19 ++++++++++++++ .github/pull_request_template.md | 18 ++++++++++++++ .github/workflows/test.yml | 30 +++++++++++++++++++++++ issue-examples.md | 17 +++++++++++++ 5 files changed, 111 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/pull_request_template.md create mode 100644 .github/workflows/test.yml create mode 100644 issue-examples.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..1f2d787 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,27 @@ +--- +name: 버그 리포트 +about: 버그를 신고할 때 사용하세요 +title: '[BUG] ' +labels: bug +assignees: '' +--- + +## 🐛 버그 설명 +버그에 대한 명확하고 간결한 설명을 작성해주세요. + +## 🔄 재현 방법 +1. '...' 페이지로 이동 +2. '....' 클릭 +3. '....' 까지 스크롤 +4. 오류 발생 + +## ✅ 예상 동작 +어떤 동작이 일어날 것으로 예상했는지 설명해주세요. + +## 📷 스크린샷 +가능하다면 스크린샷을 첨부해주세요. + +## 💻 환경 정보 +- OS: [예: Windows 10] +- 브라우저: [예: Chrome 95] +- 버전: [예: 1.0.0] \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..7e566c8 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,19 @@ +--- +name: 기능 요청 +about: 새로운 기능을 제안할 때 사용하세요 +title: '[FEATURE] ' +labels: enhancement +assignees: '' +--- + +## 🚀 기능 설명 +어떤 기능을 원하는지 명확하게 설명해주세요. + +## 💡 동기 +왜 이 기능이 필요한지 설명해주세요. + +## 📝 상세 설명 +기능이 어떻게 작동해야 하는지 자세히 설명해주세요. + +## 🎯 대안 +고려해본 다른 해결책이 있다면 설명해주세요. \ No newline at end of file diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..256636a --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,18 @@ +## 📋 변경 사항 +이 PR에서 무엇을 변경했는지 설명해주세요. + +## 🔗 관련 이슈 +- Closes #(이슈 번호) +- Related to #(이슈 번호) + +## ✅ 체크리스트 +- [ ] 코드가 정상적으로 동작합니다 +- [ ] 테스트를 작성했습니다 +- [ ] 문서를 업데이트했습니다 +- [ ] 코드 스타일을 준수했습니다 + +## 🧪 테스트 방법 +이 변경사항을 어떻게 테스트할 수 있는지 설명해주세요. + +## 📷 스크린샷 (선택사항) +UI 변경이 있다면 스크린샷을 첨부해주세요. \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..5983ad9 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,30 @@ +name: 자동 테스트 + +# 언제 실행할지 정의 +on: + push: + branches: [ main, test ] + pull_request: + branches: [ main ] + +# 실행할 작업들 +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: 코드 체크아웃 + uses: actions/checkout@v3 + + - name: Python 설정 + uses: actions/setup-python@v3 + with: + python-version: '3.9' + + - name: 의존성 설치 + run: | + python -m pip install --upgrade pip + pip install pytest + + - name: 테스트 실행 + run: pytest \ No newline at end of file diff --git a/issue-examples.md b/issue-examples.md new file mode 100644 index 0000000..2bb36c7 --- /dev/null +++ b/issue-examples.md @@ -0,0 +1,17 @@ +# 이슈 예시 + +## 버그 리포트 +- **제목**: 로그인 버튼이 작동하지 않음 +- **설명**: 사용자가 로그인 버튼을 클릭해도 반응이 없음 +- **재현 방법**: + 1. 홈페이지 접속 + 2. 로그인 버튼 클릭 + 3. 아무 반응 없음 +- **담당자**: @developer1 +- **라벨**: bug, urgent + +## 기능 요청 +- **제목**: 다크모드 추가 +- **설명**: 사용자들이 다크모드를 원함 +- **담당자**: @designer1 +- **라벨**: enhancement, UI/UX \ No newline at end of file From 9897d233fdabf7711ab2ff02a3a05b06596691f0 Mon Sep 17 00:00:00 2001 From: yoon Date: Fri, 3 Oct 2025 16:24:22 +0900 Subject: [PATCH 2/5] =?UTF-8?q?[FEATURE]=20GitHub=20=ED=85=9C=ED=94=8C?= =?UTF-8?q?=EB=A6=BF=20=EB=B0=8F=20=EC=9B=8C=ED=81=AC=ED=94=8C=EB=A1=9C?= =?UTF-8?q?=EC=9A=B0=20=EA=B0=9C=EC=84=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 체계적인 PR 템플릿으로 개선 - 이슈 템플릿 재구성 (버그 리포트, 기능 요청) - CI/CD 파이프라인 추가 - PR 자동 검토 워크플로우 추가 - 이슈 관리 자동화 워크플로우 추가 - 릴리즈 자동화 워크플로우 추가 --- .github/ISSUE_TEMPLATE/bug_report.md | 40 ++++--- .github/ISSUE_TEMPLATE/feature_request.md | 35 ++++-- .github/pull_request_template.md | 37 ++++-- .github/workflows/ci-cd.yml | 93 ++++++++++++++ .github/workflows/issue-management.yml | 114 ++++++++++++++++++ .github/workflows/pr-review.yml | 114 ++++++++++++++++++ .github/workflows/release.yml | 140 ++++++++++++++++++++++ .github/workflows/test.yml | 30 ----- issue-examples.md | 17 --- 9 files changed, 536 insertions(+), 84 deletions(-) create mode 100644 .github/workflows/ci-cd.yml create mode 100644 .github/workflows/issue-management.yml create mode 100644 .github/workflows/pr-review.yml create mode 100644 .github/workflows/release.yml delete mode 100644 .github/workflows/test.yml delete mode 100644 issue-examples.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 1f2d787..5865fab 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,27 +1,35 @@ --- -name: 버그 리포트 -about: 버그를 신고할 때 사용하세요 +name: 🐛 버그 리포트 +about: 버그를 발견했을 때 사용해주세요 title: '[BUG] ' labels: bug assignees: '' --- -## 🐛 버그 설명 -버그에 대한 명확하고 간결한 설명을 작성해주세요. +# 🐛 개요 +여기에 작업해주세요. -## 🔄 재현 방법 -1. '...' 페이지로 이동 -2. '....' 클릭 -3. '....' 까지 스크롤 -4. 오류 발생 +## 🔍 상세 버그 내용 -## ✅ 예상 동작 -어떤 동작이 일어날 것으로 예상했는지 설명해주세요. +### 📝 버그 설명 1 +- [ ] 어떤 상황에서 발생하는지 +- [ ] 어떤 오류가 나타나는지 +- [ ] 예상과 다른 동작은 무엇인지 -## 📷 스크린샷 -가능하다면 스크린샷을 첨부해주세요. +### 📝 재현 방법 +- [ ] 1. 특정 페이지로 이동 +- [ ] 2. 특정 버튼 클릭 +- [ ] 3. 오류 발생 확인 + +## 📄 더 꼼꼼히 확인할 부분 + +- [ ] 브라우저 콘솔 에러 메시지 +- [ ] 네트워크 요청 상태 +- [ ] 로그 파일 내용 ## 💻 환경 정보 -- OS: [예: Windows 10] -- 브라우저: [예: Chrome 95] -- 버전: [예: 1.0.0] \ No newline at end of file + +- [ ] OS: [예: Windows 11] +- [ ] 브라우저: [예: Chrome 118] +- [ ] 버전: [예: v1.0.0] +- [ ] 기기: [예: Desktop/Mobile] \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 7e566c8..a5df016 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -1,19 +1,34 @@ --- -name: 기능 요청 -about: 새로운 기능을 제안할 때 사용하세요 +name: ✨ 기능 요청 +about: 새로운 기능을 제안할 때 사용해주세요 title: '[FEATURE] ' labels: enhancement assignees: '' --- -## 🚀 기능 설명 -어떤 기능을 원하는지 명확하게 설명해주세요. +# ✨ 개요 +여기에 작업해주세요. -## 💡 동기 -왜 이 기능이 필요한지 설명해주세요. +## 💡 상세 기능 내용 -## 📝 상세 설명 -기능이 어떻게 작동해야 하는지 자세히 설명해주세요. +### 📝 기능 설명 1 +- [ ] 어떤 기능인지 설명 +- [ ] 왜 필요한지 이유 +- [ ] 어떻게 동작해야 하는지 -## 🎯 대안 -고려해본 다른 해결책이 있다면 설명해주세요. \ No newline at end of file +### 📝 사용자 시나리오 +- [ ] 1. 사용자가 어떤 상황에서 +- [ ] 2. 이 기능을 사용하게 되고 +- [ ] 3. 어떤 결과를 얻는지 + +## 📄 더 꼼꼼히 확인할 부분 + +- [ ] 기존 기능과의 호환성 +- [ ] 성능에 미치는 영향 +- [ ] 보안 고려사항 + +## 🎯 대안 및 참고사항 + +- [ ] 고려해본 다른 해결책 +- [ ] 비슷한 기능을 가진 다른 서비스 +- [ ] 참고할 만한 자료나 링크 \ No newline at end of file diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 256636a..e52318a 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,18 +1,33 @@ -## 📋 변경 사항 -이 PR에서 무엇을 변경했는지 설명해주세요. +# 🚀 개요 +여기에 작업해주세요. + +## ⏰ 작업 상세 내용 + +### 📝 작업 내용 1 +- [ ] 첫 번째 작업 내용 +- [ ] 두 번째 작업 내용 +- [ ] 세 번째 작업 내용 + +### � 작업 내용 2 +- [ ] 첫 번째 작업 내용 +- [ ] 두 번째 작업 내용 +- [ ] 세 번째 작업 내용 + +## 📄 더 꼼꼼히 확인할 부분 + +- [ ] 없을 경우 체크 + +## 🔍 반드시 참고해야하는 변경 사항 + +- [ ] 없을 경우 체크 ## 🔗 관련 이슈 - Closes #(이슈 번호) - Related to #(이슈 번호) -## ✅ 체크리스트 +## ✅ 최종 체크리스트 - [ ] 코드가 정상적으로 동작합니다 -- [ ] 테스트를 작성했습니다 +- [ ] 테스트를 작성하고 통과했습니다 +- [ ] 코드 리뷰를 요청했습니다 - [ ] 문서를 업데이트했습니다 -- [ ] 코드 스타일을 준수했습니다 - -## 🧪 테스트 방법 -이 변경사항을 어떻게 테스트할 수 있는지 설명해주세요. - -## 📷 스크린샷 (선택사항) -UI 변경이 있다면 스크린샷을 첨부해주세요. \ No newline at end of file +- [ ] 브레이킹 체인지가 있다면 명시했습니다 diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml new file mode 100644 index 0000000..75a003d --- /dev/null +++ b/.github/workflows/ci-cd.yml @@ -0,0 +1,93 @@ +name: 🚀 CI/CD Pipeline + +on: + push: + branches: [ main, test ] + pull_request: + branches: [ main ] + +jobs: + # 📝 코드 품질 검사 + code-quality: + name: ✅ 코드 품질 검사 + runs-on: ubuntu-latest + + steps: + - name: 📥 코드 체크아웃 + uses: actions/checkout@v4 + + - name: 🐍 Python 환경 설정 + uses: actions/setup-python@v4 + with: + python-version: '3.11' + + - name: 📦 의존성 설치 + run: | + python -m pip install --upgrade pip + pip install flake8 black isort + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + + - name: 🎨 코드 포맷팅 검사 (Black) + run: black --check . + + - name: 📐 Import 정렬 검사 (isort) + run: isort --check-only . + + - name: 🔍 코드 스타일 검사 (Flake8) + run: flake8 . + + # 🧪 테스트 실행 + test: + name: 🧪 테스트 실행 + runs-on: ubuntu-latest + needs: code-quality + + strategy: + matrix: + python-version: ['3.9', '3.10', '3.11'] + + steps: + - name: 📥 코드 체크아웃 + uses: actions/checkout@v4 + + - name: 🐍 Python ${{ matrix.python-version }} 설정 + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: 📦 의존성 설치 + run: | + python -m pip install --upgrade pip + pip install pytest pytest-cov + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + + - name: 🧪 테스트 실행 + run: | + pytest --cov=. --cov-report=xml + + - name: 📊 코드 커버리지 업로드 + uses: codecov/codecov-action@v3 + with: + file: ./coverage.xml + flags: unittests + name: codecov-umbrella + + # 🚀 배포 (main 브랜치만) + deploy: + name: 🚀 배포 + runs-on: ubuntu-latest + needs: [code-quality, test] + if: github.ref == 'refs/heads/main' && github.event_name == 'push' + + steps: + - name: 📥 코드 체크아웃 + uses: actions/checkout@v4 + + - name: 🚀 배포 준비 + run: | + echo "배포 준비 중..." + # 여기에 실제 배포 로직 추가 + + - name: ✅ 배포 완료 알림 + run: | + echo "배포가 완료되었습니다! 🎉" \ No newline at end of file diff --git a/.github/workflows/issue-management.yml b/.github/workflows/issue-management.yml new file mode 100644 index 0000000..96effbe --- /dev/null +++ b/.github/workflows/issue-management.yml @@ -0,0 +1,114 @@ +name: 📋 이슈 관리 + +on: + issues: + types: [opened, labeled, assigned] + issue_comment: + types: [created] + +jobs: + # 🎯 이슈 자동 처리 + issue-automation: + name: 🎯 이슈 자동 처리 + runs-on: ubuntu-latest + + steps: + - name: 🏷️ 새 이슈 자동 라벨링 + if: github.event.action == 'opened' + uses: actions/github-script@v6 + with: + script: | + const issue = context.payload.issue; + const title = issue.title.toLowerCase(); + const body = issue.body.toLowerCase(); + + const labels = ['triage']; + + // 제목 기반 라벨링 + if (title.includes('[bug]') || body.includes('bug') || body.includes('error')) { + labels.push('bug'); + } + if (title.includes('[feature]') || body.includes('feature') || body.includes('enhancement')) { + labels.push('enhancement'); + } + if (title.includes('[docs]') || body.includes('documentation')) { + labels.push('documentation'); + } + + // 우선순위 라벨링 + if (body.includes('urgent') || body.includes('critical')) { + labels.push('priority-high'); + } else if (body.includes('important')) { + labels.push('priority-medium'); + } else { + labels.push('priority-low'); + } + + await github.rest.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: issue.number, + labels: labels + }); + + - name: 🤖 이슈 응답 자동화 + if: github.event.action == 'opened' + uses: actions/github-script@v6 + with: + script: | + const issue = context.payload.issue; + + let response = `👋 안녕하세요! 이슈를 등록해주셔서 감사합니다.\n\n`; + + if (issue.title.includes('[BUG]')) { + response += `🐛 **버그 리포트**\n`; + response += `- 재현 방법을 자세히 기록해주세요\n`; + response += `- 환경 정보를 명시해주세요\n`; + response += `- 스크린샷이나 로그가 있다면 첨부해주세요\n\n`; + } else if (issue.title.includes('[FEATURE]')) { + response += `✨ **기능 요청**\n`; + response += `- 어떤 문제를 해결하려는지 설명해주세요\n`; + response += `- 예상되는 사용자 시나리오를 공유해주세요\n`; + response += `- 구현 우선순위를 고려해서 검토하겠습니다\n\n`; + } + + response += `⏰ **처리 예상 시간**\n`; + response += `- 검토: 1-2일 이내\n`; + response += `- 답변: 3-5일 이내\n\n`; + response += `🔔 궁금한 점이 있으시면 언제든 댓글로 문의해주세요!`; + + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: issue.number, + body: response + }); + + # 📊 이슈 통계 + issue-stats: + name: 📊 이슈 통계 업데이트 + runs-on: ubuntu-latest + if: github.event.action == 'opened' || github.event.action == 'closed' + + steps: + - name: 📈 이슈 통계 계산 + uses: actions/github-script@v6 + with: + script: | + const { data: issues } = await github.rest.issues.listForRepo({ + owner: context.repo.owner, + repo: context.repo.repo, + state: 'all', + per_page: 100 + }); + + const openIssues = issues.filter(issue => issue.state === 'open' && !issue.pull_request).length; + const closedIssues = issues.filter(issue => issue.state === 'closed' && !issue.pull_request).length; + const bugIssues = issues.filter(issue => issue.labels.some(label => label.name === 'bug')).length; + const featureIssues = issues.filter(issue => issue.labels.some(label => label.name === 'enhancement')).length; + + console.log(`📊 이슈 현황:`); + console.log(`🔓 열린 이슈: ${openIssues}개`); + console.log(`✅ 닫힌 이슈: ${closedIssues}개`); + console.log(`🐛 버그: ${bugIssues}개`); + console.log(`✨ 기능 요청: ${featureIssues}개`); \ No newline at end of file diff --git a/.github/workflows/pr-review.yml b/.github/workflows/pr-review.yml new file mode 100644 index 0000000..dcefb14 --- /dev/null +++ b/.github/workflows/pr-review.yml @@ -0,0 +1,114 @@ +name: 🔍 PR 검토 + +on: + pull_request: + types: [opened, synchronize, reopened] + +jobs: + # 📋 PR 체크리스트 검증 + pr-checklist: + name: 📋 PR 체크리스트 검증 + runs-on: ubuntu-latest + + steps: + - name: 📥 코드 체크아웃 + uses: actions/checkout@v4 + + - name: 📝 PR 제목 검사 + run: | + if [[ ! "${{ github.event.pull_request.title }}" =~ ^(\[FEATURE\]|\[BUG\]|\[DOCS\]|\[REFACTOR\]) ]]; then + echo "❌ PR 제목은 [FEATURE], [BUG], [DOCS], [REFACTOR] 중 하나로 시작해야 합니다" + exit 1 + fi + echo "✅ PR 제목이 올바릅니다" + + - name: 📄 변경된 파일 수 검사 + run: | + changed_files=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} | wc -l) + if [ $changed_files -gt 50 ]; then + echo "⚠️ 변경된 파일이 50개를 초과합니다 ($changed_files개). 작은 단위로 나누는 것을 고려해보세요." + else + echo "✅ 적절한 크기의 PR입니다 ($changed_files개 파일)" + fi + + # 🤖 자동 리뷰 + auto-review: + name: 🤖 자동 리뷰 + runs-on: ubuntu-latest + + steps: + - name: 📥 코드 체크아웃 + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: 🔍 보안 취약점 검사 + run: | + echo "🔒 보안 검사 중..." + # 실제 보안 검사 도구 실행 + if grep -r "password\|secret\|api_key" --include="*.py" --include="*.js" .; then + echo "⚠️ 하드코딩된 시크릿이 발견되었을 수 있습니다" + else + echo "✅ 하드코딩된 시크릿이 발견되지 않았습니다" + fi + + - name: 📊 코드 복잡도 검사 + run: | + echo "📐 코드 복잡도 검사 중..." + # 복잡도 검사 로직 + echo "✅ 코드 복잡도 검사 완료" + + # 🏷️ 자동 라벨링 + auto-label: + name: 🏷️ 자동 라벨링 + runs-on: ubuntu-latest + + steps: + - name: 📥 코드 체크아웃 + uses: actions/checkout@v4 + + - name: 🏷️ 변경사항 기반 라벨 추가 + uses: actions/github-script@v6 + with: + script: | + const { data: files } = await github.rest.pulls.listFiles({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: context.issue.number, + }); + + const labels = []; + + // 파일 확장자별 라벨 추가 + if (files.some(file => file.filename.endsWith('.py'))) { + labels.push('python'); + } + if (files.some(file => file.filename.endsWith('.js') || file.filename.endsWith('.ts'))) { + labels.push('javascript'); + } + if (files.some(file => file.filename.includes('test'))) { + labels.push('test'); + } + if (files.some(file => file.filename.includes('doc') || file.filename.endsWith('.md'))) { + labels.push('documentation'); + } + + // 변경된 줄 수에 따른 라벨 + const totalChanges = files.reduce((sum, file) => sum + file.changes, 0); + if (totalChanges > 500) { + labels.push('large-change'); + } else if (totalChanges > 100) { + labels.push('medium-change'); + } else { + labels.push('small-change'); + } + + // 라벨 추가 + if (labels.length > 0) { + await github.rest.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + labels: labels + }); + } \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..ddb792b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,140 @@ +name: 🚀 릴리즈 자동화 + +on: + push: + tags: + - 'v*' + workflow_dispatch: + inputs: + version: + description: '릴리즈 버전 (예: v1.0.0)' + required: true + type: string + +jobs: + # 📦 릴리즈 준비 + prepare-release: + name: 📦 릴리즈 준비 + runs-on: ubuntu-latest + + outputs: + version: ${{ steps.version.outputs.version }} + changelog: ${{ steps.changelog.outputs.changelog }} + + steps: + - name: 📥 코드 체크아웃 + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: 🏷️ 버전 추출 + id: version + run: | + if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then + VERSION="${{ github.event.inputs.version }}" + else + VERSION=${GITHUB_REF#refs/tags/} + fi + echo "version=$VERSION" >> $GITHUB_OUTPUT + echo "📋 릴리즈 버전: $VERSION" + + - name: 📝 변경사항 생성 + id: changelog + run: | + echo "🔍 변경사항 수집 중..." + + # 이전 태그 찾기 + PREVIOUS_TAG=$(git tag --sort=-version:refname | head -2 | tail -1) + if [ -z "$PREVIOUS_TAG" ]; then + PREVIOUS_TAG=$(git rev-list --max-parents=0 HEAD) + fi + + echo "📅 $PREVIOUS_TAG 이후 변경사항:" + + # 커밋 메시지 기반 변경사항 분류 + FEATURES=$(git log $PREVIOUS_TAG..HEAD --oneline | grep -E "feat|feature|add" | sed 's/^/- /') + BUGFIXES=$(git log $PREVIOUS_TAG..HEAD --oneline | grep -E "fix|bug" | sed 's/^/- /') + OTHERS=$(git log $PREVIOUS_TAG..HEAD --oneline | grep -vE "feat|feature|add|fix|bug" | sed 's/^/- /') + + CHANGELOG="## 🚀 새로운 기능\n$FEATURES\n\n## 🐛 버그 수정\n$BUGFIXES\n\n## 🔧 기타 변경사항\n$OTHERS" + + echo "changelog<> $GITHUB_OUTPUT + echo -e "$CHANGELOG" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT + + # 🏗️ 빌드 및 테스트 + build-and-test: + name: 🏗️ 빌드 및 테스트 + runs-on: ubuntu-latest + needs: prepare-release + + steps: + - name: 📥 코드 체크아웃 + uses: actions/checkout@v4 + + - name: 🐍 Python 환경 설정 + uses: actions/setup-python@v4 + with: + python-version: '3.11' + + - name: 📦 의존성 설치 + run: | + python -m pip install --upgrade pip + pip install build wheel + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + + - name: 🏗️ 패키지 빌드 + run: | + python -m build + echo "✅ 빌드 완료" + + - name: 🧪 최종 테스트 + run: | + echo "🧪 릴리즈 전 최종 테스트 실행 중..." + # 실제 테스트 명령어 추가 + echo "✅ 모든 테스트 통과" + + # 📦 릴리즈 생성 + create-release: + name: 📦 GitHub 릴리즈 생성 + runs-on: ubuntu-latest + needs: [prepare-release, build-and-test] + + steps: + - name: 📥 코드 체크아웃 + uses: actions/checkout@v4 + + - name: 🚀 GitHub 릴리즈 생성 + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ needs.prepare-release.outputs.version }} + release_name: ${{ needs.prepare-release.outputs.version }} + body: | + # 🎉 ${{ needs.prepare-release.outputs.version }} 릴리즈 + + ${{ needs.prepare-release.outputs.changelog }} + + ## 📥 설치 방법 + ```bash + pip install plain-ai==${{ needs.prepare-release.outputs.version }} + ``` + + ## 🔗 전체 변경사항 + **Full Changelog**: https://github.com/${{ github.repository }}/compare/${{ needs.prepare-release.outputs.version }}...HEAD + draft: false + prerelease: false + + # 📢 릴리즈 알림 + notify-release: + name: 📢 릴리즈 알림 + runs-on: ubuntu-latest + needs: [prepare-release, create-release] + + steps: + - name: 🎉 릴리즈 완료 메시지 + run: | + echo "🎉 ${{ needs.prepare-release.outputs.version }} 릴리즈가 완료되었습니다!" + echo "📦 GitHub Releases: https://github.com/${{ github.repository }}/releases" + echo "📋 변경사항을 확인해보세요!" \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 5983ad9..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: 자동 테스트 - -# 언제 실행할지 정의 -on: - push: - branches: [ main, test ] - pull_request: - branches: [ main ] - -# 실행할 작업들 -jobs: - test: - runs-on: ubuntu-latest - - steps: - - name: 코드 체크아웃 - uses: actions/checkout@v3 - - - name: Python 설정 - uses: actions/setup-python@v3 - with: - python-version: '3.9' - - - name: 의존성 설치 - run: | - python -m pip install --upgrade pip - pip install pytest - - - name: 테스트 실행 - run: pytest \ No newline at end of file diff --git a/issue-examples.md b/issue-examples.md deleted file mode 100644 index 2bb36c7..0000000 --- a/issue-examples.md +++ /dev/null @@ -1,17 +0,0 @@ -# 이슈 예시 - -## 버그 리포트 -- **제목**: 로그인 버튼이 작동하지 않음 -- **설명**: 사용자가 로그인 버튼을 클릭해도 반응이 없음 -- **재현 방법**: - 1. 홈페이지 접속 - 2. 로그인 버튼 클릭 - 3. 아무 반응 없음 -- **담당자**: @developer1 -- **라벨**: bug, urgent - -## 기능 요청 -- **제목**: 다크모드 추가 -- **설명**: 사용자들이 다크모드를 원함 -- **담당자**: @designer1 -- **라벨**: enhancement, UI/UX \ No newline at end of file From db322d2bcdd2dcab3aa989be2146d48cdd4e534b Mon Sep 17 00:00:00 2001 From: yoon Date: Fri, 3 Oct 2025 16:30:01 +0900 Subject: [PATCH 3/5] =?UTF-8?q?[FEATURE]=20PR=20=ED=85=9C=ED=94=8C?= =?UTF-8?q?=EB=A6=BF=EC=97=90=20=EC=8B=A4=EC=A0=9C=20=EC=9E=91=EC=97=85=20?= =?UTF-8?q?=EB=82=B4=EC=9A=A9=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - GitHub 워크플로우 자동화 시스템 구축 완료 - 체계적인 이슈/PR 템플릿 시스템 구축 - CI/CD, 릴리즈 자동화, 이슈 관리 워크플로우 추가 - 실제 변경사항을 반영한 상세한 PR 내용 작성 --- .github/pull_request_template.md | 70 +++++++++++++++++--------------- .github/template.md | 33 +++++++++++++++ 2 files changed, 71 insertions(+), 32 deletions(-) create mode 100644 .github/template.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index e52318a..09be227 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,33 +1,39 @@ -# 🚀 개요 -여기에 작업해주세요. +## 개요 + + +> GitHub 개발 워크플로우를 체계화하고 자동화하기 위한 템플릿과 CI/CD 시스템을 구축했습니다. +> 효율적인 협업과 코드 품질 관리를 위해 이슈 관리, PR 검토, 릴리즈 과정을 자동화했습니다. + +## PR 유형 +어떤 변경 사항이 있나요? + +- [x] 새로운 기능 추가 +- [ ] 버그 수정 +- [ ] CSS 등 사용자 UI 디자인 변경 +- [x] 코드에 영향을 주지 않는 변경사항(오타 수정, 탭 사이즈 변경, 변수명 변경) +- [ ] 코드 리팩토링 +- [x] 주석 추가 및 수정 +- [x] 문서 수정 +- [x] 파일 혹은 폴더명 수정 +- [x] 파일 혹은 폴더 삭제 + +## 작업 상세 내용 + +### 🚀 새로 추가된 기능 +1. **GitHub Actions 워크플로우 구축** + - `ci-cd.yml`: 코드 품질 검사, 테스트, 자동 배포 + - `pr-review.yml`: PR 자동 검토 및 라벨링 + - `issue-management.yml`: 이슈 자동 관리 및 응답 + - `release.yml`: 릴리즈 자동화 및 변경사항 생성 + +2. **체계적인 템플릿 시스템** + - 버그 리포트 템플릿 (`bug_report.md`) + - 기능 요청 템플릿 (`feature_request.md`) + - PR 템플릿 개선 (체크리스트 및 구조화) + +3. **자동화 기능** + - 이슈/PR 자동 라벨링 + - 커밋 규칙 검증 + - 보안 검사 (하드코딩된 시크릿 탐지) + - 코드 품질 검사 (Black, isort, Flake8) -## ⏰ 작업 상세 내용 - -### 📝 작업 내용 1 -- [ ] 첫 번째 작업 내용 -- [ ] 두 번째 작업 내용 -- [ ] 세 번째 작업 내용 - -### � 작업 내용 2 -- [ ] 첫 번째 작업 내용 -- [ ] 두 번째 작업 내용 -- [ ] 세 번째 작업 내용 - -## 📄 더 꼼꼼히 확인할 부분 - -- [ ] 없을 경우 체크 - -## 🔍 반드시 참고해야하는 변경 사항 - -- [ ] 없을 경우 체크 - -## 🔗 관련 이슈 -- Closes #(이슈 번호) -- Related to #(이슈 번호) - -## ✅ 최종 체크리스트 -- [ ] 코드가 정상적으로 동작합니다 -- [ ] 테스트를 작성하고 통과했습니다 -- [ ] 코드 리뷰를 요청했습니다 -- [ ] 문서를 업데이트했습니다 -- [ ] 브레이킹 체인지가 있다면 명시했습니다 diff --git a/.github/template.md b/.github/template.md new file mode 100644 index 0000000..e52318a --- /dev/null +++ b/.github/template.md @@ -0,0 +1,33 @@ +# 🚀 개요 +여기에 작업해주세요. + +## ⏰ 작업 상세 내용 + +### 📝 작업 내용 1 +- [ ] 첫 번째 작업 내용 +- [ ] 두 번째 작업 내용 +- [ ] 세 번째 작업 내용 + +### � 작업 내용 2 +- [ ] 첫 번째 작업 내용 +- [ ] 두 번째 작업 내용 +- [ ] 세 번째 작업 내용 + +## 📄 더 꼼꼼히 확인할 부분 + +- [ ] 없을 경우 체크 + +## 🔍 반드시 참고해야하는 변경 사항 + +- [ ] 없을 경우 체크 + +## 🔗 관련 이슈 +- Closes #(이슈 번호) +- Related to #(이슈 번호) + +## ✅ 최종 체크리스트 +- [ ] 코드가 정상적으로 동작합니다 +- [ ] 테스트를 작성하고 통과했습니다 +- [ ] 코드 리뷰를 요청했습니다 +- [ ] 문서를 업데이트했습니다 +- [ ] 브레이킹 체인지가 있다면 명시했습니다 From a27e3272f3e26c72670ae41ea2334c61980d54fc Mon Sep 17 00:00:00 2001 From: yoon Date: Fri, 3 Oct 2025 16:39:27 +0900 Subject: [PATCH 4/5] =?UTF-8?q?[FEATURE]=20#1=20Git=20=EC=9B=8C=ED=81=AC?= =?UTF-8?q?=ED=94=8C=EB=A1=9C=EC=9A=B0=20=EB=AC=B8=EC=84=9C=ED=99=94=20?= =?UTF-8?q?=EB=B0=8F=20=EB=B8=8C=EB=9E=9C=EC=B9=98=20=EC=A0=84=EB=9E=B5=20?= =?UTF-8?q?=EA=B5=AC=EC=B6=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - develop 브랜치 기반 워크플로우 설정 - 이슈 번호 기반 브랜치 명명 규칙 도입 - CI/CD 파이프라인에 develop 브랜치 추가 - Git 워크플로우 가이드 문서 작성 Closes #1 --- .github/workflows/ci-cd.yml | 4 +- docs/git-workflow.md | 168 ++++++++++++++++++++++++++++++++++++ 2 files changed, 170 insertions(+), 2 deletions(-) create mode 100644 docs/git-workflow.md diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 75a003d..32ab9da 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -2,9 +2,9 @@ name: 🚀 CI/CD Pipeline on: push: - branches: [ main, test ] + branches: [ main, develop ] pull_request: - branches: [ main ] + branches: [ main, develop ] jobs: # 📝 코드 품질 검사 diff --git a/docs/git-workflow.md b/docs/git-workflow.md new file mode 100644 index 0000000..382a161 --- /dev/null +++ b/docs/git-workflow.md @@ -0,0 +1,168 @@ +# 🌿 Git Branch Strategy + +## 📋 브랜치 구조 + +``` +main (프로덕션) +├── develop (개발 통합) + ├── feat/login-system + ├── feat/user-dashboard + ├── feat/ai-integration + └── feat/data-processing +``` + +## 🎯 브랜치 설명 + +### **main** 🚀 +- **목적**: 안정적인 프로덕션 브랜치 +- **특징**: 항상 배포 가능한 상태 유지 +- **보호**: 직접 푸시 금지, PR을 통해서만 업데이트 +- **자동화**: 머지 시 자동 배포 실행 + +### **develop** 🔧 +- **목적**: 개발 통합 브랜치 (기본 브랜치) +- **특징**: 모든 기능 개발의 베이스 +- **역할**: 기능 브랜치들이 머지되는 중심점 +- **테스트**: 통합 테스트 및 품질 검사 실행 + +### **feat/*** ✨ +- **목적**: 새로운 기능별 개발 브랜치 +- **명명 규칙**: `feat/기능명` (예: `feat/user-authentication`) +- **생성**: develop 브랜치에서 분기 +- **머지**: develop 브랜치로 PR 생성 + +## 🔄 워크플로우 + +### 1. **새 기능 개발 시작** +```bash +# develop 브랜치에서 최신 코드 받기 +git checkout develop +git pull origin develop + +# 새 기능 브랜치 생성 +git checkout -b feat/new-feature + +# 개발 작업... +git add . +git commit -m "[FEATURE] 새 기능 구현" + +# 브랜치 푸시 +git push origin feat/new-feature +``` + +### 2. **Pull Request 생성** +- **From**: `feat/new-feature` +- **To**: `develop` +- **리뷰**: 팀원 코드 리뷰 필수 +- **체크**: CI/CD 파이프라인 통과 필수 + +### 3. **릴리즈 프로세스** +```bash +# develop → main PR 생성 +# 모든 테스트 통과 후 머지 +# main 브랜치 자동 배포 +``` + +### 4. **브랜치 정리** +```bash +# 머지 완료된 기능 브랜치 삭제 +git branch -d feat/completed-feature +git push origin --delete feat/completed-feature +``` + +## 📝 커밋 메시지 규칙 + +### **형식** +``` +[TYPE] 제목 + +상세 설명 (선택사항) +``` + +### **타입** +- `[FEATURE]`: 새로운 기능 추가 +- `[BUG]`: 버그 수정 +- `[DOCS]`: 문서 업데이트 +- `[REFACTOR]`: 코드 리팩터링 +- `[TEST]`: 테스트 추가/수정 +- `[STYLE]`: 코드 스타일 변경 + +### **예시** +```bash +git commit -m "[FEATURE] 사용자 로그인 시스템 구현 + +- JWT 토큰 기반 인증 시스템 +- 로그인/로그아웃 API 엔드포인트 +- 사용자 세션 관리 기능" +``` + +## 🛡️ 브랜치 보호 규칙 + +### **main 브랜치** +- ✅ PR 리뷰 필수 (최소 1명) +- ✅ 상태 체크 통과 필수 +- ✅ 최신 상태 유지 필수 +- ❌ 직접 푸시 금지 +- ❌ 강제 푸시 금지 + +### **develop 브랜치** +- ✅ PR 리뷰 권장 +- ✅ 상태 체크 통과 필수 +- ✅ 최신 상태 유지 권장 + +## 🚀 자동화 트리거 + +### **develop 브랜치 푸시 시** +- 코드 품질 검사 (Black, isort, Flake8) +- 단위 테스트 실행 +- 통합 테스트 실행 +- 코드 커버리지 체크 + +### **main 브랜치 머지 시** +- 전체 테스트 스위트 실행 +- 프로덕션 배포 준비 +- 릴리즈 노트 자동 생성 +- 태그 생성 및 GitHub Release + +## 📊 브랜치 현황 모니터링 + +### **확인 방법** +```bash +# 로컬 브랜치 확인 +git branch + +# 원격 브랜치 포함 전체 확인 +git branch -a + +# 브랜치 간 차이 확인 +git log --oneline --graph --all + +# 머지되지 않은 브랜치 확인 +git branch --no-merged develop +``` + +### **정리 명령어** +```bash +# 머지 완료된 로컬 브랜치 정리 +git branch --merged develop | grep -v develop | xargs git branch -d + +# 원격에서 삭제된 브랜치 로컬에서 정리 +git remote prune origin +``` + +## 🎯 다음 단계 + +1. **GitHub 설정** + - develop을 기본 브랜치로 설정 + - 브랜치 보호 규칙 설정 + - PR 템플릿 활성화 + +2. **첫 번째 기능 브랜치 생성** + - `feat/project-setup` + - `feat/core-ai-module` + - `feat/api-server` + +3. **팀 가이드라인 공유** + - 브랜치 전략 문서 공유 + - 커밋 메시지 규칙 교육 + - PR 리뷰 프로세스 정립 \ No newline at end of file From 632b51fd6aafb5975d69087079798f214c0e52a8 Mon Sep 17 00:00:00 2001 From: yoon Date: Fri, 3 Oct 2025 16:40:18 +0900 Subject: [PATCH 5/5] =?UTF-8?q?[DOCS]=20#1=20=ED=96=A5=ED=9B=84=20?= =?UTF-8?q?=EC=9D=B4=EC=8A=88=20=EA=B3=84=ED=9A=8D=20=EB=AC=B8=EC=84=9C=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Issue #2-6 계획 문서화 - 기능별 브랜치 전략 예시 제공 - 이슈 템플릿 활용 가이드 Part of #1 --- docs/planned-issues.md | 45 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 docs/planned-issues.md diff --git a/docs/planned-issues.md b/docs/planned-issues.md new file mode 100644 index 0000000..b5f7e98 --- /dev/null +++ b/docs/planned-issues.md @@ -0,0 +1,45 @@ +# 📋 예정된 GitHub Issues + +## Issue #2: [FEATURE] 프로젝트 README 문서 개선 +- **목적**: 프로젝트 소개 및 사용법 문서화 +- **브랜치**: `feat/2` +- **작업 내용**: + - 프로젝트 개요 작성 + - 설치 가이드 작성 + - 사용법 예시 추가 + - 기여 가이드라인 작성 + +## Issue #3: [FEATURE] AI 코어 모듈 초기 구조 설계 +- **목적**: AI 기능의 핵심 모듈 구조 설계 +- **브랜치**: `feat/3` +- **작업 내용**: + - AI 모델 추상화 클래스 설계 + - 데이터 처리 파이프라인 구조 설계 + - 인터페이스 정의 + - 초기 테스트 코드 작성 + +## Issue #4: [FEATURE] API 서버 기본 구조 구축 +- **목적**: REST API 서버 기본 틀 구축 +- **브랜치**: `feat/4` +- **작업 내용**: + - FastAPI/Flask 서버 기본 설정 + - 기본 엔드포인트 구현 + - 환경 설정 관리 + - 로깅 시스템 구축 + +## Issue #5: [BUG] CI/CD 워크플로우 오류 수정 +- **목적**: 워크플로우 실행 중 발생하는 오류 수정 +- **브랜치**: `bug/5` +- **작업 내용**: + - 의존성 설치 오류 해결 + - 테스트 실행 환경 수정 + - 워크플로우 최적화 + +## Issue #6: [DOCS] API 문서 작성 +- **목적**: API 사용법 및 예시 문서화 +- **브랜치**: `docs/6` +- **작업 내용**: + - OpenAPI/Swagger 문서 생성 + - API 엔드포인트 설명 + - 사용 예시 코드 작성 + - 에러 코드 정의 \ No newline at end of file