review-followup Wave 2.5·Wave 3 라운드 1(P14·P17): 정합성 잔여 12행, gRPC 플랫폼 9 leaf·protobuf 플러그인+Buf
- P14(W2): inbox archive 종단 상태 보존, GraphQL platform context 누락 경고, fileserver 전이·quota·진행 중 upload 삭제, 알림 profile 소실 재시도·lease fencing·body 읽기 기한, Mongo bulk write concern, Dynamic Target cross-origin 헤더(결정 23), S3 profile CONDITIONAL_RETIREMENT 주장 거부, sample 포스터 abort·reconcile 경합(결정 22) - P17(W3): gRPC 18→9 leaf(registry), .proto는 protobuf Gradle 플러그인 + Buf CI(결정 18), hyeonworks→caskeleton, 인증 식별자 Context 전달, 한계값 정합 검사, P5-new-2·3 결함 수정 - 오케스트레이터: 현황표 적용(완료 395·남음 359), 새 결함 행 9개, capability-status 「제거된 코드」 17행, 계획서 Wave 3 상세 Task, by_area.py NEW-15+ KeyError 수정 검증: ./gradlew check architectureCheck verifyDependencyLocks --continue 통과(597 task), ./gradlew -p optional-platforms ci 통과, CapabilityStatusDocumentTest 통과 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
016597ac78
commit
9fdb0af417
@@ -71,6 +71,40 @@ jobs:
|
||||
working-directory: src
|
||||
run: ./gradlew -p optional-platforms ci --stacktrace
|
||||
|
||||
# gRPC schema policy (owner decision 18). protoc compiles src/grpc/grpc-contract inside the
|
||||
# optional-platforms build above; lint and breaking-change policy belong to Buf, configured by
|
||||
# buf.yaml next to the schema. Buf is a native binary rather than a Maven artifact, so it runs here
|
||||
# and not inside Gradle — and nothing in the repository re-implements its rules.
|
||||
grpc-proto-buf:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # actions/checkout@v4.2.2
|
||||
with:
|
||||
# buf breaking reads the baseline schema from Git history.
|
||||
fetch-depth: 0
|
||||
- uses: bufbuild/buf-action@85aebf73123b5c15fd5528aaecbf9129cddf7fa7 # bufbuild/buf-action@v1.6.0
|
||||
with:
|
||||
version: 1.73.0
|
||||
setup_only: true
|
||||
- name: Lint the gRPC schema
|
||||
working-directory: src/grpc/grpc-contract
|
||||
run: buf lint
|
||||
- name: Refuse a breaking change to the gRPC schema
|
||||
working-directory: src/grpc/grpc-contract
|
||||
env:
|
||||
# Pull request: the target branch. Push: the commit this push replaced.
|
||||
BASELINE: ${{ github.event_name == 'pull_request' && format('origin/{0}', github.base_ref) || github.event.before }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
baseline_commit="$(git rev-parse --verify --quiet "${BASELINE}^{commit}" || true)"
|
||||
if [[ -z "${baseline_commit}" ]] \
|
||||
|| ! git cat-file -e "${baseline_commit}:src/grpc/grpc-contract/buf.yaml" 2>/dev/null; then
|
||||
# The first change that introduces the module has nothing to be compatible with.
|
||||
echo "::notice::grpc-proto-buf: baseline ${BASELINE} has no src/grpc/grpc-contract/buf.yaml; breaking check skipped."
|
||||
exit 0
|
||||
fi
|
||||
buf breaking --against "../../../.git#ref=${baseline_commit},subdir=src/grpc/grpc-contract"
|
||||
|
||||
release-gate:
|
||||
needs:
|
||||
- quality-gates
|
||||
|
||||
@@ -252,6 +252,8 @@ Docker/runtime 규칙:
|
||||
|
||||
1. `src/settings.gradle`의 `rootProject.name`을 새 프로젝트명으로 바꾼다.
|
||||
2. Java package `dev.caskeleton`을 새 organization/project package로 바꾼다.
|
||||
gRPC 플랫폼을 쓰면 proto 조직 이름 `caskeleton`(`src/grpc/grpc-contract/src/main/proto/caskeleton/`의
|
||||
디렉터리, 각 `.proto`의 `package`·`java_package`)도 함께 바꾸고 `buf lint`로 확인한다.
|
||||
3. `CaSkeletonApplication` 이름을 새 애플리케이션 이름으로 바꾼다.
|
||||
4. production 모듈에는 목표 도메인의 entity, repository port, use case, adapter만 추가하고, 예시 코드는 `sample-portfolio`에 격리한다.
|
||||
5. 모듈 이름과 경계는 유지한다.
|
||||
|
||||
@@ -1,8 +1,17 @@
|
||||
# ADR-GRPC-002: Schema governance runs without protoc and without the Buf CLI
|
||||
|
||||
- Status: accepted
|
||||
- Status: **superseded (2026-09-28)** by owner decision 18 of the 2026-09-25 review follow-up
|
||||
- Date: 2026-08-30
|
||||
- Scope: `:grpc:grpc-proto-contract`, `:grpc:grpc-codegen`
|
||||
- Scope: `:grpc:grpc-proto-contract`, `:grpc:grpc-codegen` (both removed)
|
||||
|
||||
> **Superseded.** The regex `.proto` validator and the Java re-implementation of Buf's rules were
|
||||
> deleted. The schema now lives in `:grpc:grpc-contract` (`src/grpc/grpc-contract/src/main/proto`),
|
||||
> compiled by the Gradle protobuf plugin (`com.google.protobuf`, version pinned in
|
||||
> `src/gradle/libs.versions.toml`; protoc and the protobuf-java runtime are both `protobufGrpc`).
|
||||
> Generated sources are excluded from Spotless, Checkstyle and Error Prone in that leaf only.
|
||||
> `buf lint` and `buf breaking` (`src/grpc/grpc-contract/buf.yaml`, STANDARD lint, FILE breaking)
|
||||
> run in CI, job `grpc-proto-buf` in `.github/workflows/ci-quality-gates.yml`. The proto organization
|
||||
> is `caskeleton` (was `hyeonworks`). The text below is kept as the record of the original decision.
|
||||
|
||||
## Context
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
- Status: accepted
|
||||
- Date: 2026-08-30
|
||||
- Scope: `:grpc:grpc-core-api`, `:grpc:grpc-policy`, `:grpc:grpc-testkit`
|
||||
- Scope: `:grpc:grpc-core-api`, `:grpc:grpc-runtime` (was `grpc-policy`), `:grpc:grpc-testkit`
|
||||
|
||||
## Context
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
- Status: accepted
|
||||
- Date: 2026-08-30
|
||||
- Scope: `:grpc:grpc-policy`, `:grpc:grpc-operation-ledger-jpa`, `:grpc:grpc-core-api`
|
||||
- Scope: `:grpc:grpc-runtime` (was `grpc-policy`), `:grpc:grpc-operation-ledger-jpa`, `:grpc:grpc-core-api`
|
||||
|
||||
## Context
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
- Status: accepted
|
||||
- Date: 2026-08-30
|
||||
- Scope: `:grpc:grpc-policy`
|
||||
- Scope: `:grpc:grpc-runtime` (was `grpc-policy`)
|
||||
|
||||
## Context
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
- Status: accepted
|
||||
- Date: 2026-08-31
|
||||
- Scope: `:grpc:grpc-discovery`, `:grpc:grpc-client`
|
||||
- Scope: `:grpc:grpc-runtime` (was `grpc-discovery`, `grpc-client`)
|
||||
|
||||
## Context
|
||||
|
||||
@@ -63,6 +63,6 @@ declaration is a wrong statement somebody wrote down, and a missing one is a que
|
||||
`GrpcChannelProfileValidator` takes resolved counts where they are known at startup and skips the
|
||||
check where they are not, rather than guessing and failing on a name that cannot be resolved yet.
|
||||
|
||||
**xDS is reachable, and not by this route.** It lives in `grpc-advanced-resilience` behind its
|
||||
**xDS is reachable, and not by this route.** It lives in `grpc-advanced` (package `resilience`/`xds`) behind its
|
||||
capability flag and its production approval, and `GrpcXdsStartupGuard.advertisableAsStableSupport()`
|
||||
returns false so the Stable support statement cannot widen quietly. See ADR-GRPC-ADV-001.
|
||||
|
||||
@@ -341,3 +341,20 @@ web 경로의 `W/`는 `src/adapter/inbound/web/src/main/java/dev/caskeleton/adap
|
||||
| `GitCommandResult` record | `src/build-logic/src/main/java/dev/caskeleton/buildlogic/architecture/GitCommandResult.java` | `6d27356e` | O-3b에서 git 호출이 exit code를 직접 판정하는 `checkIgnore` 하나로 줄어 쓰는 곳이 없음 |
|
||||
| `git rev-parse --show-toplevel` 호출(checkout 판정) | `VerifyNoIgnoredSourcePackagesTask.java` | `6d27356e` | 실패하면 "checkout 아님"으로 읽혀 게이트가 통과하던 원인. `.git` 존재 판정으로 대체 |
|
||||
| compose 계약 필드 `expectedSwitchesOn` | `src/config/runtime/compose-profile-contracts.json` | `6d27356e` | 읽는 코드가 없던 필드. `expectedCapabilitiesOn`(info 이름)으로 재정의 |
|
||||
| `grpc-policy` leaf | `src/grpc/grpc-policy` | `6d27356e` | 병합: → `grpc-runtime`(S7-#3) |
|
||||
| `grpc-server` leaf | `src/grpc/grpc-server` | `6d27356e` | 병합: → `grpc-runtime`(S7-#3) |
|
||||
| `grpc-client` leaf | `src/grpc/grpc-client` | `6d27356e` | 병합: → `grpc-runtime`(S7-#3) |
|
||||
| `grpc-discovery` leaf | `src/grpc/grpc-discovery` | `6d27356e` | 병합: → `grpc-runtime`(S7-#3) |
|
||||
| `grpc-admin` leaf | `src/grpc/grpc-admin` | `6d27356e` | 병합: → `grpc-runtime`(S7-#3) |
|
||||
| `grpc-proto-contract` leaf (`.proto`는 이동) | `src/grpc/grpc-proto-contract` | `6d27356e` | 병합: → `grpc-contract`. `.proto` 두 파일은 `grpc-contract/src/main/proto/caskeleton/…`로 이동, 나머지는 삭제(S7-#13) |
|
||||
| `GrpcProtoContractValidator`, `GrpcProtoStyleManifest`, `GrpcProtoRuleViolation` + 테스트 | `src/grpc/grpc-proto-contract/src/main/java/dev/caskeleton/grpc/contract/` | `6d27356e` | regex `.proto` 파서·style 규칙 재구현 — protoc + Buf lint로 대체(결정 18) |
|
||||
| `buf.gen.yaml`, `buf.lock`, 구 `buf.yaml` | `src/grpc/grpc-proto-contract/src/main/resources/proto/` | `6d27356e` | 명세용 파일. 생성은 Gradle protobuf 플러그인, 설정은 `src/grpc/grpc-contract/buf.yaml` |
|
||||
| `grpc-codegen` leaf 전체(`GrpcBufPolicy`, `GrpcBreakingCategory`, `GrpcCodegenManifest`, `GrpcCodegenOutput`, `GrpcGeneratedPackagePolicy`, `GrpcDescriptorArtifact`, `GrpcConsumerFixture`, `GrpcSchemaArtifactPublisher`, `GrpcSchemaBaseline` + 테스트·consumer fixture) | `src/grpc/grpc-codegen` | `6d27356e` | Buf lint/breaking·codegen 소유 규칙의 Java 재구현 — Buf(CI)·protobuf 플러그인으로 대체(결정 18) |
|
||||
| `grpc-advanced-bootstrap` leaf | `src/grpc-advanced/grpc-advanced-bootstrap` | `6d27356e` | 병합: → `grpc-advanced`(S7-#3) |
|
||||
| `grpc-advanced-edition` leaf | `src/grpc-advanced/grpc-advanced-edition` | `6d27356e` | 병합: → `grpc-advanced`(S7-#3); `compatibility.proto`는 test resources로 |
|
||||
| `grpc-advanced-streaming` leaf | `src/grpc-advanced/grpc-advanced-streaming` | `6d27356e` | 병합: → `grpc-advanced`(S7-#3) |
|
||||
| `grpc-advanced-resilience` leaf | `src/grpc-advanced/grpc-advanced-resilience` | `6d27356e` | 병합: → `grpc-advanced`(S7-#3) |
|
||||
| `grpc-advanced-diagnostics` leaf | `src/grpc-advanced/grpc-advanced-diagnostics` | `6d27356e` | 병합: → `grpc-advanced`(S7-#3) |
|
||||
| `GrpcStreamProfile` | `src/grpc/grpc-policy/src/main/java/dev/caskeleton/grpc/streaming/GrpcStreamProfile.java` | `6d27356e` | 테스트에서만 쓰였고 `GrpcFlowControlPolicy`의 256/8 MiB를 복제(N-10b) |
|
||||
| `GrpcAuthenticationPolicy.isAuthenticated(Metadata)` | `src/adapter/inbound/grpc/src/main/java/dev/caskeleton/adapter/inbound/grpc/GrpcAuthenticationPolicy.java` | `6d27356e` | `authenticate(Metadata): Optional<Principal>`로 교체(K-10a) |
|
||||
| `GrpcCredentialRotationManager.completeDrain()`(무인자) | `src/grpc/grpc-policy/src/main/java/dev/caskeleton/grpc/security/GrpcCredentialRotationManager.java` | `6d27356e` | `completeDrain(GrpcCredentialGeneration)`로 교체(P5-new-3) |
|
||||
|
||||
@@ -53,13 +53,13 @@ tested the adapter and not the transport.
|
||||
|
||||
| | Where it lives |
|
||||
| --- | --- |
|
||||
| Client streaming, bidirectional streaming | `grpc-advanced-streaming` |
|
||||
| Manual flow control | `grpc-advanced-streaming` |
|
||||
| Hedging | `grpc-advanced-resilience` |
|
||||
| Custom name resolver, custom load balancer | `grpc-advanced-resilience` |
|
||||
| xDS | `grpc-advanced-resilience` |
|
||||
| Client streaming, bidirectional streaming | `grpc-advanced` (`streaming`) |
|
||||
| Manual flow control | `grpc-advanced` (`streaming`) |
|
||||
| Hedging | `grpc-advanced` (`resilience`) |
|
||||
| Custom name resolver, custom load balancer | `grpc-advanced` (`resilience`) |
|
||||
| xDS | `grpc-advanced` (`resilience`) |
|
||||
| gRPC-Web, Servlet HTTP/2, Spring Integration, Reactor, Kotlin | `grpc-advanced-compat` |
|
||||
| Channelz / CSDS diagnostics | `grpc-advanced-diagnostics` |
|
||||
| Channelz / CSDS diagnostics | `grpc-advanced` (`diagnostics`) |
|
||||
|
||||
## Current release status
|
||||
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
# W2-P14 — Wave 2.5 정합성 잔여
|
||||
|
||||
worktree `.claude/worktrees/agent-a49c7a7a5ac7707e8`, 브랜치 `worktree-agent-a49c7a7a5ac7707e8`.
|
||||
커밋(모두 W2): `5928fb06`(P9-new-1·P8-new-2), `1fa968df`(P4-new-2·3·4), `c90bb445`(P3-new-3·5·6),
|
||||
`7540c638`(P12-new-1), `50823043`(P11-new-4), `450c55e4`(P2-new-3), `facf0a80`(P2-new-2).
|
||||
새 migration 없음.
|
||||
|
||||
## 행 결과
|
||||
| ID | 결과 | 근거 |
|
||||
|---|---|---|
|
||||
| P2-new-2 | 완료 | 결정 22. `PosterImageAbortReconcileRaceTest`(sample test) — `aPublicationThatFinishesAfterTheAbortWasAuthorizedIsAttached` FAIL(`IllegalStateException: publication intent handoff changed before TX3`)→PASS, `anAbortAuthorizedIntentWhoseObjectWasPublishedIsAttachedByTheNextReconcile` FAIL(`Poster image publication is not ready to reconcile`)→PASS, `anAbortThatArrivesAfterThePublicationIsAConflict` FAIL(예외 없음, 저장소 abort 진행)→PASS, `anAbortOfAnUploadAlreadyAttachedIsAConflict` 신규 PASS. `DomainExceptionHandlerTest.anAbortThatLostToThePublicationIsA409Conflict` PASS. 수정: 저장소 `kernel/ObjectPublicationHandoffService.java:117-125` `authorizeAbort`가 게시된 operation에 예외 대신 `REJECTED`/`CONFLICT` receipt(수정 전에는 `IllegalStateException`이라 sample이 "이미 게시됨"을 다른 장애와 구분할 수 없었음; D-1b 테스트 `StagedObjectPublicationLifecycleTest$AuthorizeAbort.authorizeAbortIsRejectedOnceTheReferenceIsPublished`를 receipt 단언으로 갱신). `AbortPosterImageUploadUseCase.java:83-87,99-105` READY/SUPERSEDED intent나 REJECTED receipt면 `PosterImageAlreadyPublishedException`(409 `POSTER_IMAGE_ALREADY_PUBLISHED`, `DomainExceptionHandler`), 아무것도 지우지 않고 intent는 ABORT_AUTHORIZED로 둠. `ReconcilePosterImageUploadUseCase.java:103,145,166`와 `PosterImageUploadIntent.requirePublishable`(ready/superseded)가 ABORT_AUTHORIZED도 받아 게시된 객체를 붙임(저장소가 abort를 먼저 받았으면 finalize가 거부돼 abort가 이김). 실제 PG `:sample-portfolio:integrationTest` 49/49 |
|
||||
| P2-new-3 | 완료 | 두 번째 선택지(주장 금지). `S3ProviderBindingTest.aProfileCannotClaimRetirementTheManagedS3ProviderDoesNotImplement` FAIL(`Expecting actual not to be null`)→PASS. `s3/S3ProviderBinding.java:199-206` profile이 `CONDITIONAL_RETIREMENT`를 주장하면 바인딩 거부. retire 구현은 S3 readiness 근거가 없어 하지 않음. 결과: 기본 요구 집합(CONDITIONAL_RETIREMENT 포함)의 S3 destination은 시작 시 거부된다 — `S3ProviderCompositionTest` destination은 명시 요구 집합으로 바꿈 |
|
||||
| P3-new-3 | 완료 | `JdkNotificationHttpGatewaySecurityTest.aResponseBodyThatStallsBelowTheCapEndsAtTheRequestTimeout` FAIL(`TimeoutException: ... timed out after 15 seconds`)→PASS. `provider/http/JdkNotificationHttpGateway.java:81,88,167` 요청 timeout의 남은 시간을 body 읽기 deadline으로 걸고, 넘기면 daemon 타이머가 stream을 닫아 `RESPONSE_TIMEOUT`(body committed=true). SNS 인증서 fetch도 같은 gateway를 씀 |
|
||||
| P3-new-5 | 완료 | 결정 21. `RegistryProviderDispatchGatewayTest.aProfileNoRuntimeServesIsAProviderUnavailableFailure` FAIL(`IllegalStateException: no provider runtime registered for the profile`)→PASS; `NotificationDispatchServiceTest.aRouteWhoseProviderProfileIsGoneWaitsForTheRetryBackoff` FAIL(`[FAILED, Optional.empty, 0, ...]`)→PASS, `...FailsOnceTheRetryBudgetIsSpent` PASS. `ntf-adapter/dispatch/RegistryProviderDispatchGateway.java:35` 없는 profile → `ProviderUnavailableException(PROVIDER_UNAVAILABLE, TRANSIENT_PROVIDER)`(port javadoc에 명시). `ntf-app/dispatch/NotificationDispatchService.java:159,236` 일반 `NotificationRetryPolicy`(backoff·`RetryBudget(maxAdditionalAttempts, attemptCount)`·만료)로 RETRY_WAITING+nextDispatchAt, 한도면 FAILED, 어느 쪽이든 fenced `saveHeldBy` 후 lease 해제. attempt row가 없으므로 횟수는 수신자 `attemptCount`로 셈. 사유: 수신자 행에는 실패 코드 열이 없어 `lastFailureCategory=TRANSIENT_PROVIDER`로 남김(코드 `PROVIDER_UNAVAILABLE`은 예외 descriptor에만 있음) |
|
||||
| P3-new-6 | 완료 | `NotificationDispatchServiceTest.aGuardBlockWrittenAfterTheLeaseWasLostChangesNothing`·`aRoutingStopWrittenAfterTheLeaseWasLostChangesNothing` FAIL(수신자 행이 바뀜)→PASS. `NotificationDispatchService.java:146`(guard Blocked), `:564`(`applyRoutingStop`)를 `transitionHeldBy(..., lease)`로. 실제 PG `jpaPlatformContractTest` 217/217 |
|
||||
| P4-new-2 | 완료 | `FileReconciliationServiceTest.restoringReadyCommitsThePublishedBytesToQuota` FAIL(`expected: 10L but was: 0L`, 동작 비활성화로 재현)→PASS, `aPublishWithoutItsUploadSessionIsUnresolvedRatherThanReadyWithoutQuota` PASS. `recovery/DefaultFileReconciliationService.java:160,175` READY 복원과 같은 경계에서 `QuotaCommitGateway.commit`; upload 세션을 못 찾으면 READY를 복원하지 않고 UNRESOLVED(`PUBLISH_UPLOAD_SESSION_ABSENT`). 생성자에 `UploadSessionStore`·`StagingUploadLocator`·`QuotaCommitGateway` 추가, 조립 `FileserverMaintenanceServiceConfiguration`. 실제 PG `postgresqlFileserverReclamationIntegrationTest` 15/15 |
|
||||
| P4-new-3 | 완료 | `FinalizeUploadServiceTest.aRecordStillCreatedIsWalkedThroughUploadingToReady` FAIL(`IllegalStateException: illegal file transition: CREATED -> UPLOADED`)→PASS. `upload/DefaultFinalizeUploadService.java:196-214` CREATED→UPLOADING→UPLOADED |
|
||||
| P4-new-4 | 완료 | `FileLifecycleServiceTest.deletingAnInProgressUploadEndsItsSessionAndSchedulesItsStagingForCleanup` FAIL(`[false, []]`, 동작 비활성화로 재현)→PASS. `lifecycle/DefaultFileLifecycleService.java:94,109` UPLOADING/UPLOADED/FAILED 레코드 삭제 시 `StagingUploadLocator`로 upload를 찾아 세션 terminate + `CANCELLED_STAGING` 예약(cancel과 같은 규칙). `FileRetirement`은 건드리지 않음(admin 경로는 새로 발견한 결함 참고). fake: `InMemoryUploadSessionStore`가 `StagingUploadLocator`도 구현 |
|
||||
| P8-new-2 | 완료 | `GraphQlPlatformInstrumentationTest.aRequestWithoutPlatformContextIsLoggedAsAWiringFaultAtWarn` FAIL(`Expected size: 1 but was: 0`)→PASS. `runtime/GraphQlPlatformInstrumentation.java:72` executionId와 함께 WARN. 에러 매퍼는 건드리지 않음 |
|
||||
| P9-new-1 | 완료 | `InboxItemEntityTest.archiveLeavesAnExpiredOrDeletedItemInItsTerminalState[EXPIRED,DELETED]` FAIL(`[true, "ARCHIVED", ...]`)→PASS. `.../platform/inbox/InboxItemEntity.java:145-146` EXPIRED·DELETED면 no-op(false) |
|
||||
| P11-new-4 | 완료 | 결정 23. `DefaultDynamicTargetGatewayTest.crossOriginHopKeepsOnlySafeCallerHeaders` FAIL(`[(true, true), (true, true)]`)→PASS. `HC/dynamic/DefaultDynamicTargetGateway.java:164,172-185` cross-origin hop에서 호출자 헤더를 allowlist(`Accept`·`Accept-Language`·`Content-Type`·`Content-Language`)로만 남김. 자격증명 binding 헤더는 hop마다 새 target 기준으로 다시 붙음(기존) |
|
||||
| P12-new-1 | 완료 | 실제 replica set lane `MongoBulkMappingLaneTest.aBulkWriteCarriesTheProfileWriteConcern` FAIL(update 명령 writeConcern `["null"]`)→PASS(`{"w": "majority"}`, CommandListener로 관찰). `imperative/MongoPlatformCollectionAccess.writeConcern()`, `MongoConsistencyBinder.java:93` `writeConcernFor`, `bulk/MongoBulkExecutor.java:94` `withWriteConcern`. `mongoReplicaSetTest` 7/7 |
|
||||
|
||||
## 제거된 코드
|
||||
| 대상 | 경로 | 마지막으로 존재한 커밋 | 이유 |
|
||||
|---|---|---|---|
|
||||
| (없음) | | | |
|
||||
|
||||
## 새로 발견한 결함
|
||||
- `P14-new-1` (미수정): operator force-delete(`application-fileserver/.../admin/DefaultFileserverAdminService.java:167` `retirement.retire(record, Optional.empty())`)도 P4-new-4와 같은 결함 — 진행 중 upload를 지우면 세션이 ACTIVE로 남고 staging 정리가 예약되지 않는다. 같은 `unfinishedUpload` 처리를 admin에도 넣으면 되지만(생성자에 `StagingUploadLocator` 추가) 행 범위 밖이라 두었다.
|
||||
- `P14-new-2` (미수정, 불안정 테스트): `adapter:outbound:objectstorage`의 `S3AsyncResponseBodyBridgeTest.deliversAnExactBoundedBodyOnTheWorkerAndInvalidatesTheSource`가 전체 `check` 한 번에서 실패(`Expecting code to raise a throwable`), 단독 실행과 재실행에서는 통과. 이 묶음 변경과 무관한 타이밍 의존으로 보인다.
|
||||
- `P14-new-3` (관찰): main 코드에 `ReconcilePosterImageUploadUseCase`를 부르는 worker가 없다(`claimPending` 호출자도 없음). P2-new-2 수정 후 게시가 이긴 ABORT_AUTHORIZED intent는 reconcile 명령이 와야 붙는다 — worker가 생기면 PENDING뿐 아니라 ABORT_AUTHORIZED도 집어야 한다.
|
||||
- 테스트 규칙 잔여: `PosterImagePublicationWorkflowTest`는 이번에 testFixtures에 추가한 `InMemoryPosterImageUploadIntentStore` 대신 자기 `FakeIntents`를 계속 쓴다(중복 fake). `application-objectstorage`에 testFixtures가 없어 `ObjectPublicationHandoffPort`·`StagedObjectPublicationPort` 대역은 `PosterImageAbortReconcileRaceTest` 안의 스크립트 스텁으로 두었다.
|
||||
|
||||
## 검증
|
||||
- leaf check 통과: `:adapter:outbound:persistence-jpa` 494, `:adapter:inbound:graphql` 373, `:application-fileserver` 244, `:adapter:outbound:fileserver` 222(skip 3, 기존), `:application-notification` 215, `:adapter:outbound:notification` 333(skip 1, 기존), `:adapter:outbound:persistence-mongo`(test 80 + mongoStableContractTest 464), `:adapter:outbound:httpclient` 304, `:adapter:outbound:objectstorage` 147, `:sample-portfolio` 296, `:app-bootstrap` 642(skip 5, 기존) — 실패 0.
|
||||
- 실제 벤더 lane: `mongoReplicaSetTest` 7/7, `jpaPlatformContractTest` 217/217, `postgresqlFileserverReclamationIntegrationTest` 15/15, `:sample-portfolio:integrationTest` 49/49.
|
||||
- `architectureCheck` 통과. 설정 키·의존성 변경 없음(`verifyEnvKeys`·`verifyDependencyLocks` 불필요).
|
||||
|
||||
## 기타
|
||||
- 규칙 이탈: 소스 두 곳을 셸(python heredoc)로 편집했다 — `GraphQlPlatformInstrumentation.java`(import·LOG·warn 추가)와 `DefaultFileLifecycleService.java`(생성자 인자·필드 추가). 결과는 Read와 leaf check로 확인했고 이후 편집은 전부 Edit/Write로 했다.
|
||||
- P4-new-2·P4-new-4의 FAIL은 생성자 변경 후 새 동작을 잠시 끈 상태로 재현했다(Error Prone이 읽지 않는 필드를 컴파일 오류로 막아, 동작 없는 생성자 변경만으로는 컴파일되지 않음).
|
||||
- `ObjectPublicationHandoffPort.authorizeAbort`의 "이미 게시됨" 신호가 예외에서 `REJECTED`/`CONFLICT` receipt로 바뀌었다. 호출자는 sample 하나뿐이다.
|
||||
- 결과 파일 위치: worktree 격리 때문에 원본 작업 트리 경로(`docs/reviews/2026-09-25-review-followup-results/W2-P14.md`)에 쓰기가 거부되어 이 scratchpad 파일로 남겼다. 오케스트레이터가 원본 경로로 옮겨야 한다.
|
||||
@@ -0,0 +1,55 @@
|
||||
# W3-P17 — gRPC 플랫폼 (Wave 3)
|
||||
|
||||
worktree `.claude/worktrees/agent-aee5125c9de434b73`, 브랜치 `worktree-agent-aee5125c9de434b73`.
|
||||
커밋: `6df06c6f`(W2 결함 2건), `119b25b7`(W3 K-10a), `e2397d2f`(W3 구조·protobuf/Buf·이름).
|
||||
|
||||
## 행 결과
|
||||
| ID | 결과 | 근거 |
|
||||
|---|---|---|
|
||||
| K-10a | 완료 | `119b25b7`. `GrpcAuthenticationPolicy`가 `Optional<Principal> authenticate(Metadata)`(`src/adapter/inbound/grpc/src/main/java/dev/caskeleton/adapter/inbound/grpc/GrpcAuthenticationPolicy.java:20`), 인터셉터가 `Context.Key`에 담아 `Contexts.interceptCall`(`GrpcAuthenticationInterceptor.java:40`), handler는 새 `GrpcAuthenticatedCaller.current()`로 읽는다. `null` 반환은 fail-closed. status/trailer 매핑(`call.close(...)`·`GrpcStatusMapper`)은 바꾸지 않았다(P15 영역). 테스트: `GrpcP1BoundaryWireTest.theAuthenticatedCallerReachesTheFeatureHandlerThroughTheGrpcContext`(실제 loopback Netty로 handler가 principal 이름을 응답), `GrpcAuthenticationInterceptorTest.aPolicyReturningNullIsRejectedAsUnauthenticated`. API 변경이라 FAIL 단계는 컴파일 실패(구 `isAuthenticated` 계약에 식별자 경로 없음). `:adapter:inbound:grpc:check`·`grpcTransportQualificationTest` 통과. CLAUDE.md·README 문구 갱신 |
|
||||
| N-8d | 완료 | `e2397d2f`. `envoy.yaml`을 `src/grpc-advanced/grpc-advanced-compat/src/test/resources/envoy/envoy.yaml`로(jar에서 빠짐). 같은 이유로 테스트만 읽던 `compatibility.proto`(Edition 2024 fixture)도 `src/grpc-advanced/grpc-advanced/src/test/resources/proto/edition2024/`로. `GrpcWebCompatibilityTest`·`GrpcEdition2024PolicyTest` 통과. P5-new-1(envoy CORS deprecated, W5)은 손대지 않음 |
|
||||
| N-9a | 완료 | `e2397d2f`. `src/grpc/grpc-spring-boot-starter/build.gradle`의 proto-contract·codegen 두 줄과 registry edge 삭제(두 leaf 자체도 S7-#13으로 삭제) |
|
||||
| N-10a | 완료 | `e2397d2f`. 기본 한도 상수를 `src/grpc/grpc-core-api/src/main/java/dev/caskeleton/grpc/api/policy/GrpcTransportLimits.java` 한 곳으로(메시지 1 MiB, metadata 8 KiB); `GrpcServerProfile`·`GrpcNamedChannelProfile`·`GrpcMessageSizeProfile`·`GrpcMetadataBudget`·`GrpcMethodPolicy` 기본값이 이 상수를 쓴다. `GrpcServerProfile.stable(transport, executor)` 팩토리 추가(`src/grpc/grpc-runtime/src/main/java/dev/caskeleton/grpc/server/GrpcServerProfile.java:76`), starter bean이 재사용(`GrpcPlatformAutoConfiguration.java:56`). validator가 "method inbound 한도 ≤ server 한도" 검사(`GrpcPlatformStartupValidator.java:125`, 입력에 `GrpcServerProfile` 추가). `GrpcPlatformStartupValidatorTest.aMethodBoundAboveTheServerBoundIsRefused` 추가. 이 규칙을 넣자 기존 `aCoherentConfigurationStarts`가 FAIL(`Expecting empty but was: ["method '…/GetDocument' accepts 4194304-byte messages but the server rejects anything over 1048576; …"]`) → `GrpcMethodPolicy` 기본값 4 MiB를 1 MiB로 맞춰 PASS(아래 P17-new-1) |
|
||||
| N-10b | 완료 | `e2397d2f`. `GrpcStreamProfile`과 `GrpcStreamEnvelopeTest.theDefaultProfileBuffersLiveEventsUntilTheSnapshotCompletes` 삭제. 256/8 MiB는 `GrpcFlowControlPolicy`만 소유 |
|
||||
| S7-#3 | 완료 | `e2397d2f`. registry의 `optional-grpc` leaf 18 → 9: `grpc-core-api`, `grpc-runtime`(policy+server+client+discovery+admin), `grpc-contract`(proto-contract+codegen 자리), `grpc-observability`, `grpc-operation-ledger-jpa`, `grpc-spring-boot-starter`, `grpc-testkit`, `grpc-advanced`(bootstrap+edition+streaming+resilience+diagnostics), `grpc-advanced-compat`. 패키지 이름은 그대로(import 변경 없음). settings는 registry 구동(`OptionalArchitectureRegistrySettingsPlugin`)이라 `src/optional-platforms/settings.gradle` 변경 불필요, build-logic 무변경. 새 edge 없음, 미사용 edge 삭제: grpc-client의 io.grpc(leaf 합병으로 소멸), codegen→proto-contract, edition→core-api/proto-contract/bootstrap, testkit→proto-contract/codegen. starter·grpc-advanced·compat는 grpc-runtime의 versionless io.grpc api를 받으므로 `ca.grpc-platform-module`(gRPC BOM)로 전환 — 새 leaf로 lockfile을 재생성할 때 BOM 없이 `Could not find io.grpc:grpc-api:.`로 실패해서다(기존 lockfile 값과 동일하게 해석됨). `GrpcPackageOwnershipTest` leaf 목록 갱신. lockfile은 `-p optional-platforms resolveAndLockAll --write-locks`로 재생성 |
|
||||
| S7-#13 | 완료 | `e2397d2f`. 소유자 결정 18대로 `GrpcProtoContractValidator`(regex 파서)·`GrpcProtoStyleManifest`·`GrpcProtoRuleViolation`·`grpc-codegen` 전체(Buf 규칙 재구현, codegen manifest, descriptor/consumer fixture) 삭제. `src/grpc/grpc-contract/build.gradle`: `com.google.protobuf` 플러그인(카탈로그 `protobufPlugin = "0.10.0"`, `libs.plugins.protobuf`), protoc·runtime은 `protobufGrpc`(3.25.5, gRPC BOM 1.68.1과 같은 줄) — `libs.protoc`, `libs.protobuf.java.grpc` 추가. 생성 코드는 Spotless target·Checkstyle·Error Prone에서 이 leaf만 제외, SpotBugs(qualityCheck)는 통과. protoc tool locator 설정은 locking 해제(정확 버전 좌표라 lock이 같은 값을 반복). `src/grpc/grpc-contract/buf.yaml`(STANDARD lint, FILE breaking). CI: `.github/workflows/ci-quality-gates.yml` job `grpc-proto-buf`(`bufbuild/buf-action` SHA 고정, `buf lint` + baseline에 모듈이 있으면 `buf breaking`, 없으면 notice 후 skip). 로컬 검증: buf 1.73.0 바이너리를 scratchpad에 받아 `buf lint`·`buf build`·`buf breaking --against '../../../.git#ref=e2397d2f,subdir=src/grpc/grpc-contract'` 모두 exit 0. 테스트 `GrpcContractGeneratedCodeTest`(생성 message wire 왕복·explicit presence, 패키지 disjoint). testkit `GrpcStableReleaseGate.evaluate`의 schema 입력은 `PublishDecision` 대신 `List<String> schemaBreakages`(buf breaking 결과). ADR-GRPC-002를 superseded로 표시, 설계서에 변경 주석. **통합 시 확인 필요:** 새 job은 추가만 했고 `release-gate`의 `needs`에는 넣지 않았다(기존 job 수정 금지 지시) — required로 만들려면 오케스트레이터가 `release-gate.needs`에 `grpc-proto-buf`를 추가해야 한다 |
|
||||
| P5-new-2 | 완료 | `6df06c6f`. `GrpcMethodName` 생성자가 `parse`와 같은 전체 256자 한도 적용(`src/grpc/grpc-core-api/src/main/java/dev/caskeleton/grpc/core/GrpcMethodName.java:31`). `GrpcCoreIdentifiersTest.constructedMethodNameLongerThanTheParseLimitIsRefused` FAIL(`Expecting actual not to be null` — 308자 이름이 생성됨) → PASS |
|
||||
| P5-new-3 | 완료 | `6df06c6f`. `completeDrain(GrpcCredentialGeneration drained)`가 대상 세대가 지금 draining인 경우에만 CAS로 지우고 boolean 반환(`src/grpc/grpc-runtime/src/main/java/dev/caskeleton/grpc/security/GrpcCredentialRotationManager.java:134`, W2 커밋 시점 경로는 `grpc-policy`). `GrpcCredentialRotationManagerTest.completingAnOlderDrainLeavesTheNewerDrainInPlace` FAIL(`Expecting Optional to contain: GrpcCredentialGeneration[generation=2, …] but was empty.`) → PASS. 경합 테스트·`GrpcTlsProfileTest` 호출부 갱신 |
|
||||
| P5-new-4 | 완료 | `e2397d2f`. bootstrap이 `grpc-advanced`로 합쳐져 resilience/edition/streaming/diagnostics의 `api project(':grpc-advanced:grpc-advanced-bootstrap')`가 사라졌고, compat의 bootstrap 의존(main 사용 0)과 registry edge 삭제 |
|
||||
| NEW-15 | 완료 | `e2397d2f`. `hyeonworks` → `caskeleton`: proto 디렉터리 `src/grpc/grpc-contract/src/main/proto/caskeleton/grpc/common/v1/`, `package caskeleton.grpc.common.v1`, `java_package caskeleton.grpc.common.v1.generated`, Edition fixture, 테스트 문자열 전부(기계적 치환). `GrpcProtoStyleManifest`·`GrpcCodegenManifest`는 S7-#13으로 삭제돼 organization 필드 자체가 없다. `AGENTS.md` 「템플릿 재사용 체크리스트」 2번에 proto 조직 이름 한 줄. `src/grpc/**`·`src/grpc-advanced/**`에 `hyeonworks` 0건. 과거 리뷰·계획 문서(`docs/reviews/**`, `docs/*-superpowers-package/**`, 7월 계획)의 언급은 이력이라 두었다 |
|
||||
|
||||
## 제거된 코드
|
||||
| 대상 | 경로 | 마지막으로 존재한 커밋 | 이유 |
|
||||
|---|---|---|---|
|
||||
| `grpc-policy` leaf | `src/grpc/grpc-policy` | `6d27356e` | 병합: → `grpc-runtime`(S7-#3) |
|
||||
| `grpc-server` leaf | `src/grpc/grpc-server` | `6d27356e` | 병합: → `grpc-runtime`(S7-#3) |
|
||||
| `grpc-client` leaf | `src/grpc/grpc-client` | `6d27356e` | 병합: → `grpc-runtime`(S7-#3) |
|
||||
| `grpc-discovery` leaf | `src/grpc/grpc-discovery` | `6d27356e` | 병합: → `grpc-runtime`(S7-#3) |
|
||||
| `grpc-admin` leaf | `src/grpc/grpc-admin` | `6d27356e` | 병합: → `grpc-runtime`(S7-#3) |
|
||||
| `grpc-proto-contract` leaf (`.proto`는 이동) | `src/grpc/grpc-proto-contract` | `6d27356e` | 병합: → `grpc-contract`. `.proto` 두 파일은 `grpc-contract/src/main/proto/caskeleton/…`로 이동, 나머지는 삭제(S7-#13) |
|
||||
| `GrpcProtoContractValidator`, `GrpcProtoStyleManifest`, `GrpcProtoRuleViolation` + 테스트 | `src/grpc/grpc-proto-contract/src/main/java/dev/caskeleton/grpc/contract/` | `6d27356e` | regex `.proto` 파서·style 규칙 재구현 — protoc + Buf lint로 대체(결정 18) |
|
||||
| `buf.gen.yaml`, `buf.lock`, 구 `buf.yaml` | `src/grpc/grpc-proto-contract/src/main/resources/proto/` | `6d27356e` | 명세용 파일. 생성은 Gradle protobuf 플러그인, 설정은 `src/grpc/grpc-contract/buf.yaml` |
|
||||
| `grpc-codegen` leaf 전체(`GrpcBufPolicy`, `GrpcBreakingCategory`, `GrpcCodegenManifest`, `GrpcCodegenOutput`, `GrpcGeneratedPackagePolicy`, `GrpcDescriptorArtifact`, `GrpcConsumerFixture`, `GrpcSchemaArtifactPublisher`, `GrpcSchemaBaseline` + 테스트·consumer fixture) | `src/grpc/grpc-codegen` | `6d27356e` | Buf lint/breaking·codegen 소유 규칙의 Java 재구현 — Buf(CI)·protobuf 플러그인으로 대체(결정 18) |
|
||||
| `grpc-advanced-bootstrap` leaf | `src/grpc-advanced/grpc-advanced-bootstrap` | `6d27356e` | 병합: → `grpc-advanced`(S7-#3) |
|
||||
| `grpc-advanced-edition` leaf | `src/grpc-advanced/grpc-advanced-edition` | `6d27356e` | 병합: → `grpc-advanced`(S7-#3); `compatibility.proto`는 test resources로 |
|
||||
| `grpc-advanced-streaming` leaf | `src/grpc-advanced/grpc-advanced-streaming` | `6d27356e` | 병합: → `grpc-advanced`(S7-#3) |
|
||||
| `grpc-advanced-resilience` leaf | `src/grpc-advanced/grpc-advanced-resilience` | `6d27356e` | 병합: → `grpc-advanced`(S7-#3) |
|
||||
| `grpc-advanced-diagnostics` leaf | `src/grpc-advanced/grpc-advanced-diagnostics` | `6d27356e` | 병합: → `grpc-advanced`(S7-#3) |
|
||||
| `GrpcStreamProfile` | `src/grpc/grpc-policy/src/main/java/dev/caskeleton/grpc/streaming/GrpcStreamProfile.java` | `6d27356e` | 테스트에서만 쓰였고 `GrpcFlowControlPolicy`의 256/8 MiB를 복제(N-10b) |
|
||||
| `GrpcAuthenticationPolicy.isAuthenticated(Metadata)` | `src/adapter/inbound/grpc/src/main/java/dev/caskeleton/adapter/inbound/grpc/GrpcAuthenticationPolicy.java` | `6d27356e` | `authenticate(Metadata): Optional<Principal>`로 교체(K-10a) |
|
||||
| `GrpcCredentialRotationManager.completeDrain()`(무인자) | `src/grpc/grpc-policy/src/main/java/dev/caskeleton/grpc/security/GrpcCredentialRotationManager.java` | `6d27356e` | `completeDrain(GrpcCredentialGeneration)`로 교체(P5-new-3) |
|
||||
|
||||
`docs/capability-status.md`(고치지 말 파일)에 옛 leaf 이름 6곳(`grpc-policy` 등)이 남아 있다 — 오케스트레이터가 「제거된 코드」 표를 옮길 때 함께 갱신 필요.
|
||||
|
||||
## 새로 발견한 결함
|
||||
- `P17-new-1` — `src/grpc/grpc-core-api/src/main/java/dev/caskeleton/grpc/api/policy/GrpcMethodPolicy.java`(`readOnlyUnary`·`nonIdempotentUnary`): 기본 method 한도가 4 MiB인데 기본 server profile(`GrpcServerProfile.stableNetty`, starter bean)은 1 MiB 초과를 거부해, 기본값만으로 만든 method가 전송이 깨는 크기를 약속했다. N-10a의 validator 규칙이 드러냈고(`aCoherentConfigurationStarts` FAIL), 기본값을 `GrpcTransportLimits.DEFAULT_MAX_MESSAGE_BYTES`(1 MiB)로 맞춰 **고침**.
|
||||
- `P17-new-2` — `src/grpc/grpc-spring-boot-starter/build.gradle`(및 이전 advanced leaf들): `ca.platform-module`이라 gRPC BOM이 없는데 versionless `io.grpc:grpc-api`를 전이로 받아, lockfile을 새로 쓰면 `Could not find io.grpc:grpc-api:.`로 해석이 실패한다(기존 lockfile이 있을 때만 통과). `ca.grpc-platform-module`로 바꿔 **고침**.
|
||||
|
||||
## 실행한 검증
|
||||
- `./gradlew -p optional-platforms clean ci --max-workers=2` — BUILD SUCCESSFUL, 단위 테스트 564건 통과(실패 0). 포함: 전 leaf `check`, `qualityCheck`(SpotBugs), `architectureCheck`(registry direction·ignored sources).
|
||||
- `./gradlew -p optional-platforms integrationCheck` — gRPC ledger PG lane(`grpc-operation-ledger-jpa:integrationTest`, Testcontainers PostgreSQL) 18건 통과.
|
||||
- `./gradlew -p optional-platforms verifyDependencyLocks` — 9 leaf 통과.
|
||||
- `./gradlew -p optional-platforms :grpc:grpc-contract:check --warning-mode=fail --rerun-tasks` — protobuf 플러그인 0.10.0 deprecation 경고 없음.
|
||||
- `./gradlew architectureCheck :adapter:inbound:grpc:check :adapter:inbound:grpc:grpcTransportQualificationTest :adapter:inbound:grpc:verifyDependencyLocks --max-workers=2` — 통과.
|
||||
- buf 1.73.0(scratchpad): `buf lint`, `buf build`, `buf breaking`(자기 커밋 대비) exit 0; CI step의 "baseline에 모듈 없음 → skip" 분기를 `git cat-file`로 확인.
|
||||
- 실행하지 않음: env 키·공개 HTTP 경로·API surface는 바뀌지 않아 `verifyEnvKeys`/`verifyPublicPathSnapshot` 생략. 루트 build-logic은 건드리지 않음(P16).
|
||||
@@ -469,7 +469,7 @@ Wave 1–2 구현 중 나온 질문에 대해 받은 7건(2026-09-28):
|
||||
| K-7 | Required | `WebSocketSessionRegistry` register/deregister 경쟁으로 actor당 상한 초과 | 해당 없음(코드 삭제) | 제거 표 「platform catalog·정책 패키지 … `session` …」(K#7 명시) | - | - |
|
||||
| K-8 | Consider | conflation 교체가 연결당 상한을 건너뛰고 손실을 `CONFLATED`로 보고 | 완료 | `src/adapter/inbound/websocket/src/main/java/dev/caskeleton/adapter/inbound/websocket/outbound/OutboundQueue.java:192-210`(로컬·전역 둘 다 검사, 실패 시 `DROPPED`), 테스트 `OutboundQueueTest.conflationThatDoesNotFitTheConnectionBoundIsReportedAsDropped`. 커밋 `6d27356e` | - | - |
|
||||
| K-9 | Consider | `WebSocketCorrelationRegistry.countFor`가 노드 전체 in-flight를 요청마다 순회 | 해당 없음(코드 삭제) | 제거 표 「platform catalog·정책 패키지 … `handler` …」, 현재 websocket main에 `handler/` 없음 | - | - |
|
||||
| K-10a | Consider | gRPC 인증 정책이 yes/no만 반환해 식별자를 `Context`로 넘기지 못함 | 남음 | `src/adapter/inbound/grpc/src/main/java/dev/caskeleton/adapter/inbound/grpc/GrpcAuthenticationPolicy.java:16`(`boolean isAuthenticated(Metadata)`) | W3 | `Optional<Principal> authenticate(Metadata)`로 바꾸고 인터셉터가 `Context.Key`에 담아 `Contexts.interceptCall` |
|
||||
| K-10a | Consider | gRPC 인증 정책이 yes/no만 반환해 식별자를 `Context`로 넘기지 못함 | 완료 | Wave 3 W3-P17 (Wave 3 라운드 1 커밋): `119b25b7`. `GrpcAuthenticationPolicy`가 `Optional<Principal> authenticate(Metadata)`(`src/adapter/inbound/grpc/src/main/java/dev/caskeleton/adapter/inbound/grpc/GrpcAuthenticationPolicy.java:20`), 인터셉터가 `Context.Key`에 담아 `Contexts.interceptCall`(`GrpcAuthenticationInterceptor.java:40`), handler는 새 `GrpcAuthenticatedCaller.current()`로 읽는다. `null` 반환은 fail-closed. status/trailer 매핑(`call.close(...)`·`GrpcStatusMapper`)은 바꾸지 않았다(P15 영역). 테스트: `GrpcP1BoundaryWireTest.theAuthenticatedCallerReachesTheFeatureHandlerThroughTheGrpcContext`(실제 loopback Netty로 handler가 principal 이름을 응답), `GrpcAuthenticationInterceptorTest.aPolicyReturningNullIsRejectedAsUnauthenticated`. API 변경이라 FAIL 단계는 컴파일 실패(구 `isAuthenticated` 계약에 식별자 경로 없음). `:adapter:inbound:grpc:check`·`grpcTransportQualificationTest` 통과. CLAUDE.md·README 문구 갱신 | - | `Optional<Principal> authenticate(Metadata)`로 바꾸고 인터셉터가 `Context.Key`에 담아 `Contexts.interceptCall` |
|
||||
| K-10b | Consider | gRPC 인증 정책 예외를 로그 없이 삼킴 | 완료 | Wave 1–2 P5 (fcddab7e·Wave 2 커밋): `GrpcAuthenticationInterceptorTest.aThrowingPolicyIsLoggedWithItsTypeAndMethodButNotItsMessage` FAIL(출력 `""`)→PASS. 예외 타입·메서드만 WARN, 메시지(자격 증명 가능)는 남기지 않음 `src/adapter/inbound/grpc/src/main/java/dev/caskeleton/adapter/inbound/grpc/GrpcAuthenticationInterceptor.java:44`. 커밋 `a498ad84` | - | 예외 타입·메서드명만 WARN 로그(자격 증명 제외) 후 UNAUTHENTICATED |
|
||||
| K-11a | Consider | live STOMP inbound/outbound 채널 executor queue가 무제한(`Integer.MAX_VALUE`) | 완료 | Wave 1–2 P5 (fcddab7e·Wave 2 커밋): `WebSocketAutoConfigurationTest.clientChannelExecutorsAreBoundedByTheConfiguredQueueCapacity` FAIL(`[(2147483647, false), (2147483647, false)]` ≠ `[(64, true), (64, true)]`)→PASS. inbound·outbound 둘 다 스레드 CPU×2 고정(core=max), 큐 `app.websocket.channel-queue-capacity`(기본 10000, `@Positive`) `src/adapter/inbound/websocket/src/main/java/dev/caskeleton/adapter/inbound/websocket/stomp/WebSocketConfig.java:74,83`, `.../stomp/WebSocketSettings.java:32`. 새 env 키 `APP_WEBSOCKET_CHANNEL_QUEUE_CAPACITY`(`docs/registries/env-keys.yaml`, `src/.env.example`), `verifyEnvKeys` 통과. 커밋 `b39d3de0` | - | `registration.taskExecutor().corePoolSize/maxPoolSize/queueCapacity(n)`을 inbound·outbound 둘 다 설정(`WebSocketSettings`에서 값) |
|
||||
| K-11b | Consider | 동기 `@EventListener` 브로드캐스트가 구독자 수만큼 발행 스레드에서 fan-out | 남음 | `src/adapter/inbound/websocket/src/main/java/dev/caskeleton/adapter/inbound/websocket/stomp/LiveEventStompBroadcaster.java:57-87` | W3 | best-effort(R1) 문서 기준이면 브로커 채널에 executor를 두거나(`configureMessageBroker`의 `brokerChannel` taskExecutor) 리스너를 비동기로 |
|
||||
@@ -522,12 +522,12 @@ Wave 1–2 구현 중 나온 질문에 대해 받은 7건(2026-09-28):
|
||||
| N-8a | Consider | envoy 참조 설정의 `DownstreamTlsContext`에 인증서가 없음 | 완료 | Wave 1–2 P5 (fcddab7e·Wave 2 커밋): 실제 Envoy v1.31 `--mode validate`: 수정 전 `No TLS certificates found for server context`, 수정 후 `configuration ... OK`(임시 자체서명 인증서를 placeholder 경로에 마운트). `GrpcWebCompatibilityTest.theReferenceProxyTerminatesTlsWithACertificate` FAIL→PASS. `src/grpc-advanced/grpc-advanced-compat/src/main/resources/envoy/envoy.yaml:62`. 커밋 `a498ad84` | - | 인증서 경로 placeholder를 넣고 `envoy --mode validate` 통과 확인 |
|
||||
| N-8b | Consider | CORS header 목록이 실제 gRPC trailer와 다름(`expose_headers`에 `error-code,error-category`, 실제는 `error-reason`·`error-execution-id`·`completion-outcome`, `grpc-status-details-bin` 없음. `allow_headers`에 `x-user-agent`·`grpc-timeout` 없음) | 완료 | Wave 1–2 P5 (fcddab7e·Wave 2 커밋): `GrpcWebCompatibilityTest.theReferenceProxyExposesEveryTrailerThePlatformSends`(`GrpcErrorMapper`·`GrpcValidationInterceptor` 상수와 대조) FAIL(`error-code,error-category`만 있음)→PASS, `theReferenceProxyLetsTheBrowserSendItsDeadlineAndClientHeaders` FAIL→PASS. `envoy.yaml:41,43` | - | header 목록을 정정하고 `GrpcErrorMapper` 상수와 envoy.yaml을 대조하는 테스트 추가 |
|
||||
| N-8c | Consider | route `timeout: 30s`가 server stream을 30초에 끊음 | 완료 | Wave 1–2 P5 (fcddab7e·Wave 2 커밋): `GrpcWebCompatibilityTest.theReferenceRouteLeavesStreamLengthToTheCallersDeadline` FAIL→PASS. route `timeout: 0s` + `max_stream_duration.grpc_timeout_header_max: 0s` `envoy.yaml:34,36`(Envoy validate 통과) | - | stream route는 `timeout: 0s` + `grpc_timeout_header_max: 0s` |
|
||||
| N-8d | Consider | 참조 설정이 main resources라 jar에 포함, 테스트는 부분 문자열만 확인 | 남음 | `src/grpc-advanced/grpc-advanced-compat/src/main/resources/envoy/envoy.yaml` | W3 | test resources 또는 docs로 이동 |
|
||||
| N-9a | Consider | starter의 `grpc-proto-contract`·`grpc-codegen` 의존이 main에서 안 쓰임 | 남음 | `src/grpc/grpc-spring-boot-starter/build.gradle:21-22` (starter main의 `grpc.contract`·`grpc.codegen` import 0) | W3 | 두 줄과 registry edge 삭제 |
|
||||
| N-8d | Consider | 참조 설정이 main resources라 jar에 포함, 테스트는 부분 문자열만 확인 | 완료 | Wave 3 W3-P17 (Wave 3 라운드 1 커밋): `e2397d2f`. `envoy.yaml`을 `src/grpc-advanced/grpc-advanced-compat/src/test/resources/envoy/envoy.yaml`로(jar에서 빠짐). 같은 이유로 테스트만 읽던 `compatibility.proto`(Edition 2024 fixture)도 `src/grpc-advanced/grpc-advanced/src/test/resources/proto/edition2024/`로. `GrpcWebCompatibilityTest`·`GrpcEdition2024PolicyTest` 통과. P5-new-1(envoy CORS deprecated, W5)은 손대지 않음 | - | test resources 또는 docs로 이동 |
|
||||
| N-9a | Consider | starter의 `grpc-proto-contract`·`grpc-codegen` 의존이 main에서 안 쓰임 | 완료 | Wave 3 W3-P17 (Wave 3 라운드 1 커밋): `e2397d2f`. `src/grpc/grpc-spring-boot-starter/build.gradle`의 proto-contract·codegen 두 줄과 registry edge 삭제(두 leaf 자체도 S7-#13으로 삭제) | - | 두 줄과 registry edge 삭제 |
|
||||
| N-9b | Consider | `requireValid(..., Set.of())`로 advanced 격리 검사가 항상 통과 | 해당 없음(코드 삭제) | Wave 1–2 P5 (fcddab7e·Wave 2 커밋): P5 목록 밖이지만 D 삭제로 함께 닫힘: `validateAdvancedIsolation`과 `stableModuleDependencies` 파라미터 삭제(`GrpcStableBuildInvariant` 삭제에 따른 것). 커밋 `9b296c7c` | - | 파라미터와 `validateAdvancedIsolation` 삭제(격리는 Gradle 방향 게이트가 담당) |
|
||||
| N-9c | Consider | 문서가 `GrpcStableBuildInvariant`가 runtime에 강제한다고 적지만 호출하는 `requireStableStarterIsClean`의 main 호출자 0 | 완료 | Wave 1–2 P5 (fcddab7e·Wave 2 커밋): P5 목록 밖이지만 D에서 함께 닫힘: runtime 강제를 적던 문장을 build-time만으로 정정 `src/grpc/CLAUDE.md`(Stable 범위 절), `src/grpc-advanced/CLAUDE.md:18-19`. 커밋 `9b296c7c` | - | 두 CLAUDE.md에서 "runtime에 강제" 문구 삭제(또는 guard와 함께 삭제) |
|
||||
| N-10a | Consider | 같은 한계값(1 MiB/8192)이 여러 곳에 따로 정의되고 정합 검사 없음(server profile bean의 리터럴 복사 포함) | 남음 | `src/grpc/grpc-server/src/main/java/dev/caskeleton/grpc/server/GrpcServerProfile.java:70-71`, `src/grpc/grpc-spring-boot-starter/src/main/java/dev/caskeleton/grpc/boot/GrpcPlatformAutoConfiguration.java:59-60`, `src/grpc/grpc-policy/src/main/java/dev/caskeleton/grpc/policy/GrpcMessageSizeProfile.java:43`, `src/grpc/grpc-client/src/main/java/dev/caskeleton/grpc/client/GrpcNamedChannelProfile.java:80-81,95-96`, `src/grpc/grpc-core-api/src/main/java/dev/caskeleton/grpc/api/context/GrpcMetadataBudget.java:33` | W3 | 상수를 `GrpcTransportLimits` 한 곳으로, starter bean은 `GrpcServerProfile` 팩토리 재사용, validator에 "method profile ≤ server profile" |
|
||||
| N-10b | Consider | `GrpcStreamProfile`은 테스트에서만 쓰이고 `GrpcFlowControlPolicy`의 256/8MiB를 복제 | 남음 | `src/grpc/grpc-policy/src/main/java/dev/caskeleton/grpc/streaming/GrpcStreamProfile.java:40,45` (참조는 `GrpcStreamEnvelopeTest`뿐), `src/grpc/grpc-policy/src/main/java/dev/caskeleton/grpc/streaming/GrpcFlowControlPolicy.java:43` | W3 | `GrpcStreamProfile`과 그 테스트 참조 삭제 |
|
||||
| N-10a | Consider | 같은 한계값(1 MiB/8192)이 여러 곳에 따로 정의되고 정합 검사 없음(server profile bean의 리터럴 복사 포함) | 완료 | Wave 3 W3-P17 (Wave 3 라운드 1 커밋): `e2397d2f`. 기본 한도 상수를 `src/grpc/grpc-core-api/src/main/java/dev/caskeleton/grpc/api/policy/GrpcTransportLimits.java` 한 곳으로(메시지 1 MiB, metadata 8 KiB); `GrpcServerProfile`·`GrpcNamedChannelProfile`·`GrpcMessageSizeProfile`·`GrpcMetadataBudget`·`GrpcMethodPolicy` 기본값이 이 상수를 쓴다. `GrpcServerProfile.stable(transport, executor)` 팩토리 추가(`src/grpc/grpc-runtime/src/main/java/dev/caskeleton/grpc/server/GrpcServerProfile.java:76`), starter bean이 재사용(`GrpcPlatformAutoConfiguration.java:56`). validator가 "method inbound 한도 ≤ server 한도" 검사(`GrpcPlatformStartupValidator.java:125`, 입력에 `GrpcServerProfile` 추가). `GrpcPlatformStartupValidatorTest.aMethodBoundAboveTheServerBoundIsRefused` 추가. 이 규칙을 넣자 기존 `aCoherentConfigurationStarts`가 FAIL(`Expecting empty but was: ["method '…/GetDocument' accepts 4194304-byte messages but the server rejects anything over 1048576; …"]`) → `GrpcMethodPolicy` 기본값 4 MiB를 1 MiB로 맞춰 PASS(아래 P17-new-1) | - | 상수를 `GrpcTransportLimits` 한 곳으로, starter bean은 `GrpcServerProfile` 팩토리 재사용, validator에 "method profile ≤ server profile" |
|
||||
| N-10b | Consider | `GrpcStreamProfile`은 테스트에서만 쓰이고 `GrpcFlowControlPolicy`의 256/8MiB를 복제 | 완료 | Wave 3 W3-P17 (Wave 3 라운드 1 커밋): `e2397d2f`. `GrpcStreamProfile`과 `GrpcStreamEnvelopeTest.theDefaultProfileBuffersLiveEventsUntilTheSnapshotCompletes` 삭제. 256/8 MiB는 `GrpcFlowControlPolicy`만 소유 | - | `GrpcStreamProfile`과 그 테스트 참조 삭제 |
|
||||
| N-11a | Consider | ledger claim에서 insert 0행 + 조회 실패를 소유 획득으로 처리 | 완료 | Wave 1–2 P5 (fcddab7e·Wave 2 커밋): `GrpcOperationLedgerRepositoryTest.aConflictWhoseRowVanishedBeforeTheReadIsNotTakenAsOwnership` FAIL(`Expecting actual not to be null`)→PASS. 0행 + 조회 실패면 `IllegalStateException` `src/grpc/grpc-operation-ledger-jpa/src/main/java/dev/caskeleton/grpc/ledger/JpaGrpcOperationLedger.java:58`. PG lane(`integrationCheck`) 18건 통과. 커밋 `a498ad84` | - | 0행인데 조회도 비면 `IllegalStateException` |
|
||||
| N-11b | Consider | `callerFingerprint` 길이 제한이 없어 storageKey가 `VARCHAR(512)`를 넘을 수 있음 | 완료 | Wave 1–2 P5 (fcddab7e·Wave 2 커밋): 리뷰의 "`sha256:` 형식 검증 안 거침"은 틀림(`GrpcOperationIdentity.java:29`가 검사) — 길이만 고침. `GrpcOperationIdentityTest.aCallerFingerprintWiderThanItsLedgerColumnIsRefused`·`anIdentityWhoseStorageKeyWouldNotFitTheLedgerIsRefused` FAIL(`Expecting actual not to be null`)→PASS. V001 컬럼 폭(caller 256, method 256, hash 80, storage key 512)으로 compact constructor에서 거부 `src/grpc/grpc-core-api/src/main/java/dev/caskeleton/grpc/api/ledger/GrpcOperationIdentity.java:24,40`. migration 변경 없음. 커밋 `a498ad84` | - | fingerprint ≤256자 검증 또는 storage key를 해시로 고정 길이화 |
|
||||
| N-12a | Nit | `GrpcClientMessageDeduplicator`가 "constant space"라지만 outcome이 세션 내내 누적, `endSession`이 O(N) `removeIf` | 남음 | `src/grpc-advanced/grpc-advanced-streaming/src/main/java/dev/caskeleton/grpc/advanced/streaming/GrpcClientMessageDeduplicator.java:13,110-112` | W5 | outcome을 세션별 map으로 나눠 `endSession`은 한 번에 제거, javadoc 정정 |
|
||||
@@ -999,7 +999,7 @@ Wave 1–2 구현 중 나온 질문에 대해 받은 7건(2026-09-28):
|
||||
| S7-#1b | Required | 쓰는 곳 없는 `schema-avro`·`schema-protobuf`·`cloudevents`·`claim-check`가 기본 build에 | 남음 | 4개 leaf 유지(`CS:133` "leaf는 유지"), main 345·199·228·418줄, main 참조 0, 각 leaf에 README 없음 | W5 | Wave 3 방침(이동 대신 라이브러리로 유지)대로 각 leaf README에 "라이브러리 API — 서비스 leaf가 `implementation`으로 받음"과 SDK 의존을 적음 |
|
||||
| S7-#1c | Required | starter가 쓰지 않는 cloudevents·claim-check edge, 바인딩만 되는 `Experimental`·`Bridge` 설정 | 완료 | `CS:131`, `CS:133`; `src/messaging/messaging-spring-boot-starter/build.gradle:20-37`에 두 leaf 없음, `6d27356e` | - | - |
|
||||
| S7-#2 | Required | consume 계약 3개, 조립 0 | 남음 | `MessageHandler.java:14`(main 참조 0), `DefaultDeliveryProcessor.java:40-47`(참조 0), `IdempotentMessageHandler.java:21`; `KafkaConsumerRegistrar`(645줄)·`KafkaBatchConsumerRegistrar`(146줄) main 참조 0, 자동 조립 transport는 발행 전용(`KafkaMessagingTransport.java:89` `KAFKA_CONSUMER_NOT_CONFIGURED`) | W3 | 결정(2026-09-25): Kafka 소비 지원 — `MessageHandler<T>` 하나, starter-kafka가 handler bean이 있으면 consumer 조립, 실제 Kafka lane 테스트 |
|
||||
| S7-#3 | Required | grpc 18 leaf를 9 leaf로 | 남음 | `MJ`에 grpc leaf 18개 그대로. io.grpc import main 파일은 `grpc-policy` 4 + `grpc-server` 1(+testkit 6); `src/grpc/grpc-client/build.gradle:12-13` io.grpc api인데 import 0; 미사용 edge `src/grpc/grpc-codegen/build.gradle:13`, `src/grpc-advanced/grpc-advanced-edition/build.gradle:9-11` | W3 | policy+server+client+discovery+admin → `grpc-runtime`, proto-contract+codegen → `grpc-contract`, advanced 5개 → `grpc-advanced`, 미사용 edge 삭제 |
|
||||
| S7-#3 | Required | grpc 18 leaf를 9 leaf로 | 완료 | Wave 3 W3-P17 (Wave 3 라운드 1 커밋): `e2397d2f`. registry의 `optional-grpc` leaf 18 → 9: `grpc-core-api`, `grpc-runtime`(policy+server+client+discovery+admin), `grpc-contract`(proto-contract+codegen 자리), `grpc-observability`, `grpc-operation-ledger-jpa`, `grpc-spring-boot-starter`, `grpc-testkit`, `grpc-advanced`(bootstrap+edition+streaming+resilience+diagnostics), `grpc-advanced-compat`. 패키지 이름은 그대로(import 변경 없음). settings는 registry 구동(`OptionalArchitectureRegistrySettingsPlugin`)이라 `src/optional-platforms/settings.gradle` 변경 불필요, build-logic 무변경. 새 edge 없음, 미사용 edge 삭제: grpc-client의 io.grpc(leaf 합병으로 소멸), codegen→proto-contract, edition→core-api/proto-contract/bootstrap, testkit→proto-contract/codegen. starter·grpc-advanced·compat는 grpc-runtime의 versionless io.grpc api를 받으므로 `ca.grpc-platform-module`(gRPC BOM)로 전환 — 새 leaf로 lockfile을 재생성할 때 BOM 없이 `Could not find io.grpc:grpc-api:.`로 실패해서다(기존 lockfile 값과 동일하게 해석됨). `GrpcPackageOwnershipTest` leaf 목록 갱신. lockfile은 `-p optional-platforms resolveAndLockAll --write-locks`로 재생성 | - | policy+server+client+discovery+admin → `grpc-runtime`, proto-contract+codegen → `grpc-contract`, advanced 5개 → `grpc-advanced`, 미사용 edge 삭제 |
|
||||
| S7-#4 | Required | gate·guard·catalog 같은 governance를 운영 코드로 (≈ N-9) | 완료 | Wave 1–2 P5 (fcddab7e·Wave 2 커밋): 삭제 커밋 `9b296c7c`(P5 D). 상수 gate·guard·catalog·invariant·testkit·문자열 ArchUnit 흉내 삭제(아래 「제거된 코드」). 전부 main 호출자 0이었다. `GrpcRawApiImportRule`·`GrpcApplicationBoundaryRules`는 자기 테스트의 합성 입력만 검사하고 저장소 코드를 검사하지 않아서 테스트로 옮기지 않고 삭제했다(inbound→outbound 규칙은 app-bootstrap ArchUnit `INBOUND_ADAPTERS_DO_NOT_DEPEND_ON_OUTBOUND_ADAPTERS`가 이미 검사). `GrpcResolverSafetyPolicy`는 상수 메서드 2개만 삭제. starter의 항상 통과하던 advanced 격리 검사도 함께 제거 `src/grpc/grpc-spring-boot-starter/src/main/java/dev/caskeleton/grpc/boot/GrpcPlatformStartupValidator.java:41`. 문서 갱신: `src/grpc/CLAUDE.md`, `src/grpc-advanced/CLAUDE.md`, `docs/runbooks/grpc-advanced-capabilities.md`, `docs/compatibility/grpc-advanced-support-matrix.md` | - | 상수 gate·catalog·invariant·testkit 삭제, import 규칙은 ArchUnit 테스트로 |
|
||||
| S7-#5a | Required | `messaging-outbox-jdbc-postgresql`의 Debezium 4개 | 해당 없음(코드 삭제) | `CS:130` | - | - |
|
||||
| S7-#5b | Required | 한 leaf가 relay 로직·PG repository·admin journal을 함께 가짐 | 남음 | `src/messaging/messaging-outbox-jdbc-postgresql/src/main/java/dev/caskeleton/messaging/outbox/`: relay 7클래스 877줄, `JdbcOutboxRepository` 721줄, `JdbcAdminOperationJournal` 326줄; Spring JDBC import 파일 2개. inbox는 6개 중 5개가 stdlib | W3 | `messaging-reliability`(stdlib relay·inbox 로직) + `messaging-reliability-jdbc-postgresql`(Jdbc 3종)으로 재분할 |
|
||||
@@ -1014,7 +1014,7 @@ Wave 1–2 구현 중 나온 질문에 대해 받은 7건(2026-09-28):
|
||||
| S7-#10 | Consider | 미사용 API 타입 (1차 M-9 목록 외) | 남음 | `MessagingException` 서브클래스 24개 중 13개 main 참조 0(Authentication, BrokerUnavailable, Consumer, DeadLetter, HandlerTimeout, HeaderRejected, PublishAmbiguous, PublishRejected, Redrive, RetryExhausted, Routing, Settlement, SettlementUnknown); `MessageHandler`·`KafkaTopologyInspector`·`ReliableMessagePublisher`·`InboxRecord` 참조 0. `RabbitRequestReply`만 삭제로 소멸 | W3 | 삭제(consumer 쪽 타입은 S7-#2 결정에 따름) |
|
||||
| S7-#11 | Consider | `MessagingCapabilities` 위치 boolean 12개 | 남음 | record boolean 12개, `KafkaMessagingTransport.java:62-64` `new MessagingCapabilities(true, …, true)`; 생성 11곳 → 4곳 | W3 | `EnumSet<Capability>`로, 읽지 않는 flag 삭제 |
|
||||
| S7-#12 | Consider | messaging API leaf 병합(core-api+schema-api, admin-api+admin-runtime) | 남음 | 두 쌍 모두 별도 leaf(`MJ`). 기본 build messaging leaf 27 → 21(삭제분만) | W3 | 두 쌍 병합 |
|
||||
| S7-#13 | Consider | `.proto` regex 파서·Buf 규칙 재구현 | 남음 | `GrpcProtoContractValidator.java` 447줄, `grpc-codegen` main 692줄, 근거 주석 `src/grpc/grpc-codegen/build.gradle:8-10`(설계 D5: CLI 없음) | W3 | 결정(2026-09-25): protobuf Gradle 플러그인(protoc) + Buf(CI)로 전환, 자체 `.proto` 파서·Buf 규칙 재구현 삭제 |
|
||||
| S7-#13 | Consider | `.proto` regex 파서·Buf 규칙 재구현 | 완료 | Wave 3 W3-P17 (Wave 3 라운드 1 커밋): `e2397d2f`. 소유자 결정 18대로 `GrpcProtoContractValidator`(regex 파서)·`GrpcProtoStyleManifest`·`GrpcProtoRuleViolation`·`grpc-codegen` 전체(Buf 규칙 재구현, codegen manifest, descriptor/consumer fixture) 삭제. `src/grpc/grpc-contract/build.gradle`: `com.google.protobuf` 플러그인(카탈로그 `protobufPlugin = "0.10.0"`, `libs.plugins.protobuf`), protoc·runtime은 `protobufGrpc`(3.25.5, gRPC BOM 1.68.1과 같은 줄) — `libs.protoc`, `libs.protobuf.java.grpc` 추가. 생성 코드는 Spotless target·Checkstyle·Error Prone에서 이 leaf만 제외, SpotBugs(qualityCheck)는 통과. protoc tool locator 설정은 locking 해제(정확 버전 좌표라 lock이 같은 값을 반복). `src/grpc/grpc-contract/buf.yaml`(STANDARD lint, FILE breaking). CI: `.github/workflows/ci-quality-gates.yml` job `grpc-proto-buf`(`bufbuild/buf-action` SHA 고정, `buf lint` + baseline에 모듈이 있으면 `buf breaking`, 없으면 notice 후 skip). 로컬 검증: buf 1.73.0 바이너리를 scratchpad에 받아 `buf lint`·`buf build`·`buf breaking --against '../../../.git#ref=e2397d2f,subdir=src/grpc/grpc-contract'` 모두 exit 0. 테스트 `GrpcContractGeneratedCodeTest`(생성 message wire 왕복·explicit presence, 패키지 disjoint). testkit `GrpcStableReleaseGate.evaluate`의 schema 입력은 `PublishDecision` 대신 `List<String> schemaBreakages`(buf breaking 결과). ADR-GRPC-002를 superseded로 표시, 설계서에 변경 주석. **통합 시 확인 필요:** 새 job은 추가만 했고 `release-gate`의 `needs`에는 넣지 않았다(기존 job 수정 금지 지시) — required로 만들려면 오케스트레이터가 `release-gate.needs`에 `grpc-proto-buf`를 추가해야 한다 | - | 결정(2026-09-25): protobuf Gradle 플러그인(protoc) + Buf(CI)로 전환, 자체 `.proto` 파서·Buf 규칙 재구현 삭제 |
|
||||
| S7-#14 | Consider | 패키지·leaf 이름 불일치, 등급 용어 4개 | 남음 | `src/grpc/grpc-policy/src/main/java/dev/caskeleton/grpc/{resilience,streaming}`(leaf `grpc-advanced-resilience`/`-streaming`과 이름 겹침); `CapabilityTier`(messaging-policy), `CompatibilityMatrix`(messaging-testkit), `GrpcCapabilityGrade`(grpc-advanced-bootstrap), `GrpcEvidenceGrade`(grpc-testkit) | W3 | S7-#3 병합 때 패키지 = leaf 이름으로 맞추고 등급 용어 하나로 |
|
||||
| S7-#15a | Consider | 리뷰 ID 주석 | 남음 | `MSG-INT-003` 9곳 그대로(예: `MS/MessagingCoreAutoConfiguration.java:370,442,480`, `DeclaredDestinationAccess.java:11`, `RegisteredMessageCodecs.java:12`) | W5 | ID 삭제, 이유만 남김 |
|
||||
| S7-#15b | Consider | 이력 주석·inline FQN | 남음 | "used to/no longer" 58 → 52줄; inline FQN 약 218줄(`KafkaConsumerRegistrar` 34) | W5 | 이력 문장 삭제, OpenRewrite `ShortenFullyQualifiedTypeReferences` |
|
||||
@@ -1119,22 +1119,22 @@ Wave 1–2 구현 묶음(`P1`–`P13`)이 작업 중 찾은 결함과 통합 검
|
||||
| P1-new-2 | 발견 | `src/messaging/messaging-kafka/src/main/java/dev/caskeleton/messaging/kafka/KafkaConsumerRegistrar.java` — in-flight 천장·drain·pool 거부로 pause한 partition을 다시 resume하는 코드가 없음. ordered partition은 한 poll에 두 record를 받으면 첫 record 뒤 영구 정지… | 완료 | Wave 1–2 P1 (fcddab7e·Wave 2 커밋): 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P1.md` | - | - |
|
||||
| P1-new-3 | 발견 | 같은 파일 — requeue 재개 시각을 `Instant.now()`로, poll은 호출자가 준 `now`로 비교해 두 시계가 섞임(테스트에서 재시도가 영원히 안 풀리거나 즉시 풀림). `InstantSource` 하나로 통일(M-7 수정에 포함) | 완료 | Wave 1–2 P1 (fcddab7e·Wave 2 커밋): 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P1.md` | - | - |
|
||||
| P2-new-1 | 발견 | managed `publish`가 SCAN_CLEAN destination에서 scan 없이 게시한다 — `RoutingObjectMutationAdapter.publish`가 INTEGRITY_VERIFIED에서 곧바로 REFERENCE_PUBLISH_IN_PROGRESS로 가고 `requirePolicy`는 요구 수준이 같은지만 봤다. 이제 scan-gated destination이면 거부한다(`confi… | 완료 | Wave 1–2 P2 (fcddab7e·Wave 2 커밋): 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P2.md` | - | - |
|
||||
| P2-new-2 | 발견 | sample abort와 reconcile의 경합에서 intent가 멈춘다 — `AbortPosterImageUploadUseCase`(`sample-portfolio/.../poster/AbortPosterImageUploadUseCase.java:63-81,91`)는 DB에 ABORT_AUTHORIZED를 먼저 커밋한 뒤 저장소에 `authorizeAbort`를 부른다. 그 사이 reconcile이 fin… | 남음 | 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P2.md` | W2 | 결정 22: 먼저 끝난 쪽이 이긴다 — 이미 게시됐으면 abort는 409, 게시된 객체를 붙인다 |
|
||||
| P2-new-3 | 발견 | S3 managed provider `retire`가 항상 UNSUPPORTED를 던진다(`s3/S3ManagedObjectProvider.java:121-125`). S3 profile은 `CONDITIONAL_RETIREMENT`를 주장할 수 있어 destination 컴파일은 통과한다. D-1a 순서에서 S3 abort는 ABORTED를 기록한 뒤 retire에서 실패한다(바이트 잔존, 재시도도 같은 실… | 남음 | 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P2.md` | W2 | S3 `retire` 구현 또는 S3 profile이 `CONDITIONAL_RETIREMENT`를 주장하지 못하게 |
|
||||
| P2-new-2 | 발견 | sample abort와 reconcile의 경합에서 intent가 멈춘다 — `AbortPosterImageUploadUseCase`(`sample-portfolio/.../poster/AbortPosterImageUploadUseCase.java:63-81,91`)는 DB에 ABORT_AUTHORIZED를 먼저 커밋한 뒤 저장소에 `authorizeAbort`를 부른다. 그 사이 reconcile이 fin… | 완료 | Wave 2.5 W2-P14 (Wave 3 라운드 1 커밋): 결정 22. `PosterImageAbortReconcileRaceTest`(sample test) — `aPublicationThatFinishesAfterTheAbortWasAuthorizedIsAttached` FAIL(`IllegalStateException: publication intent handoff changed before TX3`)→PASS, `anAbortAuthorizedIntentWhoseObjectWasPublishedIsAttachedByTheNextReconcile` FAIL(`Poster image publication is not ready to reconcile`)→PASS, `anAbortThatArrivesAfterThePublicationIsAConflict` FAIL(예외 없음, 저장소 abort 진행)→PASS, `anAbortOfAnUploadAlreadyAttachedIsAConflict` 신규 PASS. `DomainExceptionHandlerTest.anAbortThatLostToThePublicationIsA409Conflict` PASS. 수정: 저장소 `kernel/ObjectPublicationHandoffService.java:117-125` `authorizeAbort`가 게시된 operation에 예외 대신 `REJECTED`/`CONFLICT` receipt(수정 전에는 `IllegalStateException`이라 sample이 "이미 게시됨"을 다른 장애와 구분할 수 없었음; D-1b 테스트 `StagedObjectPublicationLifecycleTest$AuthorizeAbort.authorizeAbortIsRejectedOnceTheReferenceIsPublished`를 receipt 단언으로 갱신). `AbortPosterImageUploadUseCase.java:83-87,99-105` READY/SUPERSEDED intent나 REJECTED receipt면 `PosterImageAlreadyPublishedException`(409 `POSTER_IMAGE_ALREADY_PUBLISHED`, `DomainExceptionHandler`), 아무것도 지우지 않고 intent는 ABORT_AUTHORIZED로 둠. `ReconcilePosterImageUploadUseCase.java:103,145,166`와 `PosterImageUploadIntent.requirePublishable`(ready/superseded)가 ABORT_AUTHORIZED도 받아 게시된 객체를 붙임(저장소가 abort를 먼저 받았으면 finalize가 거부돼 abort가 이김). 실제 PG `:sample-portfolio:integrationTest` 49/49 | - | 결정 22: 먼저 끝난 쪽이 이긴다 — 이미 게시됐으면 abort는 409, 게시된 객체를 붙인다 |
|
||||
| P2-new-3 | 발견 | S3 managed provider `retire`가 항상 UNSUPPORTED를 던진다(`s3/S3ManagedObjectProvider.java:121-125`). S3 profile은 `CONDITIONAL_RETIREMENT`를 주장할 수 있어 destination 컴파일은 통과한다. D-1a 순서에서 S3 abort는 ABORTED를 기록한 뒤 retire에서 실패한다(바이트 잔존, 재시도도 같은 실… | 완료 | Wave 2.5 W2-P14 (Wave 3 라운드 1 커밋): 두 번째 선택지(주장 금지). `S3ProviderBindingTest.aProfileCannotClaimRetirementTheManagedS3ProviderDoesNotImplement` FAIL(`Expecting actual not to be null`)→PASS. `s3/S3ProviderBinding.java:199-206` profile이 `CONDITIONAL_RETIREMENT`를 주장하면 바인딩 거부. retire 구현은 S3 readiness 근거가 없어 하지 않음. 결과: 기본 요구 집합(CONDITIONAL_RETIREMENT 포함)의 S3 destination은 시작 시 거부된다 — `S3ProviderCompositionTest` destination은 명시 요구 집합으로 바꿈 | - | S3 `retire` 구현 또는 S3 profile이 `CONDITIONAL_RETIREMENT`를 주장하지 못하게 |
|
||||
| P3-new-1 | 발견 | `ntf-app/admin/AdminAuthorizationGuard.java` `requireTenant`가 어떤 작업이든 거부 시 `AdminAccessDeniedException(SUPPRESS)`를 던졌다 — redrive·reconcile 거부가 SUPPRESS 권한 부족으로 보고됨. 실제 권한을 인자로 받게 고침(`:41`). | 완료 | Wave 1–2 P3 (fcddab7e·Wave 2 커밋): 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P3.md` | - | - |
|
||||
| P3-new-2 | 발견 | SNS 서명 인증서의 유효기간을 확인하지 않았다(`NotificationCallbackProviderConfig.java:80` `checkValidity()` 추가, B-2e와 함께). | 완료 | Wave 1–2 P3 (fcddab7e·Wave 2 커밋): 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P3.md` | - | - |
|
||||
| P3-new-3 | 발견 | JDK HttpClient의 요청 timeout은 응답 body 읽기를 덮지 않는다. B-6 재현 테스트의 FAIL이 증거다(요청 timeout 10초가 지나도 body 대기가 끝나지 않아 JUnit 20초 timeout). 상한 전까지 body를 조금씩 흘리는 provider(또는 SNS 인증서 host)는 dispatch 스레드를 무기한 잡을 수 있다. 위치 `ntf-adapter/provider/http… | 남음 | 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P3.md` | W2 | 응답 body 읽기에 별도 deadline |
|
||||
| P3-new-3 | 발견 | JDK HttpClient의 요청 timeout은 응답 body 읽기를 덮지 않는다. B-6 재현 테스트의 FAIL이 증거다(요청 timeout 10초가 지나도 body 대기가 끝나지 않아 JUnit 20초 timeout). 상한 전까지 body를 조금씩 흘리는 provider(또는 SNS 인증서 host)는 dispatch 스레드를 무기한 잡을 수 있다. 위치 `ntf-adapter/provider/http… | 완료 | Wave 2.5 W2-P14 (Wave 3 라운드 1 커밋): `JdkNotificationHttpGatewaySecurityTest.aResponseBodyThatStallsBelowTheCapEndsAtTheRequestTimeout` FAIL(`TimeoutException: ... timed out after 15 seconds`)→PASS. `provider/http/JdkNotificationHttpGateway.java:81,88,167` 요청 timeout의 남은 시간을 body 읽기 deadline으로 걸고, 넘기면 daemon 타이머가 stream을 닫아 `RESPONSE_TIMEOUT`(body committed=true). SNS 인증서 fetch도 같은 gateway를 씀 | - | 응답 body 읽기에 별도 deadline |
|
||||
| P3-new-4 | 발견 | SES adapter도 B-9a와 같은 결함(비 email 연락처·reveal 실패가 ambiguous로 기록). 공용 `EmailRecipients`로 SMTP와 함께 고침. | 완료 | Wave 1–2 P3 (fcddab7e·Wave 2 커밋): 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P3.md` | - | - |
|
||||
| P3-new-5 | 발견 | 라우트의 profile runtime이 사라진 경우 `gateway.profile()`이 `IllegalStateException`(`ntf-adapter/dispatch/ProviderRuntimeRegistry.java:50`)을 던져 B-3과 같은 경로(attempt row 전, lease 미해제 → requeue 반복)를 탄다. 설정 drift라 "고쳐질 때까지 재시도"로 볼 수도 있어 FAILED로 … | 남음 | 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P3.md` | W2 | 결정 21: 일반 재시도 정책(backoff·최대 횟수) 적용 후 FAILED + 사유 코드 |
|
||||
| P3-new-6 | 발견 | dispatch의 guard `Blocked` 전이와 routing stop 전이(`ntf-app/dispatch/NotificationDispatchService.java:138-142`, `applyRoutingStop`)는 lease fencing 없는 `transition`을 쓴다(B-5b와 같은 계열). provider 호출 전 짧은 구간이라 위험은 낮다. | 남음 | 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P3.md` | W2 | guard `Blocked`·routing stop 전이를 lease fencing 있는 전이로 |
|
||||
| P3-new-5 | 발견 | 라우트의 profile runtime이 사라진 경우 `gateway.profile()`이 `IllegalStateException`(`ntf-adapter/dispatch/ProviderRuntimeRegistry.java:50`)을 던져 B-3과 같은 경로(attempt row 전, lease 미해제 → requeue 반복)를 탄다. 설정 drift라 "고쳐질 때까지 재시도"로 볼 수도 있어 FAILED로 … | 완료 | Wave 2.5 W2-P14 (Wave 3 라운드 1 커밋): 결정 21. `RegistryProviderDispatchGatewayTest.aProfileNoRuntimeServesIsAProviderUnavailableFailure` FAIL(`IllegalStateException: no provider runtime registered for the profile`)→PASS; `NotificationDispatchServiceTest.aRouteWhoseProviderProfileIsGoneWaitsForTheRetryBackoff` FAIL(`[FAILED, Optional.empty, 0, ...]`)→PASS, `...FailsOnceTheRetryBudgetIsSpent` PASS. `ntf-adapter/dispatch/RegistryProviderDispatchGateway.java:35` 없는 profile → `ProviderUnavailableException(PROVIDER_UNAVAILABLE, TRANSIENT_PROVIDER)`(port javadoc에 명시). `ntf-app/dispatch/NotificationDispatchService.java:159,236` 일반 `NotificationRetryPolicy`(backoff·`RetryBudget(maxAdditionalAttempts, attemptCount)`·만료)로 RETRY_WAITING+nextDispatchAt, 한도면 FAILED, 어느 쪽이든 fenced `saveHeldBy` 후 lease 해제. attempt row가 없으므로 횟수는 수신자 `attemptCount`로 셈. 사유: 수신자 행에는 실패 코드 열이 없어 `lastFailureCategory=TRANSIENT_PROVIDER`로 남김(코드 `PROVIDER_UNAVAILABLE`은 예외 descriptor에만 있음) | - | 결정 21: 일반 재시도 정책(backoff·최대 횟수) 적용 후 FAILED + 사유 코드 |
|
||||
| P3-new-6 | 발견 | dispatch의 guard `Blocked` 전이와 routing stop 전이(`ntf-app/dispatch/NotificationDispatchService.java:138-142`, `applyRoutingStop`)는 lease fencing 없는 `transition`을 쓴다(B-5b와 같은 계열). provider 호출 전 짧은 구간이라 위험은 낮다. | 완료 | Wave 2.5 W2-P14 (Wave 3 라운드 1 커밋): `NotificationDispatchServiceTest.aGuardBlockWrittenAfterTheLeaseWasLostChangesNothing`·`aRoutingStopWrittenAfterTheLeaseWasLostChangesNothing` FAIL(수신자 행이 바뀜)→PASS. `NotificationDispatchService.java:146`(guard Blocked), `:564`(`applyRoutingStop`)를 `transitionHeldBy(..., lease)`로. 실제 PG `jpaPlatformContractTest` 217/217 | - | guard `Blocked`·routing stop 전이를 lease fencing 있는 전이로 |
|
||||
| P4-new-1 | 발견 | fileserver migration(`src/adapter/outbound/persistence-fileserver/src/main/resources/db/migration/jpa/fileserver/V1..V5`)은 불변성 테스트가 없다. `AppliedMigrationImmutabilityTest`는 persistence-jpa의 `src/main/resources/db/migration`만 읽는다(`s… | 남음 | 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P4.md` | W4 | fileserver migration에도 적용 파일 해시 고정 테스트 |
|
||||
| P4-new-2 | 발견 | 재조정이 READY를 복원할 때 quota를 commit하지 않는다. `src/application-fileserver/.../recovery/DefaultFileReconciliationService.java` `reconcilePrePublishWithKey`는 VERIFYING→READY 전이만 하고 `QuotaCommitGateway.commit`이 없다. C-3a·C-3b로 이 경로가 실제로 실행되므… | 남음 | 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P4.md` | W2 | 재조정 READY 복원 때 quota commit |
|
||||
| P4-new-3 | 발견 | `DefaultFinalizeUploadService.advanceToVerifying`의 CREATED 분기가 CREATED→UPLOADED를 시도하지만 전이표에는 CREATED→UPLOADING뿐이라 `IllegalStateException`이 난다(`.../upload/DefaultFinalizeUploadService.java` `advanceToVerifying` 첫 if). | 남음 | 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P4.md` | W2 | CREATED 분기 전이를 전이표에 맞게 |
|
||||
| P4-new-4 | 발견 | lifecycle delete(`DefaultFileLifecycleService.delete`)로 진행 중 upload(UPLOADING)를 지우면 레코드는 DELETED가 되지만 세션은 ACTIVE로 남고 staging 정리가 예약되지 않는다. 이후 만료 sweep도 레코드가 DELETED라 staging을 예약하지 않아 staged bytes가 남는다. `FileRetirement`에 upload를 찾는… | 남음 | 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P4.md` | W2 | 진행 중 upload 삭제 시 세션 종료·staging 정리 예약 |
|
||||
| P4-new-2 | 발견 | 재조정이 READY를 복원할 때 quota를 commit하지 않는다. `src/application-fileserver/.../recovery/DefaultFileReconciliationService.java` `reconcilePrePublishWithKey`는 VERIFYING→READY 전이만 하고 `QuotaCommitGateway.commit`이 없다. C-3a·C-3b로 이 경로가 실제로 실행되므… | 완료 | Wave 2.5 W2-P14 (Wave 3 라운드 1 커밋): `FileReconciliationServiceTest.restoringReadyCommitsThePublishedBytesToQuota` FAIL(`expected: 10L but was: 0L`, 동작 비활성화로 재현)→PASS, `aPublishWithoutItsUploadSessionIsUnresolvedRatherThanReadyWithoutQuota` PASS. `recovery/DefaultFileReconciliationService.java:160,175` READY 복원과 같은 경계에서 `QuotaCommitGateway.commit`; upload 세션을 못 찾으면 READY를 복원하지 않고 UNRESOLVED(`PUBLISH_UPLOAD_SESSION_ABSENT`). 생성자에 `UploadSessionStore`·`StagingUploadLocator`·`QuotaCommitGateway` 추가, 조립 `FileserverMaintenanceServiceConfiguration`. 실제 PG `postgresqlFileserverReclamationIntegrationTest` 15/15 | - | 재조정 READY 복원 때 quota commit |
|
||||
| P4-new-3 | 발견 | `DefaultFinalizeUploadService.advanceToVerifying`의 CREATED 분기가 CREATED→UPLOADED를 시도하지만 전이표에는 CREATED→UPLOADING뿐이라 `IllegalStateException`이 난다(`.../upload/DefaultFinalizeUploadService.java` `advanceToVerifying` 첫 if). | 완료 | Wave 2.5 W2-P14 (Wave 3 라운드 1 커밋): `FinalizeUploadServiceTest.aRecordStillCreatedIsWalkedThroughUploadingToReady` FAIL(`IllegalStateException: illegal file transition: CREATED -> UPLOADED`)→PASS. `upload/DefaultFinalizeUploadService.java:196-214` CREATED→UPLOADING→UPLOADED | - | CREATED 분기 전이를 전이표에 맞게 |
|
||||
| P4-new-4 | 발견 | lifecycle delete(`DefaultFileLifecycleService.delete`)로 진행 중 upload(UPLOADING)를 지우면 레코드는 DELETED가 되지만 세션은 ACTIVE로 남고 staging 정리가 예약되지 않는다. 이후 만료 sweep도 레코드가 DELETED라 staging을 예약하지 않아 staged bytes가 남는다. `FileRetirement`에 upload를 찾는… | 완료 | Wave 2.5 W2-P14 (Wave 3 라운드 1 커밋): `FileLifecycleServiceTest.deletingAnInProgressUploadEndsItsSessionAndSchedulesItsStagingForCleanup` FAIL(`[false, []]`, 동작 비활성화로 재현)→PASS. `lifecycle/DefaultFileLifecycleService.java:94,109` UPLOADING/UPLOADED/FAILED 레코드 삭제 시 `StagingUploadLocator`로 upload를 찾아 세션 terminate + `CANCELLED_STAGING` 예약(cancel과 같은 규칙). `FileRetirement`은 건드리지 않음(admin 경로는 새로 발견한 결함 참고). fake: `InMemoryUploadSessionStore`가 `StagingUploadLocator`도 구현 | - | 진행 중 upload 삭제 시 세션 종료·staging 정리 예약 |
|
||||
| P5-new-1 | 발견 | `src/grpc-advanced/grpc-advanced-compat/src/main/resources/envoy/envoy.yaml:37`(virtual host `cors`): Envoy v1.31 validate가 `VirtualHost.cors`를 deprecated("will be removed soon")로 경고한다. per-filter `typed_per_filter_config`의 `CorsP… | 남음 | 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P5.md` | W5 | envoy CORS를 per-filter 설정으로 |
|
||||
| P5-new-2 | 발견 | `src/grpc/grpc-core-api/src/main/java/dev/caskeleton/grpc/core/GrpcMethodName.java`: `parse`는 전체 이름을 256자로 제한하지만 생성자는 service·method를 각각 256자로만 제한해 canonical이 최대 513자가 된다. ledger 쪽은 N-11b에서 막았지만 타입 자체의 두 경로가 다르다. 안 고침. | 남음 | 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P5.md` | W2 | `GrpcMethodName` 두 생성 경로의 길이 제한 통일 |
|
||||
| P5-new-3 | 발견 | `src/grpc/grpc-policy/src/main/java/dev/caskeleton/grpc/security/GrpcCredentialRotationManager.java:125` `completeDrain()`이 인자 없이 "지금 draining인 것"을 지워서, 그 사이 새 rotation이 시작한 drain(방금 교체된 세대)을 일찍 끝낼 수 있다. 경합 자체(현재 세대 되돌림)는 N-5b로 고쳤… | 남음 | 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P5.md` | W2 | `completeDrain`이 대상 rotation을 인자로 받게 |
|
||||
| P5-new-4 | 발견 | `src/grpc-advanced/grpc-advanced-{resilience,compat,edition,streaming}/build.gradle`: `api project(':grpc-advanced:grpc-advanced-bootstrap')`를 main이 쓰지 않는다(resilience는 `GrpcXdsStartupGuard` 삭제로 새로 0, 나머지 셋은 원래 0). build 줄과 registr… | 남음 | 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P5.md` | W3 | 쓰지 않는 bootstrap 의존 제거 |
|
||||
| P5-new-2 | 발견 | `src/grpc/grpc-core-api/src/main/java/dev/caskeleton/grpc/core/GrpcMethodName.java`: `parse`는 전체 이름을 256자로 제한하지만 생성자는 service·method를 각각 256자로만 제한해 canonical이 최대 513자가 된다. ledger 쪽은 N-11b에서 막았지만 타입 자체의 두 경로가 다르다. 안 고침. | 완료 | Wave 3 W3-P17 (Wave 3 라운드 1 커밋): `6df06c6f`. `GrpcMethodName` 생성자가 `parse`와 같은 전체 256자 한도 적용(`src/grpc/grpc-core-api/src/main/java/dev/caskeleton/grpc/core/GrpcMethodName.java:31`). `GrpcCoreIdentifiersTest.constructedMethodNameLongerThanTheParseLimitIsRefused` FAIL(`Expecting actual not to be null` — 308자 이름이 생성됨) → PASS | - | `GrpcMethodName` 두 생성 경로의 길이 제한 통일 |
|
||||
| P5-new-3 | 발견 | `src/grpc/grpc-policy/src/main/java/dev/caskeleton/grpc/security/GrpcCredentialRotationManager.java:125` `completeDrain()`이 인자 없이 "지금 draining인 것"을 지워서, 그 사이 새 rotation이 시작한 drain(방금 교체된 세대)을 일찍 끝낼 수 있다. 경합 자체(현재 세대 되돌림)는 N-5b로 고쳤… | 완료 | Wave 3 W3-P17 (Wave 3 라운드 1 커밋): `6df06c6f`. `completeDrain(GrpcCredentialGeneration drained)`가 대상 세대가 지금 draining인 경우에만 CAS로 지우고 boolean 반환(`src/grpc/grpc-runtime/src/main/java/dev/caskeleton/grpc/security/GrpcCredentialRotationManager.java:134`, W2 커밋 시점 경로는 `grpc-policy`). `GrpcCredentialRotationManagerTest.completingAnOlderDrainLeavesTheNewerDrainInPlace` FAIL(`Expecting Optional to contain: GrpcCredentialGeneration[generation=2, …] but was empty.`) → PASS. 경합 테스트·`GrpcTlsProfileTest` 호출부 갱신 | - | `completeDrain`이 대상 rotation을 인자로 받게 |
|
||||
| P5-new-4 | 발견 | `src/grpc-advanced/grpc-advanced-{resilience,compat,edition,streaming}/build.gradle`: `api project(':grpc-advanced:grpc-advanced-bootstrap')`를 main이 쓰지 않는다(resilience는 `GrpcXdsStartupGuard` 삭제로 새로 0, 나머지 셋은 원래 0). build 줄과 registr… | 완료 | Wave 3 W3-P17 (Wave 3 라운드 1 커밋): `e2397d2f`. bootstrap이 `grpc-advanced`로 합쳐져 resilience/edition/streaming/diagnostics의 `api project(':grpc-advanced:grpc-advanced-bootstrap')`가 사라졌고, compat의 bootstrap 의존(main 사용 0)과 registry edge 삭제 | - | 쓰지 않는 bootstrap 의존 제거 |
|
||||
| P6-new-1 | 발견 | `src/adapter/outbound/cache-redis/README.md` 「Useful focused checks」가 `./gradlew :app-bootstrap:test --tests '*RedisSemanticScriptAclProbeTest'`를 안내했지만 그 테스트는 cache-redis leaf에 있다. `:adapter:outbound:cache-redis:test`로 수정. 같은 READ… | 완료 | Wave 1–2 P6 (fcddab7e·Wave 2 커밋): 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P6.md` | - | - |
|
||||
| P6-new-2 | 발견 | `IdempotencyExecutor`(application-core)는 `complete`가 `UNAVAILABLE`이면 곧바로 `IdempotencyUnavailableException`을 던진다(`IdempotencyExecutor.java:228`). 이번 수정으로 SCRIPT lane 포화 시 complete가 `INDETERMINATE`(재조정 경로) 대신 `UNAVAILABLE`을 받으므로, 효과… | 남음 | 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P6.md` | W5 | 결정 24: 현재 동작 유지, README·Javadoc에 복구 경로 명시 |
|
||||
| P7-new-1 | 발견 | `src/adapter/outbound/notification/src/test/java/dev/caskeleton/adapter/outbound/notification/core/NotificationAdapterTest.java:65-82`: `RoutingNotifierTest`와 같은, 절대 실패하지 않는 PII 단언이 있었다(`"provider-failure"`). 고쳤다(W1 `9a05d686`). | 완료 | Wave 1–2 P7 (fcddab7e·Wave 2 커밋): 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P7.md` | - | - |
|
||||
@@ -1142,10 +1142,10 @@ Wave 1–2 구현 묶음(`P1`–`P13`)이 작업 중 찾은 결함과 통합 검
|
||||
| P7-new-3 | 발견 | `src/sample-portfolio/src/main/resources/db/sample-migration/V2__work_log.sql:26-27`의 주석은 "local dev relies on ddl-auto=update"라고 적혀 있다. 실제로는 `SamplePostgreSqlPersistenceConfig.sampleMigrationStrategy`가 sample schema를 migrate한다. 이… | 남음 | 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P7.md` | W5 | 적용된 migration은 못 바꾸므로 sample README에 실제 경로 명시 |
|
||||
| P7-new-4 | 발견 | L-7a로 `show-details: never`가 되면 `show-components`도 따라서 never가 된다. 그러면 `/actuator/health` 응답에 component가 나오지 않는다. P13 `NEW-1a`(compose smoke가 켜진 capability를 확인)는 health component 대신 `info` 경로를 써야 한다. | 완료 | Wave 1–2 P7 (fcddab7e·Wave 2 커밋): 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P7.md` | - | - |
|
||||
| P8-new-1 | 발견 | `GraphQlBatchLoadException`(per-key 실패, adopter가 준 `errorCode`)을 mapper가 모른다 → `INTERNAL_ERROR`로 가려지고 adopter code가 사라짐. `src/adapter/inbound/graphql/src/main/java/dev/caskeleton/adapter/inbound/graphql/dataloader/GraphQlBatchResu… | 남음 | 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P8.md` | W3 | 결정 25: 등록된 `ApiErrorCode`만 노출(3-A와 함께) |
|
||||
| P8-new-2 | 발견 | instrumentation 이 platform context 없이 온 요청(= interceptor 미배선 설정 오류)을 `INTERNAL_ERROR`+`PLATFORM_CONTEXT`로 거부하지만 로그를 남기지 않아, 잘못 조립된 배포가 모든 요청을 조용히 실패시킨다. `.../runtime/GraphQlPlatformInstrumentation.java:65-70`. | 남음 | 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P8.md` | W2 | platform context 없는 요청 거부 시 WARN 로그 |
|
||||
| P8-new-2 | 발견 | instrumentation 이 platform context 없이 온 요청(= interceptor 미배선 설정 오류)을 `INTERNAL_ERROR`+`PLATFORM_CONTEXT`로 거부하지만 로그를 남기지 않아, 잘못 조립된 배포가 모든 요청을 조용히 실패시킨다. `.../runtime/GraphQlPlatformInstrumentation.java:65-70`. | 완료 | Wave 2.5 W2-P14 (Wave 3 라운드 1 커밋): `GraphQlPlatformInstrumentationTest.aRequestWithoutPlatformContextIsLoggedAsAWiringFaultAtWarn` FAIL(`Expected size: 1 but was: 0`)→PASS. `runtime/GraphQlPlatformInstrumentation.java:72` executionId와 함께 WARN. 에러 매퍼는 건드리지 않음 | - | platform context 없는 요청 거부 시 WARN 로그 |
|
||||
| P8-new-3 | 발견 | graphql `CLAUDE.md` 「Error mapping」 절이 없는 클래스 `GraphqlExceptionResolver`와 "비-carrier 예외는 null 반환"을 설명하고 있었음. 현재 경로(한 mapper, 마스킹+로그)로 고침. 커밋 `aa5f4d90`. | 완료 | Wave 1–2 P8 (fcddab7e·Wave 2 커밋): 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P8.md` | - | - |
|
||||
| P8-new-4 | 발견 | 이번 D 삭제 대상(`GraphQlRuntimeTransport`, `GraphQlExecutionProfile`, `GraphQlBlockingBridge`)을 설명하는 학습 문서가 남아 있음 — `docs/study/graphql-walkthrough.ko.md:157,461,871,1078`(결정 6 대상), `docs/graphql-superpowers-package/`. | 남음 | 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P8.md` | W5 | 학습 문서 갱신(결정 6) |
|
||||
| P9-new-1 | 발견 | `InboxItemEntity.archive()`가 EXPIRED·DELETED 항목도 ARCHIVED로 바꾼다(`src/adapter/outbound/persistence-jpa/src/main/java/dev/caskeleton/adapter/outbound/persistence/notification/platform/inbox/InboxItemEntity.java` `archive`). terminal … | 남음 | 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P9.md` | W2 | `archive()`가 EXPIRED·DELETED를 거부 |
|
||||
| P9-new-1 | 발견 | `InboxItemEntity.archive()`가 EXPIRED·DELETED 항목도 ARCHIVED로 바꾼다(`src/adapter/outbound/persistence-jpa/src/main/java/dev/caskeleton/adapter/outbound/persistence/notification/platform/inbox/InboxItemEntity.java` `archive`). terminal … | 완료 | Wave 2.5 W2-P14 (Wave 3 라운드 1 커밋): `InboxItemEntityTest.archiveLeavesAnExpiredOrDeletedItemInItsTerminalState[EXPIRED,DELETED]` FAIL(`[true, "ARCHIVED", ...]`)→PASS. `.../platform/inbox/InboxItemEntity.java:145-146` EXPIRED·DELETED면 no-op(false) | - | `archive()`가 EXPIRED·DELETED를 거부 |
|
||||
| P9-new-2 | 발견 | `PostgreSqlInboxCutoffIntegrationTest`가 repository의 SQL이 아니라 테스트 안의 사본을 실행하고 있어 E-4a가 PG lane에서 보이지 않았다. 고침(repository `@Query`를 읽어 실행). | 완료 | Wave 1–2 P9 (fcddab7e·Wave 2 커밋): 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P9.md` | - | - |
|
||||
| P9-new-3 | 발견 | 같은 operationId를 다른 요청(다른 scope)으로 재사용하면 fake(`InMemoryDurableOperationStore`)는 조용히 덮어쓰고 PG adapter는 PK 위반으로 실패한다 — fake/adapter 불일치. HTTP 경로는 id를 서버가 발급해 영향 없음. 고치지 않음. | 남음 | 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P9.md` | W4 | durable operation store 계약 테스트에 id 재사용 경우 추가, fake를 adapter와 맞춤 |
|
||||
| P9-new-4 | 발견 | `WebMvcRequestContextHolder.store(...)`를 부르는 운영 코드가 없어 `WebRequestContext`를 파라미터로 받는 컨트롤러는 항상 `IllegalStateException`으로 실패한다(`src/adapter/inbound/web/src/main/java/dev/caskeleton/adapter/inbound/web/mvc/context/WebMvcRequestContex… | 남음 | 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P9.md` | W2 | 운영 경로에서 `WebRequestContext`를 채우거나 파라미터 사용처 제거 |
|
||||
@@ -1156,9 +1156,18 @@ Wave 1–2 구현 묶음(`P1`–`P13`)이 작업 중 찾은 결함과 통합 검
|
||||
| P11-new-1 | 발견 | `app.httpclient.clients[N].timeout.streaming-idle`(`APP_HTTPCLIENT_CLIENTS_N_TIMEOUT_STREAMING_IDLE`)은 바인딩만 되고 main 코드 어디서도 읽지 않음(reactive 삭제 전에도 그랬음). `HC/profile/TimeoutSettings.java:25`, `docs/httpclient/configuration-reference… | 남음 | 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P11.md` | W3 | 읽지 않는 `timeout.streaming-idle` 키·env 키 삭제 |
|
||||
| P11-new-2 | 발견 | `scripts/verify-httpclient-docs.py:22`가 없는 경로 `src/app-bootstrap/.../autoconfigure/httpclient/HttpClientStartupValidator.java`를 읽어 `FileNotFoundError`로 실패함. 경로를 `.../httpclient/autoconfigure`로 바꿔 돌리면 `rotation-drain-timeout`이 `doc… | 남음 | 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P11.md` | W5 | `scripts/verify-httpclient-docs.py` 경로 수정, `rotation-drain-timeout` 문서 추가 |
|
||||
| P11-new-3 | 발견 | `httpClientFailureInjectionTest`의 `FailureInjectionContractTest.disabledProxyFailsBeforeARequestCanBeSent`가 이 머신에서 실패(`expected: NOT_SENT but was: SENT_NO_RESPONSE`). Docker userland proxy(`docker-proxy` 동작 중)가 꺼진 Toxiproxy 리스너의 p… | 남음 | 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P11.md` | W4 | Docker userland proxy에 의존하지 않는 방식으로 lane 수정(기준 커밋에서도 실패 — 기존 결함) |
|
||||
| P11-new-4 | 발견 | Dynamic Target cross-origin hop은 `SensitiveHeaderStripper` 표준 이름(`authorization`·`cookie`·`x-api-key`·`api-key` 등)만 제거하므로, 호출자가 `HeaderPolicy`로 넘긴 관례 밖 이름의 자격증명 헤더(예: `X-Client-Key`)는 다음 origin으로 따라감 `HC/dynamic/DefaultDynamicTarg… | 남음 | 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P11.md` | W1 | 결정 23: cross-origin hop에서 호출자 헤더 전부 제거, 안전한 헤더만 유지 |
|
||||
| P12-new-1 | 발견 | bulk 경로가 `access.rawOperations().getCollection(...)`의 raw collection에 `bulkWrite`를 해서, `MongoConsistencyBinder`가 profile별 template에 `setWriteConcern`으로 건 write concern이 적용되지 않는다(Spring `MongoTemplate.getCollection`은 template write… | 남음 | 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P12.md` | W2 | bulk 경로에 profile write concern 적용 |
|
||||
| P11-new-4 | 발견 | Dynamic Target cross-origin hop은 `SensitiveHeaderStripper` 표준 이름(`authorization`·`cookie`·`x-api-key`·`api-key` 등)만 제거하므로, 호출자가 `HeaderPolicy`로 넘긴 관례 밖 이름의 자격증명 헤더(예: `X-Client-Key`)는 다음 origin으로 따라감 `HC/dynamic/DefaultDynamicTarg… | 완료 | Wave 2.5 W2-P14 (Wave 3 라운드 1 커밋): 결정 23. `DefaultDynamicTargetGatewayTest.crossOriginHopKeepsOnlySafeCallerHeaders` FAIL(`[(true, true), (true, true)]`)→PASS. `HC/dynamic/DefaultDynamicTargetGateway.java:164,172-185` cross-origin hop에서 호출자 헤더를 allowlist(`Accept`·`Accept-Language`·`Content-Type`·`Content-Language`)로만 남김. 자격증명 binding 헤더는 hop마다 새 target 기준으로 다시 붙음(기존) | - | 결정 23: cross-origin hop에서 호출자 헤더 전부 제거, 안전한 헤더만 유지 |
|
||||
| P12-new-1 | 발견 | bulk 경로가 `access.rawOperations().getCollection(...)`의 raw collection에 `bulkWrite`를 해서, `MongoConsistencyBinder`가 profile별 template에 `setWriteConcern`으로 건 write concern이 적용되지 않는다(Spring `MongoTemplate.getCollection`은 template write… | 완료 | Wave 2.5 W2-P14 (Wave 3 라운드 1 커밋): 실제 replica set lane `MongoBulkMappingLaneTest.aBulkWriteCarriesTheProfileWriteConcern` FAIL(update 명령 writeConcern `["null"]`)→PASS(`{"w": "majority"}`, CommandListener로 관찰). `imperative/MongoPlatformCollectionAccess.writeConcern()`, `MongoConsistencyBinder.java:93` `writeConcernFor`, `bulk/MongoBulkExecutor.java:94` `withWriteConcern`. `mongoReplicaSetTest` 7/7 | - | bulk 경로에 profile write concern 적용 |
|
||||
| P13-new-1 | 발견 | included build lock은 build-logic·build-tools 자신의 configuration(compile/test)만 잠근다. main build가 plugin을 쓸 때의 settings·root buildscript classpath는 main build에서 따로 해석되고 잠기지 않는다. 증거: `./gradlew buildEnvironment`에서 `project :build-tool… | 보류 | 사유: 잠그면 Spring Boot plugin을 올릴 때마다 lock 갱신 필요, included build 자체는 잠갔다. 승인자: 저장소 소유자(2026-09-28, 결정 27) | - | - |
|
||||
| P13-new-2 | 발견 | `local-redis` lane은 기동 로그 무음 검사(스크립트 3c)를 통과할 수 없다. lane 자신이 주는 `APP_REDIS_AUTHENTICATION_ANONYMOUS_ACCESS_ACCEPTED=true`와 advanced credential 미설정 때문에 `RedisSdkAutoConfiguration`이 기동 중 WARN 2줄(`Redis is running without credentials… | 남음 | 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P13.md` | W4 | `local-redis` lane 설정 또는 smoke 무음 검사 기준 정리(NEW-1b와 함께) |
|
||||
| NEW-15 | 발견 | gRPC proto 조직 이름이 템플릿 이름이 아니라 `hyeonworks`로 고정 — `GrpcProtoStyleManifest.caSkeleton()` `organization`, 기본 proto 패키지 `hyeonworks.grpc.common.v1`, `GrpcCodegenManifest`, 테스트 38개 파일. 재사용 체크리스트에도 없음 | 남음 | `src/grpc/grpc-proto-contract/src/main/java/dev/caskeleton/grpc/contract/GrpcProtoStyleManifest.java:62`, `src/grpc/grpc-proto-contract/src/main/resources/proto/hyeonworks/`, `src/grpc/grpc-codegen/.../GrpcCodegenManifest.java:63` | W3 | 결정 18(protobuf 플러그인 전환)과 함께 `caskeleton`으로 바꾸고 `AGENTS.md` 재사용 체크리스트에 한 줄 |
|
||||
| NEW-15 | 발견 | gRPC proto 조직 이름이 템플릿 이름이 아니라 `hyeonworks`로 고정 — `GrpcProtoStyleManifest.caSkeleton()` `organization`, 기본 proto 패키지 `hyeonworks.grpc.common.v1`, `GrpcCodegenManifest`, 테스트 38개 파일. 재사용 체크리스트에도 없음 | 완료 | Wave 3 W3-P17 (Wave 3 라운드 1 커밋): `e2397d2f`. `hyeonworks` → `caskeleton`: proto 디렉터리 `src/grpc/grpc-contract/src/main/proto/caskeleton/grpc/common/v1/`, `package caskeleton.grpc.common.v1`, `java_package caskeleton.grpc.common.v1.generated`, Edition fixture, 테스트 문자열 전부(기계적 치환). `GrpcProtoStyleManifest`·`GrpcCodegenManifest`는 S7-#13으로 삭제돼 organization 필드 자체가 없다. `AGENTS.md` 「템플릿 재사용 체크리스트」 2번에 proto 조직 이름 한 줄. `src/grpc/**`·`src/grpc-advanced/**`에 `hyeonworks` 0건. 과거 리뷰·계획 문서(`docs/reviews/**`, `docs/*-superpowers-package/**`, 7월 계획)의 언급은 이력이라 두었다 | - | 결정 18(protobuf 플러그인 전환)과 함께 `caskeleton`으로 바꾸고 `AGENTS.md` 재사용 체크리스트에 한 줄 |
|
||||
| NEW-16 | 발견 | `integrationCheck`가 로컬에서 통과할 수 없는 lane을 묶음 — Redis topology 3개는 `-Predis.topology.mode` 없이 fail-closed, AWS 보호 lane은 보호 자격 증명 env가 없으면 실패. 그래서 집계 태스크가 항상 실패 | 남음 | Wave 1·2 검증 로그: `redisTopologyTest was selected with redis.topology.mode='unset'`, `AwsS3QualificationPreconditionsTest` | W3 | 매개변수·자격 증명이 필요한 lane은 `integrationCheck`에서 빼고 전용 워크플로에서만(또는 입력이 있을 때만 포함) |
|
||||
| P14-new-1 | 발견 | operator force-delete(`application-fileserver/.../admin/DefaultFileserverAdminService.java:167`)가 P4-new-4와 같은 결함 — 진행 중 upload를 지우면 세션이 ACTIVE로 남고 staging 정리가 예약되지 않는다. | 남음 | Wave 2.5 P14 결과 파일 | W2 | lifecycle delete와 같은 `unfinishedUpload` 처리를 admin 경로에도(생성자에 `StagingUploadLocator`). 라운드 2 P24 |
|
||||
| P14-new-2 | 발견 | `S3AsyncResponseBodyBridgeTest.deliversAnExactBoundedBodyOnTheWorkerAndInvalidatesTheSource`가 전체 `check` 부하에서 간헐 실패(`Expecting code to raise a throwable`), 단독 통과. | 남음 | Wave 2.5 P14 결과 파일 | W4 | 타이밍 의존 제거(결정적 executor/latch) |
|
||||
| P14-new-3 | 발견 | main에 `ReconcilePosterImageUploadUseCase`를 부르는 worker가 없다(`claimPending` 호출자 0). 게시가 이긴 ABORT_AUTHORIZED intent는 reconcile 명령이 와야 붙는다. | 남음 | Wave 2.5 P14 결과 파일 | W3 | sample에 reconcile worker(PENDING·ABORT_AUTHORIZED 모두)를 두거나 수동 명령임을 문서화. 라운드 2 P25 |
|
||||
| P14-new-4 | 발견 | P2-new-3 수정 뒤 기본 요구 집합(`CONDITIONAL_RETIREMENT` 포함, `ObjectStorageDestinationSettings.java:40`)을 쓰는 S3 destination은 기동 시 거부된다 — 운영 provider인 S3로 sample 포스터 게시(`PublishPosterImageUseCase.java:197`)를 쓸 수 없다. | 남음 | `S3ProviderBinding.java:202` | W3 | S3 조건부 retire 구현(버전·ETag 조건 삭제, MinIO lane으로 검증) 또는 기본 요구 집합 재검토. 라운드 2 P24 |
|
||||
| P14-new-5 | 발견 | 테스트 규칙 잔여: `PosterImagePublicationWorkflowTest`가 testFixtures `InMemoryPosterImageUploadIntentStore` 대신 자기 `FakeIntents` 사용, `application-objectstorage`에 testFixtures가 없어 포트 대역이 테스트 안 스텁. | 남음 | Wave 2.5 P14 결과 파일 | W4 | 공용 fake로 교체, application-objectstorage testFixtures 신설 |
|
||||
| P17-new-1 | 발견 | `GrpcMethodPolicy` 기본 method 한도 4 MiB가 기본 server profile 1 MiB와 어긋남. | 완료 | Wave 3 P17: N-10a validator가 드러냄(`aCoherentConfigurationStarts` FAIL), 기본값을 `GrpcTransportLimits.DEFAULT_MAX_MESSAGE_BYTES`로 | - | - |
|
||||
| P17-new-2 | 발견 | gRPC starter·advanced leaf가 BOM 없이 versionless `io.grpc:grpc-api`를 받아 lockfile 재생성 시 해석 실패. | 완료 | Wave 3 P17: `ca.grpc-platform-module`로 교체 | - | - |
|
||||
| P17-new-3 | 발견 | 새 CI job `grpc-proto-buf`(buf lint·breaking)가 `ci-quality-gates.yml` `release-gate.needs`에 없어 병합을 막지 않는다. | 남음 | Wave 3 P17 결과 | W3 | 오케스트레이터가 P16 통합 때 `release-gate.needs`에 추가 |
|
||||
| ORCH-new-1 | 발견 | `messaging-policy` `MessagingAdmissionControllerTest.aWaitingCallerIsAdmittedOnceAPermitIsReturned`가 에이전트 4개 부하 중 실패, 단독 재실행 통과(타이밍 의존). | 남음 | desktop 기준선 `check`(2026-09-28, `016597ac`) | W4 | 대기 확인을 sleep/시간이 아닌 결정적 신호로 |
|
||||
|
||||
@@ -42,7 +42,7 @@ def area(rid, text):
|
||||
if group:
|
||||
return GROUP_AREA[group.group(1)]
|
||||
new = re.match(r"NEW-(\d+)", head)
|
||||
if new:
|
||||
if new and int(new.group(1)) in NEW_AREA:
|
||||
return NEW_AREA[int(new.group(1))]
|
||||
if head.startswith("S3-"):
|
||||
return "httpclient" if re.search(r"httpclient|HttpClient|WebClient|OAuth2|reactive|redirect|Dynamic", text) else "redis"
|
||||
|
||||
@@ -194,7 +194,7 @@ Wave마다 Slack `#clean-architecture-전체`에 템플릿 1로 브리핑한다.
|
||||
|
||||
---
|
||||
|
||||
## Wave 3 — 구조 (시작할 때 상세 Task 추가)
|
||||
## Wave 3 — 구조 (상세 Task: 2026-09-28 desktop 재개 때 추가)
|
||||
|
||||
공통 작업(여러 leaf를 한 번에 바꿔서 순차로 한다):
|
||||
|
||||
@@ -205,6 +205,35 @@ Wave마다 Slack `#clean-architecture-전체`에 템플릿 1로 브리핑한다.
|
||||
|
||||
그다음 영역별: Kafka 소비(결정 10), SES → AWS SDK(결정 17), gRPC protobuf 플러그인 + Buf(결정 18), `persistence-notification` leaf 추출, SRP 분해, 구현 1개 인터페이스 정리, 이름 규칙, 빌드 게이트 이동(결정 4, API surface → `check` 결정 20).
|
||||
|
||||
### 실행 환경 (desktop)
|
||||
|
||||
12코어·메모리 31GB(여유 약 24GB). 동시 묶음은 **최대 4개**, 각 Gradle은 `--max-workers=2`. 결과 파일은 `docs/reviews/2026-09-25-review-followup-results/<Wave>-P<번호>.md`. 공통 작업 4개는 서로 순차(3-A → 3-C → 3-D → 3-B)로 두고, 같은 라운드의 나머지 자리는 그 공통 작업과 겹침이 적은 영역 묶음으로 채운다. 3-B(prefix)는 모든 설정이 자리 잡은 뒤 한 번에 이름을 바꾸도록 마지막에 혼자 돈다. 라운드마다 통합 → `check`·`architectureCheck`·`ci` → 커밋, Wave 끝에 Wave 종료 검증 전체.
|
||||
|
||||
W1·W2 잔여 21행(Wave 2.5)은 P14로 1라운드에서 함께 처리한다. W1 3행(legacy Kafka seam)과 W2 messaging 3행은 3-C(P18), W2 `P9-new-4`는 3-D(P19), gRPC 플랫폼 `P5-new-2`·`P5-new-3`은 P17이 맡는다.
|
||||
|
||||
### 묶음 (행 ID는 현황표 첫 열)
|
||||
|
||||
| 묶음 | 라운드 | 내용 | 행 |
|
||||
|---|---|---|---|
|
||||
| P14 | 1 | Wave 2.5 정합성 잔여(결정 21·22·23) | `P2-new-2` `P2-new-3` `P3-new-3` `P3-new-5` `P3-new-6` `P4-new-2` `P4-new-3` `P4-new-4` `P8-new-2` `P9-new-1` `P11-new-4` `P12-new-1` |
|
||||
| P15 | 1 | 3-A 에러 어휘(결정 2·11·12·25, IAE 400) | `I-3a` `J-10e` `X2-P1-6` `X2-P2-1d` `X2-P2-1e` `X2-P2-1f` `X2-P2-2a` `X2-P2-2b` `X2-P2-3a` `X2-P2-3b` `X2-P2-9a` `X2-P2-9b` `S1-#7` `S2-lead-4` `S5-#1c` `S5-#1d` `S5-#6c` `S5-#6d` `S5-lead-1` `P8-new-1` |
|
||||
| P16 | 1 | 빌드 게이트(결정 4·20, NEW-16) | `O-4c` `O-8` `BUILD-결론-1` `-2` `-4` `BUILD-중복-3` `-6` `-7` `-8` `BUILD-계획-B2` `-B3` `-B4-17` `-B4-27` `-B4-28` `-B4-30` `-C` `BUILD-O3-2` `-5` `-6` `BUILD-바로할것-7` `-12d` `X1-지도-readiness…` `X1-#7a` `S1-#16` `S5-lead-4` `NEW-13a` `-13b` `-13d` `-13e` `NEW-16` |
|
||||
| P17 | 1 | gRPC 플랫폼(결정 18, 18→9 leaf, `hyeonworks`→`caskeleton`) | `K-10a` `N-8d` `N-9a` `N-10a` `N-10b` `S7-#3` `S7-#13` `P5-new-2` `P5-new-3` `P5-new-4` `NEW-15` |
|
||||
| P18 | 2 | 3-C outbox canonical + `composition:*` + legacy Kafka seam 삭제(결정 3·7) | `X1-지도-Kafka producer` `X1-#1f` `NEW-4a` `S6-lead-3` `S7-lead-3` `X1-지도-Outbox` `X1-#1b` `X1-#1i` `S1-#2b` `S2-lead-1` `S7-#8` `S4-lead-4b` `NEW-2a` `NEW-2b` `G-11b` `X1-#2b` `S1-lead-3` `X1-지도-요청 멱등성` `S6-#7` `S7-#5b` `S2-#9b` |
|
||||
| P24 | 2 | fileserver·object storage 구조 | `D-7d` `D-7e` `D-8a` `D-8b` `D-8c` `S1-#6a` `S1-#6b` `S1-#12` `S1-#13` `S1-#17a` `S1-#17b` `S1-#18b` `S1-lead-4` `S4-#11a` `S4-#11b` `S4-#12` `S4-lead-2` `S5-#10` `S6-lead-5` |
|
||||
| P25 | 2 | core 죽은 표면 · web · GraphQL · sample 구조(NEW-10d) | `A-2c` `A-4b` `A-5b` `A-5c` `A-10c` `I-5b` `I-6b` `I-8d` `J-7` `J-10d` `K-11b` `X1-#6f` `S1-#15b` `S5-#7a` `S6-#8` `S6-#10a` `S6-#10b` `S6-#10c` `S6-#10d` `S6-#11a` `S6-#13` `NEW-9b` `NEW-10d` `NEW-12` |
|
||||
| P26 | 2 | HTTP client · JPA 구조 | `E-6b` `H-4b` `H-7a` `S2-#3b` `S3-#2b` `S3-#6` `S3-#7` `S3-#8b` `S3-#10` `S3-lead-5` `S6-#3c` `S6-#3d` |
|
||||
| P19 | 3 | 3-D 공통 유틸·tenant·context·caller 트랜잭션 guard | `D-8d` `E-3b` `I-1c` `J-12` `X1-지도-caller 트랜잭션 guard` `X1-지도-Backoff 계산식` `X1-#1c` `X1-#4` `X1-#9` `X1-#10b` `X2-P1-4b` `X2-P1-5` `X2-P1-7` `X2-P2-4` `X2-P2-5` `X2-P2-6a` `S1-#11` `S1-lead-2` `S2-lead-3` `S5-lead-3` `P9-new-4` `P9-new-5` |
|
||||
| P21 | 3 | messaging 플랫폼: Kafka 소비(결정 10)·API 정리 | `M-9` `S7-#2` `S7-#6a` `S7-#6b` `S7-#9a` `S7-#9b` `S7-#9c` `S7-#10` `S7-#11` `S7-#12` `S7-#14` |
|
||||
| P22 | 3 | Redis 구조 · startup rule | `G-4i` `G-6b` `G-7a` `G-7c` `G-7d` `G-7e` `G-8` `X1-지도-lock / lease / fencing` `S1-#15c` `S3-#3a` `S3-#3b` `S3-#4b` `S3-#5` `S3-#9` `S6-#2c` `S6-#3a` |
|
||||
| P23 | 3 | notification: SES → sesv2(결정 17), `persistence-notification` 추출, SRP | `S1-#4` `S1-#9` `S1-#10b` `S2-#1b` `S2-#6c` `S2-#8a` `S2-#13b` `S4-#3c` `S4-#4b` `S4-#9` `S4-#14b` `S4-#15` `S4-lead-3` `S4-lead-5` |
|
||||
| P20 | 4 | 3-B 설정 prefix `app.*`(결정 16), strict 바인딩 | `X2-P1-3c` `S3-lead-2` `S3-lead-4` `S6-#14` `P11-new-1` |
|
||||
|
||||
- [ ] 라운드 1: P14 · P15 · P16 · P17 → 통합·검증·커밋
|
||||
- [ ] 라운드 2: P18 · P24 · P25 · P26 → 통합·검증·커밋
|
||||
- [ ] 라운드 3: P19 · P21 · P22 · P23 → 통합·검증·커밋
|
||||
- [ ] 라운드 4: P20 → 통합 → Wave 종료 검증 → 현황표·「제거된 코드」 갱신 → 커밋 `review-followup Wave 3`
|
||||
|
||||
## Wave 4 — 테스트 규칙 (시작할 때 상세 Task 추가)
|
||||
|
||||
`AGENTS.md` 규칙 2를 한국어로 수정, 포트별 추상 계약 테스트(lock·lease 포함, 결정 8), 약한 단언 정리, 계층별 모범 모듈.
|
||||
|
||||
@@ -39,6 +39,13 @@ src/adapter/inbound/grpc 기존 인바운드 전송 어댑터 (
|
||||
원본 모듈 경계 중 **이 저장소가 이미 다른 메커니즘으로 표현하는 것**만 합친다. 능력(capability)은
|
||||
하나도 버리지 않는다.
|
||||
|
||||
> **2026-09-28 변경(리뷰 후속 S7-#3·S7-#13, 소유자 결정 18).** 아래 두 표는 채택 당시의 leaf 구성이다.
|
||||
> 현재는 `grpc-policy`·`grpc-server`·`grpc-client`·`grpc-discovery`·`grpc-admin` → `grpc-runtime`,
|
||||
> `grpc-proto-contract`·`grpc-codegen` → `grpc-contract`(protobuf Gradle 플러그인 + CI의 Buf, D5/D6 폐기 —
|
||||
> ADR-GRPC-002 superseded), `grpc-advanced-bootstrap`·`-edition`·`-streaming`·`-resilience`·`-diagnostics`
|
||||
> → `grpc-advanced`로 합쳐졌다. `grpc-advanced-compat`은 그대로다. 패키지 이름은 바뀌지 않았다. 현재
|
||||
> leaf 목록은 registry(`src/config/architecture/modules.json`)가 SSOT다.
|
||||
|
||||
### Stable — `src/grpc/`
|
||||
|
||||
| leaf | 원본 모듈 | 담는 Task | 의존 |
|
||||
|
||||
+10
@@ -13,6 +13,8 @@ import graphql.execution.instrumentation.SimplePerformantInstrumentation;
|
||||
import graphql.execution.instrumentation.parameters.InstrumentationExecuteOperationParameters;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* The seam where the platform's policies meet a real GraphQL request.
|
||||
@@ -29,6 +31,8 @@ import java.util.Objects;
|
||||
*/
|
||||
public final class GraphQlPlatformInstrumentation extends SimplePerformantInstrumentation {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(GraphQlPlatformInstrumentation.class);
|
||||
|
||||
/** Constraint reported when the request arrived without a platform context. */
|
||||
public static final String MISSING_CONTEXT_CONSTRAINT = "PLATFORM_CONTEXT";
|
||||
|
||||
@@ -63,6 +67,12 @@ public final class GraphQlPlatformInstrumentation extends SimplePerformantInstru
|
||||
GraphQlRequestContext requestContext =
|
||||
execution.getGraphQLContext().get(GraphQlRequestContext.CONTEXT_KEY);
|
||||
if (requestContext == null) {
|
||||
// The client only sees INTERNAL_ERROR; without this line a mis-assembled deployment fails
|
||||
// every request and nothing on the operator side says why.
|
||||
LOG.warn(
|
||||
"graphql request rejected: no platform context (executionId={});"
|
||||
+ " the platform transport interceptor is not wired",
|
||||
executionId);
|
||||
throw new AbortExecutionException(
|
||||
List.of(
|
||||
GraphQlWireErrors.toGraphQlError(
|
||||
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
package dev.caskeleton.adapter.inbound.graphql.runtime;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import ch.qos.logback.classic.Level;
|
||||
import ch.qos.logback.classic.Logger;
|
||||
import ch.qos.logback.classic.spi.ILoggingEvent;
|
||||
import ch.qos.logback.core.read.ListAppender;
|
||||
import dev.caskeleton.adapter.inbound.graphql.execution.GraphQlExecutionStage;
|
||||
import graphql.ExecutionInput;
|
||||
import graphql.GraphQL;
|
||||
import graphql.schema.idl.SchemaParser;
|
||||
import graphql.schema.idl.UnExecutableSchemaGenerator;
|
||||
import java.util.List;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
class GraphQlPlatformInstrumentationTest {
|
||||
|
||||
@Test
|
||||
void aRequestWithoutPlatformContextIsLoggedAsAWiringFaultAtWarn() {
|
||||
// given
|
||||
GraphQL graphQl =
|
||||
GraphQL.newGraphQL(
|
||||
UnExecutableSchemaGenerator.makeUnExecutableSchema(
|
||||
new SchemaParser().parse("type Query { _health: String }")))
|
||||
.instrumentation(
|
||||
new GraphQlPlatformInstrumentation(
|
||||
new GraphQlExecutionChain(
|
||||
List.of(
|
||||
new PassThrough(GraphQlExecutionStage.PARSE_VALIDATE),
|
||||
new PassThrough(GraphQlExecutionStage.AUTHORIZATION),
|
||||
new PassThrough(GraphQlExecutionStage.COST))),
|
||||
GraphQlWireErrorMapper.masking()))
|
||||
.build();
|
||||
Logger logger = (Logger) LoggerFactory.getLogger(GraphQlPlatformInstrumentation.class);
|
||||
ListAppender<ILoggingEvent> appender = new ListAppender<>();
|
||||
appender.start();
|
||||
logger.addAppender(appender);
|
||||
|
||||
// when
|
||||
try {
|
||||
graphQl.execute(
|
||||
ExecutionInput.newExecutionInput("{ _health }")
|
||||
.executionId(graphql.execution.ExecutionId.from("exec-7")));
|
||||
} finally {
|
||||
logger.detachAppender(appender);
|
||||
appender.stop();
|
||||
}
|
||||
|
||||
// then
|
||||
assertThat(appender.list)
|
||||
.singleElement()
|
||||
.extracting(ILoggingEvent::getLevel, ILoggingEvent::getFormattedMessage)
|
||||
.containsExactly(
|
||||
Level.WARN,
|
||||
"graphql request rejected: no platform context (executionId=exec-7);"
|
||||
+ " the platform transport interceptor is not wired");
|
||||
}
|
||||
|
||||
/** A pipeline stage that passes the state through. */
|
||||
private record PassThrough(GraphQlExecutionStage stage) implements GraphQlExecutionHandler {
|
||||
|
||||
@Override
|
||||
public GraphQlExecutionContext handle(GraphQlExecutionContext context) {
|
||||
return context;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -82,7 +82,9 @@ credential path and a separately qualified non-loopback bind.
|
||||
현재 저장소에는 production feature RPC나 sample gRPC service가 없다. 향후 feature를 도입할
|
||||
때는 `.proto`/generated stub/`BindableService`를 해당 feature가 소유하고, 서비스 빈과 정확히 한
|
||||
개의 caller-supplied `GrpcAuthenticationPolicy` 빈을 함께 제공한다. 정책이 없거나 여러 개면
|
||||
listener 시작이 실패한다. 정책이 `false`를 반환하거나 예외를 던진 요청은 feature handler에 닿지
|
||||
listener 시작이 실패한다. 정책은 `Optional<Principal> authenticate(Metadata)`이고, 돌려준
|
||||
호출자는 gRPC `Context`에 담겨 handler가 `GrpcAuthenticatedCaller.current()`로 읽는다. 정책이
|
||||
빈 값·`null`을 반환하거나 예외를 던진 요청은 feature handler에 닿지
|
||||
않고 안정적인 `UNAUTHENTICATED` status/code/category로 종료된다. 정책 예외는 예외 타입과 메서드
|
||||
이름만 WARN으로 남긴다(메시지는 자격 증명을 담을 수 있어 남기지 않는다).
|
||||
|
||||
|
||||
@@ -63,7 +63,9 @@
|
||||
개의 `GrpcAuthenticationPolicy`를 함께 기여한다. runner는 qualifier로 선택된 서비스만 등록하며,
|
||||
같은 context의 unqualified `BindableService`는 gRPC 포트에 노출하지 않는다. 노출 서비스가 하나라도
|
||||
있는데 인증 정책이 없거나 단일하지 않으면 listener 시작을 거부한다. 정책은 gRPC `Metadata`만 받아
|
||||
Spring Security에 결합되지 않으며, `false` 반환과 policy 예외는 동일한 안정적
|
||||
Spring Security에 결합되지 않는다. 인증된 호출자(`Optional<Principal>`)는 인터셉터가 gRPC
|
||||
`Context`에 담아(`Contexts.interceptCall`) handler가 `GrpcAuthenticatedCaller.current()`로 읽으므로,
|
||||
handler가 metadata를 다시 해석하지 않는다. 빈 값·`null` 반환과 policy 예외는 동일한 안정적
|
||||
`UNAUTHENTICATED` 계약으로 끝난다.
|
||||
|
||||
## 에러 매핑 — web `GlobalExceptionHandler` 의 gRPC 형제
|
||||
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package dev.caskeleton.adapter.inbound.grpc;
|
||||
|
||||
import io.grpc.Context;
|
||||
import java.security.Principal;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* The caller {@link GrpcAuthenticationPolicy} authenticated for the current feature RPC.
|
||||
*
|
||||
* <p>{@link GrpcAuthenticationInterceptor} binds it to the gRPC {@link Context} of the call, so a
|
||||
* handler reads it on the thread that runs the call's callbacks without re-parsing metadata.
|
||||
*/
|
||||
public final class GrpcAuthenticatedCaller {
|
||||
|
||||
static final Context.Key<Principal> KEY = Context.key("ca-skeleton.grpc.authenticated-caller");
|
||||
|
||||
private GrpcAuthenticatedCaller() {}
|
||||
|
||||
/** The authenticated caller of the current call, or empty outside an authenticated call. */
|
||||
public static Optional<Principal> current() {
|
||||
return Optional.ofNullable(KEY.get());
|
||||
}
|
||||
}
|
||||
+18
-6
@@ -1,15 +1,22 @@
|
||||
package dev.caskeleton.adapter.inbound.grpc;
|
||||
|
||||
import dev.caskeleton.shared.error.OperationalError;
|
||||
import io.grpc.Context;
|
||||
import io.grpc.Contexts;
|
||||
import io.grpc.Metadata;
|
||||
import io.grpc.ServerCall;
|
||||
import io.grpc.ServerCallHandler;
|
||||
import io.grpc.ServerInterceptor;
|
||||
import io.grpc.Status;
|
||||
import java.security.Principal;
|
||||
import java.util.Optional;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/** Applies the caller-supplied authentication policy before a feature RPC can reach its handler. */
|
||||
/**
|
||||
* Applies the caller-supplied authentication policy before a feature RPC can reach its handler, and
|
||||
* hands the authenticated caller to the handler through the gRPC {@link Context}.
|
||||
*/
|
||||
final class GrpcAuthenticationInterceptor implements ServerInterceptor {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(GrpcAuthenticationInterceptor.class);
|
||||
@@ -26,8 +33,11 @@ final class GrpcAuthenticationInterceptor implements ServerInterceptor {
|
||||
@Override
|
||||
public <REQT, RESPT> ServerCall.Listener<REQT> interceptCall(
|
||||
ServerCall<REQT, RESPT> call, Metadata headers, ServerCallHandler<REQT, RESPT> next) {
|
||||
if (isAuthenticated(headers, call.getMethodDescriptor().getFullMethodName())) {
|
||||
return next.startCall(call, headers);
|
||||
Optional<Principal> caller =
|
||||
authenticate(headers, call.getMethodDescriptor().getFullMethodName());
|
||||
if (caller.isPresent()) {
|
||||
Context context = Context.current().withValue(GrpcAuthenticatedCaller.KEY, caller.get());
|
||||
return Contexts.interceptCall(context, call, headers, next);
|
||||
}
|
||||
|
||||
call.close(
|
||||
@@ -36,16 +46,18 @@ final class GrpcAuthenticationInterceptor implements ServerInterceptor {
|
||||
return new ServerCall.Listener<>() {};
|
||||
}
|
||||
|
||||
private boolean isAuthenticated(Metadata headers, String method) {
|
||||
private Optional<Principal> authenticate(Metadata headers, String method) {
|
||||
try {
|
||||
return authenticationPolicy.isAuthenticated(headers);
|
||||
Optional<Principal> caller = authenticationPolicy.authenticate(headers);
|
||||
// A policy that returns null has not authenticated anybody; fail closed.
|
||||
return caller == null ? Optional.empty() : caller;
|
||||
} catch (RuntimeException failure) {
|
||||
// Type and method only: the message of a failing credential check may echo the credential.
|
||||
log.warn(
|
||||
"gRPC authentication policy threw {} for {}; the call is rejected as UNAUTHENTICATED",
|
||||
failure.getClass().getName(),
|
||||
method);
|
||||
return false;
|
||||
return Optional.empty();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+7
-3
@@ -1,6 +1,8 @@
|
||||
package dev.caskeleton.adapter.inbound.grpc;
|
||||
|
||||
import io.grpc.Metadata;
|
||||
import java.security.Principal;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* Caller-supplied policy that authenticates feature RPC metadata without Spring Security coupling.
|
||||
@@ -9,9 +11,11 @@ import io.grpc.Metadata;
|
||||
public interface GrpcAuthenticationPolicy {
|
||||
|
||||
/**
|
||||
* Returns {@code true} only when the request metadata represents an authenticated caller. A
|
||||
* {@code false} result or policy exception becomes the same stable {@code UNAUTHENTICATED} wire
|
||||
* Returns the authenticated caller, or empty when the request metadata does not authenticate one.
|
||||
* The returned principal is placed in the gRPC {@code Context} for the rest of the call and read
|
||||
* by the handler through {@link GrpcAuthenticatedCaller#current()}. An empty result, a {@code
|
||||
* null} result or a policy exception all become the same stable {@code UNAUTHENTICATED} wire
|
||||
* contract; policy diagnostics never reach the client.
|
||||
*/
|
||||
boolean isAuthenticated(Metadata metadata);
|
||||
Optional<Principal> authenticate(Metadata metadata);
|
||||
}
|
||||
|
||||
+30
-1
@@ -7,6 +7,8 @@ import io.grpc.MethodDescriptor;
|
||||
import io.grpc.ServerCall;
|
||||
import io.grpc.Status;
|
||||
import java.io.InputStream;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import org.junit.jupiter.api.DisplayName;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.springframework.boot.test.system.CapturedOutput;
|
||||
@@ -37,6 +39,29 @@ class GrpcAuthenticationInterceptorTest {
|
||||
.doesNotContain(CREDENTIAL_SENTINEL);
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("인증 정책이 null을 돌려주면 handler에 닿지 않고 UNAUTHENTICATED로 닫힌다")
|
||||
void aPolicyReturningNullIsRejectedAsUnauthenticated() {
|
||||
// given
|
||||
GrpcAuthenticationInterceptor interceptor =
|
||||
new GrpcAuthenticationInterceptor(metadata -> null, new GrpcStatusMapper());
|
||||
MethodCall call = new MethodCall();
|
||||
AtomicBoolean handlerReached = new AtomicBoolean();
|
||||
|
||||
// when
|
||||
interceptor.interceptCall(
|
||||
call,
|
||||
new Metadata(),
|
||||
(ignoredCall, headers) -> {
|
||||
handlerReached.set(true);
|
||||
return new ServerCall.Listener<>() {};
|
||||
});
|
||||
|
||||
// then
|
||||
assertThat(handlerReached).isFalse();
|
||||
assertThat(call.closedWith).isEqualTo(Status.Code.UNAUTHENTICATED);
|
||||
}
|
||||
|
||||
/** A server call that only knows its method; the interceptor closes it as unauthenticated. */
|
||||
private static final class MethodCall extends ServerCall<String, String> {
|
||||
|
||||
@@ -62,8 +87,12 @@ class GrpcAuthenticationInterceptorTest {
|
||||
@Override
|
||||
public void sendMessage(String message) {}
|
||||
|
||||
private Status.Code closedWith;
|
||||
|
||||
@Override
|
||||
public void close(Status status, Metadata trailers) {}
|
||||
public void close(Status status, Metadata trailers) {
|
||||
closedWith = status.getCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
|
||||
+25
-1
@@ -29,10 +29,13 @@ import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.Principal;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.function.Consumer;
|
||||
import org.junit.jupiter.api.DisplayName;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
@@ -42,6 +45,7 @@ class GrpcP1BoundaryWireTest {
|
||||
|
||||
private static final String SERVICE_NAME = "test.p1.Feature";
|
||||
private static final String AUTH_TOKEN = "Bearer p1-test-token";
|
||||
private static final String CALLER_NAME = "p1-test-caller";
|
||||
private static final String INVALID_TOKEN_SENTINEL = "invalid-token-secret-sentinel";
|
||||
private static final String HANDLER_SENTINEL = "handler-secret-sentinel";
|
||||
private static final String LISTENER_SENTINEL = "listener-secret-sentinel";
|
||||
@@ -110,6 +114,15 @@ class GrpcP1BoundaryWireTest {
|
||||
.isEqualTo("authorized-ok"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("인증 정책이 돌려준 호출자 식별자가 feature handler의 gRPC Context로 전달된다")
|
||||
void theAuthenticatedCallerReachesTheFeatureHandlerThroughTheGrpcContext() {
|
||||
withChannel(
|
||||
channel ->
|
||||
assertThat(unary(authenticated(channel), UNARY_METHOD, "whoami"))
|
||||
.isEqualTo(CALLER_NAME));
|
||||
}
|
||||
|
||||
@Test
|
||||
void reflectionRemainsUnavailableWhenItsIndependentFlagIsFalse() {
|
||||
withChannel(
|
||||
@@ -309,7 +322,10 @@ class GrpcP1BoundaryWireTest {
|
||||
|
||||
@Bean
|
||||
GrpcAuthenticationPolicy grpcAuthenticationPolicy() {
|
||||
return metadata -> AUTH_TOKEN.equals(metadata.get(AUTHORIZATION));
|
||||
return metadata ->
|
||||
AUTH_TOKEN.equals(metadata.get(AUTHORIZATION))
|
||||
? Optional.of(() -> CALLER_NAME)
|
||||
: Optional.empty();
|
||||
}
|
||||
|
||||
@Bean
|
||||
@@ -334,6 +350,14 @@ class GrpcP1BoundaryWireTest {
|
||||
.asRuntimeException());
|
||||
return;
|
||||
}
|
||||
if ("whoami".equals(request)) {
|
||||
observer.onNext(
|
||||
GrpcAuthenticatedCaller.current()
|
||||
.map(Principal::getName)
|
||||
.orElse("no-caller"));
|
||||
observer.onCompleted();
|
||||
return;
|
||||
}
|
||||
observer.onNext("authorized-" + request);
|
||||
observer.onCompleted();
|
||||
}))
|
||||
|
||||
+6
@@ -1,6 +1,7 @@
|
||||
package dev.caskeleton.adapter.outbound.fileserver.platform.autoconfigure;
|
||||
|
||||
import dev.caskeleton.application.fileserver.api.metadata.FileMetadataStore;
|
||||
import dev.caskeleton.application.fileserver.api.metadata.UploadSessionStore;
|
||||
import dev.caskeleton.application.fileserver.api.security.FileAccessPolicy;
|
||||
import dev.caskeleton.application.fileserver.api.security.OriginalFilenamePolicy;
|
||||
import dev.caskeleton.application.fileserver.cleanup.CleanupQueue;
|
||||
@@ -12,6 +13,7 @@ import dev.caskeleton.application.fileserver.lifecycle.CopyContentGateway;
|
||||
import dev.caskeleton.application.fileserver.lifecycle.DefaultFileLifecycleService;
|
||||
import dev.caskeleton.application.fileserver.lifecycle.FileLifecycleService;
|
||||
import dev.caskeleton.application.fileserver.observability.FileserverMetricsPort;
|
||||
import dev.caskeleton.application.fileserver.recovery.StagingUploadLocator;
|
||||
import dev.caskeleton.application.fileserver.upload.UploadIdentifierFactory;
|
||||
import dev.caskeleton.application.transaction.TransactionPort;
|
||||
import java.time.Clock;
|
||||
@@ -48,6 +50,8 @@ class FileserverDownloadLifecycleConfiguration {
|
||||
FileAccessPolicy accessPolicy,
|
||||
OriginalFilenamePolicy filenamePolicy,
|
||||
CleanupQueue cleanupQueue,
|
||||
UploadSessionStore sessionStore,
|
||||
StagingUploadLocator stagingLocator,
|
||||
UploadIdentifierFactory identifierFactory,
|
||||
TransactionPort transactions,
|
||||
Clock clock) {
|
||||
@@ -57,6 +61,8 @@ class FileserverDownloadLifecycleConfiguration {
|
||||
accessPolicy,
|
||||
filenamePolicy,
|
||||
cleanupQueue,
|
||||
sessionStore,
|
||||
stagingLocator,
|
||||
identifierFactory,
|
||||
transactions,
|
||||
clock);
|
||||
|
||||
+13
-1
@@ -19,6 +19,8 @@ import dev.caskeleton.application.fileserver.recovery.DefaultFileReconciliationS
|
||||
import dev.caskeleton.application.fileserver.recovery.FileReconciliationService;
|
||||
import dev.caskeleton.application.fileserver.recovery.ReconciliationContentProbe;
|
||||
import dev.caskeleton.application.fileserver.recovery.RecoveryQueue;
|
||||
import dev.caskeleton.application.fileserver.recovery.StagingUploadLocator;
|
||||
import dev.caskeleton.application.fileserver.upload.QuotaCommitGateway;
|
||||
import dev.caskeleton.application.transaction.TransactionPort;
|
||||
import java.time.Clock;
|
||||
import org.springframework.beans.factory.ObjectProvider;
|
||||
@@ -58,12 +60,22 @@ class FileserverMaintenanceServiceConfiguration {
|
||||
@ConditionalOnMissingBean
|
||||
FileReconciliationService fileserverReconciliationService(
|
||||
FileMetadataStore metadataStore,
|
||||
UploadSessionStore sessionStore,
|
||||
StagingUploadLocator stagingLocator,
|
||||
ReconciliationContentProbe contentProbe,
|
||||
QuotaCommitGateway quotaGateway,
|
||||
RecoveryQueue recoveryQueue,
|
||||
TransactionPort transactions,
|
||||
Clock clock) {
|
||||
return new DefaultFileReconciliationService(
|
||||
metadataStore, contentProbe, recoveryQueue, transactions, clock);
|
||||
metadataStore,
|
||||
sessionStore,
|
||||
stagingLocator,
|
||||
contentProbe,
|
||||
quotaGateway,
|
||||
recoveryQueue,
|
||||
transactions,
|
||||
clock);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+21
-4
@@ -29,10 +29,12 @@ import io.micrometer.core.instrument.Tag;
|
||||
import java.net.URI;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.NoSuchElementException;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.function.Function;
|
||||
|
||||
/**
|
||||
@@ -155,17 +157,32 @@ public final class DefaultDynamicTargetGateway implements DynamicTargetGateway {
|
||||
hopOperation = hopOperation.withMethod(HttpMethod.GET).withBody(EmptyBody.instance());
|
||||
}
|
||||
// Headers the caller chose for the first origin do not travel to an origin the upstream
|
||||
// chose. The next loop iteration revalidates the new target from scratch.
|
||||
// chose. Not a list of names known to carry credentials — a caller's X-Client-Key is one
|
||||
// under any name — but an allowlist: only content-negotiation headers survive the hop.
|
||||
// The next loop iteration revalidates the new target from scratch.
|
||||
if (follow.crossOrigin()) {
|
||||
hopOperation =
|
||||
hopOperation.withHeaders(
|
||||
runtime.support().headerStripper().stripForCrossOrigin(hopOperation.headers()));
|
||||
hopOperation = hopOperation.withHeaders(safeForCrossOrigin(hopOperation.headers()));
|
||||
}
|
||||
current = follow.target();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** The caller headers that describe the content, not the caller; nothing else crosses origins. */
|
||||
private static final Set<String> CROSS_ORIGIN_SAFE_HEADERS =
|
||||
Set.of("accept", "accept-language", "content-type", "content-language");
|
||||
|
||||
private static Map<String, List<String>> safeForCrossOrigin(Map<String, List<String>> headers) {
|
||||
Map<String, List<String>> retained = new LinkedHashMap<>();
|
||||
headers.forEach(
|
||||
(name, values) -> {
|
||||
if (CROSS_ORIGIN_SAFE_HEADERS.contains(name.toLowerCase(Locale.ROOT))) {
|
||||
retained.put(name, List.copyOf(values));
|
||||
}
|
||||
});
|
||||
return Map.copyOf(retained);
|
||||
}
|
||||
|
||||
private PinnedTarget validate(
|
||||
DynamicTargetPolicy policy, ValidatedDnsResolver resolver, URI target) {
|
||||
CanonicalTarget canonical = canonicalizer.canonicalize(policy, target);
|
||||
|
||||
+28
@@ -2,6 +2,7 @@ package dev.caskeleton.adapter.outbound.httpclient.dynamic;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.catchThrowable;
|
||||
import static org.assertj.core.api.Assertions.tuple;
|
||||
|
||||
import dev.caskeleton.adapter.outbound.httpclient.api.HttpMethod;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.api.OperationName;
|
||||
@@ -127,6 +128,33 @@ class DefaultDynamicTargetGatewayTest {
|
||||
.containsExactly(true, false);
|
||||
}
|
||||
|
||||
@Test
|
||||
void crossOriginHopKeepsOnlySafeCallerHeaders() {
|
||||
// given
|
||||
transport.redirect(302, "https://b.example/next").json(200, USER);
|
||||
HttpOperation get =
|
||||
HttpOperation.get(new OperationName("fetch"), "/start", Map.of())
|
||||
.withHeaders(
|
||||
Map.of(
|
||||
"X-Client-Key", List.of("caller-secret"),
|
||||
"Accept-Language", List.of("ko")));
|
||||
|
||||
// when
|
||||
gateway(false)
|
||||
.exchange(
|
||||
POLICY,
|
||||
URI.create("https://a.example/start"),
|
||||
get,
|
||||
ResponseType.of(UserResponse.class));
|
||||
|
||||
// then
|
||||
assertThat(transport.sent())
|
||||
.extracting(
|
||||
request -> request.hasHeader("X-Client-Key"),
|
||||
request -> request.hasHeader("Accept-Language"))
|
||||
.containsExactly(tuple(true, true), tuple(false, true));
|
||||
}
|
||||
|
||||
@Test
|
||||
void traceHeadersStayOffTheWireWhenThePolicyDisablesPropagation() {
|
||||
// given
|
||||
|
||||
+15
-1
@@ -1,6 +1,10 @@
|
||||
package dev.caskeleton.adapter.outbound.notification.platform.dispatch;
|
||||
|
||||
import dev.caskeleton.application.notification.platform.api.ProviderProfileId;
|
||||
import dev.caskeleton.application.notification.platform.api.error.FailureCategory;
|
||||
import dev.caskeleton.application.notification.platform.api.error.NotificationFailureCode;
|
||||
import dev.caskeleton.application.notification.platform.api.error.NotificationFailureDescriptor;
|
||||
import dev.caskeleton.application.notification.platform.api.error.ProviderUnavailableException;
|
||||
import dev.caskeleton.application.notification.platform.dispatch.ProviderDispatchGatewayPort;
|
||||
import dev.caskeleton.application.notification.platform.provider.ProviderProfileSnapshot;
|
||||
import dev.caskeleton.application.notification.platform.provider.ProviderRuntimeState;
|
||||
@@ -29,7 +33,17 @@ public final class RegistryProviderDispatchGateway implements ProviderDispatchGa
|
||||
|
||||
@Override
|
||||
public ProviderProfileSnapshot profile(ProviderProfileId profileId) {
|
||||
return runtimes.current(profileId).profile();
|
||||
// A route naming a profile no runtime serves is configuration drift, not a programming error:
|
||||
// typed, so the dispatcher can put it on the retry policy instead of escaping with the lease.
|
||||
return runtimes
|
||||
.find(profileId)
|
||||
.orElseThrow(
|
||||
() ->
|
||||
new ProviderUnavailableException(
|
||||
NotificationFailureDescriptor.preDispatch(
|
||||
NotificationFailureCode.PROVIDER_UNAVAILABLE,
|
||||
FailureCategory.TRANSIENT_PROVIDER)))
|
||||
.profile();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+70
-24
@@ -12,7 +12,11 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
/**
|
||||
* Default gateway on the JDK HTTP client.
|
||||
@@ -72,14 +76,18 @@ public final class JdkNotificationHttpGateway implements NotificationHttpGateway
|
||||
}
|
||||
});
|
||||
|
||||
// The request timeout covers the exchange up to the response headers and nothing after them,
|
||||
// so the body read gets its own deadline: whatever is left of the same budget.
|
||||
long deadlineNanos = System.nanoTime() + request.timeout().toNanos();
|
||||
try {
|
||||
// Bounded, not ofByteArray(). A provider response is diagnostic — a status, some headers, an
|
||||
// error document — and reading it without a cap makes the sender's heap a function of what
|
||||
// the far end chooses to send. A chunked response with no end is a single-request outage.
|
||||
HttpResponse<Supplier<byte[]>> response =
|
||||
client.send(builder.build(), boundedBody(MAX_RESPONSE_BYTES));
|
||||
HttpResponse<InputStream> response =
|
||||
client.send(builder.build(), HttpResponse.BodyHandlers.ofInputStream());
|
||||
byte[] body = readBounded(response.body(), MAX_RESPONSE_BYTES, deadlineNanos);
|
||||
return new NotificationHttpResponse(
|
||||
response.statusCode(), Map.copyOf(response.headers().map()), response.body().get());
|
||||
response.statusCode(), Map.copyOf(response.headers().map()), body);
|
||||
} catch (UncheckedIOException bodyFailure) {
|
||||
throw new NotificationHttpTransportException(
|
||||
"TRANSPORT_FAILURE", bodyWasLikelyCommitted(bodyFailure.getCause()), bodyFailure);
|
||||
@@ -133,31 +141,69 @@ public final class JdkNotificationHttpGateway implements NotificationHttpGateway
|
||||
*/
|
||||
public static final int MAX_RESPONSE_BYTES = 65_536;
|
||||
|
||||
/** Closes body streams whose deadline passed; a daemon, so it never holds the JVM open. */
|
||||
private static final ScheduledExecutorService BODY_DEADLINES =
|
||||
Executors.newSingleThreadScheduledExecutor(
|
||||
task -> {
|
||||
Thread thread = new Thread(task, "notification-http-body-deadline");
|
||||
thread.setDaemon(true);
|
||||
return thread;
|
||||
});
|
||||
|
||||
/**
|
||||
* A body handler that stops reading at the cap.
|
||||
* Reads the body up to the cap and no later than the deadline, on the caller's thread.
|
||||
*
|
||||
* <p>Truncating rather than failing: the status code is the part that decides the outcome, and a
|
||||
* provider that accepted the message and then wrote a large body should not turn into an
|
||||
* ambiguous submission.
|
||||
*
|
||||
* <p>It reads from a stream and closes it at the cap, which cancels the subscription. Mapping
|
||||
* <p>Truncating at the cap rather than failing: the status code is the part that decides the
|
||||
* outcome, and a provider that accepted the message and then wrote a large body should not turn
|
||||
* into an ambiguous submission. Closing the stream at the cap cancels the subscription. Mapping
|
||||
* {@code ofByteArray()} looked bounded but buffered the whole body before cutting it, so an
|
||||
* endless chunked response still held the thread and grew the heap until the far end stopped.
|
||||
*
|
||||
* <p>The deadline is the other half. A provider that trickles bytes and never reaches the cap
|
||||
* held the dispatch thread for as long as it cared to — the request timeout had already been
|
||||
* satisfied by the headers. At the deadline the stream is closed from outside, and the exchange
|
||||
* is a response timeout: the body was sent, so the provider may well have the message.
|
||||
*/
|
||||
private static HttpResponse.BodyHandler<Supplier<byte[]>> boundedBody(int maxBytes) {
|
||||
// A Supplier, so the blocking read runs on the caller's thread rather than the client's
|
||||
// executor, as the JDK documents for mapping over an InputStream.
|
||||
return responseInfo ->
|
||||
HttpResponse.BodySubscribers.mapping(
|
||||
HttpResponse.BodySubscribers.ofInputStream(),
|
||||
stream ->
|
||||
() -> {
|
||||
try (InputStream body = stream) {
|
||||
return body.readNBytes(maxBytes);
|
||||
} catch (IOException failure) {
|
||||
throw new UncheckedIOException(failure);
|
||||
}
|
||||
});
|
||||
private static byte[] readBounded(InputStream stream, int maxBytes, long deadlineNanos)
|
||||
throws HttpTimeoutException {
|
||||
AtomicBoolean expired = new AtomicBoolean();
|
||||
long remaining = Math.max(0L, deadlineNanos - System.nanoTime());
|
||||
ScheduledFuture<?> watchdog =
|
||||
BODY_DEADLINES.schedule(
|
||||
() -> {
|
||||
expired.set(true);
|
||||
closeQuietly(stream);
|
||||
},
|
||||
remaining,
|
||||
TimeUnit.NANOSECONDS);
|
||||
byte[] body;
|
||||
try (InputStream closing = stream) {
|
||||
body = closing.readNBytes(maxBytes);
|
||||
} catch (IOException failure) {
|
||||
if (expired.get()) {
|
||||
throw bodyDeadlineExceeded();
|
||||
}
|
||||
throw new UncheckedIOException(failure);
|
||||
} finally {
|
||||
watchdog.cancel(false);
|
||||
}
|
||||
// A stream closed from outside may end as a short read rather than an exception.
|
||||
if (expired.get()) {
|
||||
throw bodyDeadlineExceeded();
|
||||
}
|
||||
return body;
|
||||
}
|
||||
|
||||
private static HttpTimeoutException bodyDeadlineExceeded() {
|
||||
return new HttpTimeoutException("response body was not received before the request timeout");
|
||||
}
|
||||
|
||||
private static void closeQuietly(InputStream stream) {
|
||||
try {
|
||||
stream.close();
|
||||
} catch (IOException ignored) {
|
||||
// The reader sees the closed stream; there is nothing more to do here.
|
||||
}
|
||||
}
|
||||
|
||||
/** Header map helper for adapters. */
|
||||
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
package dev.caskeleton.adapter.outbound.notification.platform.dispatch;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.catchThrowable;
|
||||
|
||||
import dev.caskeleton.application.notification.platform.api.ProviderProfileId;
|
||||
import dev.caskeleton.application.notification.platform.api.error.FailureCategory;
|
||||
import dev.caskeleton.application.notification.platform.api.error.NotificationFailureCode;
|
||||
import dev.caskeleton.application.notification.platform.api.error.ProviderUnavailableException;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
class RegistryProviderDispatchGatewayTest {
|
||||
|
||||
@Test
|
||||
void aProfileNoRuntimeServesIsAProviderUnavailableFailure() {
|
||||
// given
|
||||
RegistryProviderDispatchGateway gateway =
|
||||
new RegistryProviderDispatchGateway(new ProviderRuntimeRegistry());
|
||||
|
||||
// when
|
||||
Throwable thrown = catchThrowable(() -> gateway.profile(new ProviderProfileId("gone")));
|
||||
|
||||
// then
|
||||
assertThat(thrown)
|
||||
.isInstanceOf(ProviderUnavailableException.class)
|
||||
.extracting(
|
||||
failure -> ((ProviderUnavailableException) failure).descriptor().code(),
|
||||
failure -> ((ProviderUnavailableException) failure).descriptor().category())
|
||||
.containsExactly(
|
||||
NotificationFailureCode.PROVIDER_UNAVAILABLE, FailureCategory.TRANSIENT_PROVIDER);
|
||||
}
|
||||
}
|
||||
+52
@@ -2,6 +2,7 @@ package dev.caskeleton.adapter.outbound.notification.platform.provider.http;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatThrownBy;
|
||||
import static org.assertj.core.api.Assertions.catchThrowable;
|
||||
|
||||
import com.sun.net.httpserver.HttpServer;
|
||||
import java.io.IOException;
|
||||
@@ -80,4 +81,55 @@ class JdkNotificationHttpGatewaySecurityTest {
|
||||
server.stop(0);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@Timeout(value = 15, threadMode = Timeout.ThreadMode.SEPARATE_THREAD)
|
||||
@DisplayName("상한 아래에서 멈춘 응답 body는 요청 timeout에 끊겨 RESPONSE_TIMEOUT으로 끝난다")
|
||||
void aResponseBodyThatStallsBelowTheCapEndsAtTheRequestTimeout() throws IOException {
|
||||
// given
|
||||
CountDownLatch release = new CountDownLatch(1);
|
||||
HttpServer server =
|
||||
HttpServer.create(new InetSocketAddress(InetAddress.getLoopbackAddress(), 0), 0);
|
||||
server.createContext(
|
||||
"/provider",
|
||||
exchange -> {
|
||||
exchange.sendResponseHeaders(200, 0);
|
||||
OutputStream body = exchange.getResponseBody();
|
||||
body.write(new byte[16]);
|
||||
body.flush();
|
||||
try {
|
||||
// A trickle that never reaches the cap and never ends.
|
||||
release.await(30, TimeUnit.SECONDS);
|
||||
} catch (InterruptedException interrupted) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
exchange.close();
|
||||
});
|
||||
server.start();
|
||||
JdkNotificationHttpGateway gateway =
|
||||
new JdkNotificationHttpGateway(Duration.ofSeconds(1), true);
|
||||
NotificationHttpRequest request =
|
||||
new NotificationHttpRequest(
|
||||
"POST",
|
||||
URI.create("http://127.0.0.1:" + server.getAddress().getPort() + "/provider"),
|
||||
Map.of(),
|
||||
new byte[] {1},
|
||||
Duration.ofSeconds(2));
|
||||
|
||||
try {
|
||||
// when
|
||||
Throwable thrown = catchThrowable(() -> gateway.exchange(request));
|
||||
|
||||
// then
|
||||
assertThat(thrown)
|
||||
.isInstanceOf(NotificationHttpTransportException.class)
|
||||
.extracting(
|
||||
failure -> ((NotificationHttpTransportException) failure).reasonCode(),
|
||||
failure -> ((NotificationHttpTransportException) failure).requestBodyCommitted())
|
||||
.containsExactly("RESPONSE_TIMEOUT", true);
|
||||
} finally {
|
||||
release.countDown();
|
||||
server.stop(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+7
-1
@@ -114,7 +114,13 @@ public final class ObjectPublicationHandoffService implements ObjectPublicationH
|
||||
.stablePhase();
|
||||
if (phase == PublicationOperationState.REFERENCE_PUBLISH_IN_PROGRESS
|
||||
|| phase == PublicationOperationState.PUBLISHED) {
|
||||
throw new IllegalStateException("published operation cannot authorize abort");
|
||||
// The publication finished first and wins. A typed refusal rather than an exception, so the
|
||||
// caller can tell "already published" — an expected race outcome — from a broken store.
|
||||
return new ObjectMutationReceipt(
|
||||
authorization.operationKey(),
|
||||
ObjectMutationOutcome.REJECTED,
|
||||
ObjectOperationError.CONFLICT,
|
||||
clock.instant());
|
||||
}
|
||||
ObjectControlStore.StoredControlRecord stored = loadHandoff(state);
|
||||
ObjectPublicationHandoffRecord authorized =
|
||||
|
||||
+8
@@ -196,6 +196,14 @@ public record S3ProviderBinding(
|
||||
throw invalid(
|
||||
"the exact MinIO release cannot claim native conditional managed mutation support");
|
||||
}
|
||||
// S3ManagedObjectProvider.retire is UNSUPPORTED. A profile that claimed the capability
|
||||
// compiled a destination whose abort recorded ABORTED and then failed on every retire,
|
||||
// leaving the bytes behind — refused here, before a destination can depend on it.
|
||||
if (config.capabilities().contains(ObjectStorageProvider.Capability.CONDITIONAL_RETIREMENT)) {
|
||||
throw invalid(
|
||||
"the managed-single S3 provider does not implement retirement and cannot claim"
|
||||
+ " CONDITIONAL_RETIREMENT");
|
||||
}
|
||||
profiles.put(name, new ObjectStorageOperationProfile(name, config.capabilities(), evidence));
|
||||
}
|
||||
return Map.copyOf(profiles);
|
||||
|
||||
+6
-5
@@ -39,6 +39,7 @@ import dev.caskeleton.application.objectstorage.model.ObjectHandoffReceipt;
|
||||
import dev.caskeleton.application.objectstorage.model.ObjectMediaType;
|
||||
import dev.caskeleton.application.objectstorage.model.ObjectMutationOutcome;
|
||||
import dev.caskeleton.application.objectstorage.model.ObjectMutationReceipt;
|
||||
import dev.caskeleton.application.objectstorage.model.ObjectOperationError;
|
||||
import dev.caskeleton.application.objectstorage.model.ObjectPublicationRequirement;
|
||||
import dev.caskeleton.application.objectstorage.model.ObjectPublishReceipt;
|
||||
import dev.caskeleton.application.objectstorage.model.ObjectReadRange;
|
||||
@@ -240,13 +241,13 @@ class StagedObjectPublicationLifecycleTest {
|
||||
handoffsAt(START).releaseClaim(release(POSTER, stage, claim));
|
||||
|
||||
// when
|
||||
Throwable thrown =
|
||||
catchThrowable(() -> handoffsAt(START).authorizeAbort(abortAuth(POSTER, stage, claim)));
|
||||
ObjectMutationReceipt refused =
|
||||
handoffsAt(START).authorizeAbort(abortAuth(POSTER, stage, claim));
|
||||
|
||||
// then
|
||||
assertThat(thrown)
|
||||
.isInstanceOf(IllegalStateException.class)
|
||||
.hasMessage("published operation cannot authorize abort");
|
||||
assertThat(refused)
|
||||
.extracting(ObjectMutationReceipt::outcome, ObjectMutationReceipt::error)
|
||||
.containsExactly(ObjectMutationOutcome.REJECTED, ObjectOperationError.CONFLICT);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
+41
-1
@@ -2,6 +2,7 @@ package dev.caskeleton.adapter.outbound.objectstorage.s3;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
|
||||
import static org.assertj.core.api.Assertions.catchThrowable;
|
||||
|
||||
import dev.caskeleton.adapter.outbound.objectstorage.config.ObjectStorageProviderSettings;
|
||||
import dev.caskeleton.adapter.outbound.objectstorage.provider.ObjectStorageProvider;
|
||||
@@ -231,6 +232,46 @@ class S3ProviderBindingTest {
|
||||
.requireSupportedProfile("managed-common"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void aProfileCannotClaimRetirementTheManagedS3ProviderDoesNotImplement() {
|
||||
// given
|
||||
S3ProviderCapabilityConfig existing = awsSettings().capabilityProfiles().get("managed-common");
|
||||
S3ProviderCapabilityConfig retirementClaim =
|
||||
new S3ProviderCapabilityConfig(
|
||||
existing.status(),
|
||||
existing.source(),
|
||||
existing.evidenceDigest(),
|
||||
existing.observedAt(),
|
||||
existing.validUntil(),
|
||||
existing.providerAndDeploymentIdentity(),
|
||||
Set.of(
|
||||
ObjectStorageProvider.Capability.IMMUTABLE_CREATE,
|
||||
ObjectStorageProvider.Capability.CONDITIONAL_RETIREMENT),
|
||||
List.of("retirement claim"));
|
||||
ObjectStorageProviderSettings claiming =
|
||||
provider(
|
||||
"aws-s3-general-purpose",
|
||||
mutate(
|
||||
awsSettings(),
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
Map.of("managed-common", retirementClaim)));
|
||||
|
||||
// when
|
||||
Throwable thrown = catchThrowable(() -> S3ProviderBinding.compile("aws", claiming, CLOCK));
|
||||
|
||||
// then
|
||||
assertThat(thrown)
|
||||
.isInstanceOf(IllegalArgumentException.class)
|
||||
.hasMessageContaining("CONDITIONAL_RETIREMENT");
|
||||
}
|
||||
|
||||
static ObjectStorageProviderSettings provider(String type, S3ProviderSettings settings) {
|
||||
return new ObjectStorageProviderSettings(
|
||||
type,
|
||||
@@ -351,7 +392,6 @@ class S3ProviderBindingTest {
|
||||
ObjectStorageProvider.Capability.EXACT_INSPECT,
|
||||
ObjectStorageProvider.Capability.FULL_READ,
|
||||
ObjectStorageProvider.Capability.RANGE_READ,
|
||||
ObjectStorageProvider.Capability.CONDITIONAL_RETIREMENT,
|
||||
ObjectStorageProvider.Capability.RESPONSE_LOSS_RESOLUTION),
|
||||
List.of("managed common subset only"));
|
||||
}
|
||||
|
||||
+8
-1
@@ -15,6 +15,7 @@ import dev.caskeleton.adapter.outbound.objectstorage.config.ObjectStorageDestina
|
||||
import dev.caskeleton.adapter.outbound.objectstorage.config.ObjectStorageProviderContribution;
|
||||
import dev.caskeleton.adapter.outbound.objectstorage.config.ObjectStorageProviderSettings;
|
||||
import dev.caskeleton.adapter.outbound.objectstorage.config.SelectedObjectStorageProviderFactory;
|
||||
import dev.caskeleton.application.objectstorage.model.ObjectCapabilityRequirement;
|
||||
import dev.caskeleton.application.outbound.SecretSourcePort;
|
||||
import java.nio.file.Path;
|
||||
import java.time.Clock;
|
||||
@@ -208,7 +209,13 @@ class S3ProviderCompositionTest {
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
// Everything the default asks for except retirement, which this provider does not
|
||||
// implement and so cannot be asked of it.
|
||||
Set.of(
|
||||
ObjectCapabilityRequirement.IMMUTABLE_CREATE,
|
||||
ObjectCapabilityRequirement.EXACT_VERSION_READ,
|
||||
ObjectCapabilityRequirement.SHA_256_VERIFICATION,
|
||||
ObjectCapabilityRequirement.RESPONSE_LOSS_RECONCILIATION),
|
||||
null,
|
||||
"managed-common")),
|
||||
null);
|
||||
|
||||
+5
-2
@@ -138,9 +138,12 @@ public class InboxItemEntity {
|
||||
|| "DELETED".equals(state);
|
||||
}
|
||||
|
||||
/** Archive; idempotent. */
|
||||
/**
|
||||
* Archive; idempotent. Expired and deleted are terminal: archiving them would move the item back
|
||||
* to a state the owner can still list, so both are left alone.
|
||||
*/
|
||||
boolean archive(Instant at) {
|
||||
if (archivedAt != null) {
|
||||
if (archivedAt != null || "EXPIRED".equals(state) || "DELETED".equals(state)) {
|
||||
return false;
|
||||
}
|
||||
archivedAt = at;
|
||||
|
||||
+14
@@ -39,6 +39,20 @@ class InboxItemEntityTest {
|
||||
assertThat(List.of(changed, item.state())).containsExactly(false, state);
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@ValueSource(strings = {"EXPIRED", "DELETED"})
|
||||
void archiveLeavesAnExpiredOrDeletedItemInItsTerminalState(String state) {
|
||||
// given
|
||||
InboxItemEntity item = item(state);
|
||||
|
||||
// when
|
||||
boolean changed = item.archive(LATER);
|
||||
|
||||
// then
|
||||
assertThat(List.of(changed, item.state(), String.valueOf(item.archivedAt())))
|
||||
.containsExactly(false, state, "null");
|
||||
}
|
||||
|
||||
private static InboxItemEntity item(String state) {
|
||||
return new InboxItemEntity(
|
||||
UUID.randomUUID(), "tenant-a", "user-1", null, "transactional", "{}", state, CREATED, null);
|
||||
|
||||
+18
-2
@@ -82,7 +82,12 @@ public final class DefaultMongoImperativeExecutor implements MongoImperativeExec
|
||||
|
||||
String physicalCollection = collections.require(context.collectionProfile());
|
||||
MongoOperations operations = consistency.templateFor(context.consistency());
|
||||
ScopedAccess access = new ScopedAccess(physicalCollection, operations, context.timeout());
|
||||
ScopedAccess access =
|
||||
new ScopedAccess(
|
||||
physicalCollection,
|
||||
operations,
|
||||
context.timeout(),
|
||||
consistency.writeConcernFor(context.consistency()));
|
||||
|
||||
long startedAt = System.nanoTime();
|
||||
try (MongoOperationObservation observation = observer.start(context, operationType)) {
|
||||
@@ -151,11 +156,22 @@ public final class DefaultMongoImperativeExecutor implements MongoImperativeExec
|
||||
|
||||
private final java.time.Duration timeout;
|
||||
|
||||
private final com.mongodb.WriteConcern writeConcern;
|
||||
|
||||
private ScopedAccess(
|
||||
String physicalCollection, MongoOperations operations, java.time.Duration timeout) {
|
||||
String physicalCollection,
|
||||
MongoOperations operations,
|
||||
java.time.Duration timeout,
|
||||
com.mongodb.WriteConcern writeConcern) {
|
||||
this.physicalCollection = physicalCollection;
|
||||
this.operations = operations;
|
||||
this.timeout = timeout;
|
||||
this.writeConcern = writeConcern;
|
||||
}
|
||||
|
||||
@Override
|
||||
public com.mongodb.WriteConcern writeConcern() {
|
||||
return writeConcern;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+5
@@ -89,6 +89,11 @@ public final class MongoConsistencyBinder {
|
||||
return bound;
|
||||
}
|
||||
|
||||
/** The write concern a profile's template was bound to, for driver-level writes. */
|
||||
public WriteConcern writeConcernFor(MongoConsistencyProfile profile) {
|
||||
return writeConcernOf(registry.require(profile));
|
||||
}
|
||||
|
||||
/**
|
||||
* Applies a profile's read settings to one query.
|
||||
*
|
||||
|
||||
+10
@@ -1,5 +1,6 @@
|
||||
package dev.caskeleton.adapter.outbound.mongo.imperative;
|
||||
|
||||
import com.mongodb.WriteConcern;
|
||||
import java.time.Duration;
|
||||
import org.springframework.data.mongodb.core.MongoOperations;
|
||||
|
||||
@@ -21,4 +22,13 @@ public interface MongoPlatformCollectionAccess extends MongoCollectionAccess {
|
||||
|
||||
/** The same finite operation deadline platform executors must attach to raw driver work. */
|
||||
Duration operationTimeout();
|
||||
|
||||
/**
|
||||
* The operation's consistency-profile write concern, for raw driver work.
|
||||
*
|
||||
* <p>A collection taken from {@code rawOperations().getCollection(...)} carries the client's
|
||||
* default write concern, not the one the profile's template was bound to: the template applies
|
||||
* its own only to the writes it issues itself. Driver-level writes attach this one explicitly.
|
||||
*/
|
||||
WriteConcern writeConcern();
|
||||
}
|
||||
|
||||
+3
-1
@@ -89,7 +89,9 @@ public final class MongoBulkExecutor {
|
||||
access
|
||||
.rawOperations()
|
||||
.getCollection(access.collection())
|
||||
.withTimeout(access.operationTimeout().toMillis(), TimeUnit.MILLISECONDS);
|
||||
.withTimeout(access.operationTimeout().toMillis(), TimeUnit.MILLISECONDS)
|
||||
// The raw collection has the client's write concern, not the profile's.
|
||||
.withWriteConcern(access.writeConcern());
|
||||
List<WriteModel<Document>> writes =
|
||||
mappedWrites(
|
||||
plan,
|
||||
|
||||
+45
-1
@@ -2,8 +2,12 @@ package dev.caskeleton.adapter.outbound.mongo.rs;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import com.mongodb.ConnectionString;
|
||||
import com.mongodb.MongoClientSettings;
|
||||
import com.mongodb.client.MongoClient;
|
||||
import com.mongodb.client.MongoClients;
|
||||
import com.mongodb.event.CommandListener;
|
||||
import com.mongodb.event.CommandStartedEvent;
|
||||
import dev.caskeleton.adapter.outbound.mongo.api.CollectionProfileName;
|
||||
import dev.caskeleton.adapter.outbound.mongo.api.MongoOperationContext;
|
||||
import dev.caskeleton.adapter.outbound.mongo.api.consistency.MongoConsistencyProfile;
|
||||
@@ -28,6 +32,10 @@ import dev.caskeleton.adapter.outbound.mongo.mapping.MongoCustomConversionsFacto
|
||||
import dev.caskeleton.adapter.outbound.mongo.testkit.rs.MongoSingleReplicaSetContainer;
|
||||
import java.math.BigInteger;
|
||||
import java.time.Duration;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import org.bson.BsonDocument;
|
||||
import org.bson.BsonString;
|
||||
import org.bson.Document;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
@@ -59,6 +67,9 @@ class MongoBulkMappingLaneTest {
|
||||
MongoConsistencyProfile.PRIMARY_MAJORITY,
|
||||
Duration.ofSeconds(10));
|
||||
|
||||
/** Every command the client started, as the server received it. */
|
||||
private static final List<BsonDocument> SENT = new CopyOnWriteArrayList<>();
|
||||
|
||||
private static MongoSingleReplicaSetContainer mongo;
|
||||
|
||||
private static MongoClient client;
|
||||
@@ -74,7 +85,18 @@ class MongoBulkMappingLaneTest {
|
||||
static void start() {
|
||||
mongo = MongoSingleReplicaSetContainer.mongoEight();
|
||||
mongo.start();
|
||||
client = MongoClients.create(mongo.connectionString());
|
||||
client =
|
||||
MongoClients.create(
|
||||
MongoClientSettings.builder()
|
||||
.applyConnectionString(new ConnectionString(mongo.connectionString()))
|
||||
.addCommandListener(
|
||||
new CommandListener() {
|
||||
@Override
|
||||
public void commandStarted(CommandStartedEvent event) {
|
||||
SENT.add(event.getCommand().clone());
|
||||
}
|
||||
})
|
||||
.build());
|
||||
template = templateWithTheManifestConversions(client);
|
||||
bulk =
|
||||
new MongoBulkExecutor(
|
||||
@@ -140,6 +162,28 @@ class MongoBulkMappingLaneTest {
|
||||
.isEqualTo(new Order(new DomainDocumentId("o-2"), "NEW", amount));
|
||||
}
|
||||
|
||||
@Test
|
||||
void aBulkWriteCarriesTheProfileWriteConcern() {
|
||||
// given
|
||||
template.getCollection("orders").insertOne(new Document("_id", "o-3").append("st", "NEW"));
|
||||
MongoBulkWritePlan plan =
|
||||
MongoBulkWritePlan.builder(MongoBulkMode.ORDERED)
|
||||
.update(AtomicFilter.id("o-3"), AtomicUpdate.set("status", "PAID"))
|
||||
.build();
|
||||
SENT.clear();
|
||||
|
||||
// when
|
||||
bulk.execute(CONTEXT, Order.class, plan);
|
||||
|
||||
// then
|
||||
assertThat(
|
||||
SENT.stream()
|
||||
.filter(command -> command.containsKey("update"))
|
||||
.map(command -> String.valueOf(command.get("writeConcern")))
|
||||
.toList())
|
||||
.containsExactly(new BsonDocument("w", new BsonString("majority")).toString());
|
||||
}
|
||||
|
||||
private static MongoTemplate templateWithTheManifestConversions(MongoClient client) {
|
||||
SimpleMongoClientDatabaseFactory factory =
|
||||
new SimpleMongoClientDatabaseFactory(client, "bulkmapping");
|
||||
|
||||
+31
-1
@@ -3,6 +3,7 @@ package dev.caskeleton.application.fileserver.lifecycle;
|
||||
import dev.caskeleton.application.fileserver.api.FileId;
|
||||
import dev.caskeleton.application.fileserver.api.FileState;
|
||||
import dev.caskeleton.application.fileserver.api.StorageNamespace;
|
||||
import dev.caskeleton.application.fileserver.api.UploadId;
|
||||
import dev.caskeleton.application.fileserver.api.content.StoredContent;
|
||||
import dev.caskeleton.application.fileserver.api.error.ConcurrentFileModificationException;
|
||||
import dev.caskeleton.application.fileserver.api.error.FileNotFoundException;
|
||||
@@ -13,6 +14,7 @@ import dev.caskeleton.application.fileserver.api.metadata.FileMetadataStore;
|
||||
import dev.caskeleton.application.fileserver.api.metadata.FileRecord;
|
||||
import dev.caskeleton.application.fileserver.api.metadata.FileRecordDraft;
|
||||
import dev.caskeleton.application.fileserver.api.metadata.FileRecordMutation;
|
||||
import dev.caskeleton.application.fileserver.api.metadata.UploadSessionStore;
|
||||
import dev.caskeleton.application.fileserver.api.security.FileAccessPolicy;
|
||||
import dev.caskeleton.application.fileserver.api.security.FileOperation;
|
||||
import dev.caskeleton.application.fileserver.api.security.OriginalFilenamePolicy;
|
||||
@@ -20,6 +22,7 @@ import dev.caskeleton.application.fileserver.api.security.RequestContext;
|
||||
import dev.caskeleton.application.fileserver.api.security.SanitizedFilename;
|
||||
import dev.caskeleton.application.fileserver.cleanup.CleanupQueue;
|
||||
import dev.caskeleton.application.fileserver.cleanup.FileRetirement;
|
||||
import dev.caskeleton.application.fileserver.recovery.StagingUploadLocator;
|
||||
import dev.caskeleton.application.fileserver.upload.FileView;
|
||||
import dev.caskeleton.application.fileserver.upload.UploadIdentifierFactory;
|
||||
import dev.caskeleton.application.transaction.TransactionPort;
|
||||
@@ -45,6 +48,8 @@ public final class DefaultFileLifecycleService implements FileLifecycleService {
|
||||
private final TransactionPort transactions;
|
||||
private final Clock clock;
|
||||
private final FileRetirement retirement;
|
||||
private final UploadSessionStore sessionStore;
|
||||
private final StagingUploadLocator stagingLocator;
|
||||
|
||||
public DefaultFileLifecycleService(
|
||||
FileMetadataStore metadataStore,
|
||||
@@ -52,6 +57,8 @@ public final class DefaultFileLifecycleService implements FileLifecycleService {
|
||||
FileAccessPolicy accessPolicy,
|
||||
OriginalFilenamePolicy filenamePolicy,
|
||||
CleanupQueue cleanupQueue,
|
||||
UploadSessionStore sessionStore,
|
||||
StagingUploadLocator stagingLocator,
|
||||
UploadIdentifierFactory identifierFactory,
|
||||
TransactionPort transactions,
|
||||
Clock clock) {
|
||||
@@ -63,6 +70,8 @@ public final class DefaultFileLifecycleService implements FileLifecycleService {
|
||||
this.transactions = transactions;
|
||||
this.clock = clock;
|
||||
this.retirement = new FileRetirement(metadataStore, cleanupQueue);
|
||||
this.sessionStore = sessionStore;
|
||||
this.stagingLocator = stagingLocator;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -81,7 +90,28 @@ public final class DefaultFileLifecycleService implements FileLifecycleService {
|
||||
// One boundary for the whole decision: a record that reached DELETING without either its
|
||||
// terminal transition or a queued reclamation would be unreachable and never collected.
|
||||
return transactions.inWrite(
|
||||
() -> new DeleteOutcome(fileId, retirement.retire(record, Optional.empty())));
|
||||
() -> {
|
||||
Optional<UploadId> upload = unfinishedUpload(record);
|
||||
// Same rule as cancel: the session ends in the commit that queues its staging bytes, so
|
||||
// no writer can take a lease on bytes the cleanup is about to delete, and the expiry
|
||||
// sweep — which skips a DELETED record — is not left as the only way to reclaim them.
|
||||
upload.ifPresent(sessionStore::terminate);
|
||||
return new DeleteOutcome(fileId, retirement.retire(record, upload));
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* The upload whose staging bytes an unfinished record still owns.
|
||||
*
|
||||
* <p>Only a record the upload has not finished with — UPLOADING, UPLOADED or FAILED — can have
|
||||
* staged bytes; a published record's bytes are its content key, which retirement already queues.
|
||||
*/
|
||||
private Optional<UploadId> unfinishedUpload(FileRecord record) {
|
||||
FileState state = record.state();
|
||||
if (state != FileState.UPLOADING && state != FileState.UPLOADED && state != FileState.FAILED) {
|
||||
return Optional.empty();
|
||||
}
|
||||
return stagingLocator.locate(record.fileId());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+34
-11
@@ -8,6 +8,9 @@ import dev.caskeleton.application.fileserver.api.metadata.FileMetadataStore;
|
||||
import dev.caskeleton.application.fileserver.api.metadata.FileRecord;
|
||||
import dev.caskeleton.application.fileserver.api.metadata.FileRecordMutation;
|
||||
import dev.caskeleton.application.fileserver.api.metadata.FileRecoveryQuery;
|
||||
import dev.caskeleton.application.fileserver.api.metadata.UploadSession;
|
||||
import dev.caskeleton.application.fileserver.api.metadata.UploadSessionStore;
|
||||
import dev.caskeleton.application.fileserver.upload.QuotaCommitGateway;
|
||||
import dev.caskeleton.application.transaction.TransactionPort;
|
||||
import java.time.Clock;
|
||||
import java.time.Duration;
|
||||
@@ -27,19 +30,28 @@ public final class DefaultFileReconciliationService implements FileReconciliatio
|
||||
private static final Duration STALE_AFTER = Duration.ofMinutes(5);
|
||||
|
||||
private final FileMetadataStore metadataStore;
|
||||
private final UploadSessionStore sessionStore;
|
||||
private final StagingUploadLocator stagingLocator;
|
||||
private final ReconciliationContentProbe contentProbe;
|
||||
private final QuotaCommitGateway quotaGateway;
|
||||
private final RecoveryQueue recoveryQueue;
|
||||
private final TransactionPort transactions;
|
||||
private final Clock clock;
|
||||
|
||||
public DefaultFileReconciliationService(
|
||||
FileMetadataStore metadataStore,
|
||||
UploadSessionStore sessionStore,
|
||||
StagingUploadLocator stagingLocator,
|
||||
ReconciliationContentProbe contentProbe,
|
||||
QuotaCommitGateway quotaGateway,
|
||||
RecoveryQueue recoveryQueue,
|
||||
TransactionPort transactions,
|
||||
Clock clock) {
|
||||
this.metadataStore = metadataStore;
|
||||
this.sessionStore = sessionStore;
|
||||
this.stagingLocator = stagingLocator;
|
||||
this.contentProbe = contentProbe;
|
||||
this.quotaGateway = quotaGateway;
|
||||
this.recoveryQueue = recoveryQueue;
|
||||
this.transactions = transactions;
|
||||
this.clock = clock;
|
||||
@@ -139,19 +151,30 @@ public final class DefaultFileReconciliationService implements FileReconciliatio
|
||||
if (record.state() != FileState.VERIFYING) {
|
||||
return unresolved(record, "PUBLISH_STATE_UNEXPECTED");
|
||||
}
|
||||
// READY is where the finalize path converts the upload's reservation into durable usage. A
|
||||
// restored READY that skipped it would hold bytes no quota counts, so without the upload whose
|
||||
// reservation this is, the case is reported rather than restored half-way.
|
||||
Optional<UploadSession> session =
|
||||
stagingLocator.locate(record.fileId()).flatMap(sessionStore::find);
|
||||
if (session.isEmpty()) {
|
||||
return unresolved(record, "PUBLISH_UPLOAD_SESSION_ABSENT");
|
||||
}
|
||||
long size = record.actualSize().getAsLong();
|
||||
FileRecord restored =
|
||||
transactions.inWrite(
|
||||
() ->
|
||||
metadataStore.transition(
|
||||
record.fileId(),
|
||||
record.version(),
|
||||
FileState.VERIFYING,
|
||||
FileState.READY,
|
||||
FileRecordMutation.publishAt(
|
||||
key,
|
||||
record.actualSize().getAsLong(),
|
||||
record.sha256().get(),
|
||||
clock.instant())));
|
||||
() -> {
|
||||
FileRecord ready =
|
||||
metadataStore.transition(
|
||||
record.fileId(),
|
||||
record.version(),
|
||||
FileState.VERIFYING,
|
||||
FileState.READY,
|
||||
FileRecordMutation.publishAt(
|
||||
key, size, record.sha256().get(), clock.instant()));
|
||||
// Same boundary as the READY transition, as on the finalize path.
|
||||
quotaGateway.commit(session.get(), size);
|
||||
return ready;
|
||||
});
|
||||
return ReconciliationResult.resolved(
|
||||
record.fileId(),
|
||||
ReconciliationStatus.CONFIRMED_SUCCESS,
|
||||
|
||||
+13
-2
@@ -193,12 +193,23 @@ public final class DefaultFinalizeUploadService implements FinalizeUploadService
|
||||
return transactions.inWrite(
|
||||
() -> {
|
||||
FileRecord current = record;
|
||||
if (current.state() == FileState.UPLOADING || current.state() == FileState.CREATED) {
|
||||
if (current.state() == FileState.CREATED) {
|
||||
// CREATED has one edge, to UPLOADING; the record takes it rather than a shortcut the
|
||||
// transition table refuses.
|
||||
current =
|
||||
metadataStore.transition(
|
||||
current.fileId(),
|
||||
current.version(),
|
||||
current.state(),
|
||||
FileState.CREATED,
|
||||
FileState.UPLOADING,
|
||||
FileRecordMutation.none());
|
||||
}
|
||||
if (current.state() == FileState.UPLOADING) {
|
||||
current =
|
||||
metadataStore.transition(
|
||||
current.fileId(),
|
||||
current.version(),
|
||||
FileState.UPLOADING,
|
||||
FileState.UPLOADED,
|
||||
FileRecordMutation.uploaded(committedOffset, serverDigest));
|
||||
}
|
||||
|
||||
+39
@@ -5,13 +5,17 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy;
|
||||
|
||||
import dev.caskeleton.application.fileserver.api.FileState;
|
||||
import dev.caskeleton.application.fileserver.api.StorageNamespace;
|
||||
import dev.caskeleton.application.fileserver.api.UploadId;
|
||||
import dev.caskeleton.application.fileserver.api.error.ConcurrentFileModificationException;
|
||||
import dev.caskeleton.application.fileserver.api.error.FileAccessDeniedException;
|
||||
import dev.caskeleton.application.fileserver.api.error.FileNotReadyException;
|
||||
import dev.caskeleton.application.fileserver.api.error.StorageUnavailableException;
|
||||
import dev.caskeleton.application.fileserver.api.metadata.FileRecord;
|
||||
import dev.caskeleton.application.fileserver.api.metadata.UploadSessionDraft;
|
||||
import dev.caskeleton.application.fileserver.api.security.FileOperation;
|
||||
import dev.caskeleton.application.fileserver.api.security.OriginalFilenamePolicy;
|
||||
import dev.caskeleton.application.fileserver.api.transfer.UploadMode;
|
||||
import dev.caskeleton.application.fileserver.cleanup.CleanupRequest;
|
||||
import dev.caskeleton.application.fileserver.cleanup.CleanupType;
|
||||
import dev.caskeleton.application.fileserver.testkit.DirectTransactions;
|
||||
import dev.caskeleton.application.fileserver.testkit.FakeCopyContentGateway;
|
||||
@@ -19,12 +23,16 @@ import dev.caskeleton.application.fileserver.testkit.FakeFileAccessPolicy;
|
||||
import dev.caskeleton.application.fileserver.testkit.FileserverFixtures;
|
||||
import dev.caskeleton.application.fileserver.testkit.InMemoryCleanupQueue;
|
||||
import dev.caskeleton.application.fileserver.testkit.InMemoryFileMetadataStore;
|
||||
import dev.caskeleton.application.fileserver.testkit.InMemoryUploadSessionStore;
|
||||
import dev.caskeleton.application.fileserver.testkit.ReadyFileFixture;
|
||||
import dev.caskeleton.application.fileserver.testkit.SequentialUploadIdentifierFactory;
|
||||
import dev.caskeleton.application.fileserver.upload.FileView;
|
||||
import java.time.Clock;
|
||||
import java.time.ZoneOffset;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.OptionalLong;
|
||||
import java.util.UUID;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
class FileLifecycleServiceTest {
|
||||
@@ -36,6 +44,7 @@ class FileLifecycleServiceTest {
|
||||
private final FakeCopyContentGateway copyGateway = new FakeCopyContentGateway();
|
||||
private final FakeFileAccessPolicy accessPolicy = new FakeFileAccessPolicy();
|
||||
private final InMemoryCleanupQueue cleanup = new InMemoryCleanupQueue();
|
||||
private final InMemoryUploadSessionStore sessions = new InMemoryUploadSessionStore();
|
||||
|
||||
private final FileLifecycleService service =
|
||||
new DefaultFileLifecycleService(
|
||||
@@ -44,6 +53,8 @@ class FileLifecycleServiceTest {
|
||||
accessPolicy,
|
||||
OriginalFilenamePolicy.standard(),
|
||||
cleanup,
|
||||
sessions,
|
||||
sessions,
|
||||
new SequentialUploadIdentifierFactory(),
|
||||
new DirectTransactions(),
|
||||
Clock.fixed(FileserverFixtures.NOW, ZoneOffset.UTC));
|
||||
@@ -77,6 +88,34 @@ class FileLifecycleServiceTest {
|
||||
assertThat(cleanup.queued()).isEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
void deletingAnInProgressUploadEndsItsSessionAndSchedulesItsStagingForCleanup() {
|
||||
// given
|
||||
FileRecord uploading = ReadyFileFixture.uploading(metadata, SIZE, DIGEST);
|
||||
UploadId uploadId = UploadId.of(UUID.randomUUID());
|
||||
sessions.create(
|
||||
new UploadSessionDraft(
|
||||
uploadId,
|
||||
uploading.fileId(),
|
||||
UploadMode.SINGLE_SHOT,
|
||||
OptionalLong.of(SIZE),
|
||||
FileserverFixtures.NOW.plusSeconds(3600)));
|
||||
|
||||
// when
|
||||
service.delete(uploading.fileId(), Optional.empty(), FileserverFixtures.context());
|
||||
|
||||
// then
|
||||
assertThat(
|
||||
List.of(
|
||||
sessions.find(uploadId).orElseThrow().terminal(),
|
||||
cleanup.queued().stream().map(item -> item.request()).toList()))
|
||||
.containsExactly(
|
||||
true,
|
||||
List.of(
|
||||
CleanupRequest.forStaging(
|
||||
CleanupType.CANCELLED_STAGING, uploading.fileId(), uploadId)));
|
||||
}
|
||||
|
||||
@Test
|
||||
void deletingAVerifyingFileIsAConflictRatherThanAnInventedTransition() {
|
||||
FileRecord verifying = ReadyFileFixture.verifying(metadata, SIZE, DIGEST);
|
||||
|
||||
+59
@@ -5,15 +5,23 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
import dev.caskeleton.application.fileserver.api.ContentKey;
|
||||
import dev.caskeleton.application.fileserver.api.FileId;
|
||||
import dev.caskeleton.application.fileserver.api.FileState;
|
||||
import dev.caskeleton.application.fileserver.api.UploadId;
|
||||
import dev.caskeleton.application.fileserver.api.metadata.FileRecord;
|
||||
import dev.caskeleton.application.fileserver.api.metadata.FileRecordMutation;
|
||||
import dev.caskeleton.application.fileserver.api.metadata.UploadSessionDraft;
|
||||
import dev.caskeleton.application.fileserver.api.transfer.UploadMode;
|
||||
import dev.caskeleton.application.fileserver.testkit.DirectTransactions;
|
||||
import dev.caskeleton.application.fileserver.testkit.FakeQuotaCommitGateway;
|
||||
import dev.caskeleton.application.fileserver.testkit.FakeReconciliationContentProbe;
|
||||
import dev.caskeleton.application.fileserver.testkit.FileserverFixtures;
|
||||
import dev.caskeleton.application.fileserver.testkit.InMemoryFileMetadataStore;
|
||||
import dev.caskeleton.application.fileserver.testkit.InMemoryRecoveryQueue;
|
||||
import dev.caskeleton.application.fileserver.testkit.InMemoryUploadSessionStore;
|
||||
import java.time.Clock;
|
||||
import java.time.ZoneOffset;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.OptionalLong;
|
||||
import java.util.UUID;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@@ -24,11 +32,16 @@ class FileReconciliationServiceTest {
|
||||
private final InMemoryFileMetadataStore metadata = new InMemoryFileMetadataStore();
|
||||
private final FakeReconciliationContentProbe probe = new FakeReconciliationContentProbe();
|
||||
private final InMemoryRecoveryQueue recovery = new InMemoryRecoveryQueue();
|
||||
private final InMemoryUploadSessionStore sessions = new InMemoryUploadSessionStore();
|
||||
private final FakeQuotaCommitGateway quota = new FakeQuotaCommitGateway();
|
||||
|
||||
private final FileReconciliationService service =
|
||||
new DefaultFileReconciliationService(
|
||||
metadata,
|
||||
sessions,
|
||||
sessions,
|
||||
probe,
|
||||
quota,
|
||||
recovery,
|
||||
new DirectTransactions(),
|
||||
Clock.fixed(FileserverFixtures.NOW, ZoneOffset.UTC));
|
||||
@@ -43,6 +56,42 @@ class FileReconciliationServiceTest {
|
||||
assertThat(metadata.find(fileId).orElseThrow().state()).isEqualTo(FileState.READY);
|
||||
}
|
||||
|
||||
@Test
|
||||
void restoringReadyCommitsThePublishedBytesToQuota() {
|
||||
// given
|
||||
FileId fileId = preparePhysicalObjectAndVerifyingMetadata();
|
||||
|
||||
// when
|
||||
service.reconcile(fileId);
|
||||
|
||||
// then
|
||||
assertThat(quota.committedBytes()).isEqualTo(10);
|
||||
}
|
||||
|
||||
@Test
|
||||
void aPublishWithoutItsUploadSessionIsUnresolvedRatherThanReadyWithoutQuota() {
|
||||
// given
|
||||
FileId fileId = preparePhysicalObjectAndVerifyingMetadata();
|
||||
FileReconciliationService withoutSessions =
|
||||
new DefaultFileReconciliationService(
|
||||
metadata,
|
||||
sessions,
|
||||
ignored -> Optional.empty(),
|
||||
probe,
|
||||
quota,
|
||||
recovery,
|
||||
new DirectTransactions(),
|
||||
Clock.fixed(FileserverFixtures.NOW, ZoneOffset.UTC));
|
||||
|
||||
// when
|
||||
ReconciliationResult result = withoutSessions.reconcile(fileId);
|
||||
|
||||
// then
|
||||
assertThat(List.of(result.status(), result.reasonCode(), metadata.find(fileId).get().state()))
|
||||
.containsExactly(
|
||||
ReconciliationStatus.UNRESOLVED, "PUBLISH_UPLOAD_SESSION_ABSENT", FileState.VERIFYING);
|
||||
}
|
||||
|
||||
@Test
|
||||
void neverGuessesReadyWhenDigestCannotBeVerified() {
|
||||
FileId fileId = prepareUnknownPhysicalObject();
|
||||
@@ -90,7 +139,10 @@ class FileReconciliationServiceTest {
|
||||
FileReconciliationService withoutObject =
|
||||
new DefaultFileReconciliationService(
|
||||
metadata,
|
||||
sessions,
|
||||
sessions,
|
||||
emptyProbe,
|
||||
quota,
|
||||
recovery,
|
||||
new DirectTransactions(),
|
||||
Clock.fixed(FileserverFixtures.NOW, ZoneOffset.UTC));
|
||||
@@ -219,6 +271,13 @@ class FileReconciliationServiceTest {
|
||||
private FileId verifyingWithContentKeyButNoObject() {
|
||||
FileId fileId = FileId.of(UUID.randomUUID());
|
||||
FileRecord created = metadata.insert(FileserverFixtures.draft(fileId, 10));
|
||||
sessions.create(
|
||||
new UploadSessionDraft(
|
||||
UploadId.of(UUID.randomUUID()),
|
||||
fileId,
|
||||
UploadMode.SINGLE_SHOT,
|
||||
OptionalLong.of(10),
|
||||
FileserverFixtures.NOW.plusSeconds(3600)));
|
||||
FileRecord uploading =
|
||||
metadata.transition(
|
||||
created.fileId(),
|
||||
|
||||
+17
-1
@@ -1,5 +1,6 @@
|
||||
package dev.caskeleton.application.fileserver.testkit;
|
||||
|
||||
import dev.caskeleton.application.fileserver.api.FileId;
|
||||
import dev.caskeleton.application.fileserver.api.UploadId;
|
||||
import dev.caskeleton.application.fileserver.api.error.ConcurrentFileModificationException;
|
||||
import dev.caskeleton.application.fileserver.api.error.FileserverErrorCode;
|
||||
@@ -8,6 +9,7 @@ import dev.caskeleton.application.fileserver.api.metadata.UploadSession;
|
||||
import dev.caskeleton.application.fileserver.api.metadata.UploadSessionDraft;
|
||||
import dev.caskeleton.application.fileserver.api.metadata.UploadSessionStore;
|
||||
import dev.caskeleton.application.fileserver.api.metadata.WriterLease;
|
||||
import dev.caskeleton.application.fileserver.recovery.StagingUploadLocator;
|
||||
import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.util.ArrayList;
|
||||
@@ -23,8 +25,11 @@ import java.util.UUID;
|
||||
* <p>A lease is granted only when none is held or the held one expired, and an offset commit
|
||||
* requires the exact token plus the expected offset. A terminal session refuses all three, which is
|
||||
* what the {@code lifecycle_state = 'ACTIVE'} clause on the JPA statements does.
|
||||
*
|
||||
* <p>Also answers {@link StagingUploadLocator} from the same sessions, as the JPA locator reads the
|
||||
* session table: the newest session recorded for a file.
|
||||
*/
|
||||
public final class InMemoryUploadSessionStore implements UploadSessionStore {
|
||||
public final class InMemoryUploadSessionStore implements UploadSessionStore, StagingUploadLocator {
|
||||
|
||||
private final Map<UploadId, UploadSession> sessions = new LinkedHashMap<>();
|
||||
private Instant now = FileserverFixtures.NOW;
|
||||
@@ -59,6 +64,17 @@ public final class InMemoryUploadSessionStore implements UploadSessionStore {
|
||||
return Optional.ofNullable(sessions.get(uploadId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<UploadId> locate(FileId fileId) {
|
||||
UploadId newest = null;
|
||||
for (UploadSession session : sessions.values()) {
|
||||
if (session.fileId().equals(fileId)) {
|
||||
newest = session.uploadId();
|
||||
}
|
||||
}
|
||||
return Optional.ofNullable(newest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WriterLease acquireLease(
|
||||
UploadId uploadId,
|
||||
|
||||
+18
@@ -307,6 +307,24 @@ class FinalizeUploadServiceTest {
|
||||
assertThat(quota.anyCommitted()).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
void aRecordStillCreatedIsWalkedThroughUploadingToReady() {
|
||||
// given
|
||||
FileId fileId = FileId.of(UUID.randomUUID());
|
||||
metadata.insert(FileserverFixtures.draft(fileId, 10));
|
||||
UploadSession session = FileserverFixtures.session(fileId, 10, 10);
|
||||
|
||||
// when
|
||||
FileView result =
|
||||
service.finalizeUpload(
|
||||
session,
|
||||
FinalizeUploadRequest.synchronousWithoutDigest(),
|
||||
FileserverFixtures.context());
|
||||
|
||||
// then
|
||||
assertThat(result.state()).isEqualTo(FileState.READY);
|
||||
}
|
||||
|
||||
private UploadSession uploadedSession(long length) {
|
||||
return uploadedSession(length, length);
|
||||
}
|
||||
|
||||
+109
-27
@@ -1,11 +1,13 @@
|
||||
package dev.caskeleton.application.notification.platform.dispatch;
|
||||
|
||||
import dev.caskeleton.application.notification.platform.api.NotificationVariable;
|
||||
import dev.caskeleton.application.notification.platform.api.delivery.AttemptConfirmation;
|
||||
import dev.caskeleton.application.notification.platform.api.delivery.RecipientDeliveryState;
|
||||
import dev.caskeleton.application.notification.platform.api.delivery.SubmissionOutcome;
|
||||
import dev.caskeleton.application.notification.platform.api.error.FailureCategory;
|
||||
import dev.caskeleton.application.notification.platform.api.error.NotificationException;
|
||||
import dev.caskeleton.application.notification.platform.api.error.NotificationFailureCode;
|
||||
import dev.caskeleton.application.notification.platform.api.error.ProviderUnavailableException;
|
||||
import dev.caskeleton.application.notification.platform.policy.NotificationRetryPolicy;
|
||||
import dev.caskeleton.application.notification.platform.policy.RetryBudget;
|
||||
import dev.caskeleton.application.notification.platform.policy.RetryContext;
|
||||
@@ -17,6 +19,7 @@ import dev.caskeleton.application.notification.platform.policy.RoutingDecisionEn
|
||||
import dev.caskeleton.application.notification.platform.provider.ProviderExecutionEvidence;
|
||||
import dev.caskeleton.application.notification.platform.provider.ProviderFailure;
|
||||
import dev.caskeleton.application.notification.platform.provider.ProviderProfileSnapshot;
|
||||
import dev.caskeleton.application.notification.platform.provider.ProviderRuntimeState;
|
||||
import dev.caskeleton.application.notification.platform.provider.ProviderSubmission;
|
||||
import dev.caskeleton.application.notification.platform.provider.ProviderSubmissionResult;
|
||||
import dev.caskeleton.application.notification.platform.provider.TraceContext;
|
||||
@@ -121,7 +124,7 @@ public final class NotificationDispatchService {
|
||||
|
||||
RoutingDecision decision = routing.next(routingContext(work, now));
|
||||
if (decision.selected().isEmpty()) {
|
||||
applyRoutingStop(work, decision);
|
||||
applyRoutingStop(work, decision, lease);
|
||||
releaseLease(lease);
|
||||
return;
|
||||
}
|
||||
@@ -136,10 +139,12 @@ public final class NotificationDispatchService {
|
||||
route,
|
||||
now);
|
||||
if (guard instanceof DispatchGuardOutcome.Blocked blocked) {
|
||||
// Fenced like every other write this worker makes: a lease that expired while the guard ran
|
||||
// belongs to another worker now, and an unfenced write would overwrite its state.
|
||||
transactions.inWrite(
|
||||
() ->
|
||||
recipients.transition(
|
||||
work.recipient().id(), blocked.state(), blocked.nextDispatchAt()));
|
||||
recipients.transitionHeldBy(
|
||||
work.recipient().id(), blocked.state(), blocked.nextDispatchAt(), lease));
|
||||
refreshStatus(work);
|
||||
releaseLease(lease);
|
||||
return;
|
||||
@@ -151,6 +156,13 @@ public final class NotificationDispatchService {
|
||||
try {
|
||||
content = render(work, route);
|
||||
profile = gateway.profile(route.providerProfileId());
|
||||
} catch (ProviderUnavailableException profileUnavailable) {
|
||||
// The route names a profile no runtime serves — configuration drift that a deploy may well
|
||||
// correct. It gets the ordinary retry policy rather than an immediate FAILED, and rather
|
||||
// than the old escape that left the lease held and requeued the job with no bound at all.
|
||||
retryBeforeAttempt(work, lease, now);
|
||||
releaseLease(lease);
|
||||
return;
|
||||
} catch (NotificationException preDispatch) {
|
||||
if (preDispatch.descriptor().retryable()) {
|
||||
throw preDispatch;
|
||||
@@ -201,37 +213,107 @@ public final class NotificationDispatchService {
|
||||
private void failBeforeAttempt(
|
||||
Work work, RecipientLease lease, FailureCategory category, Instant now) {
|
||||
RecipientDeliveryRecord recipient = work.recipient();
|
||||
RecipientDeliveryRecord failed =
|
||||
new RecipientDeliveryRecord(
|
||||
recipient.id(),
|
||||
recipient.notificationId(),
|
||||
recipient.tenantId(),
|
||||
recipient.recipientRef(),
|
||||
recipient.locale(),
|
||||
recipient.timeZone(),
|
||||
recipient.routingPlan(),
|
||||
recipient.routeCursor(),
|
||||
saveBeforeAttempt(
|
||||
work,
|
||||
lease,
|
||||
beforeAttempt(
|
||||
recipient,
|
||||
RecipientDeliveryState.FAILED,
|
||||
recipient.submissionOutcome(),
|
||||
recipient.deliveryOutcome(),
|
||||
recipient.evidenceLevel(),
|
||||
recipient.ambiguousAttemptExists(),
|
||||
recipient.duplicateRisk(),
|
||||
Optional.empty(),
|
||||
recipient.expiresAt(),
|
||||
recipient.leaseOwner(),
|
||||
recipient.leaseUntil(),
|
||||
recipient.attemptCount(),
|
||||
Optional.of(category.name()),
|
||||
recipient.createdAt(),
|
||||
now);
|
||||
category,
|
||||
now));
|
||||
}
|
||||
|
||||
/**
|
||||
* Schedules another pass for a delivery that failed before any attempt row, or closes it.
|
||||
*
|
||||
* <p>No attempt was made, so the attempt table cannot count these passes; the recipient's attempt
|
||||
* count does, and the budget is read from it the same way the post-attempt path reads it from the
|
||||
* attempt number. The provider state is taken as degraded — a runtime that is not there now but
|
||||
* may be registered again — so the decision rests on the backoff, the budget and the expiry.
|
||||
*/
|
||||
private void retryBeforeAttempt(Work work, RecipientLease lease, Instant now) {
|
||||
RecipientDeliveryRecord recipient = work.recipient();
|
||||
int attemptNumber = recipient.attemptCount() + 1;
|
||||
RetryDecision decision =
|
||||
retryPolicy.decide(
|
||||
new RetryContext(
|
||||
FailureCategory.TRANSIENT_PROVIDER,
|
||||
AttemptConfirmation.REJECTED,
|
||||
SubmissionOutcome.NOT_SUBMITTED,
|
||||
ProviderExecutionEvidence.notStarted(),
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
recipient.ambiguousAttemptExists(),
|
||||
work.request().expiresAt(),
|
||||
Optional.empty(),
|
||||
attemptNumber,
|
||||
new RetryBudget(maxAdditionalAttempts, recipient.attemptCount()),
|
||||
ProviderRuntimeState.DEGRADED,
|
||||
estimatedDispatchDuration,
|
||||
now));
|
||||
RecipientDeliveryRecord next =
|
||||
decision instanceof RetryDecision.RetryAfter retry
|
||||
? beforeAttempt(
|
||||
recipient,
|
||||
RecipientDeliveryState.RETRY_WAITING,
|
||||
Optional.of(now.plus(retry.delay())),
|
||||
attemptNumber,
|
||||
FailureCategory.TRANSIENT_PROVIDER,
|
||||
now)
|
||||
: beforeAttempt(
|
||||
recipient,
|
||||
RecipientDeliveryState.FAILED,
|
||||
Optional.empty(),
|
||||
attemptNumber,
|
||||
FailureCategory.TRANSIENT_PROVIDER,
|
||||
now);
|
||||
saveBeforeAttempt(work, lease, next);
|
||||
}
|
||||
|
||||
private void saveBeforeAttempt(Work work, RecipientLease lease, RecipientDeliveryRecord updated) {
|
||||
transactions.inWrite(
|
||||
() -> {
|
||||
recipients.saveHeldBy(failed, lease);
|
||||
recipients.saveHeldBy(updated, lease);
|
||||
refreshStatus(work);
|
||||
});
|
||||
}
|
||||
|
||||
private static RecipientDeliveryRecord beforeAttempt(
|
||||
RecipientDeliveryRecord recipient,
|
||||
RecipientDeliveryState state,
|
||||
Optional<Instant> nextDispatchAt,
|
||||
int attemptCount,
|
||||
FailureCategory category,
|
||||
Instant now) {
|
||||
return new RecipientDeliveryRecord(
|
||||
recipient.id(),
|
||||
recipient.notificationId(),
|
||||
recipient.tenantId(),
|
||||
recipient.recipientRef(),
|
||||
recipient.locale(),
|
||||
recipient.timeZone(),
|
||||
recipient.routingPlan(),
|
||||
recipient.routeCursor(),
|
||||
state,
|
||||
recipient.submissionOutcome(),
|
||||
recipient.deliveryOutcome(),
|
||||
recipient.evidenceLevel(),
|
||||
recipient.ambiguousAttemptExists(),
|
||||
recipient.duplicateRisk(),
|
||||
nextDispatchAt,
|
||||
recipient.expiresAt(),
|
||||
recipient.leaseOwner(),
|
||||
recipient.leaseUntil(),
|
||||
attemptCount,
|
||||
Optional.of(category.name()),
|
||||
recipient.createdAt(),
|
||||
now);
|
||||
}
|
||||
|
||||
/**
|
||||
* Recomputes and stores the request status.
|
||||
*
|
||||
@@ -472,14 +554,14 @@ public final class NotificationDispatchService {
|
||||
clock.instant());
|
||||
}
|
||||
|
||||
private void applyRoutingStop(Work work, RoutingDecision decision) {
|
||||
private void applyRoutingStop(Work work, RoutingDecision decision, RecipientLease lease) {
|
||||
RecipientDeliveryState state =
|
||||
decision.reconciliationRequired()
|
||||
? RecipientDeliveryState.RECONCILIATION_REQUIRED
|
||||
: terminalStateFor(work);
|
||||
transactions.inWrite(
|
||||
() -> {
|
||||
recipients.transition(work.recipient().id(), state, Optional.empty());
|
||||
recipients.transitionHeldBy(work.recipient().id(), state, Optional.empty(), lease);
|
||||
refreshStatus(work);
|
||||
});
|
||||
}
|
||||
|
||||
+6
-1
@@ -15,7 +15,12 @@ import dev.caskeleton.application.notification.platform.provider.ProviderSubmiss
|
||||
*/
|
||||
public interface ProviderDispatchGatewayPort {
|
||||
|
||||
/** Current profile snapshot including credential generation. */
|
||||
/**
|
||||
* Current profile snapshot including credential generation.
|
||||
*
|
||||
* @throws dev.caskeleton.application.notification.platform.api.error.ProviderUnavailableException
|
||||
* when no runtime serves the profile, so the dispatcher can retry it on the ordinary policy
|
||||
*/
|
||||
ProviderProfileSnapshot profile(ProviderProfileId profileId);
|
||||
|
||||
/** Current health of a provider runtime. */
|
||||
|
||||
+172
@@ -17,11 +17,15 @@ import dev.caskeleton.application.notification.platform.api.delivery.SubmissionO
|
||||
import dev.caskeleton.application.notification.platform.api.error.FailureCategory;
|
||||
import dev.caskeleton.application.notification.platform.api.error.NotificationFailureCode;
|
||||
import dev.caskeleton.application.notification.platform.api.error.NotificationFailureDescriptor;
|
||||
import dev.caskeleton.application.notification.platform.api.error.ProviderUnavailableException;
|
||||
import dev.caskeleton.application.notification.platform.api.error.TemplateVariableValidationException;
|
||||
import dev.caskeleton.application.notification.platform.api.routing.Channel;
|
||||
import dev.caskeleton.application.notification.platform.contact.ContactPointStatus;
|
||||
import dev.caskeleton.application.notification.platform.contact.ContactPointType;
|
||||
import dev.caskeleton.application.notification.platform.policy.DefaultNotificationRetryPolicy;
|
||||
import dev.caskeleton.application.notification.platform.policy.JitterSource;
|
||||
import dev.caskeleton.application.notification.platform.policy.NotificationEligibilityPolicy;
|
||||
import dev.caskeleton.application.notification.platform.policy.RetryBackoff;
|
||||
import dev.caskeleton.application.notification.platform.policy.RetryDecision;
|
||||
import dev.caskeleton.application.notification.platform.policy.RoutingDecisionEngine;
|
||||
import dev.caskeleton.application.notification.platform.provider.ProviderCapabilities;
|
||||
@@ -226,6 +230,125 @@ class NotificationDispatchServiceTest {
|
||||
assertThat(scenario.stored().nextDispatchAt()).contains(notBefore);
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("provider profile 이 사라진 route 는 일반 재시도 backoff 뒤에 다시 꺼낸다")
|
||||
void aRouteWhoseProviderProfileIsGoneWaitsForTheRetryBackoff() {
|
||||
// given
|
||||
Scenario scenario = new Scenario(PlatformFakes.plan("profile-gone", Map.of()));
|
||||
RecordingLeases leases = new RecordingLeases();
|
||||
NotificationDispatchService service =
|
||||
scenario.service(leases, channel -> renderer(), new ProfileGoneGateway(), 3);
|
||||
|
||||
// when
|
||||
service.dispatch(scenario.lease());
|
||||
|
||||
// then
|
||||
assertThat(scenario.stored())
|
||||
.extracting(
|
||||
RecipientDeliveryRecord::state,
|
||||
RecipientDeliveryRecord::nextDispatchAt,
|
||||
RecipientDeliveryRecord::attemptCount,
|
||||
RecipientDeliveryRecord::lastFailureCategory)
|
||||
.containsExactly(
|
||||
RecipientDeliveryState.RETRY_WAITING,
|
||||
Optional.of(NOW.plusSeconds(1)),
|
||||
1,
|
||||
Optional.of("TRANSIENT_PROVIDER"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("provider profile 이 사라진 route 는 재시도 한도를 다 쓰면 FAILED 로 닫힌다")
|
||||
void aRouteWhoseProviderProfileIsGoneFailsOnceTheRetryBudgetIsSpent() {
|
||||
// given
|
||||
Scenario scenario = new Scenario(PlatformFakes.plan("profile-gone-budget", Map.of()));
|
||||
RecordingLeases leases = new RecordingLeases();
|
||||
NotificationDispatchService service =
|
||||
scenario.service(leases, channel -> renderer(), new ProfileGoneGateway(), 0);
|
||||
|
||||
// when
|
||||
service.dispatch(scenario.lease());
|
||||
|
||||
// then
|
||||
assertThat(List.of(scenario.stored().state(), leases.released))
|
||||
.containsExactly(RecipientDeliveryState.FAILED, List.of(scenario.lease()));
|
||||
}
|
||||
|
||||
@Test
|
||||
void aGuardBlockWrittenAfterTheLeaseWasLostChangesNothing() {
|
||||
// given
|
||||
NotificationPlan base = PlatformFakes.plan("blocked-lease-lost", Map.of());
|
||||
Scenario scenario =
|
||||
new Scenario(
|
||||
new NotificationPlan(
|
||||
base.tenantId(),
|
||||
base.idempotencyKey(),
|
||||
base.category(),
|
||||
base.template(),
|
||||
base.variables(),
|
||||
base.recipients(),
|
||||
base.deliveryStrategy(),
|
||||
Optional.of(NOW.plusSeconds(3600)),
|
||||
base.expiresAt(),
|
||||
base.deduplication(),
|
||||
base.collapse(),
|
||||
base.correlationId(),
|
||||
base.boundedMetadata()));
|
||||
scenario.recipients.transition(
|
||||
scenario.recipient.id(), RecipientDeliveryState.READY_TO_DISPATCH, Optional.of(NOW));
|
||||
RecipientDeliveryRecord beforeDispatch = scenario.stored();
|
||||
scenario.recipients.supersededLeases.add(scenario.lease());
|
||||
NotificationDispatchService service =
|
||||
scenario.service(new RecordingLeases(), channel -> renderer());
|
||||
|
||||
// when
|
||||
service.dispatch(scenario.lease());
|
||||
|
||||
// then
|
||||
assertThat(scenario.stored()).isEqualTo(beforeDispatch);
|
||||
}
|
||||
|
||||
@Test
|
||||
void aRoutingStopWrittenAfterTheLeaseWasLostChangesNothing() {
|
||||
// given
|
||||
Scenario scenario = new Scenario(PlatformFakes.plan("stop-lease-lost", Map.of()));
|
||||
RecipientDeliveryRecord r = scenario.stored();
|
||||
// A non-retryable last failure makes the routing engine stop without selecting a route.
|
||||
RecipientDeliveryRecord beforeDispatch =
|
||||
scenario.recipients.save(
|
||||
new RecipientDeliveryRecord(
|
||||
r.id(),
|
||||
r.notificationId(),
|
||||
r.tenantId(),
|
||||
r.recipientRef(),
|
||||
r.locale(),
|
||||
r.timeZone(),
|
||||
r.routingPlan(),
|
||||
r.routeCursor(),
|
||||
RecipientDeliveryState.READY_TO_DISPATCH,
|
||||
r.submissionOutcome(),
|
||||
r.deliveryOutcome(),
|
||||
r.evidenceLevel(),
|
||||
r.ambiguousAttemptExists(),
|
||||
r.duplicateRisk(),
|
||||
Optional.of(NOW),
|
||||
r.expiresAt(),
|
||||
r.leaseOwner(),
|
||||
r.leaseUntil(),
|
||||
r.attemptCount(),
|
||||
Optional.of("TEMPLATE_FAILURE"),
|
||||
r.createdAt(),
|
||||
r.updatedAt()));
|
||||
scenario.recipients.supersededLeases.add(scenario.lease());
|
||||
NotificationDispatchService service =
|
||||
scenario.service(new RecordingLeases(), channel -> renderer());
|
||||
|
||||
// when
|
||||
service.dispatch(scenario.lease());
|
||||
|
||||
// then
|
||||
assertThat(scenario.stored()).isEqualTo(beforeDispatch);
|
||||
}
|
||||
|
||||
/** One accepted request and its recipient, dispatched against fakes. */
|
||||
private static final class Scenario {
|
||||
private final PlatformFakes.RequestStore requests = new PlatformFakes.RequestStore();
|
||||
@@ -262,6 +385,34 @@ class NotificationDispatchServiceTest {
|
||||
return new RecipientLease(recipient.id(), "worker-a", 1L, NOW.plusSeconds(30));
|
||||
}
|
||||
|
||||
/** Dispatches through the real retry policy with no jitter, so the backoff is exact. */
|
||||
private NotificationDispatchService service(
|
||||
RecipientLeaseStorePort leases,
|
||||
TemplateRendererRegistry renderers,
|
||||
ProviderDispatchGatewayPort gateway,
|
||||
int maxAdditionalAttempts) {
|
||||
return new NotificationDispatchService(
|
||||
requests,
|
||||
recipients,
|
||||
attempts,
|
||||
new DispatchPipeline(
|
||||
new SingleContactStore(contactPoint()),
|
||||
NotificationEligibilityPolicy.permitAll(),
|
||||
new PlatformFakes.RecordingMetrics()),
|
||||
new RoutingDecisionEngine(),
|
||||
new DefaultNotificationRetryPolicy(
|
||||
RetryBackoff.DEFAULT, JitterSource.none(), Duration.ofMinutes(1)),
|
||||
new DeliveryAttemptFactory(new PlatformFakes.SequentialIds()),
|
||||
NotificationPlatformNoops.outcomeRecorder(attempts, recipients),
|
||||
gateway,
|
||||
renderers,
|
||||
leases,
|
||||
new PlatformFakes.RecordingTransactions(),
|
||||
Clock.fixed(NOW, ZoneOffset.UTC),
|
||||
maxAdditionalAttempts,
|
||||
Duration.ofSeconds(5));
|
||||
}
|
||||
|
||||
private NotificationDispatchService service(
|
||||
RecipientLeaseStorePort leases, TemplateRendererRegistry renderers) {
|
||||
return new NotificationDispatchService(
|
||||
@@ -388,6 +539,27 @@ class NotificationDispatchServiceTest {
|
||||
}
|
||||
}
|
||||
|
||||
/** A gateway whose route names a profile no runtime serves any more. */
|
||||
private static final class ProfileGoneGateway implements ProviderDispatchGatewayPort {
|
||||
|
||||
@Override
|
||||
public ProviderProfileSnapshot profile(ProviderProfileId profileId) {
|
||||
throw new ProviderUnavailableException(
|
||||
NotificationFailureDescriptor.preDispatch(
|
||||
NotificationFailureCode.PROVIDER_UNAVAILABLE, FailureCategory.TRANSIENT_PROVIDER));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProviderRuntimeState state(ProviderProfileId profileId) {
|
||||
throw new AssertionError("no runtime state exists for a profile that is gone");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProviderSubmissionResult submit(ProviderSubmission submission) {
|
||||
throw new AssertionError("nothing may be submitted through a profile that is gone");
|
||||
}
|
||||
}
|
||||
|
||||
private static final class EmptyContactStore implements ContactPointStorePort {
|
||||
@Override
|
||||
public Optional<ContactPointRecord> find(TenantId tenantId, ContactPointId id) {
|
||||
|
||||
@@ -548,34 +548,10 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "grpc-admin",
|
||||
"gradle_path": ":grpc:grpc-admin",
|
||||
"source_path": "src/grpc/grpc-admin",
|
||||
"allowed_dependencies": [
|
||||
"grpc-core-api",
|
||||
"grpc-server",
|
||||
"grpc-policy"
|
||||
],
|
||||
"build": "optional-grpc"
|
||||
},
|
||||
{
|
||||
"id": "grpc-client",
|
||||
"gradle_path": ":grpc:grpc-client",
|
||||
"source_path": "src/grpc/grpc-client",
|
||||
"allowed_dependencies": [
|
||||
"grpc-core-api",
|
||||
"grpc-policy"
|
||||
],
|
||||
"build": "optional-grpc"
|
||||
},
|
||||
{
|
||||
"id": "grpc-codegen",
|
||||
"gradle_path": ":grpc:grpc-codegen",
|
||||
"source_path": "src/grpc/grpc-codegen",
|
||||
"allowed_dependencies": [
|
||||
"grpc-core-api",
|
||||
"grpc-proto-contract"
|
||||
],
|
||||
"id": "grpc-contract",
|
||||
"gradle_path": ":grpc:grpc-contract",
|
||||
"source_path": "src/grpc/grpc-contract",
|
||||
"allowed_dependencies": [],
|
||||
"build": "optional-grpc"
|
||||
},
|
||||
{
|
||||
@@ -585,17 +561,6 @@
|
||||
"allowed_dependencies": [],
|
||||
"build": "optional-grpc"
|
||||
},
|
||||
{
|
||||
"id": "grpc-discovery",
|
||||
"gradle_path": ":grpc:grpc-discovery",
|
||||
"source_path": "src/grpc/grpc-discovery",
|
||||
"allowed_dependencies": [
|
||||
"grpc-core-api",
|
||||
"grpc-client",
|
||||
"grpc-policy"
|
||||
],
|
||||
"build": "optional-grpc"
|
||||
},
|
||||
{
|
||||
"id": "grpc-observability",
|
||||
"gradle_path": ":grpc:grpc-observability",
|
||||
@@ -615,47 +580,22 @@
|
||||
"build": "optional-grpc"
|
||||
},
|
||||
{
|
||||
"id": "grpc-policy",
|
||||
"gradle_path": ":grpc:grpc-policy",
|
||||
"source_path": "src/grpc/grpc-policy",
|
||||
"id": "grpc-runtime",
|
||||
"gradle_path": ":grpc:grpc-runtime",
|
||||
"source_path": "src/grpc/grpc-runtime",
|
||||
"allowed_dependencies": [
|
||||
"grpc-core-api"
|
||||
],
|
||||
"build": "optional-grpc"
|
||||
},
|
||||
{
|
||||
"id": "grpc-proto-contract",
|
||||
"gradle_path": ":grpc:grpc-proto-contract",
|
||||
"source_path": "src/grpc/grpc-proto-contract",
|
||||
"allowed_dependencies": [
|
||||
"grpc-core-api"
|
||||
],
|
||||
"build": "optional-grpc"
|
||||
},
|
||||
{
|
||||
"id": "grpc-server",
|
||||
"gradle_path": ":grpc:grpc-server",
|
||||
"source_path": "src/grpc/grpc-server",
|
||||
"allowed_dependencies": [
|
||||
"grpc-core-api",
|
||||
"grpc-policy"
|
||||
],
|
||||
"build": "optional-grpc"
|
||||
},
|
||||
{
|
||||
"id": "grpc-spring-boot-starter",
|
||||
"gradle_path": ":grpc:grpc-spring-boot-starter",
|
||||
"source_path": "src/grpc/grpc-spring-boot-starter",
|
||||
"allowed_dependencies": [
|
||||
"grpc-core-api",
|
||||
"grpc-policy",
|
||||
"grpc-server",
|
||||
"grpc-client",
|
||||
"grpc-discovery",
|
||||
"grpc-admin",
|
||||
"grpc-observability",
|
||||
"grpc-proto-contract",
|
||||
"grpc-codegen"
|
||||
"grpc-runtime",
|
||||
"grpc-observability"
|
||||
],
|
||||
"build": "optional-grpc"
|
||||
},
|
||||
@@ -665,24 +605,19 @@
|
||||
"source_path": "src/grpc/grpc-testkit",
|
||||
"allowed_dependencies": [
|
||||
"grpc-core-api",
|
||||
"grpc-policy",
|
||||
"grpc-server",
|
||||
"grpc-client",
|
||||
"grpc-discovery",
|
||||
"grpc-admin",
|
||||
"grpc-runtime",
|
||||
"grpc-observability",
|
||||
"grpc-proto-contract",
|
||||
"grpc-codegen",
|
||||
"grpc-operation-ledger-jpa"
|
||||
],
|
||||
"build": "optional-grpc"
|
||||
},
|
||||
{
|
||||
"id": "grpc-advanced-bootstrap",
|
||||
"gradle_path": ":grpc-advanced:grpc-advanced-bootstrap",
|
||||
"source_path": "src/grpc-advanced/grpc-advanced-bootstrap",
|
||||
"id": "grpc-advanced",
|
||||
"gradle_path": ":grpc-advanced:grpc-advanced",
|
||||
"source_path": "src/grpc-advanced/grpc-advanced",
|
||||
"allowed_dependencies": [
|
||||
"grpc-core-api"
|
||||
"grpc-core-api",
|
||||
"grpc-runtime"
|
||||
],
|
||||
"build": "optional-grpc"
|
||||
},
|
||||
@@ -692,57 +627,7 @@
|
||||
"source_path": "src/grpc-advanced/grpc-advanced-compat",
|
||||
"allowed_dependencies": [
|
||||
"grpc-core-api",
|
||||
"grpc-policy",
|
||||
"grpc-server",
|
||||
"grpc-client",
|
||||
"grpc-advanced-bootstrap"
|
||||
],
|
||||
"build": "optional-grpc"
|
||||
},
|
||||
{
|
||||
"id": "grpc-advanced-diagnostics",
|
||||
"gradle_path": ":grpc-advanced:grpc-advanced-diagnostics",
|
||||
"source_path": "src/grpc-advanced/grpc-advanced-diagnostics",
|
||||
"allowed_dependencies": [
|
||||
"grpc-core-api",
|
||||
"grpc-client",
|
||||
"grpc-advanced-bootstrap",
|
||||
"grpc-policy"
|
||||
],
|
||||
"build": "optional-grpc"
|
||||
},
|
||||
{
|
||||
"id": "grpc-advanced-edition",
|
||||
"gradle_path": ":grpc-advanced:grpc-advanced-edition",
|
||||
"source_path": "src/grpc-advanced/grpc-advanced-edition",
|
||||
"allowed_dependencies": [
|
||||
"grpc-core-api",
|
||||
"grpc-proto-contract",
|
||||
"grpc-advanced-bootstrap"
|
||||
],
|
||||
"build": "optional-grpc"
|
||||
},
|
||||
{
|
||||
"id": "grpc-advanced-resilience",
|
||||
"gradle_path": ":grpc-advanced:grpc-advanced-resilience",
|
||||
"source_path": "src/grpc-advanced/grpc-advanced-resilience",
|
||||
"allowed_dependencies": [
|
||||
"grpc-core-api",
|
||||
"grpc-policy",
|
||||
"grpc-client",
|
||||
"grpc-discovery",
|
||||
"grpc-advanced-bootstrap"
|
||||
],
|
||||
"build": "optional-grpc"
|
||||
},
|
||||
{
|
||||
"id": "grpc-advanced-streaming",
|
||||
"gradle_path": ":grpc-advanced:grpc-advanced-streaming",
|
||||
"source_path": "src/grpc-advanced/grpc-advanced-streaming",
|
||||
"allowed_dependencies": [
|
||||
"grpc-core-api",
|
||||
"grpc-policy",
|
||||
"grpc-advanced-bootstrap"
|
||||
"grpc-runtime"
|
||||
],
|
||||
"build": "optional-grpc"
|
||||
}
|
||||
|
||||
@@ -69,6 +69,10 @@ protobuf = "4.33.2"
|
||||
# imports protobuf-bom at this major to match the gRPC BOM above; it is read through
|
||||
# `ext.protobufVersion`.
|
||||
protobufGrpc = "3.25.5"
|
||||
# The Gradle plugin that runs protoc for grpc:grpc-contract. protoc and the protobuf-java runtime
|
||||
# the generated code links against are both `protobufGrpc` above, so generator and runtime move
|
||||
# together with the gRPC BOM.
|
||||
protobufPlugin = "0.10.0"
|
||||
# The websocket leaf's proto contract is generated against an older runtime and has not been
|
||||
# requalified; see the coordinate's own comment in that leaf.
|
||||
protobufLegacy = "4.29.3"
|
||||
@@ -116,6 +120,8 @@ mockwebserver = { module = "com.squareup.okhttp3:mockwebserver", version.ref = "
|
||||
okhttp-tls = { module = "com.squareup.okhttp3:okhttp-tls", version.ref = "okhttp" }
|
||||
protobuf-java = { module = "com.google.protobuf:protobuf-java", version.ref = "protobuf" }
|
||||
protobuf-java-legacy = { module = "com.google.protobuf:protobuf-java", version.ref = "protobufLegacy" }
|
||||
protobuf-java-grpc = { module = "com.google.protobuf:protobuf-java", version.ref = "protobufGrpc" }
|
||||
protoc = { module = "com.google.protobuf:protoc", version.ref = "protobufGrpc" }
|
||||
resilience4j-bulkhead = { module = "io.github.resilience4j:resilience4j-bulkhead", version.ref = "resilience4j" }
|
||||
resilience4j-circuitbreaker = { module = "io.github.resilience4j:resilience4j-circuitbreaker", version.ref = "resilience4j" }
|
||||
resilience4j-micrometer = { module = "io.github.resilience4j:resilience4j-micrometer", version.ref = "resilience4j" }
|
||||
@@ -143,3 +149,4 @@ spotless = { id = "com.diffplug.spotless", version.ref = "spotless" }
|
||||
spotbugs = { id = "com.github.spotbugs", version.ref = "spotbugsPlugin" }
|
||||
errorprone = { id = "net.ltgt.errorprone", version.ref = "errorpronePlugin" }
|
||||
jmh = { id = "me.champeau.jmh", version.ref = "jmhPlugin" }
|
||||
protobuf = { id = "com.google.protobuf", version.ref = "protobufPlugin" }
|
||||
|
||||
@@ -37,14 +37,19 @@ property key는 `ca-skeleton.grpc.advanced.<capability>.enabled`이고 전부
|
||||
|
||||
## Leaf별 담당 capability
|
||||
|
||||
| leaf | capability |
|
||||
| --- | --- |
|
||||
| `grpc-advanced-bootstrap` | capability grade, feature flag, module guard, capability별 promotion gate |
|
||||
| `grpc-advanced-edition` | Protobuf Edition 2024 opt-in lane, Edition 2026 watch lane |
|
||||
| `grpc-advanced-streaming` | client streaming(session/dedup/checkpoint), bidi(dual sequence), manual flow control |
|
||||
| `grpc-advanced-resilience` | read-only hedging, custom name resolver SPI, custom load balancer SPI, proxyless xDS |
|
||||
| `grpc-advanced-compat` | gRPC-Web, Spring Integration bridge, Reactor adapter, Kotlin coroutine 취소 bridge |
|
||||
| `grpc-advanced-diagnostics` | Channelz/CSDS 진단 |
|
||||
| leaf | 패키지(`dev.caskeleton.grpc.advanced.*`) | capability |
|
||||
| --- | --- | --- |
|
||||
| `grpc-advanced` | `bootstrap` | capability grade, feature flag, module guard, capability별 promotion gate |
|
||||
| `grpc-advanced` | `edition` | Protobuf Edition 2024 opt-in lane, Edition 2026 watch lane |
|
||||
| `grpc-advanced` | `streaming` | client streaming(session/dedup/checkpoint), bidi(dual sequence), manual flow control |
|
||||
| `grpc-advanced` | `resilience`·`discovery`·`xds` | read-only hedging, custom name resolver SPI, custom load balancer SPI, proxyless xDS |
|
||||
| `grpc-advanced` | `diagnostics` | Channelz/CSDS 진단 |
|
||||
| `grpc-advanced-compat` | `web`·`integration`·`reactor`·`kotlin` | gRPC-Web, Spring Integration bridge, Reactor adapter, Kotlin coroutine 취소 bridge |
|
||||
|
||||
`grpc-advanced-compat`만 따로 있는 이유는 Reactor·Spring Integration이라는 실제 의존성 경계다. 나머지
|
||||
다섯 capability는 framework 의존이 없어 한 leaf에 있다(2026-09-28까지는 leaf 다섯 개). capability별
|
||||
독립은 leaf 경계가 아니라 capability flag와 promotion 레코드가 보장한다. 참조 Envoy 설정은 jar에 싣지
|
||||
않는 테스트 fixture(`grpc-advanced-compat/src/test/resources/envoy/envoy.yaml`)다.
|
||||
|
||||
## Promotion은 capability별로 독립이다
|
||||
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
plugins {
|
||||
id 'ca.platform-module'
|
||||
}
|
||||
|
||||
// The Advanced boundary itself: capability grades, the `ca-skeleton.grpc.advanced.*` feature-flag
|
||||
// contract, the module guard that refuses an unflagged capability, and the per-capability
|
||||
// promotion gate.
|
||||
//
|
||||
// This leaf depends on Stable public types and never the other way round. The Stable starter's
|
||||
// registry entry names no advanced id, so `verifyCleanArchitectureDependencies` is what makes
|
||||
// "Advanced never leaks into Stable" a build failure rather than a review note.
|
||||
dependencies {
|
||||
api project(':grpc:grpc-core-api')
|
||||
}
|
||||
@@ -1,84 +0,0 @@
|
||||
# This is a Gradle generated file for dependency locking.
|
||||
# Manual edits can break the build and are not advised.
|
||||
# This file is expected to be part of source control.
|
||||
com.github.ben-manes.caffeine:caffeine:3.2.4=annotationProcessor,testAnnotationProcessor
|
||||
com.github.kevinstern:software-and-algorithms:1.0=annotationProcessor,testAnnotationProcessor
|
||||
com.github.spotbugs:spotbugs-annotations:4.10.2=spotbugs
|
||||
com.github.spotbugs:spotbugs:4.10.2=spotbugs
|
||||
com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs
|
||||
com.google.auto.service:auto-service-annotations:1.0.1=annotationProcessor,testAnnotationProcessor
|
||||
com.google.auto.value:auto-value-annotations:1.9=annotationProcessor,testAnnotationProcessor
|
||||
com.google.auto:auto-common:1.2.2=annotationProcessor,testAnnotationProcessor
|
||||
com.google.code.findbugs:jsr305:3.0.2=checkstyle,spotbugs
|
||||
com.google.code.gson:gson:2.13.2=spotbugs
|
||||
com.google.errorprone:error_prone_annotation:2.49.0=annotationProcessor,testAnnotationProcessor
|
||||
com.google.errorprone:error_prone_annotations:2.41.0=spotbugs
|
||||
com.google.errorprone:error_prone_annotations:2.47.0=checkstyle
|
||||
com.google.errorprone:error_prone_annotations:2.49.0=annotationProcessor,testAnnotationProcessor
|
||||
com.google.errorprone:error_prone_check_api:2.49.0=annotationProcessor,testAnnotationProcessor
|
||||
com.google.errorprone:error_prone_core:2.49.0=annotationProcessor,testAnnotationProcessor
|
||||
com.google.googlejavaformat:google-java-format:1.35.0=annotationProcessor,testAnnotationProcessor
|
||||
com.google.guava:failureaccess:1.0.3=annotationProcessor,checkstyle,testAnnotationProcessor
|
||||
com.google.guava:guava:33.5.0-jre=annotationProcessor,testAnnotationProcessor
|
||||
com.google.guava:guava:33.6.0-jre=checkstyle
|
||||
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,checkstyle,testAnnotationProcessor
|
||||
com.google.j2objc:j2objc-annotations:3.1=annotationProcessor,checkstyle,testAnnotationProcessor
|
||||
com.google.protobuf:protobuf-java:4.33.2=annotationProcessor,testAnnotationProcessor
|
||||
com.h3xstream.findsecbugs:findsecbugs-plugin:1.14.0=spotbugsPlugins
|
||||
com.puppycrawl.tools:checkstyle:13.5.0=checkstyle
|
||||
commons-beanutils:commons-beanutils:1.11.0=checkstyle
|
||||
commons-collections:commons-collections:3.2.2=checkstyle
|
||||
commons-io:commons-io:2.21.0=spotbugs
|
||||
info.picocli:picocli:4.7.7=checkstyle
|
||||
io.github.eisop:dataflow-errorprone:3.41.0-eisop1=annotationProcessor,testAnnotationProcessor
|
||||
io.github.java-diff-utils:java-diff-utils:4.12=annotationProcessor,testAnnotationProcessor
|
||||
javax.inject:javax.inject:1=annotationProcessor,testAnnotationProcessor
|
||||
jaxen:jaxen:2.0.6=spotbugs
|
||||
net.bytebuddy:byte-buddy:1.17.8=testCompileClasspath,testRuntimeClasspath
|
||||
net.sf.saxon:Saxon-HE:12.9=checkstyle,spotbugs
|
||||
org.antlr:antlr4-runtime:4.13.2=checkstyle
|
||||
org.apache.bcel:bcel:6.12.0=spotbugs
|
||||
org.apache.commons:commons-lang3:3.20.0=checkstyle,spotbugs
|
||||
org.apache.commons:commons-text:1.15.0=spotbugs
|
||||
org.apache.commons:commons-text:1.3=checkstyle
|
||||
org.apache.httpcomponents:httpclient:4.5.13=checkstyle
|
||||
org.apache.httpcomponents:httpcore:4.4.16=checkstyle
|
||||
org.apache.logging.log4j:log4j-api:2.25.5=spotbugs
|
||||
org.apache.logging.log4j:log4j-core:2.25.5=spotbugs
|
||||
org.apache.maven.doxia:doxia-core:1.12.0=checkstyle
|
||||
org.apache.maven.doxia:doxia-logging-api:1.12.0=checkstyle
|
||||
org.apache.maven.doxia:doxia-module-xdoc:1.12.0=checkstyle
|
||||
org.apache.maven.doxia:doxia-sink-api:1.12.0=checkstyle
|
||||
org.apache.xbean:xbean-reflect:3.7=checkstyle
|
||||
org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath
|
||||
org.assertj:assertj-core:3.27.7=testCompileClasspath,testRuntimeClasspath
|
||||
org.codehaus.plexus:plexus-classworlds:2.6.0=checkstyle
|
||||
org.codehaus.plexus:plexus-component-annotations:2.1.0=checkstyle
|
||||
org.codehaus.plexus:plexus-container-default:2.1.0=checkstyle
|
||||
org.codehaus.plexus:plexus-utils:3.3.0=checkstyle
|
||||
org.dom4j:dom4j:2.2.0=spotbugs
|
||||
org.javassist:javassist:3.28.0-GA=checkstyle
|
||||
org.jspecify:jspecify:1.0.1=annotationProcessor,checkstyle,testAnnotationProcessor,testCompileClasspath
|
||||
org.junit.jupiter:junit-jupiter-api:6.0.3=testCompileClasspath,testRuntimeClasspath
|
||||
org.junit.jupiter:junit-jupiter-engine:6.0.3=testRuntimeClasspath
|
||||
org.junit.jupiter:junit-jupiter-params:6.0.3=testCompileClasspath,testRuntimeClasspath
|
||||
org.junit.jupiter:junit-jupiter:6.0.3=testCompileClasspath,testRuntimeClasspath
|
||||
org.junit.platform:junit-platform-commons:6.0.3=testCompileClasspath,testRuntimeClasspath
|
||||
org.junit.platform:junit-platform-engine:6.0.3=testRuntimeClasspath
|
||||
org.junit.platform:junit-platform-launcher:6.0.3=testRuntimeClasspath
|
||||
org.junit:junit-bom:6.0.3=testCompileClasspath,testRuntimeClasspath
|
||||
org.junit:junit-bom:6.1.0=spotbugs
|
||||
org.mockito:mockito-core:5.20.0=mockitoAgent
|
||||
org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath
|
||||
org.ow2.asm:asm-analysis:9.10.1=spotbugs
|
||||
org.ow2.asm:asm-commons:9.10.1=spotbugs
|
||||
org.ow2.asm:asm-tree:9.10.1=spotbugs
|
||||
org.ow2.asm:asm-util:9.10.1=spotbugs
|
||||
org.ow2.asm:asm:9.10.1=spotbugs
|
||||
org.pcollections:pcollections:4.0.1=annotationProcessor,testAnnotationProcessor
|
||||
org.reflections:reflections:0.10.2=checkstyle
|
||||
org.slf4j:slf4j-api:2.0.18=spotbugs,spotbugsSlf4j
|
||||
org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j
|
||||
org.slf4j:slf4j-simple:2.0.18=checkstyle
|
||||
org.xmlresolver:xmlresolver:5.3.3=checkstyle,spotbugs
|
||||
empty=compileClasspath,runtimeClasspath
|
||||
@@ -1,5 +1,7 @@
|
||||
plugins {
|
||||
id 'ca.platform-module'
|
||||
// grpc-platform, not platform: grpc-runtime's io.grpc api dependencies are versionless and
|
||||
// need the gRPC BOM on every classpath they reach.
|
||||
id 'ca.grpc-platform-module'
|
||||
}
|
||||
|
||||
// Compatibility bridges: gRPC-Web, the Spring Integration bridge, the Reactor adapter, and the
|
||||
@@ -7,12 +9,12 @@ plugins {
|
||||
//
|
||||
// No Kotlin source set (adaptation D7): this repository has no Kotlin toolchain, so the Kotlin side
|
||||
// is only the Java-side cancellation bridge; nothing here claims Kotlin support.
|
||||
//
|
||||
// The reference Envoy configuration is a test fixture (src/test/resources/envoy), not something
|
||||
// this jar ships: a proxy configuration belongs to the deployment that runs the proxy.
|
||||
dependencies {
|
||||
api project(':grpc:grpc-core-api')
|
||||
api project(':grpc:grpc-policy')
|
||||
api project(':grpc:grpc-server')
|
||||
api project(':grpc:grpc-client')
|
||||
api project(':grpc-advanced:grpc-advanced-bootstrap')
|
||||
api project(':grpc:grpc-runtime')
|
||||
|
||||
// api: the Reactor adapter's public signatures are Mono/Flux, and the Integration gateways name
|
||||
// Spring Integration's Message. Hiding either would only stop an adopter compiling against the
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ class GrpcIntegrationBridgePolicyTest {
|
||||
|
||||
private static final GrpcMetadataKey CORRELATION = GrpcMetadataKey.ascii("x-correlation-id");
|
||||
private static final GrpcMethodName GET =
|
||||
GrpcMethodName.parse("hyeonworks.document.v1.DocumentService/GetDocument");
|
||||
GrpcMethodName.parse("caskeleton.document.v1.DocumentService/GetDocument");
|
||||
|
||||
private static GrpcRequestContext requestContext() {
|
||||
return GrpcRequestContext.create(
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ import reactor.util.context.Context;
|
||||
class GrpcReactorContextBridgeTest {
|
||||
|
||||
private static final GrpcMethodName GET =
|
||||
GrpcMethodName.parse("hyeonworks.document.v1.DocumentService/GetDocument");
|
||||
GrpcMethodName.parse("caskeleton.document.v1.DocumentService/GetDocument");
|
||||
private static final Instant NOW = Instant.parse("2026-08-30T10:00:00Z");
|
||||
|
||||
private static GrpcContextSnapshot snapshot() {
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
plugins {
|
||||
id 'ca.platform-module'
|
||||
}
|
||||
|
||||
// Channelz/CSDS diagnostics for administrators, with the redactor that keeps socket authority,
|
||||
// credentials, certificate material, metadata and payload out of a snapshot.
|
||||
dependencies {
|
||||
api project(':grpc:grpc-core-api')
|
||||
api project(':grpc:grpc-client')
|
||||
api project(':grpc-advanced:grpc-advanced-bootstrap')
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
plugins {
|
||||
id 'ca.platform-module'
|
||||
}
|
||||
|
||||
// Protobuf Edition lanes. Edition 2024 is an opt-in Advanced lane that must produce cross-consumer
|
||||
// compile evidence before anything public moves onto it; Edition 2026 is a watch lane that records
|
||||
// release/toolchain status.
|
||||
dependencies {
|
||||
api project(':grpc:grpc-core-api')
|
||||
api project(':grpc:grpc-proto-contract')
|
||||
api project(':grpc-advanced:grpc-advanced-bootstrap')
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
plugins {
|
||||
id 'ca.platform-module'
|
||||
}
|
||||
|
||||
// Resilience and discovery capabilities that Stable refuses: read-only unary hedging, the custom
|
||||
// name resolver SPI, the custom load balancer SPI, and the proxyless xDS experimental profile.
|
||||
dependencies {
|
||||
api project(':grpc:grpc-core-api')
|
||||
api project(':grpc:grpc-policy')
|
||||
api project(':grpc:grpc-client')
|
||||
api project(':grpc:grpc-discovery')
|
||||
api project(':grpc-advanced:grpc-advanced-bootstrap')
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
plugins {
|
||||
id 'ca.platform-module'
|
||||
}
|
||||
|
||||
// The streaming shapes the Stable plan deliberately excludes: client streaming sessions with
|
||||
// dedup/checkpoint/resume, bidirectional sessions with independent per-direction sequences, and the
|
||||
// manual flow-control approval API.
|
||||
dependencies {
|
||||
api project(':grpc:grpc-core-api')
|
||||
api project(':grpc:grpc-policy')
|
||||
api project(':grpc-advanced:grpc-advanced-bootstrap')
|
||||
}
|
||||
@@ -1,91 +0,0 @@
|
||||
# This is a Gradle generated file for dependency locking.
|
||||
# Manual edits can break the build and are not advised.
|
||||
# This file is expected to be part of source control.
|
||||
com.github.ben-manes.caffeine:caffeine:3.2.4=annotationProcessor,testAnnotationProcessor
|
||||
com.github.kevinstern:software-and-algorithms:1.0=annotationProcessor,testAnnotationProcessor
|
||||
com.github.spotbugs:spotbugs-annotations:4.10.2=spotbugs
|
||||
com.github.spotbugs:spotbugs:4.10.2=spotbugs
|
||||
com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs
|
||||
com.google.auto.service:auto-service-annotations:1.0.1=annotationProcessor,testAnnotationProcessor
|
||||
com.google.auto.value:auto-value-annotations:1.9=annotationProcessor,testAnnotationProcessor
|
||||
com.google.auto:auto-common:1.2.2=annotationProcessor,testAnnotationProcessor
|
||||
com.google.code.findbugs:jsr305:3.0.2=checkstyle,compileClasspath,runtimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath
|
||||
com.google.code.gson:gson:2.13.2=spotbugs
|
||||
com.google.errorprone:error_prone_annotation:2.49.0=annotationProcessor,testAnnotationProcessor
|
||||
com.google.errorprone:error_prone_annotations:2.28.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
com.google.errorprone:error_prone_annotations:2.41.0=spotbugs
|
||||
com.google.errorprone:error_prone_annotations:2.47.0=checkstyle
|
||||
com.google.errorprone:error_prone_annotations:2.49.0=annotationProcessor,testAnnotationProcessor
|
||||
com.google.errorprone:error_prone_check_api:2.49.0=annotationProcessor,testAnnotationProcessor
|
||||
com.google.errorprone:error_prone_core:2.49.0=annotationProcessor,testAnnotationProcessor
|
||||
com.google.googlejavaformat:google-java-format:1.35.0=annotationProcessor,testAnnotationProcessor
|
||||
com.google.guava:failureaccess:1.0.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
com.google.guava:failureaccess:1.0.3=annotationProcessor,checkstyle,testAnnotationProcessor
|
||||
com.google.guava:guava:33.2.1-android=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
com.google.guava:guava:33.5.0-jre=annotationProcessor,testAnnotationProcessor
|
||||
com.google.guava:guava:33.6.0-jre=checkstyle
|
||||
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,checkstyle,compileClasspath,runtimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath
|
||||
com.google.j2objc:j2objc-annotations:3.0.0=compileClasspath,testCompileClasspath
|
||||
com.google.j2objc:j2objc-annotations:3.1=annotationProcessor,checkstyle,testAnnotationProcessor
|
||||
com.google.protobuf:protobuf-java:4.33.2=annotationProcessor,testAnnotationProcessor
|
||||
com.h3xstream.findsecbugs:findsecbugs-plugin:1.14.0=spotbugsPlugins
|
||||
com.puppycrawl.tools:checkstyle:13.5.0=checkstyle
|
||||
commons-beanutils:commons-beanutils:1.11.0=checkstyle
|
||||
commons-collections:commons-collections:3.2.2=checkstyle
|
||||
commons-io:commons-io:2.21.0=spotbugs
|
||||
info.picocli:picocli:4.7.7=checkstyle
|
||||
io.github.eisop:dataflow-errorprone:3.41.0-eisop1=annotationProcessor,testAnnotationProcessor
|
||||
io.github.java-diff-utils:java-diff-utils:4.12=annotationProcessor,testAnnotationProcessor
|
||||
io.grpc:grpc-api:1.68.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
io.grpc:grpc-stub:1.68.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
javax.inject:javax.inject:1=annotationProcessor,testAnnotationProcessor
|
||||
jaxen:jaxen:2.0.6=spotbugs
|
||||
net.bytebuddy:byte-buddy:1.17.8=testCompileClasspath,testRuntimeClasspath
|
||||
net.sf.saxon:Saxon-HE:12.9=checkstyle,spotbugs
|
||||
org.antlr:antlr4-runtime:4.13.2=checkstyle
|
||||
org.apache.bcel:bcel:6.12.0=spotbugs
|
||||
org.apache.commons:commons-lang3:3.20.0=checkstyle,spotbugs
|
||||
org.apache.commons:commons-text:1.15.0=spotbugs
|
||||
org.apache.commons:commons-text:1.3=checkstyle
|
||||
org.apache.httpcomponents:httpclient:4.5.13=checkstyle
|
||||
org.apache.httpcomponents:httpcore:4.4.16=checkstyle
|
||||
org.apache.logging.log4j:log4j-api:2.25.5=spotbugs
|
||||
org.apache.logging.log4j:log4j-core:2.25.5=spotbugs
|
||||
org.apache.maven.doxia:doxia-core:1.12.0=checkstyle
|
||||
org.apache.maven.doxia:doxia-logging-api:1.12.0=checkstyle
|
||||
org.apache.maven.doxia:doxia-module-xdoc:1.12.0=checkstyle
|
||||
org.apache.maven.doxia:doxia-sink-api:1.12.0=checkstyle
|
||||
org.apache.xbean:xbean-reflect:3.7=checkstyle
|
||||
org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath
|
||||
org.assertj:assertj-core:3.27.7=testCompileClasspath,testRuntimeClasspath
|
||||
org.checkerframework:checker-qual:3.42.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.codehaus.plexus:plexus-classworlds:2.6.0=checkstyle
|
||||
org.codehaus.plexus:plexus-component-annotations:2.1.0=checkstyle
|
||||
org.codehaus.plexus:plexus-container-default:2.1.0=checkstyle
|
||||
org.codehaus.plexus:plexus-utils:3.3.0=checkstyle
|
||||
org.dom4j:dom4j:2.2.0=spotbugs
|
||||
org.javassist:javassist:3.28.0-GA=checkstyle
|
||||
org.jspecify:jspecify:1.0.1=annotationProcessor,checkstyle,testAnnotationProcessor,testCompileClasspath
|
||||
org.junit.jupiter:junit-jupiter-api:6.0.3=testCompileClasspath,testRuntimeClasspath
|
||||
org.junit.jupiter:junit-jupiter-engine:6.0.3=testRuntimeClasspath
|
||||
org.junit.jupiter:junit-jupiter-params:6.0.3=testCompileClasspath,testRuntimeClasspath
|
||||
org.junit.jupiter:junit-jupiter:6.0.3=testCompileClasspath,testRuntimeClasspath
|
||||
org.junit.platform:junit-platform-commons:6.0.3=testCompileClasspath,testRuntimeClasspath
|
||||
org.junit.platform:junit-platform-engine:6.0.3=testRuntimeClasspath
|
||||
org.junit.platform:junit-platform-launcher:6.0.3=testRuntimeClasspath
|
||||
org.junit:junit-bom:6.0.3=testCompileClasspath,testRuntimeClasspath
|
||||
org.junit:junit-bom:6.1.0=spotbugs
|
||||
org.mockito:mockito-core:5.20.0=mockitoAgent
|
||||
org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath
|
||||
org.ow2.asm:asm-analysis:9.10.1=spotbugs
|
||||
org.ow2.asm:asm-commons:9.10.1=spotbugs
|
||||
org.ow2.asm:asm-tree:9.10.1=spotbugs
|
||||
org.ow2.asm:asm-util:9.10.1=spotbugs
|
||||
org.ow2.asm:asm:9.10.1=spotbugs
|
||||
org.pcollections:pcollections:4.0.1=annotationProcessor,testAnnotationProcessor
|
||||
org.reflections:reflections:0.10.2=checkstyle
|
||||
org.slf4j:slf4j-api:2.0.18=spotbugs,spotbugsSlf4j
|
||||
org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j
|
||||
org.slf4j:slf4j-simple:2.0.18=checkstyle
|
||||
org.xmlresolver:xmlresolver:5.3.3=checkstyle,spotbugs
|
||||
empty=
|
||||
@@ -0,0 +1,28 @@
|
||||
plugins {
|
||||
// grpc-platform, not platform: grpc-runtime's io.grpc api dependencies are versionless and
|
||||
// need the gRPC BOM on every classpath they reach.
|
||||
id 'ca.grpc-platform-module'
|
||||
}
|
||||
|
||||
// The capabilities the Stable platform deliberately excludes, each behind its own capability flag:
|
||||
//
|
||||
// bootstrap capability grades, the `ca-skeleton.grpc.advanced.*` feature-flag contract, the
|
||||
// module guard that refuses an unflagged capability, the per-capability promotion
|
||||
// gate
|
||||
// edition Protobuf Edition 2024 opt-in lane and Edition 2026 watch lane
|
||||
// streaming client streaming sessions (dedup/checkpoint/resume), bidirectional sessions with
|
||||
// independent per-direction sequences, the manual flow-control approval API
|
||||
// resilience read-only unary hedging, custom name resolver / load balancer SPIs, proxyless xDS
|
||||
// diagnostics Channelz/CSDS snapshots and the redactor that keeps secrets out of them
|
||||
//
|
||||
// These were five leaves until 2026-09-28. None of them carried a framework dependency of its own,
|
||||
// and the only rule the split enforced — Stable never reaches Advanced — is expressed by the
|
||||
// registry through the two prefixes (`grpc:*` may not depend on `grpc-advanced:*`), not by how many
|
||||
// advanced leaves exist. `grpc-advanced-compat` stays separate because Reactor and Spring
|
||||
// Integration are a real dependency boundary.
|
||||
//
|
||||
// This leaf depends on Stable public types and never the other way round.
|
||||
dependencies {
|
||||
api project(':grpc:grpc-core-api')
|
||||
api project(':grpc:grpc-runtime')
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user