chore(ci): GH Actions 폐기 + 로컬 4 계층 게이트 (RFC 0002, ADR 0009) - #2
Conversation
글로벌 CLAUDE.md §2 (GitHub Actions 영구 금지, 2026-04-29 사고 트리거 —
organization billing 1건 실패 → 전 저장소 전 PR 4초 만에 fail) 적용.
본 프로젝트의 .github/workflows/{ci,upstream-watch}.yml을 폐기하고
로컬 4 계층(pre-commit · pre-push · Makefile · PR review)으로 일원화.
폐기:
- ci.yml — 5 jobs (lint, test, matrix-build, e2e, scan) 모두 로컬로 마이그
- upstream-watch.yml — Citus 신 릴리스 cron, RemoteTrigger/사용자 schedule로 대체 (후속)
신규:
- .pre-commit-config.yaml
L1 pre-commit: golangci-lint
L2 pre-push: go mod tidy drift, make test, make audit, gitleaks
- Makefile audit 타겟 — trivy fs --severity HIGH,CRITICAL --ignore-unfixed
- docs/adr/0009-no-github-actions-rfc-0002.md — 결정 근거 + 4 계층 매핑
- README.md "Development (로컬 게이트)" 섹션 — 1회 셋업 + PR body 증거 블록
검증:
- make lint: 0 issues
- make audit: 0 vulnerabilities (PR #1 deps fix 효과 객관 확인)
- pre-commit validate-config: PASS
후속 작업:
1. branch protection "Required status checks" 제거 (admin이 GitHub UI에서)
2. upstream-watch 대체 (RemoteTrigger / 사용자 schedule)
3. e2e cert-manager 통합 완성 PR (PR #1 fail의 진짜 fix)
Refs: 글로벌 CLAUDE.md §2, RFC 0002 (2026-04-29), ADR 0009
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 166ac440c9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| - id: gitleaks | ||
| name: gitleaks (staged secrets scan) | ||
| language: system | ||
| entry: bash -c 'command -v gitleaks >/dev/null 2>&1 && gitleaks protect --staged --redact || { echo "[warn] gitleaks 미설치 — brew install gitleaks 권장"; exit 0; }' |
There was a problem hiding this comment.
Fail pre-push when gitleaks actually finds secrets
The gitleaks hook currently uses command -v ... && gitleaks ... || { ...; exit 0; }, which means any non-zero exit from gitleaks protect (including real secret detections) falls into the || branch and returns success, so pushes are not blocked even when secrets are found. In this repo, CI workflows were removed in the same commit, so this effectively disables secret-enforcement for contributors who do have gitleaks installed.
Useful? React with 👍 / 👎.
…ORDINAL RFC 0006 R3 final review 에서 발견된 cross-file contract 버그 수정. 문제: bootstrap script 의 분기 조건이 SHARD_ORDINAL 을 키로 사용했으나, PostgresClusterSpec.Shards.Replicas 는 *동일 StatefulSet 안* pod 수를 늘리는 모델이라 한 shard 의 모든 Pod 가 같은 SHARD_ORDINAL 값을 받는다 (PodTemplateSpec 공유). 결과적으로 ord-0, ord-1 모두 initdb 분기를 타며 standby.signal 이 생성되지 않아 streaming replication 미설정 → e2e It #2 (replica + standby.signal 존재) 실패 + split-data 위험. 해결: 분기 키를 *Pod ordinal* 로 교체. POD_NAME 을 downward API (metadata.name) 로 주입하고 script 가 마지막 `-` 뒤를 추출 (StatefulSet ordinal-stable 명명). SHARD_ORDINAL / PRIMARY_ENDPOINT 는 RFC 0005 multi-shard 용 보존. 부수 변경: - supervise/standby.go: instance manager panic/SIGKILL 시 standby.signal 미생성 알파 한계를 package doc 에 명시 (RFC 0007 후속). - test/e2e/failover_e2e_test.go: t0 RTO 기준점 (kill 명령 발행 시점, apiserver RT 포함) 한 줄 주석. 검증: - go build ./... ok - go vet ./... ok - go test ./... PASS (controller 8.6s, supervise 6.9s 등 전체 PASS) - go build -tags=e2e ./test/e2e/... ok - make lint: 0 issues Refs: RFC 0006 R3 final review Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
R3 commit chain (e501ab4 → 30f88a6) 가 compile-only 검증만 완료. 첫 실 kind 실행에서 unit/envtest 가 catch 못 하는 환경 정합성 회귀 5 건이 한 번에 드러남. 모두 fix-forward 로 정정 — RTO < 30s 측정의 전제. 1. hack/smoke.sh:72 — namespace 'postgres-operator-system' (ql 누락) → 실제는 'postgresql-operator-system'. wait NotFound → 5분 timeout. 2. hack/smoke.sh OPERATOR_IMG — ':smoke' 가 install.yaml ':0.3.0-alpha' 와 drift → ImagePullBackOff. Chart.yaml appVersion 에서 도출 (Makefile IMAGE_TAG 와 동일 출처). 3. hack/smoke.sh NS env override — sample CR 의 hardcoded metadata.namespace=default 와 어긋남. 부모 shell 의 NS=dev 가 STS wait 를 dev namespace 로 보내 false-negative timeout. NS hardcode 'default'. 4. test/e2e/e2e_suite_test.go BeforeSuite — operator install 단계 자체 누락 + managerImage tag 가 install.yaml 과 drift. make build-installer IMG=... + kubectl apply -f dist/install.yaml + wait Available 추가. 5. test/e2e/{failover,postgrescluster}_e2e_test.go — label selector 'postgres.keiailab.io/cluster=' 가 controller 의 실제 라벨 'app.kubernetes.io/instance=' 와 불일치. Pod selector 영원히 zero match → BeforeAll 5분 Eventually timeout. 6 occurrence 일괄 정정. 검증: make lint : 0 issues go test ./... : 모든 패키지 PASS (controller/election/fencing/ supervise/plugin/sharding/version/webhook) ./hack/smoke.sh : SUCCESS — quickstart cluster Ready 18s, psql 1=1 make test-e2e-failover (RTO 측정): - It #1 elects ord-0 as initial primary PASS - It #2 spawns ord-1 as standby (role=replica) PASS - It #3 promotes new primary RTO < 30s PASS (RTO=7.45s) - It #4 old primary rejoins as standby FAIL (R3 후속 — bootstrap container rejoin 분기 부재) Refs: RFC 0006 §1 (검증되지 않은 기능이 vaporware — 본 수정은 그 원칙이 *테스트 코드 자체*에 적용된 사례), §7 beta 게이트. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
본 cycle 이 R1+R2+R3 commit chain 의 첫 실 kind 측정. RFC 0006 §4 Phase 표
의 alpha (R1+R2) + beta (R3) 측정 게이트를 동시에 검증.
§A smoke 회귀 (`hack/smoke.sh`):
- operator manager Available ~12s
- CR apply → cluster Ready 18s (이전 cross-validation 62s
대비 3.4× 개선 — readinessProbe
5s 단축 + R1/R2 정착 누적)
- psql round-trip PASS
- status.conditions[Ready] True ('all subsystems ready')
§B RFC 0006 R3 회귀 (`make test-e2e-failover`):
- It #1 ord-0 initial primary PASS
- It #2 ord-1 standby (role=replica) PASS
- It #3 RTO < 30s PASS (RTO=7.45s, 4× 여유)
- It #4 old primary rejoin as standby FAIL (알려진 R3 gap)
§C It #4 의 알려진 한계 (R3 implementation gap):
- 옛 primary 가 Pod 로 강제 종료 (graceful demote 아님) 시
OnStoppedLeading callback 미호출 → standby.signal 미작성.
- bootstrap container (R3 task-b) 는 first boot (PGDATA empty) 만
standby.signal 생성. rejoin (PGDATA 존재) 분기 부재.
- fix scope: bootstrap container 가 election lease 를 읽어
leader != self 일 때 standby.signal touch — 별도 R3 후속 task.
§D Phase 게이트 (RFC 0006 §4):
- alpha : 코드 ✅ + 측정 ✅ (smoke Pod Ready 18s < 60s) → 통과
- beta : 코드 ✅ + 측정 ⚠️ (RTO 7.45s ✅ / It #4 ❌) → 부분 통과
§E 본 cycle 에서 한 commit 으로 묶인 fix 5 건 (별도 commit 9994e38):
smoke namespace ql / smoke image tag drift / smoke NS env /
e2e managerImage drift + operator install missing /
e2e label selector wrong (6 occurrence). 모두 unit + envtest 가
catch 못 하는 환경 정합성 — RFC 0006 §1 'vaporware' 원칙이 *테스트
코드 자체에* 적용된 사례.
Refs: RFC 0006 §4 (Phase) + §7 (측정 가능한 성공 기준).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
WORK_HANDOFF §6.6: per-query extended·분산수치 1차 완료 표기, 새 #1=멀티호스트 수평스케일 실증·#2=라우터 오버헤드 개선. ROUTER-GAP-ANALYSIS: extended per-query 완료로 "pin-on-first 유지" stale 노트 정정. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TnVYb8dUQFg2GSiSwo1dtZ
WORK_HANDOFF §6.6 + ROUTER-GAP-ANALYSIS §능력사다리: 읽기→replica·reference table·resharding 데이터이동 core 완료 표기. 새 우선순위 #1=ShardSplitJob 컨트롤러 K8s 결선, #2=bufio 라우터 최적화, #3=멀티머신 수평스케일 실측. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TnVYb8dUQFg2GSiSwo1dtZ
WORK_HANDOFF §6.6 + ROUTER-GAP-ANALYSIS: full e2e(kind 실 K8s+실 PG) 성공 — 전 phase 동작, t0=44/t1=56/source=0 키유실0, ShardRange flip, write-block 해제. 새 #1=CDC 증분 catch-up, #2=resharding 운영화(인덱스 복제·RESHARD_COPY_IMAGE manager env·target 승격). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TnVYb8dUQFg2GSiSwo1dtZ
WORK_HANDOFF §6.6: ReplicateIndexes(PK 포함) + RESHARD_COPY_IMAGE manager env 완료·라이브 검증. 새 #2=target shard 영구 승격(ordinal 편입). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TnVYb8dUQFg2GSiSwo1dtZ
사용자 시나리오
본 PR이 머지되면:
.github/workflows/0개 (예외 3종 0건). 다른 Kei* repo와 일관된 RFC 0002 적용 상태.pre-commit install1회로 lint·test·audit·secrets·drift 자동 검증.변경 요약
.github/workflows/ci.yml.github/workflows/upstream-watch.yml.pre-commit-config.yamlMakefiledocs/adr/0009-no-github-actions-rfc-0002.mdREADME.md4 계층 매핑
make lintmake test, go mod tidy driftmake auditmake test-e2e(kind 7-9분, pre-push 부적합)로컬 게이트 PASS
pre-commit validate-config: PASS (구문 valid)make lint: 0 issuesmake audit: 0 vulnerabilities (PR feat: P0-1/P0-5 + 19 권장 거버넌스 등록 (Bitnami + PGO 교차검증) #1 deps fix 효과 객관 확인 — go.mod gomod scan)make test: 모든 패키지 PASS (PR #1에서 검증, 본 PR은 코드 변경 0)후속 작업
Refs
🤖 Generated with Claude Code