문제: 앞 커밋이 Gradle 루트를 저장소 루트로 옮기고 계층 폴더를 묶었다.
빌드 스크립트·build-logic·시험·workflow·스크립트·문서가 아직 옛 배치
(Gradle 루트 = src/)를 가정해 빌드가 되지 않는다.
고른 방법:
- Gradle 경로와 registry id는 그대로 둔다(:app-bootstrap, :application-core,
:composition:*). registry의 source_path만 새 폴더를 가리킨다. 폴더에 맞춘
이름(:domain:core, :application:core)은 프로젝트 이름 core가 둘이 되어
boot jar의 BOOT-INF/lib와 기본 capability가 겹치고, 파생 서비스의 모든
project(':…') 줄을 바꾸게 한다.
- registry는 gradle/modules.json, 시험 이미지 목록은
gradle/container-images.properties: 버전 카탈로그 옆, 빌드가 고정하는 것.
config/는 코드 검사 도구 설정만 둔다.
- build-logic: settings·architecture 플러그인의 저장소 루트를 Gradle 루트로
(getParentFile 제거). config contract의 파일 트리는 src/만 훑는다(루트를
훑으면 docs·.claude/worktrees까지 줍는다).
- 빌드 스크립트: rootProject.projectDir.parentFile → rootProject.projectDir,
rootProject.file('../…') → rootProject.file('…'), 옛 src 기준 include에
src/를 붙인다. notification API surface의 application-notification 소스
루트를 새 폴더로(놓치면 272개 타입이 surface에서 말없이 빠진다).
- 시험: 옛 src 기준 모듈 목록과 ../ 개수를 고친다. 없는 폴더를 말없이
건너뛰던 목록(MessagingAuthority, NotificationPayloadAtRest 등)을 새
폴더로, FileserverDocumentationCoverageTest는 Gradle 경로 → 폴더를
registry로 찾는다. Docker 계약은 WORKDIR /build, 새 jar 경로.
- Docker: 빌드 context를 저장소 루트로, .dockerignore는 허용 목록으로 다시
써서 전에 context였던 것만 들어가게 한다. compose의 build.context는 .,
env_file은 ./.env.
- workflow: working-directory: src 기본값과 그것을 되돌리던 줄을 지운다.
- scripts: verify.sh, ci/*, bootstrap-local, new-feature,
verify-feature-scaffold, mongo 검증, hooks, check-repo-layout 허용 목록.
check-docs의 경로 검사는 build-logic/·gradle/로 시작하는 경로도 본다.
- 문서: AGENTS.md 지도, README 구조 표, leaf AGENTS.md의 cd src, gates·
operate·결정 색인, src/bootstrap/AGENTS.md를 조립 계층 family 규칙으로
다시 쓴다. 기록 문서(docs/design·history·reviews, 지난 upgrade 안내,
capability-status 제거 표)는 머리 블록만 고친다. 파생 서비스용 안내
docs/upgrade/2026-11-relayout.md를 더한다.
위험: bootRun working dir가 저장소 루트가 되어 .env와 상대 경로 설정이
루트 기준이다. 루트 .env는 compose 보간에도 읽힌다(upgrade 안내 5절).
파생 서비스는 태그 pre-relayout-2026-11까지 받은 뒤 이 묶음을 받는다.
검증: desktop에서 캐시 없이 scripts/verify.sh docs·pr·main·release,
compose smoke 18 lane, 빠른 시작(scripts/verify.sh app). 결과는 PR 본문.
구조 리뷰(arch-reviewer) 지적 5건을 반영했다.
BREAKING CHANGE: Gradle은 저장소 루트에서 돈다(cd src 없음). registry는
gradle/modules.json, 이미지 빌드 context는 저장소 루트다. 옛 경로 → 새 경로
표는 docs/upgrade/2026-11-relayout.md.
Refs: design-docs repo-structure/01-backend-layout.md 6.1절 가-2·가-3
271 lines
15 KiB
Groovy
271 lines
15 KiB
Groovy
plugins {
|
|
// Spring Boot stays on the root build script classpath because a leaf applies it by id
|
|
// (`app-bootstrap`) and a leaf resolves plugin classes from the root.
|
|
//
|
|
// Spotless, SpotBugs, Error Prone and Spring's dependency-management are NOT here any more. They
|
|
// were declared `apply false` for a `configure(subprojects)` block that applied them to every
|
|
// leaf; build-logic's `ca.quality-conventions` and `ca.java-conventions` apply them now, and a
|
|
// plugin reachable from two classpaths is two versions waiting to differ. Their versions are the
|
|
// same catalog entries either way — build-logic/settings.gradle reads gradle/libs.versions.toml.
|
|
alias(libs.plugins.spring.boot) apply false
|
|
// JMH benchmarks in three leaves (`./gradlew :<leaf>:jmh`); never part of a gate.
|
|
alias(libs.plugins.jmh) apply false
|
|
|
|
// Convention plugin from the included build, applied to the ROOT because the rules it owns are
|
|
// about the repository: the architecture gates. The release version/revision is each leaf's
|
|
// `ca.java-conventions` (ca.release-provenance was removed, BUILD-O3-5). The public-path
|
|
// baseline is app-bootstrap's approval test, the local start-up is scripts/bootstrap-local.sh,
|
|
// and archive hygiene is gone with the revision it cleaned out of every leaf's jar name (review
|
|
// 2026-09-24 BUILD-O3-5).
|
|
id 'ca.architecture'
|
|
// Every strict lane belongs to a stage, and each stage's workflow job runs it (review
|
|
// 2026-11-01 08-01).
|
|
id 'ca.strict-lane-stages'
|
|
}
|
|
|
|
group = 'dev.caskeleton'
|
|
|
|
// A release archive has to name the commit that produced it. The revision rule is the one every
|
|
// leaf's version uses (JavaConventionsPlugin.sourceRevision, tested in build-logic), read here so
|
|
// the tag-only gate and the jars cannot disagree about what counts as a commit id.
|
|
tasks.register('verifyReleaseProvenance') {
|
|
group = 'verification'
|
|
description = 'Fails when the build cannot name the source revision it was produced from.'
|
|
String revision = dev.caskeleton.buildlogic.java.JavaConventionsPlugin.sourceRevision(providers)
|
|
boolean traceable = revision != dev.caskeleton.buildlogic.java.JavaConventionsPlugin.UNKNOWN_REVISION
|
|
outputs.upToDateWhen { false }
|
|
doLast { task ->
|
|
if (!traceable) {
|
|
throw new GradleException('verifyReleaseProvenance: no source revision. A release archive has to name the '
|
|
+ 'commit that produced it; supply -PgitRevision=<sha>, GIT_SHA or GITHUB_SHA.')
|
|
}
|
|
task.logger.lifecycle("verifyReleaseProvenance: OK — revision ${revision}")
|
|
}
|
|
}
|
|
|
|
// One explicit command regenerates every module's Gradle-default lockfile.
|
|
tasks.register('resolveAndLockAll') {
|
|
group = 'build setup'
|
|
description = 'Regenerates dependency locks for all subprojects (requires --write-locks).'
|
|
dependsOn subprojects.findAll { it.childProjects.isEmpty() }.collect { "${it.path}:resolveAndLockAll" }
|
|
}
|
|
|
|
tasks.register('verifyDependencyLocks') {
|
|
group = 'verification'
|
|
description = 'Verifies strict dependency lock state for production CI subprojects.'
|
|
dependsOn subprojects.findAll { it.childProjects.isEmpty() }.collect { "${it.path}:verifyDependencyLocks" }
|
|
}
|
|
|
|
// feature-developer-experience-contract D3 — the ordered local bootstrap lifecycle is
|
|
// scripts/bootstrap-local.sh (compile, Docker preflight, dependency wait, migrate-and-start, smoke).
|
|
|
|
// ---------------------------------------------------------------------------------------------
|
|
// Lifecycle.
|
|
//
|
|
// :<leaf>:check that leaf — compile, its tests, Spotless, Checkstyle, Error Prone
|
|
// check every leaf's check (Gradle matches the name across projects)
|
|
// architectureCheck dependency direction + purity + app-bootstrap whole-repository ArchUnit
|
|
// qualityCheck SpotBugs + FindSecBugs across every leaf (ca.quality-conventions)
|
|
// ci leaf checks + architectureCheck + qualityCheck
|
|
// prCheck the pull-request stage: ci + dependency locks + the Compose render, the
|
|
// repository layout and the document checks (scripts outside Gradle)
|
|
// mainCheck the main-branch stage: environment contract, full-boot qualification,
|
|
// public-path baseline, transport and messaging qualification lanes, each
|
|
// leaf's document-contract lanes, and the feature generator round trip
|
|
// (verifyFeatureScaffold)
|
|
// integrationCheck the declared strict integration lanes (several need a container runtime)
|
|
// performanceCheck the declared strict performance lanes (load, shutdown, pool and resource
|
|
// bounds; real servers and containers)
|
|
// releaseCheck the tag-only checks: release provenance + public path snapshot (not `ci`
|
|
// again — a tag is cut from a main commit the PR and main stages ran on)
|
|
//
|
|
// A leaf's check is that leaf's; a repository question gets a repository task named after it.
|
|
// Task PATHS, not TaskProviders: a leaf's tasks are created by convention plugins after the root is
|
|
// evaluated, and a path is resolved when the task graph is built.
|
|
// ---------------------------------------------------------------------------------------------
|
|
List<String> leafPaths = subprojects.findAll { it.childProjects.isEmpty() }.collect { it.path }.toSorted()
|
|
|
|
tasks.register('qualityCheck') {
|
|
group = 'verification'
|
|
description = 'Runs SpotBugs and FindSecBugs across every production CI leaf.'
|
|
dependsOn leafPaths.collect { "${it}:qualityCheck" }
|
|
}
|
|
|
|
tasks.register('configContractCheck') {
|
|
group = 'verification'
|
|
description = 'Runs the environment contract owned by the composition root.'
|
|
dependsOn ':app-bootstrap:verifyEnvKeys'
|
|
}
|
|
|
|
// A lane that needs an input this build was not given (the Redis topology coordinates, the protected
|
|
// AWS sandbox authority) is explicit-only: the aggregate leaves it out and names it when it runs
|
|
// (review NEW-16).
|
|
tasks.register('integrationCheck') {
|
|
group = 'verification'
|
|
description = "Runs every production CI leaf's integration-category test lanes. Several need a container runtime."
|
|
dependsOn leafPaths.collect { "${it}:integrationTestLaneCheck" }
|
|
}
|
|
|
|
// Performance lanes are not the pull request's or the main stage's: their bounds need a machine that
|
|
// is not compiling something else. main.yml runs this aggregate nightly, after its other jobs.
|
|
tasks.register('performanceCheck') {
|
|
group = 'verification'
|
|
description = "Runs every production CI leaf's performance-category test lanes. Several need a container runtime."
|
|
dependsOn leafPaths.collect { "${it}:performanceTestLaneCheck" }
|
|
}
|
|
|
|
tasks.named('architectureCheck') {
|
|
dependsOn leafPaths.collect { "${it}:architectureTestLaneCheck" }
|
|
}
|
|
|
|
// app-bootstrap is left out: its `check` already runs its full-boot lane in the pull-request gate,
|
|
// and the main stage ran the same lane a second time on every main push (review 2026-11-01 08-02).
|
|
// The lane stays merge-blocking, because a composition that does not boot must not merge.
|
|
tasks.register('systemTestCheck') {
|
|
group = 'verification'
|
|
description = "Runs every production CI leaf's full application/system test lanes that `ci` does not already run."
|
|
dependsOn leafPaths.findAll { it != ':app-bootstrap' }.collect { "${it}:systemTestLaneCheck" }
|
|
}
|
|
|
|
tasks.register('qualificationCheck') {
|
|
group = 'verification'
|
|
description = 'Runs repository/build-behavior qualification that is intentionally outside local leaf checks.'
|
|
dependsOn tasks.named('systemTestCheck')
|
|
dependsOn leafPaths.collect { "${it}:auxiliaryStyleCheck" }
|
|
dependsOn tasks.named('testQualityCheck')
|
|
}
|
|
|
|
// SpotBugs + FindSecBugs over every leaf's test source sets, against config/spotbugs/exclude-test.xml.
|
|
// Main stage, not `ci`: test code does not ship, and the full run is about as long as `ci` itself.
|
|
// It ran in no stage until 2026-11-04, and 53 of these tasks had been failing unseen.
|
|
tasks.register('testQualityCheck') {
|
|
group = 'verification'
|
|
description = 'Runs SpotBugs and FindSecBugs over every leaf\'s test source sets.'
|
|
dependsOn leafPaths.collect { "${it}:testQualityCheck" }
|
|
}
|
|
|
|
// The feature generator's round trip (review 2026-11-01 개선 순서 4): scripts/new-feature.sh writes
|
|
// two features into a throwaway copy of the working tree and that copy's own Gradle runs the leaf
|
|
// checks they touch plus architectureCheck. A nested build of five leaves, so the main stage, not
|
|
// the pull request. The script is the whole check; this task only gives it a stage.
|
|
tasks.register('verifyFeatureScaffold', Exec) {
|
|
group = 'verification'
|
|
description = 'Generates features with scripts/new-feature.sh in a scratch copy and runs the gates they must pass.'
|
|
workingDir = rootProject.projectDir
|
|
commandLine 'bash', 'scripts/verify-feature-scaffold.sh'
|
|
}
|
|
|
|
// Each lane below names its tests and rejects skips; these two only aggregate them.
|
|
tasks.register('conditionalTransportQualification') {
|
|
group = 'verification'
|
|
description = 'Runs the no-skip GraphQL, gRPC and WebSocket transport lanes and the opt-in classpath contract.'
|
|
dependsOn ':adapter:inbound:graphql:graphqlTransportQualificationTest',
|
|
':adapter:inbound:grpc:grpcTransportQualificationTest',
|
|
':adapter:inbound:websocket:websocketTransportQualificationTest',
|
|
':app-bootstrap:conditionalTransportBuildContractTest'
|
|
}
|
|
|
|
tasks.register('verifyMessagingContracts') {
|
|
group = 'verification'
|
|
description = 'Qualifies the application integration-event contract and the shared envelope schema.'
|
|
dependsOn ':application-core:messagingApplicationContractQualificationTest',
|
|
':shared-contract:messagingSharedSchemaQualificationTest'
|
|
}
|
|
|
|
tasks.register('ci') {
|
|
group = 'verification'
|
|
description = 'The pull-request gate: every production CI leaf check plus the architecture and quality gates.'
|
|
dependsOn leafPaths.collect { "${it}:check" }
|
|
dependsOn tasks.named('architectureCheck')
|
|
dependsOn tasks.named('qualityCheck')
|
|
}
|
|
|
|
tasks.register('mainCheck') {
|
|
group = 'verification'
|
|
description = 'The main-branch stage: the gates that are not worth a pull request\'s wait.'
|
|
dependsOn leafPaths.collect { "${it}:mainCheck" }
|
|
dependsOn tasks.named('configContractCheck')
|
|
dependsOn tasks.named('qualificationCheck')
|
|
dependsOn tasks.named('verifyPublicPathSnapshot')
|
|
dependsOn tasks.named('conditionalTransportQualification')
|
|
dependsOn tasks.named('verifyMessagingContracts')
|
|
dependsOn ':adapter:inbound:graphql:graphqlStableTest'
|
|
dependsOn tasks.named('verifyFeatureScaffold')
|
|
}
|
|
|
|
// The checks outside Gradle that the pull-request stage runs. Each is a script with its own tests
|
|
// (scripts/tests); these tasks only give them a stage, so pr.yml and scripts/verify.sh run the same
|
|
// one line. Repository root as working directory: that is where the scripts expect to start.
|
|
def repositoryRoot = rootProject.projectDir
|
|
tasks.register('verifyComposeProfiles', Exec) {
|
|
group = 'verification'
|
|
description = 'Renders every Compose lane and checks it renders exactly what it declares.'
|
|
workingDir = repositoryRoot
|
|
commandLine 'bash', 'scripts/verify-compose-profile-contracts.sh'
|
|
}
|
|
tasks.register('verifyRepositoryLayout', Exec) {
|
|
group = 'verification'
|
|
description = 'Refuses a top-level entry of the repository or src/ outside the allow list.'
|
|
workingDir = repositoryRoot
|
|
commandLine 'python3', 'scripts/check-repo-layout.py'
|
|
}
|
|
tasks.register('testDocumentChecks', Exec) {
|
|
group = 'verification'
|
|
description = 'Runs the tests of the scripts outside Gradle (document checker, hooks, ledger).'
|
|
workingDir = repositoryRoot
|
|
commandLine 'python3', '-m', 'unittest', 'discover', '-s', 'scripts/tests'
|
|
}
|
|
tasks.register('documentCheck', Exec) {
|
|
group = 'verification'
|
|
description = 'Checks living documents: language, head blocks, references, numbers, links, style.'
|
|
workingDir = repositoryRoot
|
|
commandLine 'python3', 'scripts/check-docs.py'
|
|
dependsOn tasks.named('testDocumentChecks')
|
|
}
|
|
|
|
tasks.register('prCheck') {
|
|
group = 'verification'
|
|
description = 'The pull-request stage: ci, dependency locks, the Compose render, the layout and the documents.'
|
|
dependsOn tasks.named('ci')
|
|
dependsOn tasks.named('verifyDependencyLocks')
|
|
dependsOn tasks.named('verifyComposeProfiles')
|
|
dependsOn tasks.named('verifyRepositoryLayout')
|
|
dependsOn tasks.named('documentCheck')
|
|
}
|
|
|
|
// The stages a strict lane may belong to, and the one workflow job that runs each.
|
|
// `verifyStrictLaneStages --dry-run` (pull-request stage) fails when a strict lane that is not
|
|
// `explicitOnly` is in the plan of none of them — the gap that left fourteen lanes running nowhere
|
|
// while each one failed closed (review 2026-11-01 08-01) — or when a stage job is not the line
|
|
// `./gradlew <stage> <options>` under the declared event and condition. A new lane joins a stage
|
|
// through its category aggregate; no workflow line names it. The performance lane runs only
|
|
// nightly, after the other heavy jobs, on a runner nothing else is using (owner decision 2026-11-07).
|
|
strictLaneStages {
|
|
workflowDirectory = layout.projectDirectory.dir('.gitea/workflows')
|
|
stage ':prCheck', workflow: 'pr.yml', event: 'pull_request', job: 'gradle'
|
|
stage ':mainCheck', workflow: 'main.yml', event: 'push', filter: 'branches: [main]', job: 'main',
|
|
options: '--continue'
|
|
stage ':integrationCheck', workflow: 'main.yml', event: 'push', filter: 'branches: [main]', job: 'integration',
|
|
options: '--continue'
|
|
stage ':performanceCheck', workflow: 'main.yml', event: 'schedule', job: 'performance', options: '--continue',
|
|
condition: '${{ !cancelled() && github.event_name != \'push\' }}'
|
|
stage ':releaseCheck', workflow: 'release.yml', event: 'push', filter: 'tags: ["v*"]', job: 'release'
|
|
}
|
|
|
|
// The deny-by-default public path baseline: app-bootstrap's approval-test lane under its old name.
|
|
// `-PapprovePublicPathChange` rewrites the baseline after review.
|
|
tasks.register('verifyPublicPathSnapshot') {
|
|
group = 'verification'
|
|
description = 'Fails when the shipped public path default drifts from docs/security/public-paths-snapshot.txt.'
|
|
dependsOn ':app-bootstrap:publicPathSnapshotTest'
|
|
}
|
|
|
|
// The checks that only matter for a release artifact. Not `ci` again: a release tag is cut from a
|
|
// main commit that the pull-request gate and the main stage already ran on (review BUILD-중복-6).
|
|
tasks.register('releaseCheck') {
|
|
group = 'verification'
|
|
description = 'The tag-only checks: release provenance and the public path baseline.'
|
|
dependsOn tasks.named('verifyReleaseProvenance')
|
|
dependsOn tasks.named('verifyPublicPathSnapshot')
|
|
}
|