From eaf189590e1bc293ab6fc2c287c0a33b685dc03e Mon Sep 17 00:00:00 2001 From: donghyeon-ka Date: Thu, 17 Sep 2026 15:22:32 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20=EB=B9=8C=EB=93=9C=20=EC=B5=9C?= =?UTF-8?q?=EC=A0=81=ED=99=94=20=EB=B0=8F=20ci=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 13 ++++ build.gradle | 23 ++++++++ .../grpc-advanced-bootstrap/build.gradle | 4 +- .../grpc-advanced-compat/build.gradle | 4 +- .../grpc-advanced-diagnostics/build.gradle | 4 +- .../grpc-advanced-edition/build.gradle | 4 +- .../grpc-advanced-resilience/build.gradle | 4 +- .../grpc-advanced-streaming/build.gradle | 4 +- grpc/CLAUDE.md | 24 ++++---- grpc/grpc-admin/build.gradle | 4 +- grpc/grpc-client/build.gradle | 8 ++- grpc/grpc-codegen/build.gradle | 4 +- grpc/grpc-core-api/build.gradle | 4 +- grpc/grpc-discovery/build.gradle | 4 +- grpc/grpc-observability/build.gradle | 4 +- grpc/grpc-operation-ledger-jpa/build.gradle | 4 +- grpc/grpc-policy/build.gradle | 8 ++- grpc/grpc-proto-contract/build.gradle | 4 +- grpc/grpc-server/build.gradle | 8 ++- grpc/grpc-spring-boot-starter/build.gradle | 6 +- grpc/grpc-testkit/build.gradle | 12 ++-- settings.gradle | 59 +++++++++++++++++++ 22 files changed, 171 insertions(+), 42 deletions(-) create mode 100644 README.md create mode 100644 build.gradle create mode 100644 settings.gradle diff --git a/README.md b/README.md new file mode 100644 index 0000000..cbd11f3 --- /dev/null +++ b/README.md @@ -0,0 +1,13 @@ +# Optional gRPC platforms + +The default application does not depend on `grpc/*` or `grpc-advanced/*`, so those 18 projects are +kept out of the main multi-project build. This build preserves their existing project paths and +internal project dependencies while making their configuration opt-in. + +```bash +./gradlew -p optional-platforms ci +./gradlew -p optional-platforms :grpc:grpc-testkit:grpcInProcessContractTest +``` + +`adapter:inbound:grpc` remains in the main application build because it is an application adapter; +the reusable gRPC platform libraries are optional capability code and live here. diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..4604ffb --- /dev/null +++ b/build.gradle @@ -0,0 +1,23 @@ +ext.sourceRevision = providers.gradleProperty('gitRevision') + .orElse(providers.environmentVariable('GIT_SHA')) + .orElse(providers.environmentVariable('GITHUB_SHA')) + .getOrElse('unknown') + +tasks.register('checkAll') { + group = 'verification' + description = 'Runs every gRPC optional-platform leaf check.' + dependsOn subprojects.findAll { it.childProjects.isEmpty() }.collect { "${it.path}:check" } +} + +tasks.register('qualityCheck') { + group = 'verification' + description = 'Runs production-bytecode static analysis for every optional-platform leaf.' + dependsOn subprojects.findAll { it.childProjects.isEmpty() }.collect { "${it.path}:qualityCheck" } +} + +tasks.register('ci') { + group = 'verification' + description = 'Runs the optional gRPC platform verification surface.' + dependsOn tasks.named('checkAll') + dependsOn tasks.named('qualityCheck') +} diff --git a/grpc-advanced/grpc-advanced-bootstrap/build.gradle b/grpc-advanced/grpc-advanced-bootstrap/build.gradle index 4310d02..347ed7d 100644 --- a/grpc-advanced/grpc-advanced-bootstrap/build.gradle +++ b/grpc-advanced/grpc-advanced-bootstrap/build.gradle @@ -1,4 +1,6 @@ -apply plugin: 'ca.platform-module' +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 diff --git a/grpc-advanced/grpc-advanced-compat/build.gradle b/grpc-advanced/grpc-advanced-compat/build.gradle index 56617ac..011791e 100644 --- a/grpc-advanced/grpc-advanced-compat/build.gradle +++ b/grpc-advanced/grpc-advanced-compat/build.gradle @@ -1,4 +1,6 @@ -apply plugin: 'ca.platform-module' +plugins { + id 'ca.platform-module' +} // Compatibility bridges: gRPC-Web, the Servlet HTTP/2 profile, the Spring Integration bridge, the // Reactor adapter, and the Kotlin coroutine/Flow boundary. diff --git a/grpc-advanced/grpc-advanced-diagnostics/build.gradle b/grpc-advanced/grpc-advanced-diagnostics/build.gradle index 07b2526..e9cb9d0 100644 --- a/grpc-advanced/grpc-advanced-diagnostics/build.gradle +++ b/grpc-advanced/grpc-advanced-diagnostics/build.gradle @@ -1,4 +1,6 @@ -apply plugin: 'ca.platform-module' +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, plus the advanced diff --git a/grpc-advanced/grpc-advanced-edition/build.gradle b/grpc-advanced/grpc-advanced-edition/build.gradle index bbfbff5..bbf33e2 100644 --- a/grpc-advanced/grpc-advanced-edition/build.gradle +++ b/grpc-advanced/grpc-advanced-edition/build.gradle @@ -1,4 +1,6 @@ -apply plugin: 'ca.platform-module' +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 diff --git a/grpc-advanced/grpc-advanced-resilience/build.gradle b/grpc-advanced/grpc-advanced-resilience/build.gradle index 787ea9f..1e56b2d 100644 --- a/grpc-advanced/grpc-advanced-resilience/build.gradle +++ b/grpc-advanced/grpc-advanced-resilience/build.gradle @@ -1,4 +1,6 @@ -apply plugin: 'ca.platform-module' +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. diff --git a/grpc-advanced/grpc-advanced-streaming/build.gradle b/grpc-advanced/grpc-advanced-streaming/build.gradle index 8ba3cd4..2e5bbbd 100644 --- a/grpc-advanced/grpc-advanced-streaming/build.gradle +++ b/grpc-advanced/grpc-advanced-streaming/build.gradle @@ -1,4 +1,6 @@ -apply plugin: 'ca.platform-module' +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 diff --git a/grpc/CLAUDE.md b/grpc/CLAUDE.md index 5423a41..4d0fcb8 100644 --- a/grpc/CLAUDE.md +++ b/grpc/CLAUDE.md @@ -1,9 +1,8 @@ # grpc — local authority for the gRPC platform family -이 문서는 `grpc:*` family의 **local authority**다. leaf 목록·gradle path·허용 의존성은 -`src/config/architecture/modules.json`이 SSOT이며 이 문서는 그것을 복제하지 않는다. 여기서 정하는 -것은 registry가 표현할 수 없는 것들이다: family별 framework 규칙, 증거 등급, Stable 범위의 경계, -그리고 `runtime_memberships`가 비어 있다는 사실의 의미. +이 문서는 `grpc:*` family의 **local authority**다. gRPC platform은 기본 application build와 분리된 +`src/optional-platforms` build가 소유한다. 여기서 정하는 것은 family별 framework 규칙, 증거 등급, +Stable 범위의 경계와 application에 채택될 때 필요한 계약이다. Root 정책(`CLAUDE.md` / `AGENTS.md`)과 충돌하면 root가 이긴다. @@ -70,17 +69,16 @@ capability flag 뒤에 있다. `GrpcPlatformStartupValidator`가 Stable catalog `grpc-spring-boot-starter`는 어떤 advanced module도 참조하지 않는다. registry의 `allowed_dependencies`가 이를 build time에, `GrpcStableBuildInvariant`가 runtime에 강제한다. -## Runtime membership이 비어 있다는 것의 의미 +## Optional build에 있다는 것의 의미 -registry의 모든 `grpc:*` leaf는 현재 `runtime_memberships`가 비어 있다. `messaging:*`가 처음 -착지했을 때와 같은 상태다: +`grpc:*`와 `grpc-advanced:*`는 기본 `ca-skeleton` settings에 include되지 않는다. 따라서 일반 +`:app-bootstrap:build`는 이 18개 project를 configure하지 않는다. 플랫폼 자체는 +`./gradlew -p optional-platforms ci`로 검증하고, application runtime에 실제 채택하려면 composition root가 +명시적으로 dependency를 가져오는 별도 변경이 필요하다. -- **배포 아티팩트가 싣고 있지 않다.** build-only다. -- 애플리케이션에 배선하려면 registry의 `runtime_memberships`를 먼저 바꾸고 - `verifyRuntimeModuleMembership`을 통과시켜야 한다. 코드만 추가하는 것으로는 런타임에 들어가지 않는다. -- **런타임에 있다는 것과 자격이 증명됐다는 것은 다르다.** 현재 in-process·Netty·fault lane은 실제로 - 실행되어 통과하지만, 실제 배포 환경에서의 soak·performance baseline은 없다. `GrpcStableReleaseGate`가 - 그 구분을 문서가 아니라 코드로 붙들고 있다. +런타임 포함 여부와 qualification은 별개다. in-process·Netty·fault lane이 통과해도 실제 배포 환경의 +soak/performance baseline을 자동으로 의미하지 않는다. 지원 범위는 release gate와 support matrix가 +별도로 정의한다. ## application이 이 family에 도달하는 경로 diff --git a/grpc/grpc-admin/build.gradle b/grpc/grpc-admin/build.gradle index 707966e..fafabf0 100644 --- a/grpc/grpc-admin/build.gradle +++ b/grpc/grpc-admin/build.gradle @@ -1,4 +1,6 @@ -apply plugin: 'ca.platform-module' +plugins { + id 'ca.platform-module' +} // Operational surface: the standard health registry, the reflection exposure policy, the drain // coordinator, and the secret-free runtime policy snapshot an administrator reads. diff --git a/grpc/grpc-client/build.gradle b/grpc/grpc-client/build.gradle index b6b83a7..3ea3d8d 100644 --- a/grpc/grpc-client/build.gradle +++ b/grpc/grpc-client/build.gradle @@ -1,4 +1,6 @@ -apply plugin: 'ca.grpc-platform-module' +plugins { + id 'ca.grpc-platform-module' +} // Client runtime: named channel profiles, channel runtime generations with drain, the typed stub // factory that refuses to hand a raw Channel to application code, and client metadata/credentials. @@ -7,6 +9,6 @@ dependencies { api project(':grpc:grpc-core-api') api project(':grpc:grpc-policy') - api "io.grpc:grpc-api:${grpcVersion}" - api "io.grpc:grpc-stub:${grpcVersion}" + api "io.grpc:grpc-api" + api "io.grpc:grpc-stub" } diff --git a/grpc/grpc-codegen/build.gradle b/grpc/grpc-codegen/build.gradle index 0e58993..f45471a 100644 --- a/grpc/grpc-codegen/build.gradle +++ b/grpc/grpc-codegen/build.gradle @@ -1,4 +1,6 @@ -apply plugin: 'ca.platform-module' +plugins { + id 'ca.platform-module' +} // Contract governance: Buf format/lint/breaking policy, the single codegen owner declaration, and // the descriptor/schema-hash release artifact with its consumer-compile gate. diff --git a/grpc/grpc-core-api/build.gradle b/grpc/grpc-core-api/build.gradle index caea738..ddde61d 100644 --- a/grpc/grpc-core-api/build.gradle +++ b/grpc/grpc-core-api/build.gradle @@ -1,4 +1,6 @@ -apply plugin: 'ca.platform-module' +plugins { + id 'ca.platform-module' +} // The platform's port layer: identifiers, method policy, execution evidence, failure model, // deadline primitives and request context. diff --git a/grpc/grpc-discovery/build.gradle b/grpc/grpc-discovery/build.gradle index 7b58bb1..bee89e7 100644 --- a/grpc/grpc-discovery/build.gradle +++ b/grpc/grpc-discovery/build.gradle @@ -1,4 +1,6 @@ -apply plugin: 'ca.platform-module' +plugins { + id 'ca.platform-module' +} // Stable discovery: Static/DNS resolvers, pick_first/round_robin load balancing, and the // Kubernetes VIP / headless / mesh routing profiles. Custom resolvers, custom load balancers and diff --git a/grpc/grpc-observability/build.gradle b/grpc/grpc-observability/build.gradle index 7b09ff8..f6ed15c 100644 --- a/grpc/grpc-observability/build.gradle +++ b/grpc/grpc-observability/build.gradle @@ -1,4 +1,6 @@ -apply plugin: 'ca.platform-module' +plugins { + id 'ca.platform-module' +} // Bounded observability: logical RPC vs physical attempt vs stream lifecycle, with a cardinality // policy that refuses payload, raw metadata and any actor/tenant/object/stream/idempotency diff --git a/grpc/grpc-operation-ledger-jpa/build.gradle b/grpc/grpc-operation-ledger-jpa/build.gradle index 4e6409b..abd71d2 100644 --- a/grpc/grpc-operation-ledger-jpa/build.gradle +++ b/grpc/grpc-operation-ledger-jpa/build.gradle @@ -1,4 +1,6 @@ -apply plugin: 'ca.platform-module' +plugins { + id 'ca.platform-module' +} // Durable mutation idempotency: the operation ledger entity, its state machine, the vendor-neutral // repository port and the Spring Data JPA binding, plus the migration that owns the unique diff --git a/grpc/grpc-policy/build.gradle b/grpc/grpc-policy/build.gradle index cfb7f0e..17a4f5b 100644 --- a/grpc/grpc-policy/build.gradle +++ b/grpc/grpc-policy/build.gradle @@ -1,4 +1,6 @@ -apply plugin: 'ca.grpc-platform-module' +plugins { + id 'ca.grpc-platform-module' +} // Validation, context propagation, status/rich-error mapping, TLS/credential profiles, deadline // and cancellation, retry ownership and eligibility, idempotency and completion recovery, server @@ -9,6 +11,6 @@ dependencies { // api: interceptors, context binders and the error mapper name io.grpc types in public // signatures, so an adopter cannot compile against this module without them. - api "io.grpc:grpc-api:${grpcVersion}" - api "io.grpc:grpc-stub:${grpcVersion}" + api "io.grpc:grpc-api" + api "io.grpc:grpc-stub" } diff --git a/grpc/grpc-proto-contract/build.gradle b/grpc/grpc-proto-contract/build.gradle index 299583e..d2c9d36 100644 --- a/grpc/grpc-proto-contract/build.gradle +++ b/grpc/grpc-proto-contract/build.gradle @@ -1,4 +1,6 @@ -apply plugin: 'ca.platform-module' +plugins { + id 'ca.platform-module' +} // Schema source of truth: the `.proto` files plus the rule engine that judges them. // diff --git a/grpc/grpc-server/build.gradle b/grpc/grpc-server/build.gradle index 2dd916f..26c8142 100644 --- a/grpc/grpc-server/build.gradle +++ b/grpc/grpc-server/build.gradle @@ -1,4 +1,6 @@ -apply plugin: 'ca.grpc-platform-module' +plugins { + id 'ca.grpc-platform-module' +} // Server boundary: the ArchUnit-shaped application boundary rules, the typed service adapter SPI, // the interceptor order contract, and the Netty server/executor/admission profiles. @@ -10,6 +12,6 @@ dependencies { api project(':grpc:grpc-core-api') api project(':grpc:grpc-policy') - api "io.grpc:grpc-api:${grpcVersion}" - api "io.grpc:grpc-stub:${grpcVersion}" + api "io.grpc:grpc-api" + api "io.grpc:grpc-stub" } diff --git a/grpc/grpc-spring-boot-starter/build.gradle b/grpc/grpc-spring-boot-starter/build.gradle index 77534d7..ca55556 100644 --- a/grpc/grpc-spring-boot-starter/build.gradle +++ b/grpc/grpc-spring-boot-starter/build.gradle @@ -1,5 +1,7 @@ -apply plugin: 'ca.platform-module' -apply plugin: 'ca.spring-config' +plugins { + id 'ca.platform-module' + id 'ca.spring-config' +} // The platform's composition boundary: typed properties, auto-configuration and the startup // validator that refuses a deployment whose configuration contradicts a Stable invariant. diff --git a/grpc/grpc-testkit/build.gradle b/grpc/grpc-testkit/build.gradle index f9a8ec8..44c0f3c 100644 --- a/grpc/grpc-testkit/build.gradle +++ b/grpc/grpc-testkit/build.gradle @@ -1,4 +1,6 @@ -apply plugin: 'ca.grpc-platform-module' +plugins { + id 'ca.grpc-platform-module' +} // Certification. The Stable plan splits this across four modules (core / in-process / netty / // fault); this repository already expresses "these two runs are not the same kind of evidence" with @@ -50,11 +52,11 @@ dependencies { api project(':grpc:grpc-codegen') api project(':grpc:grpc-operation-ledger-jpa') - api "io.grpc:grpc-api:${grpcVersion}" - api "io.grpc:grpc-stub:${grpcVersion}" + api "io.grpc:grpc-api" + api "io.grpc:grpc-stub" // The transports the lanes stand on. In-process is fast contract evidence; Netty is the only // transport this platform certifies, and the lane separation is what keeps them distinguishable. - implementation "io.grpc:grpc-inprocess:${grpcVersion}" - implementation "io.grpc:grpc-netty-shaded:${grpcVersion}" + implementation "io.grpc:grpc-inprocess" + implementation "io.grpc:grpc-netty-shaded" } diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..f6401e3 --- /dev/null +++ b/settings.gradle @@ -0,0 +1,59 @@ +pluginManagement { + includeBuild('../build-logic') +} + +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + mavenCentral() + } + versionCatalogs { + libs { + from(files('../gradle/libs.versions.toml')) + } + } +} + +rootProject.name = 'optional-platforms' + +include ':grpc' +project(':grpc').projectDir = file('../grpc') +include ':grpc-advanced' +project(':grpc-advanced').projectDir = file('../grpc-advanced') + +include ':grpc:grpc-admin' +project(':grpc:grpc-admin').projectDir = file('../grpc/grpc-admin') +include ':grpc:grpc-client' +project(':grpc:grpc-client').projectDir = file('../grpc/grpc-client') +include ':grpc:grpc-codegen' +project(':grpc:grpc-codegen').projectDir = file('../grpc/grpc-codegen') +include ':grpc:grpc-core-api' +project(':grpc:grpc-core-api').projectDir = file('../grpc/grpc-core-api') +include ':grpc:grpc-discovery' +project(':grpc:grpc-discovery').projectDir = file('../grpc/grpc-discovery') +include ':grpc:grpc-observability' +project(':grpc:grpc-observability').projectDir = file('../grpc/grpc-observability') +include ':grpc:grpc-operation-ledger-jpa' +project(':grpc:grpc-operation-ledger-jpa').projectDir = file('../grpc/grpc-operation-ledger-jpa') +include ':grpc:grpc-policy' +project(':grpc:grpc-policy').projectDir = file('../grpc/grpc-policy') +include ':grpc:grpc-proto-contract' +project(':grpc:grpc-proto-contract').projectDir = file('../grpc/grpc-proto-contract') +include ':grpc:grpc-server' +project(':grpc:grpc-server').projectDir = file('../grpc/grpc-server') +include ':grpc:grpc-spring-boot-starter' +project(':grpc:grpc-spring-boot-starter').projectDir = file('../grpc/grpc-spring-boot-starter') +include ':grpc:grpc-testkit' +project(':grpc:grpc-testkit').projectDir = file('../grpc/grpc-testkit') +include ':grpc-advanced:grpc-advanced-bootstrap' +project(':grpc-advanced:grpc-advanced-bootstrap').projectDir = file('../grpc-advanced/grpc-advanced-bootstrap') +include ':grpc-advanced:grpc-advanced-compat' +project(':grpc-advanced:grpc-advanced-compat').projectDir = file('../grpc-advanced/grpc-advanced-compat') +include ':grpc-advanced:grpc-advanced-diagnostics' +project(':grpc-advanced:grpc-advanced-diagnostics').projectDir = file('../grpc-advanced/grpc-advanced-diagnostics') +include ':grpc-advanced:grpc-advanced-edition' +project(':grpc-advanced:grpc-advanced-edition').projectDir = file('../grpc-advanced/grpc-advanced-edition') +include ':grpc-advanced:grpc-advanced-resilience' +project(':grpc-advanced:grpc-advanced-resilience').projectDir = file('../grpc-advanced/grpc-advanced-resilience') +include ':grpc-advanced:grpc-advanced-streaming' +project(':grpc-advanced:grpc-advanced-streaming').projectDir = file('../grpc-advanced/grpc-advanced-streaming')