C.W.K.
Stream
Lesson 02 of 04 · published

Conventional Commits와 release notes

~18 min · commits, automation

Level 0Untracked 새싹
0 XP0/47 lessons0/14 achievements
0/100 XP to next level100 XP to go0% complete

Conventional Commits 가 메시지를 build artifact 로

2인 repo 엔 자유 형식 commit 메시지 OK. 팀 규모에선 모든 commit 이 release tooling, changelog, triage 의 입력. Conventional Commits 는 그 도구가 사람 큐레이터 없이 작동하게 하는 형식: release bot 과 changelog generator 가 기계적으로 파싱 가능한 작은 문법이 제목줄에. 비용 = commit 당 prefix 하나, 이득 = 자동 changelog + version bump.

문법: <type>(<optional scope>): <subject>. Type 은 feat, fix, docs, style, refactor, perf, test, chore, build, ci, revert. Scope 는 선택적 영역 마커 feat(auth): 또는 fix(api):. Type/scope 뒤 ! 가 breaking change 표시: feat(api)!: drop /v1/legacy. 본문 + footer 는 좋은 commit 메시지 룰 따라 — why 설명, issue 참조, breaking change 디테일.

강제하면 형식이 semantic-releaseconventional-changelog 도구를 풀어줘. main 에 push 마다 다음 버전 자동 계산: fix: 는 patch bump, feat: 는 minor, !/BREAKING CHANGE: 는 major. 같은 도구가 commit 메시지에서 카테고리화된 CHANGELOG.md 생성 — feature, fix, breaking change — 손으로 release note 쓰는 사람 없이. Release 가 merge 의 부수 효과.

강제가 형식을 durable 하게 만드는 자리. commitlint 를 Git hook 으로 두면 잘못된 메시지 local 거부, commitizen 이 올바른 메시지 만드는 interactive prompt 제공, GitHub Action 체크가 잘못된 PR 거부. 팀이 형식을 가이드로 다루고 가볍게 어기면 다 무용. 코드처럼 다뤄: 잘못 = 거부, lint 실패와 같이.

Code

형식 카탈로그·text
feat: add OAuth2 GitHub login
feat(auth): add OAuth2 GitHub login            # scope 포함
fix(api): handle empty array in /search response
docs(readme): document OAUTH_ENABLED flag
refactor(store): replace ad-hoc cache with TTL map
test(api): add property tests for /search edge cases
chore(deps): bump fastapi to 0.115.0
perf(query): index conversations.created_at
revert: "feat(auth): add OAuth2 GitHub login"

# Breaking change marker:
feat(api)!: drop /v1/legacy-search endpoint

# 또는 footer 로:
feat(api): replace /v1/search with /v2/search

BREAKING CHANGE: /v1/search endpoint is removed.
Migrate to /v2/search; response schema changes are
documented in docs/api/v2-migration.md.
Local + CI 강제·bash
# Git hook 으로 commitlint (Husky):
npm install --save-dev @commitlint/cli @commitlint/config-conventional husky
echo "module.exports = { extends: ['@commitlint/config-conventional'] };" > commitlint.config.js
npx husky init
echo 'npx --no -- commitlint --edit "$1"' > .husky/commit-msg

# Interactive 올바른 메시지용 commitizen:
npm install --save-dev commitizen cz-conventional-changelog
echo '{"path": "cz-conventional-changelog"}' > .czrc
git cz                       # git commit 대신 이거 사용

# PR title + commit 검증 GitHub Action:
# .github/workflows/commitlint.yml — wagoid/commitlint-github-action 사용

External links

Exercise

아무 repo 에서 최근 commit 셋의 Conventional Commits 메시지 초안. Scratch repo 에 commitlint + Husky 설치, 잘못된 메시지로 commit 시도. 거부 메시지 읽어. 고치고 commit. 실제 작업 프로젝트에서 Conventional Commits 가 release 도왔을 한 곳 적어.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.