feat(lefthook): pre-push 3 hook incremental gate + envtest 자동 보장 (ADR-0024) - #99
Merged
eightynine01 merged 2 commits intoMay 21, 2026
Merged
Conversation
added 2 commits
May 21, 2026 16:00
근본 원인: - unit-test (./...) 가 KUBEBUILDER_ASSETS 미설정 시 webhook BeforeSuite 실패 (envtest etcd/kube-apiserver binary 미설치 환경) - full-lint 가 기존 main 의 modernize 7건 + staticcheck SA1019 1건 으로 *모든 PR* push 차단 (문서 PR 도 fail) 해결: - .lefthook.yml pre-push unit-test: `make setup-envtest` 자동 호출 + KUBEBUILDER_ASSETS 절대 경로 export (호스트 환경 무관 통과) - .lefthook.yml pre-push full-lint: `--new-from-rev=origin/main` (HEAD~1 fallback) — PR 신규 이슈만 차단. 기존 main 이슈는 별개 modernize PR 로 누적 처리 - ADR-0024 신규 (Nygard 5 sections) + docs/kb/adr/INDEX.md 갱신 검증: - unit-test wrapping: K8S_DIR=bin/k8s/1.36.0-darwin-arm64/ + KUBEBUILDER_ASSETS 절대 경로 + etcd binary 접근 OK - full-lint --new-from-rev=origin/main → 0 issues (본 PR Go 변경 0) 후속: - mongodb-operator / valkey-operator 동일 패턴 sister-port (Phase 2/3) - 8 modernize/staticcheck 이슈 별도 PR (main 부채 누적 청산) Signed-off-by: Claude (postgres-operator) <support@masblue.studio>
근본 원인: - 이전 commit (7296e75) 에서 unit-test + full-lint 만 incremental 화 - markdown-link-check 는 여전히 전체 docs/**/*.md 검사 → 기존 main 의 22 dead link (9 파일) 로 push 차단 해결: - .lefthook.yml pre-push markdown-link-check: `git diff --name-only $BASE_REF...HEAD | grep .md$` 으로 PR 변경 markdown 만 검사 (full-lint 동일 패턴) - ADR-0024 본문 보강: 문제 2건 → 3건, markdown-link-check 부채 22 dead link 목록 명시, Consequences 갱신 - docs/kb/adr/INDEX.md 0024 description 갱신 (3 hook 모두 명시) 검증: - BASE_REF=origin/main → changed_md=2 파일 (0024 ADR + INDEX) 정상 추출 - 두 파일 단독 markdown-link-check 통과 확인 후속 (기존 부채): - README.md / CHANGELOG.md / docs/family.md keiailab.com 도메인 + logo SVG 복원 - CHANGELOG.{ko,ja,zh}.md / family.{ko,ja,zh}.md placeholder 생성 - docs/index.md mkdocs 라우팅 base URL fix - community-operators PR 8109 외부 링크 archive 또는 cite-only - docs/kb/adr/0023 keiailab/.codex 404 fix Signed-off-by: Claude (postgres-operator) <support@masblue.studio>
eightynine01
deleted the
worktree-fix+lefthook-pre-push-incremental-2026-05-21
branch
May 21, 2026 07:09
This was referenced May 21, 2026
Merged
eightynine01
added a commit
that referenced
this pull request
May 21, 2026
…파일 (#101) PR #98/#96 시도 후 잔존하는 ADR 0006/0007 ID 중복 정리 + ARCHITECTURE.md 변경에 따른 ko/ja/zh 다국어 파일 누락 (markdown-link-check pre-push 차단) 해소. orphan 2건 (INDEX 미인용 Proposed 2026-05-14): - 0006-repmgr-pgbouncer-barman-integration → 0025 - 0007-operatorhub-io-version-sync → 0026 PR #98 (v2) 는 0023/0024 renumber 시도 → 동시기 머지된 #97 (v3x-stable ADR-0023) + #99 (lefthook-pre-push ADR-0024) 과 충돌로 CONFLICTING CLOSED. 본 PR 은 현재 빈 다음 번호 0025/0026 으로 안전 renumber. 변경 (7 파일): - docs/kb/adr/0006-* → 0025-* (파일명 + 헤더 1줄) - docs/kb/adr/0007-* → 0026-* (파일명 + 헤더 1줄) - docs/kb/adr/INDEX.md: 0025/0026 항목 추가 - ARCHITECTURE.md L115-123: "17 ADRs" → "24 ADRs", 0006/0007/0009/0013 인용 정정 + 0019/0022/0023/0024/0025/0026 추가 - ARCHITECTURE.ko.md (신규, native 번역) - ARCHITECTURE.ja.md (신규, native 번역) - ARCHITECTURE.zh.md (신규, native 번역) 증거: - grep '0006-repmgr\|0007-operatorhub-io' = 0 inbound link (안전 renumber) - ARCHITECTURE.md 의 ko/ja/zh 다국어 link → 본 PR 에 포함되어 dead 0 - 나머지 다국어 33 파일 (ROADMAP/BRANDING/AGENTS/etc × 3 lang) = 별 PR Signed-off-by: eightynine01 <support@masblue.studio> Co-authored-by: eightynine01 <support@masblue.studio> Co-authored-by: Claude Opus 4.7 (1M context) <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
.lefthook.ymlpre-push 3 hook 수정:unit-test(envtest 자동) +full-lint(--new-from-rev=origin/main) +markdown-link-check(PR 변경.md만)docs/kb/adr/INDEX.md갱신사용자 시나리오 (Given / When / Then)
Given: 신규 contributor 가 postgres-operator clone 후 문서만 변경한 PR push.
When (이전, 본 PR 전): pre-push hook 이 (1) KUBEBUILDER_ASSETS 미설정 → webhook BeforeSuite fork/exec fail, (2)
full-lint가 기존 main 의 8 modernize/staticcheck 부채로 fail, (3)markdown-link-check가 기존 22 dead link 로 fail → 머지 0%.Then (본 PR 후): 동일 contributor 가 (1)
make setup-envtest자동 호출 → KUBEBUILDER_ASSETS 절대 경로 자동 export, (2)--new-from-rev=origin/main으로 PR 신규 이슈만 평가, (3) PR 변경.md만 link check → 문서 PR 정상 통과. 기존 부채는 별개 PR 로 누적 처리.변경 내역
.lefthook.yml(pre-push)unit-test:make setup-envtest자동 + KUBEBUILDER_ASSETS 절대 경로.lefthook.yml(pre-push)full-lint:--new-from-rev=origin/main(HEAD~1 fallback).lefthook.yml(pre-push)markdown-link-check:git diff --name-only \$BASE...HEAD | grep .md\$변경 파일만docs/kb/adr/0024-lefthook-pre-push-incremental-lint-envtest.mddocs/kb/adr/INDEX.md검증 (push 실제 결과 인용)
```
✔️ full-lint (1.97 seconds)
✔️ gitleaks (0.08 seconds)
✔️ go-licenses (0.02 seconds)
✔️ go-mod-tidy (0.10 seconds)
✔️ govulncheck (0.02 seconds)
✔️ helm-lint (0.20 seconds)
✔️ helm-template (0.06 seconds)
✔️ kube-linter (0.18 seconds)
✔️ markdown-link-check (0.50 seconds)
✔️ platforms-amd64-guard (0.02 seconds)
✔️ unit-test (20.14 seconds)
✔️ version-sync (0.06 seconds)
```
3 hook 모두 수정된 incremental wrapping 으로 통과.
Test plan
make setup-envtest→ bin/k8s//{etcd,kube-apiserver,kubectl} 다운로드KUBEBUILDER_ASSETS=\$(pwd)/bin/k8s/1.36.0-darwin-arm64 go test ./internal/webhook/v1alpha1/...→ PASS 9.5s./bin/golangci-lint run --new-from-rev=origin/main→ 0 issues (PR Go 변경 0)markdown-link-check -qfor 2 staged .md → 0 dead links후속 작업 (별개 PR 로 누적)
ptrInt64/scheme.Builder등).lefthook.yml패턴 sister-portRelated