✨ feat: port passthrough from commithelper-go package#80
Merged
Conversation
Reflect the passthrough / verbatim-key rules from @naverpay/commithelper-go into the original @naverpay/commit-helper. - passthrough: verbatim Jira/Linear keys (feature/PROJ-1871 -> [PROJ-1871]), Jigit key recognition (<KEY>-<1-7 digit number>, anywhere in the branch), allowlist-only so tokens like UTF-8 are never mistaken for issues. - reference-specific idempotency (alreadyHasRef) replacing the old any-tag ISSUE_TAGGING_REGEX gate; safe on git commit --amend / hook re-run, including verbatim keys like [PROJ-1871]. - hybrid casing: preserve branch case so uppercase keys are recognized; rules lookup and protect matching stay case-insensitive. BREAKING: idempotency is now reference-specific -- a tag for a different issue no longer suppresses tagging ([#123] [#999] ...). Major bump via changeset. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
✅ Changeset detectedLatest commit: 31cb20a
If no version change is needed, please add The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
|
Contributor
Author
|
/canary-publish |
Contributor
Published Canary Packages |
kyungmi
approved these changes
Jul 2, 2026
kyungmi
left a comment
Contributor
There was a problem hiding this comment.
Go 버전(commithelper-go)에서 포팅한 passthrough 로직이 resolveKey, alreadyHasRef, 우선순위 처리 전부 충실하게 반영되어 있습니다.
resolveKey→alreadyHasRef→ 우선순위(rules>passthrough) 모두 Go 구현체와 동작 일치 확인- 재태깅 기준 변경(
ISSUE_TAGGING_REGEX→alreadyHasRef)에 대한 behavior-change lock 테스트 포함된 점 좋았습니다 - changeset major bump 근거도 PR 설명에 명확히 정리되어 있어 리뷰하기 수월했습니다
Contributor
Author
|
감사합니다! 🙇🏻🙇🏻 |
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.
요약
@naverpay/commit-helper(JS 원본)에 Jira/Linear 스타일 이슈 키 지원passthrough를 추가합니다. Go 버전(@naverpay/commithelper-go)이 ✨ feat: add passthrough for verbatim issue keys #77 에서 받은 기능과 동일합니다.Closes #76
새 옵션:
passthroughpassthrough에 등록된 프로젝트의 키를 브랜치에서 찾아 커밋 메시지에 그대로 복사합니다. prefix를 저장소 참조로 번역하는rules와 구분됩니다.{ "rules": { "feature": null, "qa": "org/repo" }, "passthrough": ["PROJ", "ABC"], "protect": ["main"] }UTF-8,SHA-1같은 무관한대문자-숫자토큰이 이슈로 오인되지 않습니다.rules는 계속 동작합니다.rulesprefix와 키 양쪽에 매칭되면rules가 우선합니다.해석 순서와 케이스
rules(prefix → GitHub 참조) →passthrough(키 그대로) → 둘 다 아니면 원본 유지. 위 설정 기준:feature/123[#123]qa/45[org/repo#45]feature/PROJ-123[PROJ-123]feature/OPS-9OPS미등록)feature/12-ABC-34[#12]feature/wipmain키 인식 규칙
<PROJECT>-<NUMBER>를 브랜치 이름 어디서든 찾습니다.PROJECT는 대문자 2자 이상([A-Z][A-Z0-9]+),NUMBER는 1~7자리 숫자. Jigit과 동일한 규칙이므로 commithelper가 태깅하는 키는 Jigit에서도 같은 방식으로 링크됩니다.passthrough: ["PROJ"]기준:PROJ-123[PROJ-123]feature_PROJ-123[PROJ-123]PROJ-123-add-login[PROJ-123]PROJ-123-20260101[PROJ-123]-<숫자>(날짜) suffix도 무시PROJ-12345678PROJ/123-사용, 슬래시 형태는rulesprefix 영역PROJ_123-로 이어야 함proj-123OPS-123동작 변경: 재태깅 판단 기준
--amend나 훅 재실행 시 태그 중복([#123] [#123] fix)을 막기 위한 "이미 태깅됨" 검사의 기준을 바꿉니다:ISSUE_TAGGING_REGEX→alreadyHasRef.[…#숫자]형태가 하나라도 있으면 건너뜁니다.#을 요구해[PROJ-1871]같은 하이픈 키를 인식하지 못하고, 다른 이슈의 태그([#999])가 이 브랜치의 태그 추가를 막습니다.브랜치
feature/123(붙일 참조#123) 기준:[#123] fix[#999] fix[#123]추가 →[#123] [#999] fixfixes #123[#123]추가fix[#123]추가[#123]추가--amend·재실행에서 같은 태그를 중복으로 붙이지 않는 보장은 이전과 동일합니다.테스트
resolveKey: Jigit 규칙을 미러링한 인식 테이블 + 엣지 케이스alreadyHasRef: 위 재태깅 판단 케이스getCommitMessageByBranchName: end-to-end