refactor: 리펙토링 진행중 의존성 gradle은 얇게 유지, 각 모듈에서 처리하고 있는 부분에 대해서 리펙토링

This commit is contained in:
donghyeon-ka
2026-09-24 11:15:10 +09:00
parent 9da00eb782
commit 208077fddf
438 changed files with 5815 additions and 1528 deletions
+1
View File
@@ -235,6 +235,7 @@ APP_FILESERVER_LOCAL_EXPECTED_FILE_STORE_TYPE=
APP_FILESERVER_LOCAL_MOUNT_SENTINEL_SHA256=
APP_FILESERVER_LOCAL_EXPECTED_OWNER=
APP_HTTPCLIENT_ENABLED=false
APP_HTTPCLIENT_ROTATION_DRAIN_TIMEOUT=30s
APP_FILESERVER_PLATFORM_ENABLED=false
APP_FILESERVER_PLATFORM_INSTANCE_ID=local-node
APP_FILESERVER_PLATFORM_DEFAULT_NAMESPACE=default
+4
View File
@@ -38,6 +38,10 @@ WORKDIR /build/src
# (Requires the labs Dockerfile frontend — see the `# syntax` directive at the top of this file.)
COPY gradlew ./
COPY gradle/ gradle/
# The repository's Gradle memory, worker and caching settings. Without it the dependency-resolution
# stage below resolves every module's locked configuration on Gradle's defaults rather than the
# -Xmx1g / workers.max / caching-on this build is tuned for.
COPY gradle.properties ./
COPY config/ ./config/
COPY --parents settings.gradle build.gradle **/build.gradle **/gradle.lockfile ./
# The convention plugins, whole. The glob above copies files named build.gradle and gradle.lockfile,
+12 -3
View File
@@ -15,6 +15,11 @@
테스트, Spotless, Checkstyle, Error Prone만 담당합니다. 저장소 전체 정책은 이름이 드러나는
루트 task로 실행하며, CI가 이를 집계합니다.
이 셋의 역할은 겹치지 않습니다. Spotless(google-java-format)가 포맷과 import 순서를 소유하고,
Checkstyle은 **포매터가 표현할 수 없는 것만** — 네이밍과 몇 가지 논리/설계 규칙만 — 봅니다
(`config/checkstyle/checkstyle.xml`). 줄 길이·들여쓰기·import 순서 모듈이 여기에 없는 것은 누락이
아니라 포매터와 싸우지 않기 위한 선택입니다. Error Prone은 컴파일 시점 버그 패턴을 담당합니다.
| 게이트 | 하는 일 |
| --- | --- |
| `architectureCheck` | Clean Architecture 의존 방향, runtime membership, application-core purity, Git에 실리지 않는 source package를 검사 |
@@ -142,9 +147,13 @@ Checkstyle은 파싱된 파일에 같은 질문을 하고, leaf 단위로 돕니
- **하는 일.** deny-by-default public path 표면이 승인 없이 바뀌면 빌드를 실패시킵니다.
- **배경.** 이 앱은 deny-by-default 입니다. 즉 `SECURITY_PUBLIC_PATHS` 가 먹이는 명시적 `permitAll()`
경로를 **제외한** 모든 요청은 인증을 요구합니다(`src/.env` → `SecuritySettings.publicPaths()` →
`SecurityConfig`). 이 public 표면이 바뀌는 순간이 곧 보호되던 엔드포인트가 조용히 공개로 노출되는
지점입니다. 그래서 그 표면을 snapshot 으로 떠 두고, 미승인 변경에 빌드를 실패시킵니다.
경로를 **제외한** 모든 요청은 인증을 요구합니다
(`app-bootstrap/src/main/resources/config/security.yml` → `SecuritySettings.publicPaths()` →
`SecurityConfig`). 설정 분할 이전에는 이 SSOT 가 `src/.env` 였고 문서만 그대로 남아 있었습니다.
스냅샷 플러그인이 실제로 읽는 파일은 `config/security.yml` 입니다
(`build-logic/.../publicpath/PublicPathSnapshotPlugin.java`).
이 public 표면이 바뀌는 순간이 곧 보호되던 엔드포인트가 조용히 공개로 노출되는 지점입니다.
그래서 그 표면을 snapshot 으로 떠 두고, 미승인 변경에 빌드를 실패시킵니다.
- **승인 방법.** `verifyPublicPathSnapshot` 은 항상 읽기 전용입니다. reviewer 가 변경을 승인한 뒤
`./gradlew updatePublicPathSnapshot -PapprovePublicPathChange` 로 snapshot 을 명시적으로 다시
생성합니다. 공개 경로 변경은 보안 리뷰 대상으로 보고 재생성된 snapshot 을 함께 커밋합니다.
+2
View File
@@ -4,6 +4,8 @@ plugins {
id 'java-test-fixtures'
id 'ca.auxiliary-source-set'
id 'ca.graphql-platform'
id 'ca.api-surface'
id 'ca.strict-qualification'
}
// Driving adapter: GraphQL API (skeleton machinery, transport-only).
@@ -86,8 +86,20 @@ public final class BoundedPreparsedDocumentProvider<D> {
return await(leader);
}
metrics.recordMiss();
try {
// Claiming the key is not the same instant as missing it. Between this thread's lookup and
// its claim, the previous leader can finish parsing, store the document and release its
// in-flight slot — and then this thread's putIfAbsent succeeds and it parses a document that
// is already cached. The single-flight guarantee this class documents is only true if the
// leader re-reads the cache after it has the claim.
D parsedWhileClaiming = lookup(key, clock.instant());
if (parsedWhileClaiming != null) {
metrics.recordHit();
mine.complete(parsedWhileClaiming);
return parsedWhileClaiming;
}
metrics.recordMiss();
D document = parseAndValidate.apply(key);
store(key, document, documentWeight, clock.instant());
mine.complete(document);
+1
View File
@@ -1,6 +1,7 @@
plugins {
id 'ca.spring-library'
id 'ca.spring-config'
id 'ca.strict-qualification'
}
String grpcVersion = libs.versions.grpc.get()
@@ -0,0 +1,42 @@
plugins {
id 'ca.spring-library'
id 'ca.spring-config'
}
// The Fileserver capability's HTTP surface.
//
// It was the `web.fileserver` package inside `adapter:inbound:web`, and that is the last reason
// every application resolved `application-fileserver`: the capability's controllers, DTOs, mappers,
// range and nginx helpers, tus and draft-12 upload surfaces and its HTTP authorization all compiled
// into the leaf that any application with an HTTP API depends on.
//
// The package keeps its name. It is still part of the web platform's module map — `WebStableModule`
// declares its twelve modules and their edges, and `WebBuildModel.platformSourceRoots()` scans this
// source root alongside the web leaf's, which is what that method's plural has always been for. A
// second copy of the map here would be a second answer to "is this edge declared", and the map is
// the one thing the platform must not have two of.
//
// It depends on `adapter:inbound:web` rather than the reverse: the fileserver modules import `core`,
// `auth` and `observability`, nine times in total, and nothing outside them imports fileserver.
dependencies {
implementation project(':adapter:inbound:web')
implementation project(':application-core')
implementation project(':application-fileserver')
implementation project(':shared-contract')
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-validation'
// `spring-webflux`, not `spring-boot-starter-webflux`, for the reason the web leaf states in
// its own build file: the starter puts reactor-netty — a second embedded server — on the
// runtime classpath of an application that already has Tomcat. The reactive fileserver surface
// needs the types, not another server.
implementation 'org.springframework:spring-webflux'
implementation 'io.projectreactor:reactor-core'
testImplementation project(':adapter:inbound:web')
testImplementation testFixtures(project(':adapter:inbound:web'))
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.security:spring-security-test'
testImplementation 'io.projectreactor:reactor-test'
}
@@ -0,0 +1,192 @@
# 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.
biz.aQute.bnd:biz.aQute.bnd.annotation:7.1.0=compileClasspath,testCompileClasspath
ch.qos.logback:logback-classic:1.5.38=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
ch.qos.logback:logback-core:1.5.38=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
com.fasterxml.jackson.core:jackson-annotations:2.21=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
com.fasterxml.jackson.core:jackson-core:2.21.5=runtimeClasspath,testRuntimeClasspath
com.fasterxml.jackson.core:jackson-databind:2.21.5=runtimeClasspath,testRuntimeClasspath
com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.21.5=runtimeClasspath,testRuntimeClasspath
com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.21.5=runtimeClasspath,testRuntimeClasspath
com.fasterxml.jackson:jackson-bom:2.21.5=runtimeClasspath,testRuntimeClasspath
com.fasterxml:classmate:1.7.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
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.38.0=compileClasspath,testCompileClasspath
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.jayway.jsonpath:json-path:2.10.0=testCompileClasspath,testRuntimeClasspath
com.nimbusds:nimbus-jose-jwt:10.4=runtimeClasspath,testRuntimeClasspath
com.puppycrawl.tools:checkstyle:13.5.0=checkstyle
com.tngtech.archunit:archunit-junit5-api:1.3.0=testRuntimeClasspath
com.tngtech.archunit:archunit-junit5-engine-api:1.3.0=testRuntimeClasspath
com.tngtech.archunit:archunit-junit5-engine:1.3.0=testRuntimeClasspath
com.tngtech.archunit:archunit-junit5:1.3.0=testRuntimeClasspath
com.tngtech.archunit:archunit:1.3.0=testRuntimeClasspath
com.vaadin.external.google:android-json:0.0.20131108.vaadin1=testCompileClasspath,testRuntimeClasspath
commons-beanutils:commons-beanutils:1.11.0=checkstyle
commons-collections:commons-collections:3.2.2=checkstyle
commons-io:commons-io:2.21.0=spotbugs
commons-logging:commons-logging:1.3.6=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
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.micrometer:micrometer-commons:1.16.7=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
io.micrometer:micrometer-observation:1.16.7=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
io.projectreactor:reactor-core:3.8.7=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
io.projectreactor:reactor-test:3.8.7=testCompileClasspath,testRuntimeClasspath
io.swagger.core.v3:swagger-annotations-jakarta:2.2.38=runtimeClasspath,testRuntimeClasspath
io.swagger.core.v3:swagger-core-jakarta:2.2.38=runtimeClasspath,testRuntimeClasspath
io.swagger.core.v3:swagger-models-jakarta:2.2.38=runtimeClasspath,testRuntimeClasspath
jakarta.activation:jakarta.activation-api:2.1.4=runtimeClasspath,testCompileClasspath,testRuntimeClasspath
jakarta.annotation:jakarta.annotation-api:3.0.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
jakarta.servlet:jakarta.servlet-api:6.1.0=testRuntimeClasspath
jakarta.validation:jakarta.validation-api:3.1.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
jakarta.xml.bind:jakarta.xml.bind-api:4.0.5=runtimeClasspath,testCompileClasspath,testRuntimeClasspath
javax.inject:javax.inject:1=annotationProcessor,testAnnotationProcessor
jaxen:jaxen:2.0.6=spotbugs
net.bytebuddy:byte-buddy-agent:1.17.8=testCompileClasspath,testRuntimeClasspath
net.bytebuddy:byte-buddy:1.17.8=testCompileClasspath,testRuntimeClasspath
net.minidev:accessors-smart:2.6.0=testCompileClasspath,testRuntimeClasspath
net.minidev:json-smart:2.6.0=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,runtimeClasspath,spotbugs,testRuntimeClasspath
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=compileClasspath,runtimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath
org.apache.logging.log4j:log4j-core:2.25.5=spotbugs
org.apache.logging.log4j:log4j-to-slf4j:2.25.5=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
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.tomcat.embed:tomcat-embed-core:11.0.24=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.apache.tomcat.embed:tomcat-embed-el:11.0.24=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.apache.tomcat.embed:tomcat-embed-websocket:11.0.24=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
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.awaitility:awaitility:4.3.0=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.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath
org.hibernate.validator:hibernate-validator:9.0.1.Final=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.javassist:javassist:3.28.0-GA=checkstyle
org.jboss.logging:jboss-logging:3.6.3.Final=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.jspecify:jspecify:1.0.1=annotationProcessor,checkstyle,compileClasspath,runtimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath
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,testCompileClasspath,testRuntimeClasspath
org.mockito:mockito-junit-jupiter:5.20.0=testCompileClasspath,testRuntimeClasspath
org.objenesis:objenesis:3.3=testRuntimeClasspath
org.openapitools:jackson-databind-nullable:0.2.6=runtimeClasspath,testRuntimeClasspath
org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath
org.osgi:org.osgi.annotation.bundle:2.0.0=compileClasspath,testCompileClasspath
org.osgi:org.osgi.annotation.versioning:1.1.2=compileClasspath,testCompileClasspath
org.osgi:org.osgi.resource:1.0.0=compileClasspath,testCompileClasspath
org.osgi:org.osgi.service.serviceloader:1.0.0=compileClasspath,testCompileClasspath
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.ow2.asm:asm:9.7.1=testCompileClasspath,testRuntimeClasspath
org.pcollections:pcollections:4.0.1=annotationProcessor,testAnnotationProcessor
org.reactivestreams:reactive-streams:1.0.4=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.reflections:reflections:0.10.2=checkstyle
org.skyscreamer:jsonassert:1.5.3=testCompileClasspath,testRuntimeClasspath
org.slf4j:jul-to-slf4j:2.0.18=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.slf4j:slf4j-api:2.0.18=compileClasspath,runtimeClasspath,spotbugs,spotbugsSlf4j,testCompileClasspath,testRuntimeClasspath
org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j
org.slf4j:slf4j-simple:2.0.18=checkstyle
org.springdoc:springdoc-openapi-starter-common:3.0.0=runtimeClasspath,testRuntimeClasspath
org.springdoc:springdoc-openapi-starter-webmvc-api:3.0.0=runtimeClasspath,testRuntimeClasspath
org.springframework.boot:spring-boot-autoconfigure:4.0.8=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.springframework.boot:spring-boot-configuration-processor:4.0.8=annotationProcessor
org.springframework.boot:spring-boot-http-converter:4.0.8=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.springframework.boot:spring-boot-jackson:4.0.8=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.springframework.boot:spring-boot-resttestclient:4.0.8=testCompileClasspath,testRuntimeClasspath
org.springframework.boot:spring-boot-security-oauth2-resource-server:4.0.8=runtimeClasspath,testRuntimeClasspath
org.springframework.boot:spring-boot-security:4.0.8=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.springframework.boot:spring-boot-servlet:4.0.8=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.springframework.boot:spring-boot-starter-jackson-test:4.0.8=testCompileClasspath,testRuntimeClasspath
org.springframework.boot:spring-boot-starter-jackson:4.0.8=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.springframework.boot:spring-boot-starter-logging:4.0.8=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.springframework.boot:spring-boot-starter-oauth2-resource-server:4.0.8=runtimeClasspath,testRuntimeClasspath
org.springframework.boot:spring-boot-starter-security:4.0.8=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.springframework.boot:spring-boot-starter-test:4.0.8=testCompileClasspath,testRuntimeClasspath
org.springframework.boot:spring-boot-starter-tomcat-runtime:4.0.8=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.springframework.boot:spring-boot-starter-tomcat:4.0.8=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.springframework.boot:spring-boot-starter-validation:4.0.8=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.springframework.boot:spring-boot-starter-web:4.0.8=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.springframework.boot:spring-boot-starter-webmvc-test:4.0.8=testCompileClasspath,testRuntimeClasspath
org.springframework.boot:spring-boot-starter-webmvc:4.0.8=testCompileClasspath,testRuntimeClasspath
org.springframework.boot:spring-boot-starter:4.0.8=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.springframework.boot:spring-boot-test-autoconfigure:4.0.8=testCompileClasspath,testRuntimeClasspath
org.springframework.boot:spring-boot-test:4.0.8=testCompileClasspath,testRuntimeClasspath
org.springframework.boot:spring-boot-tomcat:4.0.8=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.springframework.boot:spring-boot-validation:4.0.8=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.springframework.boot:spring-boot-web-server:4.0.8=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.springframework.boot:spring-boot-webmvc-test:4.0.8=testCompileClasspath,testRuntimeClasspath
org.springframework.boot:spring-boot-webmvc:4.0.8=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.springframework.boot:spring-boot:4.0.8=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.springframework.security:spring-security-config:7.0.7=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.springframework.security:spring-security-core:7.0.7=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.springframework.security:spring-security-crypto:7.0.7=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.springframework.security:spring-security-oauth2-core:7.0.7=runtimeClasspath,testRuntimeClasspath
org.springframework.security:spring-security-oauth2-jose:7.0.7=runtimeClasspath,testRuntimeClasspath
org.springframework.security:spring-security-oauth2-resource-server:7.0.7=runtimeClasspath,testRuntimeClasspath
org.springframework.security:spring-security-test:7.0.7=testCompileClasspath,testRuntimeClasspath
org.springframework.security:spring-security-web:7.0.7=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.springframework.session:spring-session-core:4.0.5=runtimeClasspath,testRuntimeClasspath
org.springframework:spring-aop:7.0.9=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.springframework:spring-beans:7.0.9=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.springframework:spring-context:7.0.9=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.springframework:spring-core:7.0.9=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.springframework:spring-expression:7.0.9=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.springframework:spring-test:7.0.9=testCompileClasspath,testRuntimeClasspath
org.springframework:spring-web:7.0.9=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.springframework:spring-webflux:7.0.9=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.springframework:spring-webmvc:7.0.9=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.xmlresolver:xmlresolver:5.3.3=checkstyle,spotbugs
org.xmlunit:xmlunit-core:2.10.4=testCompileClasspath,testRuntimeClasspath
org.yaml:snakeyaml:2.5=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
tools.jackson.core:jackson-core:3.1.5=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
tools.jackson.core:jackson-databind:3.1.5=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
tools.jackson:jackson-bom:3.1.5=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
empty=
+7 -1
View File
@@ -16,7 +16,12 @@ plugins {
dependencies {
implementation project(':application-core')
implementation project(':application-notification')
implementation project(':application-fileserver')
// `PresentationWebConfigTest` names the capability controllers as the examples of an absolute
// platform route the presentation prefix must not touch. Test scope only: the production graph
// has no edge to the capability, which is the whole point of the split.
testImplementation project(':adapter:inbound:web-fileserver')
// No `application-fileserver`. The capability's HTTP surface is
// `adapter:inbound:web-fileserver`, which depends on this leaf rather than living inside it.
implementation project(':shared-contract')
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-security'
@@ -307,3 +312,4 @@ strictTestLanes {
tasks.named('check') {
dependsOn tasks.named('webSecurityBoundaryTest')
}
@@ -184,9 +184,31 @@ public final class WebBuildModel {
return List.copyOf(violations);
}
/** Every source root the module map governs. */
/**
* Every source root the module map governs.
*
* <p>Two, since the Fileserver capability's HTTP surface became `adapter:inbound:web-fileserver`.
* The module map did not move with it: `WebStableModule` still declares the twelve fileserver
* modules and their edges, because a second copy of the map in the second leaf would be a second
* answer to "is this edge declared", and one map with two source roots is what this method's
* plural has meant since it was written.
*
* <p>The sibling root is optional rather than required. A checkout that does not have it is a
* checkout where that leaf is absent, and the rules then govern what is present — the empty-scan
* guard in {@link #scan(List)} is what refuses a scan that found nothing at all.
*/
public static List<Path> platformSourceRoots() {
return List.of(mainSourceRoot());
Path own = mainSourceRoot();
Path sibling =
own.getParent()
.getParent()
.getParent()
.getParent()
.resolve("web-fileserver")
.resolve("src")
.resolve("main")
.resolve("java");
return Files.isDirectory(sibling) ? List.of(own, sibling) : List.of(own);
}
/**
@@ -0,0 +1,103 @@
package dev.caskeleton.adapter.inbound.web.mvc.autoconfigure;
import static org.assertj.core.api.Assertions.assertThat;
import java.io.IOException;
import java.io.UncheckedIOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.List;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.core.annotation.AnnotatedElementUtils;
/**
* This leaf's auto-configurations are registered, not merely annotated.
*
* <p>Spring Boot needs two independent things before an auto-configuration runs: the annotation on
* the class, and a line naming it in {@code META-INF/spring/...AutoConfiguration.imports}. Tests
* that build a context with {@code AutoConfigurations.of(...)} supply the second one themselves, so
* they stay green for a capability that is present in no running application — which is exactly how
* several capabilities in this repository came to be assembled by nothing.
*
* <p>So this reads the registration file the jar actually ships and asserts both directions: every
* class this leaf means to register is named in it, and every name in it resolves to a class that
* carries {@code @AutoConfiguration}. A rename, a move or a deleted line fails here rather than in
* a deployment that starts and quietly does less than it says.
*/
class WebAutoConfigurationRegistrationTest {
private static final String IMPORTS_RESOURCE =
"META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports";
/** The auto-configurations this leaf publishes. */
private static final List<String> PUBLISHED_ROOTS =
List.of(
"dev.caskeleton.adapter.inbound.web.mvc.autoconfigure.WebMvcPlatformAutoConfiguration",
"dev.caskeleton.adapter.inbound.web.webflux.autoconfigure.WebFluxPlatformAutoConfiguration");
@Test
@DisplayName("the shipped registration file names every root this leaf publishes")
void theShippedRegistrationFileNamesEveryRoot() {
assertThat(registeredNames())
.as("the registration lines this leaf's own jar ships")
.containsAll(PUBLISHED_ROOTS);
}
@Test
@DisplayName("every registered name resolves to a real Boot auto-configuration")
void everyRegisteredNameResolvesToAnAutoConfiguration() {
for (String name : registeredNames()) {
Class<?> registered;
try {
registered =
Class.forName(name, false, WebAutoConfigurationRegistrationTest.class.getClassLoader());
} catch (ClassNotFoundException missing) {
throw new AssertionError(
IMPORTS_RESOURCE + " registers " + name + ", which does not exist", missing);
}
assertThat(AnnotatedElementUtils.hasAnnotation(registered, AutoConfiguration.class))
.as("%s is registered but is not annotated @AutoConfiguration", name)
.isTrue();
}
}
/**
* The registration lines this leaf's own resource declares.
*
* <p>Read from this leaf's source tree rather than from the classpath. {@code
* ClassLoader#getResources} returns every registration file on the test runtime classpath —
* Spring Boot's, springdoc's, and every dependency leaf's — so asserting over that set tests
* other people's modules and fails on their conditional classes. The file below is the one this
* leaf packages, which is the thing this contract is about.
*/
private static List<String> registeredNames() {
Path resource = leafRoot().resolve("src/main/resources/" + IMPORTS_RESOURCE);
assertThat(Files.isRegularFile(resource)).as("%s", resource).isTrue();
List<String> names;
try {
names =
Files.readAllLines(resource, StandardCharsets.UTF_8).stream()
.map(String::strip)
.filter(line -> !line.isEmpty() && !line.startsWith("#"))
.toList();
} catch (IOException failure) {
throw new UncheckedIOException("cannot read " + resource, failure);
}
assertThat(names).as("%s registers nothing", resource).isNotEmpty();
return names;
}
/** The nearest directory above the test's working directory that ships a registration file. */
private static Path leafRoot() {
for (Path path = Path.of("").toAbsolutePath(); path != null; path = path.getParent()) {
if (Files.isRegularFile(path.resolve("src/main/resources/" + IMPORTS_RESOURCE))) {
return path;
}
}
throw new IllegalStateException(
"no leaf shipping " + IMPORTS_RESOURCE + " found above " + Path.of("").toAbsolutePath());
}
}
@@ -0,0 +1,32 @@
package dev.caskeleton.adapter.inbound.web.testkit;
/**
* Socket budgets for the fixtures that drive a real server over a real socket.
*
* <p>One place, because the number is not a per-fixture judgement. None of these suites asserts
* latency — they assert the status, headers, problem code and body that came back — so the only
* requirement on a timeout is that it exceed the worst scheduling delay a healthy server can suffer
* on a loaded machine. Below that threshold the timeout stops being a safety net and becomes a
* second, invisible assertion about how busy the build host is.
*
* <p>That is not hypothetical here. With {@code org.gradle.parallel=true} these lanes run while
* SpotBugs analyses a dozen leaves, and at five-second connects and ten-second reads {@code
* ReactiveContractRecordingIT} and {@code ReactiveWebThrottleIT} failed a full {@code ci} run with
* {@code SocketTimeoutException} and passed when run alone. A lane that starts real servers and
* fails under load is the kind of gate people learn to re-run, and a gate people re-run is not a
* gate.
*
* <p>A suite whose subject *is* a timeout — the fault lanes' client read budget, the performance
* lanes' load measurements — does not use these. There the number is the contract, and it belongs
* next to the contract.
*/
public final class HttpFixtureTimeouts {
/** How long to wait for the connection itself. */
public static final int CONNECT_MILLIS = 15_000;
/** How long to wait for a response whose latency nothing asserts. */
public static final int READ_MILLIS = 30_000;
private HttpFixtureTimeouts() {}
}
@@ -1,5 +1,6 @@
package dev.caskeleton.adapter.inbound.web.testkit.budget;
import dev.caskeleton.adapter.inbound.web.testkit.HttpFixtureTimeouts;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
@@ -124,8 +125,8 @@ public final class HttpBudgetFixture {
HttpURLConnection connection =
(HttpURLConnection) URI.create(baseUrl + path).toURL().openConnection();
connection.setRequestMethod(method);
connection.setConnectTimeout(5_000);
connection.setReadTimeout(10_000);
connection.setConnectTimeout(HttpFixtureTimeouts.CONNECT_MILLIS);
connection.setReadTimeout(HttpFixtureTimeouts.READ_MILLIS);
return connection;
}

Some files were not shown because too many files have changed in this diff Show More