refactor(repo)!: 들여온 플랫폼을 src/platforms 아래로 묶는다

문제: src/ 최상위에 계층 폴더와 들여온 제품 폴더(messaging, grpc,
grpc-advanced)와 optional 빌드 폴더(optional-platforms)가 같은 높이로
놓여, 무엇이 이 애플리케이션의 계층인지 폴더만으로 안 보인다.
src/config/에는 빌드 전체 설정과 기능 하나가 주인인 데이터(jpa,
messaging, mongodb)가 섞여 있다.

고른 방법(소유자 결정 2026-11-07, 설계 가-1):
- git mv로 src/platforms/{messaging,grpc,grpc-advanced,optional-build}.
  registry source_path 28행만 바꾸고 Gradle 경로(:messaging:*, :grpc:*)는
  그대로다. optional 빌드의 이름(optional-platforms)도 그대로다.
- optional 빌드가 한 단계 깊어져, build-logic이 "optional 빌드의 부모 =
  주 빌드"로 가정한 네 곳(registry settings, ArchitecturePlugin, 테스트
  이미지 catalog, checkstyle·spotbugs 설정)을 MainBuild(위로 올라가며
  registry·설정 파일을 찾음)로 바꾼다.
- settings.gradle·build.gradle의 상대 경로, workflow의 -p 값과 경로,
  buf 작업 폴더를 고친다. buf breaking은 이동 전 baseline에서도 옛
  경로로 비교해 이동 PR에서 건너뛰지 않는다.
- config/jpa, config/messaging, config/mongodb의 데이터를 주인 leaf의
  release/로 옮기고 읽는 빌드 줄·테스트·스크립트·문서를 고친다.
- 루트 CLAUDE.md 5절에 최상위 폴더 지도를 한 줄로 적는다.
버린 대안: Gradle 루트를 저장소 루트로(가-3, CI 재편 때 다시 봄),
application-* 묶기(가-2, 파생 서비스 충돌이 큼).

위험·한계: Gradle 문서의 "이름 = 위치" 권고와 한 단계 어긋난다
(:messaging:x가 platforms/messaging/x). 옮긴 폴더를 고쳐 쓰던 파생
서비스는 이름 바뀜 충돌이 날 수 있다(B-52). docs/capability-status.md
「제거된 코드」 표와 docs/work/evidence.md의 옛 경로는 이력이라 두었다.

검증(desktop, 트리 2b3354a4, ~/t1-layout-logs/):
- ./gradlew :ci :verifyDependencyLocks --warning-mode=fail --continue
  첫 실행 rc=1: MessagingAuthorityContractTest가 src/messaging을 찾아 실패
  → 경로를 고침. 두 번째 rc=1: messaging-policy
  MessagingAdmissionControllerTest.aWaitingCallerIsAdmittedOnceAPermitIsReturned
  (2초 대기 경쟁, 부하 7.3에서 한 번 실패, 코드 변경 없는 leaf) → --rerun
  3회 모두 통과. 세 번째 rc=0
- -p platforms/optional-build ci rc=0, 두 빌드의 verifyStrictLaneStages
  --dry-run rc=0, -p build-logic check rc=0
- :app-bootstrap:documentContractTest
  :adapter:outbound:persistence-mongo:mongoDocumentContractTest rc=0
- ./gradlew projects(주 빌드)와 optional 빌드 projects의 프로젝트 목록이
  이동 전 트리와 같다(Gradle 경로 불변)
- check-work-docs.py, 상대 링크 검사 rc=0

