fix(build-logic): 이미지 빌드의 의존성 단계가 API surface 검사로 멈추지 않게 한다 #47
Closed
donghyeon.kang
wants to merge 5 commits from
claude/be-main-red2-compose into main
pull from: claude/be-main-red2-compose
merge into: :main
:main
:fix/verify-remote-prep-env-rules
:fix/notification-template-refusal-carriers
:fix/in-process-lock-per-key
:fix/notification-secret-key-id-purpose
:fix/draft12-chunked-create-body
:fix/notification-admin-refusal-carriers
:fix/notification-lookup-hmac-rotation-guard
:fix/repository-contract-wrapper-input
:test/web-graceful-shutdown-inflight
:fix/notification-idempotency-conflict-carrier
:fix/compose-contract-verdict-false-pass
:fix/lock-handle-idempotent-close
:fix/core-redrive-missing-attempt-and-lease-field
:fix/verify-remote-stdin
:test/lock-contract-bounded-waits
:fix/verify-remote-log-header
:test/lease-value-bounds
:refactor/ratelimit-shared-bounds
:test/objectstorage-production-client-timeouts
:fix/verify-junit-summary
:fix/env-contract-nested-placeholder
:fix/notification-eligibility-and-redrive
:fix/httpclient-docs-field-match
:test/fileserver-admin-access-checks
:fix/gitignore-nested-env
:fix/check-docs-reference-rules
:fix/hooks-n5-verify-sh-n6-records
:fix/hooks-verify-sh-and-record-body
:test/compose-contract-verdict
:test/fileserver-precondition-and-policy-wiring
:ci/nfs-nightly-host-check-and-pin
:test/notification-worker-behavior
:test/mongo-tls-lane-handshake-refusal
:test/compose-smoke-judgements
:test/notification-admin-guards-cancel-branches
:claude/links-dns-probe
:docs/ledger-fixed-by-49-50
:claude/be-main-red2-minio-2
:claude/be-main-red2-compose
:claude/be-main-red2-minio
:claude/r9-b-claim-tx
:claude/w2-be-ci-perf-4
:claude/r9-review-record
:claude/r9-c-tests-build
:claude/r9-c-docs-body
:claude/r9-c-contracts
:claude/r9-compose-ops
:claude/r9-public-surface
:claude/r9-stale-names
:claude/r9-tx-timeouts
:claude/r9-env-keys
:claude/r9-arch-rules
:claude/w2-be-ci-perf-2
:claude/w2-be-ci-perf-2-wip
:claude/redteam-be-fixes-main
:claude/w2-be-ci-perf-e89fe7
:claude/redteam-be-fixes
:claude/t2a-backend-ci-451e3b
:claude/x3-messaging-library-1aa3fa
:claude/x2-grpc-library-43dd09
:claude/h3-backend-harness-34fc23
:claude/v1-vuln-fix-e089b9
:claude/i2-docs-merge-02df15
:claude/d2c-ops-docs-1-c22c9f
:claude/d2a-entry-docs-12a342
:claude/d2b-src-adr-d46d23
:claude/d2d-ops-docs-2-e40938
:claude/i1-layout-docs-merge-217f1e
:refactor/maturity-review-2026-11
:claude/t1-backend-layout-46973e
:claude/d1-docs-system-fd4a0f
:claude/integration-r9-f1bc5c
:claude/r9-g1-inbound-456713
:claude/r9-g3-migration-7ce36d
:claude/r9-g2-stomp-interceptor-f5675d
:claude/r9-g4-idempotency-c669be
:claude/manual-gap-fix-2-9b0fe2
:claude/r8-review-a-3851a7
:claude/integration-r8-a4196a
:claude/r8-f1-transport-errors-b21ebf
:claude/r8-f5-small-fixes-f40412
:claude/r8-f3-persistence-9e8157
:claude/r8-f2-arch-rules-60140e
:claude/r8-f4-idempotency-3a6a0f
:claude/manual-gap-fix-1-824a41
:claude/t4-2-manual-history-ids-9ac57c
:claude/t1-r10-review-d0ecc6
:claude/integration-r7
:claude/t5-idempotency-operation-id-9bd973
:claude/t3-error-codes-loglevel-fcf427
:claude/t1-baseline-7d623a
:claude/t2-circuit-breaker-2ff8df
:claude/t4-manual-history-ids-51889f
:claude/b3-docs-work-34a1dd
:claude/perf-assertions-fail-closed-c09414
:claude/improvement-manual-6ae516
:refactor/review-followup
5
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
5c28ebf51b |
ci(compose): 개수 검사와 handoff 재시작이 실패하면 그 단계 이름을 남긴다
pr / done (pull_request) Successful in 13m28s
문제: 실패한 lane은 마지막 lane_step의 이름과 로그 꼬리를 보고한다. one-shot 개수 검사와 handoff 1단계 뒤의 재시작 기록(record_restarts phase1)·app 정지 앞에서는 lane_step이 바뀌지 않는다. 그래서 그 검사가 실패하면 「one-shot <마지막>」·「handoff phase 1」로 보고되고, 이미 성공한 그 단계의 로그 꼬리가 원인처럼 찍힌다. 방법: 두 검사 앞에 로그 없는 lane_step을 둔다(「one-shot count」, 「handoff restart into the second phase」). 로그 없는 단계는 꼬리를 찍지 않고, 바로 앞 stderr 한 줄이 이유를 준다. 위험·한계: 이 두 실패는 desktop에서 일부러 만들지 않았다. 성공한 lane의 출력은 바뀌지 않는다. 검증: desktop 트리 efc4cdda(이 커밋) `:app-bootstrap:verifyEnvKeys --no-build-cache` rc=0, 전체 matrix 18 lane 모두 통과 rc=0(1081초). 노트북 `bash -n`, `python3 -m unittest discover -s scripts/tests` 166개 rc=0. |
||
|
|
bff1be45d0 |
docs(build-logic): 설정 단계 규칙의 경계를 leaf의 소스·자원으로 적는다
문제: 「설정 단계에서 보지 않는 것」 절이 플러그인은 「소스 폴더나 자원 파일」이 있는지 보지 않는다고 쓰고, 의존성 단계가 「build 스크립트· lockfile·release/ 데이터·build-logic/만」 복사한다고 쓴다. 실제 Dockerfile은 gradlew·gradle/·gradle.properties·config/도 복사하고, JavaConventionsPlugin은 설정 단계에서 gradle/container-images.properties를 읽는다. 그 코드는 맞는데 규칙대로 읽으면 위반으로 보인다. 방법: 경계를 「의존성 단계가 복사하지 않는 것, 곧 leaf의 src/ 아래 소스·자원」으로 적고, 복사 목록은 Dockerfile의 그 단계 COPY 줄을 정본으로 가리킨다. 목록을 다시 옮겨 쓰면 Dockerfile과 또 갈라진다. 검증: 노트북 `python3 scripts/check-work-docs.py`·`python3 scripts/check-docs.py` rc=0. |
||
|
|
2b264f62d1 |
docs(build-logic): 플러그인이 설정 단계에서 파일 존재를 보지 않는다는 규칙을 적는다
문제: 설정 단계 검사가 이미지 빌드의 의존성 단계를 멈추는 일은 PR·main 단계에서 보이지 않고 nightly compose smoke와 release에서야 드러난다 (2026-11-13 회귀, 2026-11-18 확인). build-logic 지역 규칙과 게이트 표에 그 단계의 모양과 볼 게이트가 없다. 방법: build-logic/AGENTS.md에 「설정 단계에서 보지 않는 것」 절을 두고, gates.md 2절 compose·Dockerfile 행에 설정 단계 동작을 바꿨을 때 돌릴 이미지 빌드 한 lane을 더한다. 버린 대안: PR 단계에 이미지 빌드 job을 더하기 — runner가 한 대라 PR마다 수 분이 늘고, 이 규칙 하나로 막을 수 있는 실수다. 검증: 노트북 `python3 scripts/check-work-docs.py`·`python3 scripts/check-docs.py` rc=0. |
||
|
|
5f7bf80ff2 |
fix(build-logic): 없는 API surface 추가 root를 설정 단계가 아니라 surface 태스크에서 거절한다
문제: cbfa77627이 apiSurface.additionalSourceRoots의 폴더가 없으면
afterEvaluate에서 실패하게 했다. Dockerfile builder의 의존성 단계는
build.gradle·lockfile만 복사하고 `./gradlew verifyDependencyLocks`를 돌리므로
src/application/notification/src/main/java가 없고, :adapter:outbound:notification
설정이 실패해 이미지 빌드가 멈춘다. compose smoke의 모든 lane이 이 빌드로
시작해 nightly run 306·315·318·321·324에서 18개 lane이 모두 실패했다.
방법: 검사를 verify·update surface 태스크의 실행 첫머리로 옮긴다
(AdditionalSourceRoots.requireExisting). surface를 계산하는 순간에는 여전히
없는 root를 경로와 함께 거절하므로 2026-11-12 리뷰가 막은 「줄어든 surface
승인」은 그대로 막힌다. surface를 읽지 않는 빌드(의존성 확인, help)는 설정을
마친다.
버린 대안: (1) Dockerfile 의존성 단계에 src/**/src/main/java 빈 폴더를
만들기 — 검사가 빈 폴더를 통과시켜 검사의 뜻이 사라진다. (2) 검사를 끄는
속성을 Dockerfile에서 주기 — 스위치가 하나 늘고 다른 빌드도 그 스위치를 쓸 수
있다.
위험·한계: 없는 root가 이제 surface 태스크를 돌릴 때만 드러난다. 그
태스크는 각 leaf의 check(PR 단계)에 들어 있어 PR에서 걸리는 시점은 같다.
Fixes:
|
||
|
|
92d204b9c4 |
ci(compose): 실패한 lane이 멈춘 단계와 그 단계 로그 꼬리를 job 로그에 남긴다
문제: nightly compose-smoke가 run 306·315·318·321·324에서 18개 lane을 모두 실패시켰는데 job 로그에는 lane 이름만 있다. 실패 이유는 lane 증거 폴더 (build.log, compose.log 등)에 있고, 그 폴더는 job 컨테이너와 함께 사라진다. 특히 앱 이미지 빌드는 출력을 build.log로만 보내 실패해도 한 줄도 남지 않는다. 방법: lane이 단계마다 lane_step으로 이름과 그 단계가 쓰는 증거 파일을 적는다. lane이 실패하면 trap이 logs·containers를 모은 뒤, teardown 전에 stderr로 멈춘 단계, 그 단계 로그의 마지막 25줄, 컨테이너마다 상태·exit code·health, compose.log의 마지막 오류 줄 15개를 쓴다. 정적 계약 검사가 실패하면 그 로그 꼬리도 쓴다. 출력은 모두 이미 가린(redact) 증거에서 나온다. 버린 대안: 증거 폴더를 artifact로 올리기 — .gitea workflow에 upload-artifact를 더해야 하고(Gitea는 v4 이상을 못 쓴다) 받아서 열어야 이유가 보인다. job 로그의 몇 줄이 더 빠르다. 위험·한계: 출력이 실패한 lane마다 50줄 안팎 는다. 성공한 lane의 출력은 그대로다. report 함수는 `|| true`로 불러 실패해도 teardown을 건너뛰지 않는다. |