diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..5c4d852 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,42 @@ +### ๐Ÿ“ PR ํƒ€์ž… + +- [ ] ๋ฒ„๊ทธ ์ˆ˜์ • (fix) +- [ ] ์‹ ๊ทœ ๊ธฐ๋Šฅ (feat) +- [ ] ๋ฌธ์„œ ์—…๋ฐ์ดํŠธ (docs) +- [ ] ์ฝ”๋“œ ์Šคํƒ€์ผ / ํฌ๋งทํŒ… (style) +- [ ] ๋ฆฌํŒฉํ† ๋ง (refactor) +- [ ] ํ…Œ์ŠคํŠธ (test) +- [ ] ๊ธฐํƒ€ (chore, ci ๋“ฑ) + +--- +### ๐Ÿ“œ ์„ค๋ช… + + + +### ์—ฎ์ธ ์ด์Šˆ + +- Closes # + + +--- + +### ๐Ÿ”จ ์ž‘์—… ๋‚ด์šฉ + +- + + +### ๐Ÿ“ธ ์Šคํฌ๋ฆฐ์ƒท + + + +--- + +### ๐Ÿง‘โ€๐Ÿ’ป ํ…Œ์ŠคํŠธ ๊ฒฐ๊ณผ + + + +--- + +### ๐Ÿ“… ์ฒดํฌ๋ฆฌ์ŠคํŠธ +- [ ] ์ดํ•ดํ•˜๊ธฐ ์–ด๋ ค์šด ๋ถ€๋ถ„์— ์ฃผ์„์„ ์ถ”๊ฐ€ํ–ˆ์Šต๋‹ˆ๋‹ค. +- [ ] ๊ด€๋ จ๋œ ๋ฌธ์„œ๋ฅผ ์—…๋ฐ์ดํŠธํ–ˆ์Šต๋‹ˆ๋‹ค. diff --git a/.github/workflows/auto-label.yml b/.github/workflows/auto-label.yml new file mode 100644 index 0000000..37f6392 --- /dev/null +++ b/.github/workflows/auto-label.yml @@ -0,0 +1,46 @@ +name: Auto Label PR + +on: + pull_request: + types: [opened, closed] + +jobs: + # PR ์ƒ์„ฑ ์‹œ โ†’ needs-review + add_label_on_open: + if: github.event.action == 'opened' + runs-on: ubuntu-latest + steps: + - name: Remove old status labels (safety) + uses: actions-ecosystem/action-remove-labels@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + labels: | + changes-requested + approved + merged + + - name: Add 'needs-review' label + uses: actions-ecosystem/action-add-labels@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + labels: needs-review + + # PR ๋ณ‘ํ•ฉ ์‹œ โ†’ merged + label_on_merge: + if: github.event.pull_request.merged == true + runs-on: ubuntu-latest + steps: + - name: Remove previous labels + uses: actions-ecosystem/action-remove-labels@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + labels: | + needs-review + changes-requested + approved + + - name: Add 'merged' label + uses: actions-ecosystem/action-add-labels@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + labels: merged \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 98b1887..b77b7c9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,65 +1,173 @@ - # ๐Ÿ› ๏ธ DevFactory Contributing Guide -## 1. ๋ธŒ๋žœ์น˜ ์ „๋žต -- ๊ธฐ๋ณธ ๋ธŒ๋žœ์น˜: `main`, `dev` -- ์ž‘์—… ๋ธŒ๋žœ์น˜: `feat/`, `fix/`, `docs/` ๋“ฑ prefix ์‚ฌ์šฉ - - ์˜ˆ์‹œ: `feat/login`, `fix/navbar-crash` -- ๋จธ์ง€๋Š” `PR(Pull Request)`๋ฅผ ํ†ตํ•ด ์ง„ํ–‰ - -## 2. ์ปค๋ฐ‹ ๋ฉ”์‹œ์ง€ ๊ทœ์น™ -- [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) ํ˜•์‹ ์‚ฌ์šฉ - ``` - - โ”‚ โ”‚ - โ”‚ โ””โ”€โซธ Summary in present tense. Not capitalized. No period at the end. - โ”‚ - โ””โ”€โซธ Commit Type: build|ci|docs|feat|fix|perf|refactor|test - ``` -- Commit type (ex: feat: commit message) - ``` - build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm) - ci: Changes to our CI configuration files and scripts (examples: CircleCi, SauceLabs) - docs: Documentation only changes - feat: A new feature - fix: A bug fix - perf: A code change that improves performance - refactor: A code change that neither fixes a bug nor adds a feature - test: Adding missing tests or correcting existing tests - ``` - -## 3. PR(Pull Request) ๊ทœ์น™ -- PR ์ œ๋ชฉ์€ ์ž‘์—… ๋ชฉ์ ์ด ๋“œ๋Ÿฌ๋‚˜๋„๋ก ์ž‘์„ฑ -- PR ์„ค๋ช…์— **์ž‘์—… ๋‚ด์šฉ**, **๊ด€๋ จ ์ด์Šˆ**, **์Šคํฌ๋ฆฐ์ƒท** ๋“ฑ ํฌํ•จ -- ์ตœ์†Œ 1๋ช… ์ด์ƒ์˜ ๋ฆฌ๋ทฐ์–ด ์Šน์ธ ํ›„ ๋จธ์ง€ - - ์ƒํ™ฉ์— ๋”ฐ๋ผ ์œ ๋™์ ์œผ๋กœ ์ ์šฉ -- ๋ฆฌ๋ทฐ ํ›„ **๋ณธ์ธ์ด ๋จธ์ง€ ์ง„ํ–‰** - -## 4. ์ฝ”๋“œ ํ’ˆ์งˆ -- Lint, Test๋Š” PR ์ „์— ๋ฐ˜๋“œ์‹œ ํ†ต๊ณผ -- CI ์ž๋™ ๊ฒ€์‚ฌ(GitHub Actions ๋“ฑ) ์ ์šฉ - -## 5. Issue ๊ด€๋ฆฌ(์„ ํƒ) -- ์ž‘์—… ์‹œ์ž‘ ์ „ ๊ด€๋ จ ์ด์Šˆ ์ƒ์„ฑ ๋˜๋Š” ์—ฐ๊ฒฐ -- ๋ผ๋ฒจ(label) ์ง€์ •: `bug`, `feature`, `question`, `urgent` ๋“ฑ -- ์™„๋ฃŒ๋œ ์ด์Šˆ๋Š” PR๊ณผ ํ•จ๊ป˜ ์ž๋™ ๋‹ซํž˜ (`Fixes #์ด์Šˆ๋ฒˆํ˜ธ`) - -## 6. ๋ณด์•ˆ ๋ฐ ํ™˜๊ฒฝ ๋ณ€์ˆ˜ -- `.env` ํŒŒ์ผ ๋˜๋Š” ๋ฏผ๊ฐํ•œ ์ •๋ณด๋Š” Git์— ์ปค๋ฐ‹ ๊ธˆ์ง€ -- `gitignore`์— ํฌํ•จ๋œ ํŒŒ์ผ ๋ชฉ๋ก ํ™•์ธ ํ•„์ˆ˜ -- ํ•„์š”์‹œ `.env.example` ์ œ๊ณต - - - -## EX) ์˜ˆ์‹œ ์›Œํฌํ”Œ๋กœ์šฐ -1. `dev` ๋ธŒ๋žœ์น˜ ์ตœ์‹  ์ƒํƒœ๋กœ๋ถ€ํ„ฐ ์ž‘์—… ๋ธŒ๋žœ์น˜ ์ƒ์„ฑ - `git checkout -b feat/search dev` - -2. ๊ธฐ๋Šฅ ๊ฐœ๋ฐœ ๋ฐ ์ปค๋ฐ‹ - `git commit -m "feat: ๊ฒ€์ƒ‰ ๊ธฐ๋Šฅ ๊ตฌํ˜„"` - -3. ์›๊ฒฉ ํ‘ธ์‹œ ๋ฐ PR ์ƒ์„ฑ - `git push origin feat/search` - -4. `feat/search` -> `dev` PR ์ƒ์„ฑ โ†’ ๋ฆฌ๋ทฐ์–ด ์ง€์ • โ†’ ๋ฆฌ๋ทฐ ํ›„ ๋จธ์ง€ - `main` ๋ธŒ๋žœ์น˜๋Š” ๋ฐฐํฌ์šฉ์œผ๋กœ๋งŒ ์‚ฌ์šฉ +> Last updated: 2025-11-05 +> +> +> Maintainer: **DevFactory Team** +> + +--- + +## ๐Ÿงญ Branch Strategy + +DevFactory๋Š” **๋ชจ๋…ธ๋ ˆํฌ(Monorepo)** ๊ตฌ์กฐ๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. + +์—ฌ๋Ÿฌ ์„œ๋น„์Šค(`getcloser`, `cert-system`)๋ฅผ ํ•˜๋‚˜์˜ ๋ฆฌํฌ์ง€ํ† ๋ฆฌ์—์„œ ๊ด€๋ฆฌํ•˜๋ฉฐ, + +์ผ๋ถ€ ํ”„๋กœ์ ํŠธ(`JobPT`, `event-bingo`)๋Š” **๋ณ„๋„ ๋ฆฌํฌ์ง€ํ† ๋ฆฌ**๋กœ ์šด์˜ํ•ฉ๋‹ˆ๋‹ค. + +| ๋ธŒ๋žœ์น˜ | ์—ญํ•  | ๋น„๊ณ  | +| --- | --- | --- | +| `main` | ํ”„๋กœ๋•์…˜ ํ†ตํ•ฉ | ์ „์ฒด ์„œ๋น„์Šค์˜ ํ†ตํ•ฉ ๋ฐ ๋ฐฐํฌ์šฉ ๋ธŒ๋žœ์น˜ | +| `feat/*` | ๊ธฐ๋Šฅ ๊ฐœ๋ฐœ | ์„œ๋น„์Šค๋ณ„ ๊ธฐ๋Šฅ ๋‹จ์œ„ ๊ฐœ๋ฐœ ๋ธŒ๋žœ์น˜ | +| `fix/*` | ๋ฒ„๊ทธ ์ˆ˜์ • | ์„œ๋น„์Šค๋ณ„ ๋ฒ„๊ทธ ์ˆ˜์ • ๋ธŒ๋žœ์น˜ | +| `docs/*` | ๋ฌธ์„œ ์ˆ˜์ • | README, CONTRIBUTING ๋“ฑ ๋ฌธ์„œ ์ „์šฉ ๋ธŒ๋žœ์น˜ | + +> ๋ธŒ๋žœ์น˜๋ช… ์˜ˆ์‹œ +> +> - `feat/getcloser/auto-deploy` +> - `fix/getcloser/auth-refresh` +> - `docs/getcloser/update-deploy-guide` +> - `chore/devfactory/github-actions-update` + +--- + +## โš™๏ธ Workflow + +1. **๊ธฐ๋Šฅ ๊ฐœ๋ฐœ ๋ธŒ๋žœ์น˜ ์ƒ์„ฑ** + + ```bash + git checkout main + git checkout -b feat/ + # ์˜ˆ์‹œ + git checkout -b feat/auto-deploy + ``` + +2. **๊ธฐ๋Šฅ ๊ตฌํ˜„ ๋ฐ ์ปค๋ฐ‹** + + ```bash + git commit -m "feat(getcloser): add CI/CD auto deploy pipeline" + ``` + +3. **PR ์ƒ์„ฑ** + + ```bash + git push origin feat/auto-deploy + ``` + + - `feat/*` โ†’ `main`์œผ๋กœ PR ์ƒ์„ฑ + - PR ์ œ๋ชฉ์€ ์ž‘์—… ๋ชฉ์ ์„ ๋ช…ํ™•ํžˆ ์ž‘์„ฑ + ์˜ˆ: `fix(getcloser): resolve API timeout issue` +4. **๋ฆฌ๋ทฐ ๋ฐ ๋ณ‘ํ•ฉ** + - ์ฝ”๋“œ ๋ฆฌ๋ทฐ ๋ฐ ์Šน์ธ ํ›„ ๋ณ‘ํ•ฉ + - ์ดํ›„ ๋ธŒ๋žœ์น˜๋Š” **์‚ญ์ œ ๊ถŒ์žฅ** (`Delete branch after merge`) + - ์ž์„ธํ•œ ๋‚ด์šฉ์€ ๋ณ‘ํ•ฉ ๋ฐ ๋ฆฌ๋ทฐ ๊ทœ์น™ ์ฐธ๊ณ  + +--- + +## ๐Ÿชถ Commit Convention + +๋ชจ๋“  ์ปค๋ฐ‹์€ [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) ๊ทœ์น™์„ ๋”ฐ๋ฆ…๋‹ˆ๋‹ค. + +```bash +(): +``` + +| Type | ์„ค๋ช… | +| --- | --- | +| `feat` | ์ƒˆ๋กœ์šด ๊ธฐ๋Šฅ ์ถ”๊ฐ€ | +| `fix` | ๋ฒ„๊ทธ ์ˆ˜์ • | +| `docs` | ๋ฌธ์„œ ๋ณ€๊ฒฝ (README, CONTRIBUTING ๋“ฑ) | +| `chore` | ๋นŒ๋“œ, ์˜์กด์„ฑ, ์„ค์ • ๋“ฑ ๋ณ€๊ฒฝ (๋น„์ฆˆ๋‹ˆ์Šค ๋กœ์ง ์˜ํ–ฅ ์—†์Œ) | +| `refactor` | ์ฝ”๋“œ ๋ฆฌํŒฉํ† ๋ง | +| `test` | ํ…Œ์ŠคํŠธ ์ฝ”๋“œ ์ถ”๊ฐ€ ๋˜๋Š” ์ˆ˜์ • | +| `perf` | ์„ฑ๋Šฅ ๊ฐœ์„  | + +> ์ปค๋ฐ‹ ์˜ˆ์‹œ +> +> - `feat(getcloser): add automatic deploy pipeline` +> - `fix(getcloser): handle login token issue` +> - `docs(devfactory): update contributing guide` + +--- + +## ๐Ÿ”€ Merge & Review Rules + +- **์ง์ ‘ push ๊ธˆ์ง€** (`main` ๋ธŒ๋žœ์น˜ ํฌํ•จ) +- ๋ชจ๋“  ๋ณ€๊ฒฝ์€ **Pull Request(PR)**๋ฅผ ํ†ตํ•ด ์ง„ํ–‰ +- **์„œ๋น„์Šค ๊ตฌ๋ถ„ ๋ผ๋ฒจ(`์นœํ•ด์ง€๊ธธ๋ฐ”๋ผ`, `์ˆ˜๋ฃŒ์ฆ`, `devfactory`, `Bingo`) ์ˆ˜๋™ ์ถ”๊ฐ€ ํ•„์ˆ˜** +- **๋ฆฌ๋ทฐ์–ด 1์ธ ์ด์ƒ ์Šน์ธ ํ•„์ˆ˜** +- **PR ์ž‘์„ฑ์ž๊ฐ€ ์ง์ ‘ ๋ณ‘ํ•ฉ (rebase merge ๊ถŒ์žฅ)** +- **๋ณ‘ํ•ฉ ํ›„ ๋ธŒ๋žœ์น˜ ์‚ญ์ œ ๊ถŒ์žฅ** + +๐Ÿ’ก **PR ์ƒํƒœ๋Š” ๋ผ๋ฒจ์„ ํ†ตํ•ด ๊ด€๋ฆฌ๋ฉ๋‹ˆ๋‹ค.** + +| ๋ผ๋ฒจ | ์„ค๋ช… | ๋ถ€์—ฌ ๋ฐฉ์‹ | +| --- | --- | --- | +| ๐ŸŸจ `needs-review` | ์ƒˆ PR ์ƒ์„ฑ ์‹œ ์ž๋™ ๋ถ€์—ฌ (๋ฆฌ๋ทฐ ๋Œ€๊ธฐ ์ƒํƒœ) | ์ž๋™ | +| ๐ŸŸง `changes-requested` | ๋ฆฌ๋ทฐ์–ด๊ฐ€ ์ฝ”๋“œ ์ˆ˜์ • ์š”์ฒญ์„ ๋‚จ๊ธด ์ƒํƒœ | ๋ฆฌ๋ทฐ์–ด๊ฐ€ ์ˆ˜๋™ ๋ณ€๊ฒฝ | +| ๐ŸŸฉ `approved` | ๋ฆฌ๋ทฐ์–ด ์Šน์ธ ์™„๋ฃŒ, ๋ณ‘ํ•ฉ ๊ฐ€๋Šฅํ•œ ์ƒํƒœ | ๋ฆฌ๋ทฐ์–ด๊ฐ€ ์ˆ˜๋™ ๋ณ€๊ฒฝ | +| ๐ŸŸช `merged` | PR ๋ณ‘ํ•ฉ ์™„๋ฃŒ ์‹œ ์ž๋™ ๋ถ€์—ฌ | ์ž๋™ | + +๐Ÿ”– **๋ฆฌ๋ทฐ์–ด ๊ฐ€์ด๋“œ** +- ์ฝ”๋“œ ์ˆ˜์ •์ด ํ•„์š”ํ•  ๊ฒฝ์šฐ โ†’ `changes-requested` +- ์ˆ˜์ • ํ™•์ธ ํ›„ ์Šน์ธ ์‹œ โ†’ `approved` + +๐Ÿ”ง **PR ์ž‘์„ฑ์ž ๊ฐ€์ด๋“œ** +- PR์ด **`approved` ์ƒํƒœ**๊ฐ€ ๋˜๋ฉด **rebase merge** ๋ฐฉ์‹์œผ๋กœ ์ง์ ‘ ๋ณ‘ํ•ฉํ•ฉ๋‹ˆ๋‹ค. +- ๋ณ‘ํ•ฉ์ด ์™„๋ฃŒ๋˜๋ฉด `merged` ๋ผ๋ฒจ์ด ์ž๋™์œผ๋กœ ์ถ”๊ฐ€๋ฉ๋‹ˆ๋‹ค. + +--- + +## โœ… Pull Request Guide + +1. **PR ์ œ๋ชฉ ๊ทœ์น™** + + ``` + feat(getcloser): add deploy pipeline + fix(getcloser): resolve API error + docs(devfactory): update contributing guide + + ``` + +2. **PR ๋ณธ๋ฌธ ํ…œํ”Œ๋ฆฟ** + - **์š”์•ฝ:** ๋ณ€๊ฒฝ ๋‚ด์šฉ์„ ๊ฐ„๋žตํžˆ ์„ค๋ช… + - **๊ด€๋ จ ์ด์Šˆ:** `Closes #123` + - **ํ…Œ์ŠคํŠธ ๊ฒฐ๊ณผ:** ๊ฒ€์ฆ ๋ฐฉ๋ฒ• ๋ช…์‹œ + - **์Šคํฌ๋ฆฐ์ƒท (์„ ํƒ):** UI ๋ณ€๊ฒฝ ์‹œ ์ฒจ๋ถ€ + +--- + +## ๐Ÿ”’ Security & Environment Files + +- `.env`, API ํ‚ค, ๋น„๋ฐ€๋ฒˆํ˜ธ ๋“ฑ **๋ฏผ๊ฐํ•œ ์ •๋ณด ์ปค๋ฐ‹ ๊ธˆ์ง€** +- `.env.example`๋งŒ Git์— ํฌํ•จ +- ์‹ค์ œ ํ™˜๊ฒฝ ๋ณ€์ˆ˜๋Š” GitHub **Secrets / Variables**์—์„œ ๊ด€๋ฆฌ + +--- + +## ๐Ÿ’ก Workflow Example + +```bash +# 1. ๊ธฐ๋Šฅ ๋ธŒ๋žœ์น˜ ์ƒ์„ฑ +git checkout main +git checkout -b feat/auto-deploy + +# 2. ์ž‘์—… ๋ฐ ์ปค๋ฐ‹ +git commit -m "feat(getcloser): add CI/CD pipeline" + +# 3. ์›๊ฒฉ ํ‘ธ์‹œ & PR ์ƒ์„ฑ +git push origin feat/auto-deploy + +# 4. PR ์ƒ์„ฑ โ†’ 'needs-review' ์ž๋™ ๋ถ€์—ฌ +# 5. ๋ฆฌ๋ทฐ ์Šน์ธ โ†’ rebase merge โ†’ 'merged' ์ž๋™ ๋ถ€์—ฌ +# 6. ๋ธŒ๋žœ์น˜ ์‚ญ์ œ + +``` + +--- + +## ๐Ÿ“˜ Notes + +- ์ฃผ์š” ์„œ๋น„์Šค: `getcloser`, `cert-system` +- ๋ณ„๋„ ๋ฆฌํฌ์ง€ํ† ๋ฆฌ: `JobPT`, `event-bingo`