Refs: design-docs repo-structure/README.md 3.1, repo-structure/01-backend-layout.md 6.1
BREAKING CHANGE: src/messaging·src/grpc·src/grpc-advanced·src/optional-platforms가 src/platforms/ 아래로, src/config/{jpa,messaging,mongodb}가 주인 leaf의 release/로 옮겨졌다. optional 빌드는 -p platforms/optional-build로 부른다. docs/upgrade/2026-11-maturity-review.md B-52.
This commit is contained in:
DongHyeonka
2026-11-07 13:04:54 +09:00
parent 50cd7154d0
commit 8d69e599a3
850 changed files with 271 additions and 180 deletions
@@ -7,7 +7,7 @@
`messaging:messaging-spring-boot-starter-kafka` (the vendored platform and its Kafka transport) and
ships the module defaults in `config/module-defaults/messaging.yml`.
- Boundaries: add no code here. A publish rule belongs to the bridge (`adapter:outbound:messaging`),
a Kafka rule to the vendored product (`src/messaging/CLAUDE.md`); a class here would be a third
a Kafka rule to the vendored product (`src/platforms/messaging/CLAUDE.md`); a class here would be a third
place. Allowed edges come only from the registry entry.
- Tests: activation tests (`./gradlew :adapter:outbound:messaging-kafka:test`) and the real-Kafka
lane `messagingKafkaRelayIntegrationTest` (relay → bridge → broker record bytes; `:integrationCheck`).
+1 -1
View File
@@ -38,7 +38,7 @@ Package root: `dev.caskeleton.adapter.outbound.messaging`.
may not carry this module. The R1 contract/binding compilers and JSON Schema envelope encoder were
removed on 2026-09-25 (see `docs/capability-status.md`).
- No JSON Schema engine (NetworkNT) on the main classpath. The evidence manifest schema check and the
capability card check (`config/messaging`) are this leaf's tests (`evidence/`); snakeyaml is
capability card check (`release/`) are this leaf's tests (`evidence/`); snakeyaml is
test-only (owner decision 2026-09-25).
- Do not hide use-case sequencing or business routing policy in broker adapters.
- `OutboxMessagePublishAdapter` is delegate-only and emits no dependency log. The confirmed
+3 -3
View File
@@ -19,7 +19,7 @@ dependencies {
// Test-only: MessagingEvidenceSchemaValidatorTest holds the common evidence schema to Draft 2020-12.
testImplementation libs.json.schema.validator
// Test-only (owner decision 29): MessagingCapabilityRegistryContractTest reads the capability
// cards in config/messaging/*.yaml. The rules below keep snakeyaml out of every main
// cards in release/*.yaml. The rules below keep snakeyaml out of every main
// configuration; only the `test*` ones may resolve it.
testImplementation 'org.yaml:snakeyaml'
}
@@ -57,8 +57,8 @@ configurations.configureEach { configuration ->
}
}
// The card check reads the whole config/messaging tree (cards, profiles, the evidence schema).
// The card check reads the whole release tree (cards, profiles, the evidence schema).
tasks.named('test') {
inputs.dir(rootProject.file('config/messaging'))
inputs.dir(file('release'))
.withPathSensitivity(PathSensitivity.RELATIVE)
}
@@ -23,8 +23,9 @@ import tools.jackson.core.type.TypeReference;
import tools.jackson.databind.json.JsonMapper;
/**
* The messaging capability cards under {@code config/messaging} (readiness cards, compatibility and
* release profiles, the common evidence manifest schema) stay closed and fail-safe.
* The messaging capability cards under {@code adapter/outbound/messaging/release} (readiness cards,
* compatibility and release profiles, the common evidence manifest schema) stay closed and
* fail-safe.
*
* <p>Owner decision 29: the card check lives in this leaf's tests, and snakeyaml is on this leaf's
* test classpath only — main stays YAML-free (build.gradle). The files it reads are declared as
@@ -350,7 +351,8 @@ class MessagingCapabilityRegistryContractTest {
}
private static Path requiredConfig(String relativePath) {
Path path = repositorySrcRoot().resolve("config/messaging").resolve(relativePath);
Path path =
repositorySrcRoot().resolve("adapter/outbound/messaging/release").resolve(relativePath);
assertThat(path).as("required Messaging configuration %s", path).isRegularFile();
return path;
}
@@ -11,13 +11,13 @@ import java.util.List;
import org.junit.jupiter.api.Test;
/**
* The common build-evidence manifest schema (config/messaging/evidence) is valid Draft 2020-12 and
* accepts the manifest shape the R2 evidence producers are specified to write.
* The common build-evidence manifest schema (release/evidence) is valid Draft 2020-12 and accepts
* the manifest shape the R2 evidence producers are specified to write.
*/
class MessagingEvidenceSchemaValidatorTest {
private static final Path COMMON_SCHEMA =
Path.of("../../../config/messaging/evidence/build-evidence-manifest-v1.schema.json");
Path.of("release/evidence/build-evidence-manifest-v1.schema.json");
private static final String SHA256 = "sha256:" + "0".repeat(64);
private static final String VALID_MANIFEST =
"""
@@ -60,7 +60,7 @@ in `platform`), so the two capability leaves read the same way.
`jpaPlatformContractTest` lane on `FileserverPostgreSqlStack`, whose clock a case moves.
- The real-PostgreSQL tests are still in `persistence-jpa`'s `postgresqlIntegrationTest` source
set, which owns the container and Flyway wiring, and the JPA readiness card
(`config/jpa/readiness-cards.yaml`, checked by `JpaReadinessRegistryTest`) names them as that
(`persistence-jpa/release/readiness-cards.yaml`, checked by `JpaReadinessRegistryTest`) names them as that
leaf's tasks — moving them means moving the card's tasks and selectors with them:
`postgresqlFileserverMigrationIntegrationTest`, `postgresqlFileserverMetadataIntegrationTest`,
`postgresqlFileserverReclamationIntegrationTest`
@@ -46,6 +46,6 @@ apiSurface {
adopterBaseline = rootProject.file('../docs/architecture/persistence-fileserver-adopter-api-surface.txt')
adopterSources = fileTree(rootProject.projectDir) {
include '*/**/src/main/java/**/*.java'
exclude '**/build/**', 'adapter/outbound/persistence-fileserver/**', 'build-logic/**', 'optional-platforms/**'
exclude '**/build/**', 'adapter/outbound/persistence-fileserver/**', 'build-logic/**', 'platforms/optional-build/**'
}
}
@@ -389,7 +389,7 @@ cadence 측정 필요). retention 한 값은 reaper-local 이라 `@Value` 로
## JPA production capability candidate
`src/config/jpa/readiness-cards.yaml`이 capability와 독립 schema stream의
`src/adapter/outbound/persistence-jpa/release/readiness-cards.yaml`이 capability와 독립 schema stream의
machine-readable SSOT다(개수는 registry가 소유한다). `selected` base card와 `implemented-candidate` reliability card를
구분하며, 실제 PostgreSQL 테스트 통과만으로 immutable 운영 evidence가 필요한 R2를 주장하지
않는다.
@@ -117,7 +117,7 @@ dependencies {
postgresqlIntegrationTestImplementation testFixtures(project(':application-fileserver'))
// The notification capability's persistence moved out the same way, and its real-PostgreSQL
// qualifications stay here for the same reason: this lane owns the container, the Flyway wiring
// and the readiness cards that name those tests (config/jpa/readiness-cards.yaml). Test scope
// and the readiness cards that name those tests (release/readiness-cards.yaml). Test scope
// only.
postgresqlIntegrationTestImplementation project(':adapter:outbound:persistence-notification')
postgresqlIntegrationTestImplementation project(':application-notification')
@@ -171,7 +171,7 @@ dependencies {
// Real-PostgreSQL lanes. A readiness lane runs one named class (the security lane also names the
// runtime-role namespace-denial method), a platform lane selects a tag, and the pool lane has a
// source set of its own. release.yml (jpa-release-gate) and config/jpa/*.{json,yaml} name these tasks.
// source set of its own. release.yml (jpa-release-gate) and release/*.{json,yaml} name these tasks.
def jpaEvidenceImage = providers.gradleProperty('jpaPostgreSqlEvidenceImage').orElse(testContainerImages['postgres-16']).get()
def jpaMatrixVersions = providers.gradleProperty('jpa.matrix.versions').orElse('16').get()
def readinessLanes = [
@@ -205,12 +205,12 @@ def platformLanes = [
jpaPlatformQueryPlanTest: ['jpa-queryplan', 'Asserts query plan structure and planner estimate error (design §33).'],
jpaPlatformSecurityTest : ['jpa-security', 'Verifies runtime role privileges and search_path safety (design §36).'],
]
// Every scenario a readiness card cites (config/jpa/readiness-cards.yaml `evidence.scenarios`) is a
// Every scenario a readiness card cites (release/readiness-cards.yaml `evidence.scenarios`) is a
// required test of the lane that runs its class, and a readiness lane rejects skips. That is what the
// deleted JPA evidence manifest used to establish from JUnit XML after the fact; JpaReadinessRegistryTest
// checks the cards themselves.
def readinessScenarios = new groovy.json.JsonSlurper()
.parse(rootProject.file('config/jpa/readiness-cards.yaml'))
.parse(file('release/readiness-cards.yaml'))
.cards.values()
.findAll { it.state != 'not-implemented' }
.collectMany { card -> (card.evidence?.scenarios ?: []).collect { it.selector } }
@@ -287,7 +287,7 @@ tasks.named('postgresqlSecurityBaselineIntegrationTest') {
dependsOn ':adapter:inbound:web:jpaPersistenceRedactionContractTest'
}
// Which JPA lanes block a release is declared by config/jpa/release-registry.json (jpaReleaseQualification below).
// Which JPA lanes block a release is declared by release/release-registry.json (jpaReleaseQualification below).
// This leaf declares the lanes and how each runs; it does not own release orchestration.
// The unit lane reads three files that are not Java sources: the release registry and its two
@@ -298,9 +298,9 @@ tasks.named('postgresqlSecurityBaselineIntegrationTest') {
// up-to-date after a registry demotion or a workflow edit — so the drift checks that exist to catch
// exactly those edits never run on them.
tasks.named('test') {
inputs.file(rootProject.file('config/jpa/release-registry.json'))
inputs.file(file('release/release-registry.json'))
// JpaReadinessRegistryTest: the readiness cards, the lanes they name and the scenarios they cite.
inputs.file(rootProject.file('config/jpa/readiness-cards.yaml'))
inputs.file(file('release/readiness-cards.yaml'))
inputs.dir(file('src/postgresqlIntegrationTest/java')).withPropertyName('readinessScenarioSources')
inputs.file(new File(rootProject.projectDir.parentFile, 'docs/jpa/support-matrix.md'))
inputs.file(new File(rootProject.projectDir.parentFile, 'docs/jpa/repository-adaptation.md'))
@@ -316,7 +316,7 @@ tasks.named('test') {
inputs.dir(file('../persistence-fileserver/src/main/resources/db/migration'))
.withPropertyName('fileserverMigrations')
// ...and the messaging platform's tree, whose inbox range the consume side applies here.
inputs.dir(file('../../../messaging/messaging-reliability-jdbc-postgresql/src/main/resources/db/migration'))
inputs.dir(file('../../../platforms/messaging/messaging-reliability-jdbc-postgresql/src/main/resources/db/migration'))
.withPropertyName('messagingMigrations')
}
@@ -351,20 +351,20 @@ apiSurface {
include '*/**/src/main/java/**/*.java'
exclude '**/build/**', 'adapter/outbound/persistence-jpa/**', 'adapter/outbound/persistence-fileserver/**',
'adapter/outbound/persistence-notification/**',
'build-logic/**', 'optional-platforms/**'
'build-logic/**', 'platforms/optional-build/**'
}
}
// The release registry (config/jpa/release-registry.json) names the blocking release gates; this
// The release registry (release/release-registry.json) names the blocking release gates; this
// aggregate runs exactly those. It replaced the build-tools `ca.jpa-qualification` plugin (review
// 2026-09-24 BUILD-O3-2): a gate that names a task that does not exist fails when the task graph is
// built, which is the whole of what `verifyJpaReleaseGateTasks` used to check.
tasks.register('jpaReleaseQualification') {
group = 'verification'
description = 'Runs exactly the blocking JPA release gates declared by config/jpa/release-registry.json.'
description = 'Runs exactly the blocking JPA release gates declared by release/release-registry.json.'
dependsOn(new groovy.json.JsonSlurper()
.parse(rootProject.file('config/jpa/release-registry.json'))
.parse(file('release/release-registry.json'))
.gates.findAll { it.blocking }.collect { it.task })
}
@@ -40,7 +40,7 @@ final class MigrationTrees {
Path.of("../persistence-notification/src/main/resources/db/migration"),
Path.of("../persistence-fileserver/src/main/resources/db/migration"),
Path.of(
"../../../messaging/messaging-reliability-jdbc-postgresql/src/main/resources/db/migration"));
"../../../platforms/messaging/messaging-reliability-jdbc-postgresql/src/main/resources/db/migration"));
private MigrationTrees() {}
@@ -20,7 +20,8 @@ import tools.jackson.databind.JsonNode;
import tools.jackson.databind.json.JsonMapper;
/**
* The JPA readiness cards ({@code src/config/jpa/readiness-cards.yaml}) against the lanes and tests
* The JPA readiness cards ({@code
* src/adapter/outbound/persistence-jpa/release/readiness-cards.yaml}) against the lanes and tests
* they name.
*
* <p>This replaced the build-tools {@code ca.jpa-qualification}/{@code ca.jpa-evidence} plugins
@@ -33,8 +34,8 @@ import tools.jackson.databind.json.JsonMapper;
class JpaReadinessRegistryTest {
private static final Path SOURCE_ROOT = Path.of("../../..").toAbsolutePath().normalize();
private static final Path REGISTRY = SOURCE_ROOT.resolve("config/jpa/readiness-cards.yaml");
private static final Path LEAF = SOURCE_ROOT.resolve("adapter/outbound/persistence-jpa");
private static final Path REGISTRY = LEAF.resolve("release/readiness-cards.yaml");
private static final String LEAF_PATH = ":adapter:outbound:persistence-jpa:";
private static final Set<String> STATES =
Set.of("selected", "implemented-candidate", "not-implemented");
@@ -43,7 +43,8 @@ public record JpaReleaseManifest(
String providerBaseline) {
/** Where the registry lives, relative to the repository's {@code src} directory. */
public static final String REGISTRY_PATH = "config/jpa/release-registry.json";
public static final String REGISTRY_PATH =
"adapter/outbound/persistence-jpa/release/release-registry.json";
/**
* The registry, located by walking up from the working directory.
@@ -109,7 +109,7 @@ The architecture rule catalogue (`…mongo.architecture`) is in the **testkit**
production: it is ArchUnit input, and shipping it put rule text on every consumer's runtime
classpath. Release gating is testkit-only for the same reason and is one implementation, not two:
`…mongo.testkit.release` reads the JUnit XML a lane wrote and is what
`scripts/verify-mongodb-platform.sh` and `src/config/mongodb/release-contracts.json` drive. A second
`scripts/verify-mongodb-platform.sh` and `src/adapter/outbound/persistence-mongo/release/release-contracts.json` drive. A second
pair on the production classpath — a hand-built set of category names and a gate that checked it —
had no caller outside its own test and no source of truth behind the categories; it is gone rather
than moved.
@@ -257,7 +257,7 @@ tasks.named('check') {
strictTestLanes {
lane('mongoDocumentContractTest') {
tag = 'document-contract'
description = 'Holds the Mongo lane tags to config/mongodb/release-contracts.json.'
description = 'Holds the Mongo lane tags to release/release-contracts.json.'
rejectSkipped = true
mainStage()
}
@@ -30,8 +30,7 @@ import tools.jackson.databind.json.JsonMapper;
class MongoTestLaneContractTest {
private static final Path INTEGRATION_SOURCES = Path.of("src/mongoIntegrationTest/java");
private static final Path RELEASE_CONTRACTS =
Path.of("../../../config/mongodb/release-contracts.json");
private static final Path RELEASE_CONTRACTS = Path.of("release/release-contracts.json");
private static final Set<String> DOCKER_LANE_TAGS =
Set.of(
"mongodb-replicaset",
+2 -2
View File
@@ -473,12 +473,12 @@ app-bootstrap 은 합성 루트라 "왜 이 의존성이, 왜 이 scope 로" 결
- **`spring-security-test`** — `@WithMockUser`로 actuator 보안 인가(permit-all 프로브 / 인증 필요한
링크 / 노출 안 한 loggers)를 검증한다.
- **`snakeyaml`** — `docs/registries/*.yaml` 같은 checked-in YAML 레지스트리를 contract 테스트가
읽는다. `config/messaging/*.yaml` 카드 검증(`MessagingCapabilityRegistryContractTest`)은 소유자
읽는다. `adapter/outbound/messaging/release/*.yaml` 카드 검증(`MessagingCapabilityRegistryContractTest`)은 소유자
결정 29로 `adapter:outbound:messaging` 테스트로 옮겼다.
### Messaging qualification scaffold
`config/messaging/`은 first polling-producer tuple의 machine-readable 계획 truth만 보관한다.
`adapter/outbound/messaging/release/`는 first polling-producer tuple의 machine-readable 계획 truth만 보관한다.
현재 card 11개는 모두 `maturity: not-implemented`, `evidenceFingerprint: ""`이고 consumer,
CDC, EOS, schema-registry 확장 row는 없다. `verifyMessagingContracts`는 application-core·
shared-contract의 exact qualification test를 실행하고 `contracts-schema/manifest.json`을 쓴 뒤 그
+3 -1
View File
@@ -183,7 +183,7 @@ dependencies {
capabilityProjects.each { architectureTestRuntimeOnly project(it) }
// What this import does NOT see: the optional-platforms build (`grpc:*`, `grpc-advanced:*`).
// It is a separate Gradle build, so its classes cannot be on this classpath; its registered
// leaves are held by the Gradle direction gate (`-p optional-platforms ci` runs
// leaves are held by the Gradle direction gate (`-p platforms/optional-build ci` runs
// verifyCleanArchitectureDependencies), which is the whole of what the owner decided it needs.
// The capability integration lane selects Fileserver and object storage together, as a service
@@ -349,6 +349,8 @@ def repositoryContractInputs = files(
include 'config/**', '**/*.gradle', 'gradle/*.toml', 'Dockerfile*', '.env*', '**/src/main/**'
// The compose lane fixtures this leaf owns (the lane contract, overlays, smoke clients).
include 'app-bootstrap/compose-lanes/**'
// The release data a capability leaf owns (readiness cards, release registries).
include 'adapter/outbound/*/release/**'
exclude '**/*.md'
exclude repositoryContractExcludes
})
@@ -371,19 +371,19 @@ class DeveloperExperienceContractTest {
// and the dependency verifier, and none of those runs a lane whose category is INTEGRATION.
// A lane nobody runs is not coverage, so both halves are pinned here — the aggregate that
// covers the category, and the workflow that executes the aggregate.
assertThat(read("src/optional-platforms/build.gradle"))
assertThat(read("src/platforms/optional-build/build.gradle"))
.as("the optional platform build must aggregate its integration-category lanes")
.contains("tasks.register('integrationCheck')")
.contains(":integrationTestLaneCheck");
assertThat(read("src/grpc/grpc-operation-ledger-jpa/build.gradle"))
assertThat(read("src/platforms/grpc/grpc-operation-ledger-jpa/build.gradle"))
.as("the operation ledger lane this contract protects must still be declared")
.contains("lane('integrationTest')")
.contains("integration()");
assertThat(read(".github/workflows/integration-main.yml"))
.as("a workflow must actually execute the optional platform integration aggregate")
.contains("./gradlew -p optional-platforms integrationCheck");
.contains("./gradlew -p platforms/optional-build integrationCheck");
}
@Test
@@ -51,7 +51,7 @@ class MessagingAuthorityContractTest {
Pattern.compile("String PREFIX\\s*=\\s*\"app\\.messaging\"");
private static final List<ProductionSource> MESSAGING_SOURCES =
loadSources("adapter/outbound/messaging", "messaging", "app-bootstrap");
loadSources("adapter/outbound/messaging", "platforms/messaging", "app-bootstrap");
private static final List<ProductionSource> CORE_SOURCES =
loadSources("application-core", "domain-core");
@@ -34,8 +34,8 @@ import org.junit.jupiter.api.Test;
*
* <p>So the rule is one-directional and mechanical: a vendor library named in a public or protected
* signature is declared {@code api}; one used only behind private members stays {@code
* implementation}. {@code src/messaging/CLAUDE.md} states it as policy — this holds it to the
* source so the two cannot drift.
* implementation}. {@code src/platforms/messaging/CLAUDE.md} states it as policy — this holds it to
* the source so the two cannot drift.
*
* <p>The libraries checked are the ones an adopter would otherwise have to reverse-engineer into
* their own build: broker clients, codec libraries, the metrics registry, the reactive facade.
@@ -345,7 +345,7 @@ class MessagingPublicSurfaceContractTest {
}
private static List<Path> messagingLeaves() {
Path family = repositoryRoot().resolve("src/messaging");
Path family = repositoryRoot().resolve("src/platforms/messaging");
try (Stream<Path> children = Files.list(family)) {
return children
.filter(Files::isDirectory)
@@ -66,7 +66,8 @@ class ReleaseManifestTaskExistenceTest {
// Only the blocking set. experimental_contracts is explicitly not promoted and is never
// aggregated into a release manifest, so a task it names is allowed not to exist yet.
List<String> named =
blockingTaskNamesIn(root.resolve("src/config/mongodb/release-contracts.json"));
blockingTaskNamesIn(
root.resolve("src/adapter/outbound/persistence-mongo/release/release-contracts.json"));
List<String> registered =
registeredTaskNamesIn(root.resolve("src/adapter/outbound/persistence-mongo/build.gradle"));
@@ -0,0 +1,78 @@
package dev.caskeleton.buildlogic;
import java.io.File;
import java.io.IOException;
import java.io.UncheckedIOException;
import org.gradle.api.GradleException;
/**
* Where the main build is, seen from any build of this repository.
*
* <p>The main build is the Gradle root that owns the module registry ({@code
* config/architecture/modules.json}); the repository root is its parent. The optional platform build
* lives inside it ({@code src/platforms/optional-build}), and the code that needs the registry, the
* shared tool configuration or the test image catalog used to reach the main build by taking one
* parent of the optional build's root. That held only while the optional build sat directly under
* the main build; it is found by walking up instead, so the optional build's depth is not a fact
* every caller repeats.
*/
public final class MainBuild {
/** The registry, relative to the main build: what makes a directory the main build. */
public static final String REGISTRY = "config/architecture/modules.json";
private MainBuild() {}
/**
* The main build's directory: {@code buildRoot} itself or the nearest directory above it that
* holds the module registry.
*
* @param buildRoot the root directory of the build asking (its settings or root project directory)
* @return the canonical main build directory
*/
public static File directory(File buildRoot) {
File registry = nearest(buildRoot, REGISTRY);
if (registry == null) {
throw new GradleException(
"No " + REGISTRY + " at or above " + buildRoot + "; this build is not inside the repository");
}
return registry.getParentFile().getParentFile().getParentFile();
}
/**
* The nearest {@code relativePath} at or above {@code buildRoot}: in the build's own root first,
* then in each parent. A file or a directory; {@code null} when no ancestor has it.
*
* @param buildRoot the root directory of the build asking
* @param relativePath the path to look for, relative to each candidate directory
* @return the canonical path found, or {@code null}
*/
public static File nearest(File buildRoot, String relativePath) {
for (File directory = canonical(buildRoot);
directory != null;
directory = directory.getParentFile()) {
File candidate = new File(directory, relativePath);
if (candidate.exists()) {
return candidate;
}
}
return null;
}
/**
* The repository root: the main build's parent.
*
* @param buildRoot the root directory of the build asking
* @return the canonical repository root
*/
public static File repositoryRoot(File buildRoot) {
return directory(buildRoot).getParentFile();
}
private static File canonical(File file) {
try {
return file.getCanonicalFile();
} catch (IOException exception) {
throw new UncheckedIOException("cannot resolve " + file, exception);
}
}
}
@@ -1,9 +1,8 @@
package dev.caskeleton.buildlogic.architecture;
import dev.caskeleton.buildlogic.MainBuild;
import dev.caskeleton.buildlogic.ModuleRegistry;
import java.io.File;
import java.io.IOException;
import java.io.UncheckedIOException;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.HashSet;
@@ -33,15 +32,9 @@ public final class ArchitecturePlugin implements Plugin<Project> {
Project root = project.getRootProject();
boolean optionalGrpcBuild = root.getName().equals("optional-platforms");
String buildName = optionalGrpcBuild ? "optional-grpc" : "main";
File mainBuildDirectory =
optionalGrpcBuild ? root.getProjectDir().getParentFile() : root.getProjectDir();
File registryFile = new File(mainBuildDirectory, "config/architecture/modules.json");
File repositoryRoot;
try {
repositoryRoot = mainBuildDirectory.getParentFile().getCanonicalFile();
} catch (IOException exception) {
throw new UncheckedIOException("failed to resolve repository root", exception);
}
File mainBuildDirectory = MainBuild.directory(root.getProjectDir());
File registryFile = new File(mainBuildDirectory, MainBuild.REGISTRY);
File repositoryRoot = mainBuildDirectory.getParentFile();
ModuleRegistry registry = ModuleRegistry.read(registryFile, repositoryRoot);
List<ModuleRegistry.Module> modules = registry.modulesForBuild(buildName);
List<String> registryViolations = registryViolations(registry, modules);
@@ -1,5 +1,6 @@
package dev.caskeleton.buildlogic.java;
import dev.caskeleton.buildlogic.MainBuild;
import io.spring.gradle.dependencymanagement.dsl.DependencyManagementExtension;
import java.io.File;
import java.io.IOException;
@@ -282,11 +283,12 @@ public final class JavaConventionsPlugin implements Plugin<Project> {
public static final String CONTAINER_IMAGE_PROPERTY_PREFIX = "ca.test.image.";
private static File containerImageCatalog(Project project) {
// The optional platform build's root is a directory inside the main build, which owns the
// catalog.
File root = project.getRootProject().getProjectDir();
File catalog = new File(root, "config/testing/container-images.properties");
if (!catalog.isFile()) {
// The optional-platforms build's root is a directory inside the main build.
catalog = new File(root.getParentFile(), "config/testing/container-images.properties");
File catalog = MainBuild.nearest(root, "config/testing/container-images.properties");
if (catalog == null) {
catalog = new File(root, "config/testing/container-images.properties");
}
if (!catalog.isFile()) {
throw new GradleException("Missing test container image catalog: " + catalog);
@@ -5,6 +5,7 @@ import com.github.spotbugs.snom.Confidence;
import com.github.spotbugs.snom.SpotBugsExtension;
import com.github.spotbugs.snom.SpotBugsReport;
import com.github.spotbugs.snom.SpotBugsTask;
import dev.caskeleton.buildlogic.MainBuild;
import java.io.File;
import java.util.List;
import net.ltgt.gradle.errorprone.ErrorProneOptions;
@@ -36,11 +37,14 @@ public final class QualityConventionsPlugin implements Plugin<Project> {
SourceSet main = javaExtension.getSourceSets().getByName(SourceSet.MAIN_SOURCE_SET_NAME);
SourceSet test = javaExtension.getSourceSets().getByName(SourceSet.TEST_SOURCE_SET_NAME);
File repositoryConfigDirectory = project.getRootProject().file("config");
if (!repositoryConfigDirectory.isDirectory()) {
repositoryConfigDirectory =
new File(project.getRootProject().getProjectDir().getParentFile(), "config");
}
// The optional platform build's root is a directory inside the main build, which owns the tool
// configuration.
File repositoryConfigDirectory =
MainBuild.nearest(project.getRootProject().getProjectDir(), "config/checkstyle");
repositoryConfigDirectory =
repositoryConfigDirectory == null
? project.getRootProject().file("config")
: repositoryConfigDirectory.getParentFile();
SpotlessExtension spotless = project.getExtensions().getByType(SpotlessExtension.class);
spotless.java(
@@ -1,23 +1,17 @@
package dev.caskeleton.buildlogic.settings;
import dev.caskeleton.buildlogic.MainBuild;
import dev.caskeleton.buildlogic.ModuleRegistrySettingsInstaller;
import java.io.File;
import java.io.IOException;
import java.io.UncheckedIOException;
import org.gradle.api.Plugin;
import org.gradle.api.initialization.Settings;
public final class OptionalArchitectureRegistrySettingsPlugin implements Plugin<Settings> {
@Override
public void apply(Settings settings) {
try {
File mainBuildDirectory = settings.getSettingsDir().getParentFile().getCanonicalFile();
File repositoryRoot = mainBuildDirectory.getParentFile().getCanonicalFile();
File registryFile = new File(mainBuildDirectory, "config/architecture/modules.json");
ModuleRegistrySettingsInstaller.install(
settings, registryFile, repositoryRoot, "optional-grpc");
} catch (IOException exception) {
throw new UncheckedIOException("failed to resolve optional architecture registry paths", exception);
}
File mainBuildDirectory = MainBuild.directory(settings.getSettingsDir());
File registryFile = new File(mainBuildDirectory, MainBuild.REGISTRY);
ModuleRegistrySettingsInstaller.install(
settings, registryFile, mainBuildDirectory.getParentFile(), "optional-grpc");
}
}
@@ -18,7 +18,7 @@ public abstract class StrictLaneStagesExtension {
* command executes this build's stages only when it starts in this build's directory from there
* — its step's {@code working-directory} joined with its {@code -p}. The directory is read from
* where the build is, so no build states it (review 2026-11-04 RR2-04-04: a {@code -p} value
* alone missed {@code working-directory: src/optional-platforms} with {@code ../gradlew}).
* alone missed {@code working-directory: src/platforms/optional-build} with {@code ../gradlew}).
*/
public abstract DirectoryProperty getWorkflowDirectory();
@@ -298,7 +298,7 @@ public final class StrictLaneStagesPlugin implements Plugin<Project> {
/**
* This build's directory from the repository root, which holds {@code .github/workflows}: {@code
* src} for the main build, {@code src/optional-platforms} for the optional one.
* src} for the main build, {@code src/platforms/optional-build} for the optional one.
*/
private static String buildDirectory(Project root, File workflowDirectory) {
File repository = workflowDirectory.getAbsoluteFile().getParentFile().getParentFile();
+28 -28
View File
@@ -386,13 +386,13 @@
{
"id": "messaging-core-api",
"gradle_path": ":messaging:messaging-core-api",
"source_path": "src/messaging/messaging-core-api",
"source_path": "src/platforms/messaging/messaging-core-api",
"allowed_dependencies": []
},
{
"id": "messaging-schema-json",
"gradle_path": ":messaging:messaging-schema-json",
"source_path": "src/messaging/messaging-schema-json",
"source_path": "src/platforms/messaging/messaging-schema-json",
"allowed_dependencies": [
"messaging-core-api"
]
@@ -400,7 +400,7 @@
{
"id": "messaging-schema-avro",
"gradle_path": ":messaging:messaging-schema-avro",
"source_path": "src/messaging/messaging-schema-avro",
"source_path": "src/platforms/messaging/messaging-schema-avro",
"allowed_dependencies": [
"messaging-core-api"
]
@@ -408,7 +408,7 @@
{
"id": "messaging-schema-protobuf",
"gradle_path": ":messaging:messaging-schema-protobuf",
"source_path": "src/messaging/messaging-schema-protobuf",
"source_path": "src/platforms/messaging/messaging-schema-protobuf",
"allowed_dependencies": [
"messaging-core-api"
]
@@ -416,7 +416,7 @@
{
"id": "messaging-cloudevents",
"gradle_path": ":messaging:messaging-cloudevents",
"source_path": "src/messaging/messaging-cloudevents",
"source_path": "src/platforms/messaging/messaging-cloudevents",
"allowed_dependencies": [
"messaging-core-api"
]
@@ -424,7 +424,7 @@
{
"id": "messaging-policy",
"gradle_path": ":messaging:messaging-policy",
"source_path": "src/messaging/messaging-policy",
"source_path": "src/platforms/messaging/messaging-policy",
"allowed_dependencies": [
"messaging-core-api"
]
@@ -432,7 +432,7 @@
{
"id": "messaging-transport-spi",
"gradle_path": ":messaging:messaging-transport-spi",
"source_path": "src/messaging/messaging-transport-spi",
"source_path": "src/platforms/messaging/messaging-transport-spi",
"allowed_dependencies": [
"messaging-core-api",
"messaging-policy"
@@ -441,7 +441,7 @@
{
"id": "messaging-runtime-core",
"gradle_path": ":messaging:messaging-runtime-core",
"source_path": "src/messaging/messaging-runtime-core",
"source_path": "src/platforms/messaging/messaging-runtime-core",
"allowed_dependencies": [
"messaging-core-api",
"messaging-policy",
@@ -453,7 +453,7 @@
{
"id": "messaging-observability",
"gradle_path": ":messaging:messaging-observability",
"source_path": "src/messaging/messaging-observability",
"source_path": "src/platforms/messaging/messaging-observability",
"allowed_dependencies": [
"messaging-core-api"
]
@@ -461,7 +461,7 @@
{
"id": "messaging-security",
"gradle_path": ":messaging:messaging-security",
"source_path": "src/messaging/messaging-security",
"source_path": "src/platforms/messaging/messaging-security",
"allowed_dependencies": [
"messaging-core-api"
]
@@ -469,7 +469,7 @@
{
"id": "messaging-kafka",
"gradle_path": ":messaging:messaging-kafka",
"source_path": "src/messaging/messaging-kafka",
"source_path": "src/platforms/messaging/messaging-kafka",
"allowed_dependencies": [
"messaging-core-api",
"messaging-policy",
@@ -482,7 +482,7 @@
{
"id": "messaging-reliability-api",
"gradle_path": ":messaging:messaging-reliability-api",
"source_path": "src/messaging/messaging-reliability-api",
"source_path": "src/platforms/messaging/messaging-reliability-api",
"allowed_dependencies": [
"messaging-core-api"
]
@@ -490,7 +490,7 @@
{
"id": "messaging-reliability",
"gradle_path": ":messaging:messaging-reliability",
"source_path": "src/messaging/messaging-reliability",
"source_path": "src/platforms/messaging/messaging-reliability",
"allowed_dependencies": [
"messaging-core-api",
"messaging-reliability-api"
@@ -499,7 +499,7 @@
{
"id": "messaging-reliability-jdbc-postgresql",
"gradle_path": ":messaging:messaging-reliability-jdbc-postgresql",
"source_path": "src/messaging/messaging-reliability-jdbc-postgresql",
"source_path": "src/platforms/messaging/messaging-reliability-jdbc-postgresql",
"allowed_dependencies": [
"messaging-core-api",
"messaging-reliability-api",
@@ -510,7 +510,7 @@
{
"id": "messaging-claim-check",
"gradle_path": ":messaging:messaging-claim-check",
"source_path": "src/messaging/messaging-claim-check",
"source_path": "src/platforms/messaging/messaging-claim-check",
"allowed_dependencies": [
"messaging-core-api",
"messaging-reliability-api"
@@ -519,7 +519,7 @@
{
"id": "messaging-admin",
"gradle_path": ":messaging:messaging-admin",
"source_path": "src/messaging/messaging-admin",
"source_path": "src/platforms/messaging/messaging-admin",
"allowed_dependencies": [
"messaging-core-api",
"messaging-observability"
@@ -528,7 +528,7 @@
{
"id": "messaging-spring-boot-starter",
"gradle_path": ":messaging:messaging-spring-boot-starter",
"source_path": "src/messaging/messaging-spring-boot-starter",
"source_path": "src/platforms/messaging/messaging-spring-boot-starter",
"allowed_dependencies": [
"messaging-admin",
"messaging-core-api",
@@ -546,7 +546,7 @@
{
"id": "messaging-spring-boot-starter-kafka",
"gradle_path": ":messaging:messaging-spring-boot-starter-kafka",
"source_path": "src/messaging/messaging-spring-boot-starter-kafka",
"source_path": "src/platforms/messaging/messaging-spring-boot-starter-kafka",
"allowed_dependencies": [
"messaging-spring-boot-starter",
"messaging-kafka",
@@ -562,7 +562,7 @@
{
"id": "messaging-testkit",
"gradle_path": ":messaging:messaging-testkit",
"source_path": "src/messaging/messaging-testkit",
"source_path": "src/platforms/messaging/messaging-testkit",
"allowed_dependencies": [
"messaging-core-api",
"messaging-policy",
@@ -572,21 +572,21 @@
{
"id": "grpc-contract",
"gradle_path": ":grpc:grpc-contract",
"source_path": "src/grpc/grpc-contract",
"source_path": "src/platforms/grpc/grpc-contract",
"allowed_dependencies": [],
"build": "optional-grpc"
},
{
"id": "grpc-core-api",
"gradle_path": ":grpc:grpc-core-api",
"source_path": "src/grpc/grpc-core-api",
"source_path": "src/platforms/grpc/grpc-core-api",
"allowed_dependencies": [],
"build": "optional-grpc"
},
{
"id": "grpc-observability",
"gradle_path": ":grpc:grpc-observability",
"source_path": "src/grpc/grpc-observability",
"source_path": "src/platforms/grpc/grpc-observability",
"allowed_dependencies": [
"grpc-core-api"
],
@@ -595,7 +595,7 @@
{
"id": "grpc-operation-ledger-jpa",
"gradle_path": ":grpc:grpc-operation-ledger-jpa",
"source_path": "src/grpc/grpc-operation-ledger-jpa",
"source_path": "src/platforms/grpc/grpc-operation-ledger-jpa",
"allowed_dependencies": [
"grpc-core-api"
],
@@ -604,7 +604,7 @@
{
"id": "grpc-runtime",
"gradle_path": ":grpc:grpc-runtime",
"source_path": "src/grpc/grpc-runtime",
"source_path": "src/platforms/grpc/grpc-runtime",
"allowed_dependencies": [
"grpc-core-api"
],
@@ -613,7 +613,7 @@
{
"id": "grpc-spring-boot-starter",
"gradle_path": ":grpc:grpc-spring-boot-starter",
"source_path": "src/grpc/grpc-spring-boot-starter",
"source_path": "src/platforms/grpc/grpc-spring-boot-starter",
"allowed_dependencies": [
"grpc-core-api",
"grpc-runtime",
@@ -624,7 +624,7 @@
{
"id": "grpc-testkit",
"gradle_path": ":grpc:grpc-testkit",
"source_path": "src/grpc/grpc-testkit",
"source_path": "src/platforms/grpc/grpc-testkit",
"allowed_dependencies": [
"grpc-core-api",
"grpc-runtime",
@@ -636,7 +636,7 @@
{
"id": "grpc-advanced",
"gradle_path": ":grpc-advanced:grpc-advanced",
"source_path": "src/grpc-advanced/grpc-advanced",
"source_path": "src/platforms/grpc-advanced/grpc-advanced",
"allowed_dependencies": [
"grpc-core-api",
"grpc-runtime"
@@ -646,7 +646,7 @@
{
"id": "grpc-advanced-compat",
"gradle_path": ":grpc-advanced:grpc-advanced-compat",
"source_path": "src/grpc-advanced/grpc-advanced-compat",
"source_path": "src/platforms/grpc-advanced/grpc-advanced-compat",
"allowed_dependencies": [
"grpc-core-api",
"grpc-runtime"

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