diff --git a/.env.example b/.env.example index 91afa010..1c68b40e 100644 --- a/.env.example +++ b/.env.example @@ -9,10 +9,13 @@ # is a credential in the repository, and the fact that it is 'only an example' is not something a # scanner, a fork, or a hurried operator can tell. # -# A key left blank here uses the inline default in application.yml. Seven values have no default -# at all — the datasource URL, username and password, the application name, and the JWT issuer and -# audience — because a default for any of them is a deployment running against something nobody -# chose. +# Every value here is the registry default (or the row's `example:`, a recommended production +# value such as the SMTP submission port). A blank line is not "use the default": Compose env_file +# and bootRun both set the variable to an empty string, which replaces the default. So a key is left +# blank only when it has no default — secrets, and the values a deployment must choose itself (the +# profile, the application name, the datasource URL and username, the JWT issuer and audience), +# because a default for any of them is a deployment running against something nobody chose. +# Keys the registry marks deprecated_orphaned are not listed: nothing reads them. # ============================================================================= # ---- Configuration ----------------------------------------------------------- @@ -20,9 +23,13 @@ SPRING_PROFILES_ACTIVE= APP_NAME= APP_SERVER_PORT=8080 MANAGEMENT_SERVER_PORT=9001 +# Loopback by default, so the actuator is reachable only from inside the container. Kubernetes +# probes and a Prometheus scrape reach the pod IP: set the address they use (for example 0.0.0.0 +# behind a NetworkPolicy) or run them as a sidecar. +MANAGEMENT_SERVER_ADDRESS=127.0.0.1 APP_SERVER_SHUTDOWN=graceful APP_SERVER_SHUTDOWN_TIMEOUT=30s -APP_SERVER_FORWARD_HEADERS_STRATEGY=native +APP_SERVER_FORWARD_HEADERS_STRATEGY=none APP_SERVER_TOMCAT_MAX_THREADS=200 APP_SERVER_TOMCAT_MIN_SPARE_THREADS=10 APP_SERVER_TOMCAT_ACCEPT_COUNT=100 @@ -42,7 +49,7 @@ APP_DATASOURCE_URL= APP_DATASOURCE_USERNAME= APP_DATASOURCE_POOL_MAX_SIZE=10 APP_DATASOURCE_POOL_MIN_IDLE=2 -APP_DATASOURCE_CONNECTION_TIMEOUT=5s +APP_DATASOURCE_CONNECTION_TIMEOUT=5000 APP_DATASOURCE_DRIVER=org.postgresql.Driver APP_DATASOURCE_DDL_AUTO=validate APP_DATASOURCE_SHOW_SQL=false @@ -57,7 +64,7 @@ APP_LOG_LEVEL_ROOT=INFO APP_LOG_LEVEL_APP=INFO APP_LOG_LEVEL_SPRING=INFO APP_LOG_LEVEL_WEB=INFO -APP_LOG_LEVEL_SQL=WARN +APP_LOG_LEVEL_SQL=INFO APP_LOG_FILE_ENABLED=false APP_LOG_FILE_PATH=logs/ca-skeleton.json APP_LOG_FILE_MAX_SIZE=100MB @@ -76,7 +83,7 @@ APP_SECURITY_CORS_ENABLED=false APP_SECURITY_CORS_ALLOWED_METHODS= APP_SECURITY_CORS_ALLOWED_HEADERS=* APP_SECURITY_CORS_ALLOW_CREDENTIALS=false -APP_SECURITY_CORS_MAX_AGE=600s +APP_SECURITY_CORS_MAX_AGE=600 APP_SECURITY_AUTH_MODE=jwt APP_SESSION_COOKIE_NAME=CA_SESSION APP_SESSION_COOKIE_SECURE=true @@ -85,33 +92,16 @@ APP_SESSION_COOKIE_SAME_SITE=Lax APP_SESSION_COOKIE_PATH=/ APP_SESSION_CSRF_COOKIE_NAME=XSRF-TOKEN APP_SESSION_CSRF_HEADER_NAME=X-XSRF-TOKEN -APP_SESSION_REDIS_NAMESPACE_ENVIRONMENT=local -APP_SESSION_IDLE_TIMEOUT=30m -APP_SESSION_ABSOLUTE_LIFETIME=8h -APP_SESSION_TOUCH_INTERVAL=1m -APP_SESSION_TOMBSTONE_TTL=5m -APP_SESSION_MAXIMUM_ENVELOPE_BYTES=32768 -APP_SESSION_MAXIMUM_ATTRIBUTES=64 -APP_SESSION_MAXIMUM_SCALAR_BYTES=8192 APP_SECURITY_JWT_ISSUER= APP_SECURITY_JWT_AUDIENCE= APP_RATE_LIMIT_ENABLED=false -APP_RATE_LIMIT_REDIS_ENABLED=false APP_RATE_LIMIT_PROVIDER=disabled APP_RATE_LIMIT_FAILURE_POLICY=fail-closed APP_RATE_LIMIT_DEFAULT_POLICY_ID=api-default APP_RATE_LIMIT_FAILURE_RETRY_AFTER=100ms APP_RATE_LIMIT_HASH_KEY_VERSION=1 APP_RATE_LIMIT_KEY_VERSION=1 -APP_RATE_LIMIT_REDIS_HOST= -APP_RATE_LIMIT_REDIS_PORT=6379 -APP_RATE_LIMIT_REDIS_TRUST_PEM= -APP_SESSION_REDIS_TRUST_PEM= -APP_RATE_LIMIT_REDIS_COMMAND_TIMEOUT=1s -APP_RATE_LIMIT_REDIS_MAXIMUM_COMMAND_BYTES=16384 -APP_RATE_LIMIT_REDIS_MAXIMUM_QUEUED_COMMANDS=32 -APP_RATE_LIMIT_REDIS_MAXIMUM_IN_FLIGHT_BYTES=1048576 -APP_RATE_LIMIT_REDIS_NAMESPACE_ENVIRONMENT=local +APP_RATE_LIMIT_REDIS_COMMAND_TIMEOUT=200ms APP_RATE_LIMIT_POLICY_REVISION=v1 APP_RATE_LIMIT_ALGORITHM=sliding-counter APP_RATE_LIMIT_LIMIT=100 @@ -127,12 +117,10 @@ APP_IDEMPOTENCY_TTL=24h # disabled | redis | postgresql. postgresql refuses a non-PostgreSQL data source, so bootRunH2 # runs with disabled or redis. APP_IDEMPOTENCY_PROVIDER=disabled -APP_IDEMPOTENCY_REDIS_NAMESPACE_ENVIRONMENT=local APP_IDEMPOTENCY_PROCESSING_LEASE=30s # Failure retention: at most 30d and not shorter than APP_IDEMPOTENCY_TTL (startup fails). APP_IDEMPOTENCY_FAILURE_RETENTION=24h APP_LEASE_PROVIDER=disabled -APP_LEASE_REDIS_NAMESPACE_ENVIRONMENT=local APP_LEASE_REDIS_DRIFT_BUDGET=10ms APP_CACHE_CANONICAL_DEFAULT_PROVIDER=disabled APP_REDIS_ENABLED=true @@ -179,32 +167,10 @@ APP_REDIS_TLS_CLIENT_KEY_REFERENCE= APP_REDIS_TLS_ENABLED=false APP_REDIS_TLS_HOSTNAME_VERIFICATION=true APP_REDIS_TLS_TRUST_MATERIAL_RESOURCE= -APP_CACHE_REDIS_ENABLED=false -APP_CACHE_REDIS_CLIENT_MODE=managed -APP_CACHE_REDIS_HOST= -APP_CACHE_REDIS_PORT=6379 -APP_CACHE_REDIS_TRUST_PEM= -APP_REDIS_SEMANTIC_PROBE_MINIMUM_INTERVAL=5s -APP_REDIS_SENTINEL_DISCOVERY_REFRESH_PERIOD=30s -APP_REDIS_SEMANTIC_PROBE_MAXIMUM_STALENESS=15s -APP_CACHE_REDIS_COMMAND_TIMEOUT=2s -APP_CACHE_REDIS_MAXIMUM_QUEUED_COMMANDS=8 -APP_CACHE_REDIS_MAXIMUM_IN_FLIGHT_BYTES=16777216 -APP_CACHE_REDIS_POSITIVE_SOFT_TTL= -APP_CACHE_REDIS_TTL_JITTER=0.10 +APP_CACHE_REDIS_COMMAND_TIMEOUT=200ms +APP_CACHE_REDIS_POSITIVE_SOFT_TTL=30s APP_CACHE_REDIS_MINIMUM_HARD_TTL=1s -APP_CACHE_REDIS_NAMESPACE_ENVIRONMENT=local APP_CACHE_REDIS_SEMANTIC_REGION=default -APP_CACHE_REDIS_MAXIMUM_VALUE_BYTES=1048576 -APP_CACHE_REDIS_L1_ENABLED=false -APP_CACHE_REDIS_L1_MAXIMUM_ENTRIES=10000 -APP_CACHE_REDIS_L1_MAXIMUM_WEIGHT_BYTES=67108864 -APP_CACHE_REDIS_L1_MAXIMUM_ENTRY_WEIGHT_BYTES=1048576 -APP_CACHE_REDIS_L1_TTL=30s -APP_CACHE_REDIS_L1_GENERATION_RECHECK_INTERVAL=5s -APP_CACHE_REDIS_L1_INVALIDATION_QUEUE_CAPACITY=1024 -APP_CACHE_DEFAULT_TTL=300s -APP_CACHE_NEGATIVE_TTL=60s APP_MESSAGING_BROKER=kafka APP_MESSAGING_PRODUCER_ID= APP_MESSAGING_KAFKA_BROKERS= @@ -301,6 +267,9 @@ APP_WEBSOCKET_ENABLED=true # `false` is the explicit off the Compose lanes set. APP_OBJECTSTORAGE_ENABLED=true APP_GRPC_SERVER_ENABLED=true +# The listener is loopback plaintext only; a deployment that selects the gRPC module sets this to +# true or startup refuses. +APP_GRPC_SERVER_ALLOW_INSECURE_LOCAL=false APP_WEBSOCKET_ENDPOINT=/ws APP_WEBSOCKET_ALLOWED_ORIGINS=http://localhost:3000 APP_WEBSOCKET_BROADCAST_DESTINATION=/topic/events @@ -384,10 +353,6 @@ APP_PRIVACY_PSEUDONYMIZATION_SALT= APP_RATE_LIMIT_REDIS_PASSWORD= APP_RATE_LIMIT_REDIS_KEY_HMAC_SECRET= APP_SESSION_REDIS_PASSWORD= -APP_SESSION_REDIS_KEY_HMAC_SECRET= -APP_IDEMPOTENCY_REDIS_KEY_HMAC_SECRET= -APP_LEASE_REDIS_KEY_HMAC_SECRET= -APP_CACHE_REDIS_PASSWORD= APP_CACHE_REDIS_KEY_HMAC_SECRET= APP_FILESERVER_PLATFORM_OBSERVABILITY_FINGERPRINT_KEY= # The notification platform's seven key purposes. Each is base64 of at least 32 bytes and must diff --git a/.github/dependency-vulnerability-policy.md b/.github/dependency-vulnerability-policy.md index 80a87906..abc2635d 100644 --- a/.github/dependency-vulnerability-policy.md +++ b/.github/dependency-vulnerability-policy.md @@ -3,8 +3,9 @@ 이 정책을 강제하는 것은 [`scripts/ci/trivy-scan.sh`](../scripts/ci/trivy-scan.sh)(pull request workflow의 `done` job, main·nightly workflow의 `vulnerabilities` job, release workflow의 이미지 job이 부른다), -[`../.trivyignore.yaml`](../.trivyignore.yaml), CODEOWNERS, -[`../renovate.json`](../renovate.json)이다. +[`../.trivyignore.yaml`](../.trivyignore.yaml), CODEOWNERS다. [`../renovate.json`](../renovate.json)은 갱신 PR을 만드는 +설정일 뿐 강제 수단이 아니다. 이 repo를 보는 Renovate 실행기가 지금 Gitea에 없어서, 그 설정은 누가 Renovate를 이 repo에 +붙일 때부터 쓰인다. ## 실행 위치와 플랫폼 경계 @@ -92,7 +93,9 @@ mirror가 살아 있고 최신인지는 운영이 챙길 의존이다. 낡은 mi ## 의존성 갱신 정책 -Renovate가 저장소에 커밋된 보안 갱신 봇 설정이다. 보안 갱신은 갱신 종류와 상관없이 자동 병합하지 않는다 +Renovate가 저장소에 커밋된 보안 갱신 봇 설정이다. 실행기가 붙어 있지 않은 동안 갱신은 trivy 실패를 본 관리자가 +손으로 한다. GitHub vulnerability alert(`vulnerabilityAlerts`)는 GitHub 호스트에서만 있고, 그 밖에서는 +`osvVulnerabilityAlerts`가 근거다. 보안 갱신은 갱신 종류와 상관없이 자동 병합하지 않는다 (`renovate.json`의 `automerge: false`). Renovate는 strict lockfile을 다시 만들지 않는다. 관리자가 `./gradlew resolveAndLockAll --write-locks`로 잠금을 다시 만들고, 잠금 diff를 검토해 함께 커밋한다. 의존성 선언과 모든 `gradle.lockfile`은 같이 움직이고, `verifyDependencyLocks`는 계속 릴리스를 diff --git a/Dockerfile b/Dockerfile index e8205522..1e0453bc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -152,8 +152,8 @@ ENV HOME=/tmp # -XX:MaxRAMPercentage=75 — use up to 75% of the container memory limit for heap. # -XX:+UseContainerSupport — respect cgroup memory limits (default on JDK 10+, explicit here). # -XX:+ExitOnOutOfMemoryError — terminate immediately on OOM so the orchestrator can restart. -# -XX:+HeapDumpOnOutOfMemoryError / -XX:HeapDumpPath — write a heap dump to the writable -# /var/tmp/heap mount (see tmpfs mounts in compose files, D2). +# -XX:+HeapDumpOnOutOfMemoryError / -XX:HeapDumpPath — write a heap dump to /var/tmp/heap when a +# disk-backed volume is mounted there (see below). # -Dserver.tomcat.basedir=/tmp — redirect Tomcat temp files to /tmp (D2: read-only root fs). ENV JAVA_TOOL_OPTIONS="\ -XX:MaxRAMPercentage=75 \ @@ -164,10 +164,13 @@ ENV JAVA_TOOL_OPTIONS="\ -Dserver.tomcat.basedir=/tmp" # ---- Filesystem layout (D2: read-only root filesystem) ---------------------- -# /var/tmp/heap — heap dump landing zone; must be a writable mount at runtime. -# /tmp — Tomcat working directory (see JAVA_TOOL_OPTIONS above). -# Both directories are declared here so tooling is aware of them; at runtime they -# MUST be mounted as tmpfs (or host volumes) by the orchestrator (see compose files). +# /tmp — Tomcat working directory (see JAVA_TOOL_OPTIONS above); a tmpfs at runtime. +# /var/tmp/heap — heap dump landing zone. To keep dumps, mount a disk-backed volume there: in +# Kubernetes an emptyDir without `medium: Memory` (it survives a container restart) +# or a PersistentVolume. Never a tmpfs: it is charged to the container's memory +# limit and vanishes on exit, so the dump only risks an OOM kill. With nothing +# mounted the read-only root refuses the file and the JVM exits 3 at once (compose.yaml). +# Both directories are declared here so tooling is aware of them. RUN mkdir -p /var/tmp/heap && chmod 1777 /var/tmp/heap # ---- Non-root user (D3) ----------------------------------------------------- @@ -219,7 +222,9 @@ EXPOSE 8080 9001 # connection adds its own indicator when it is selected — the JPA module adds the datasource — so a # container started without that dependency reachable is genuinely not ready. # Kubernetes ignores HEALTHCHECK and uses its own probes against the same path; this exists for -# docker and Compose. +# docker and Compose. A kubelet probe reaches the pod IP, and the management port binds loopback +# by default (MANAGEMENT_SERVER_ADDRESS=127.0.0.1): a Kubernetes deployment sets that address, or +# its probes fail (src/bootstrap/service-runtime/README.md 「management/security」). # # wget is present in eclipse-temurin:21-jre-noble, so nothing is installed for it. HEALTHCHECK --interval=30s --timeout=5s --start-period=60s --retries=3 \ diff --git a/README.md b/README.md index cd6a255f..b49fc279 100644 --- a/README.md +++ b/README.md @@ -116,12 +116,15 @@ DB, Redis, Kafka, 알림, 파일 서버 같은 부가 기능(capability)은 `src 이 저장소를 새 서비스의 출발점으로 쓸 때의 순서다. 이 목록이 템플릿 재사용 체크리스트의 정본이다. 1. `settings.gradle`의 `rootProject.name`을 새 서비스 이름으로 바꾼다. -2. 패키지 루트 `dev.caskeleton`을 서비스 패키지로 바꾼다. Java 소스만이 아니라 `AutoConfiguration.imports`·`spring.factories`·빌드 스크립트·설정 파일·생성 명령 템플릿도 이 이름을 쓴다. 바꿀 파일은 이 명령으로 찾는다. +2. 패키지 루트 `dev.caskeleton`을 서비스 패키지로 바꾼다. Java 소스만이 아니라 `AutoConfiguration.imports`·`spring.factories`·빌드 스크립트·설정 파일·생성 명령 템플릿, SpotBugs 제외 목록(`config/spotbugs/`), 루트 `build.gradle`과 build-logic의 `group`, registry와 공개 API 스냅숏(`docs/registries/`, `docs/architecture/`, `docs/notification/api-surface-snapshot.txt`)도 이 이름을 쓴다. 바꿀 파일은 이 명령으로 찾는다. build-logic 자신의 패키지(`dev.caskeleton.buildlogic`)는 앱 패키지가 아니라 그대로 둬도 된다. ```bash - git grep -l 'dev\.caskeleton' -- src scripts + git grep -l -e 'dev\.caskeleton' -- src scripts config build.gradle docs/registries docs/architecture docs/notification + git grep -l -e '"dev\.caskeleton"' -- build-logic/src/main ``` + SpotBugs 목록을 빼먹으면 `qualityCheck`가, 스냅숏을 빼먹으면 각 leaf `check`의 API surface 검사가 실패한다. + 3. `CaSkeletonApplication`을 새 애플리케이션 이름으로 바꾼다. 4. 새 업무 기능은 `scripts/new-feature.sh `으로 만들고 [docs/manual/README.md](docs/manual/README.md) 순서대로 채운다. 모듈 이름과 경계는 그대로 둔다. 5. 쓰는 capability의 `runtimeOnly` 줄만 켠다. 켜지 않은 capability leaf는 산출물에 들어가지 않으니 지우지 않아도 된다. diff --git a/build-logic/src/main/java/dev/caskeleton/buildlogic/apisurface/ApiSurfacePlugin.java b/build-logic/src/main/java/dev/caskeleton/buildlogic/apisurface/ApiSurfacePlugin.java index a022deaa..9f261c36 100644 --- a/build-logic/src/main/java/dev/caskeleton/buildlogic/apisurface/ApiSurfacePlugin.java +++ b/build-logic/src/main/java/dev/caskeleton/buildlogic/apisurface/ApiSurfacePlugin.java @@ -34,10 +34,22 @@ public final class ApiSurfacePlugin implements Plugin { if (extension.getSourceRoot() != null && !extension.getSourceRoot().isBlank()) { sourcePaths.add(extension.getSourceRoot()); } - extension.getAdditionalSourceRoots().stream() - .filter(path -> path != null && !path.isBlank()) - .forEach(sourcePaths::add); - List roots = sourcePaths.stream().map(project::file).toList(); + List additional = + extension.getAdditionalSourceRoots().stream() + .filter(path -> path != null && !path.isBlank()) + .map(project::file) + .toList(); + // A missing additional root used to be skipped without a word, so an approved update + // recorded a surface with a whole module's types gone (2026-11-12 review). + List missing = additional.stream().filter(root -> !root.isDirectory()).toList(); + if (!missing.isEmpty()) { + throw new GradleException( + project.getPath() + + " apiSurface.additionalSourceRoots names a folder that does not exist: " + + missing); + } + List roots = new ArrayList<>(sourcePaths.stream().map(project::file).toList()); + roots.addAll(additional); String verifyTaskName = "verify" + label + "ApiSurface"; String updateTaskName = "update" + label + "ApiSurface"; String approvalProperty = "approve" + label + "ApiSurfaceChange"; diff --git a/build-logic/src/main/java/dev/caskeleton/buildlogic/config/EnvContractVerifier.java b/build-logic/src/main/java/dev/caskeleton/buildlogic/config/EnvContractVerifier.java index c1f1892e..f917534f 100644 --- a/build-logic/src/main/java/dev/caskeleton/buildlogic/config/EnvContractVerifier.java +++ b/build-logic/src/main/java/dev/caskeleton/buildlogic/config/EnvContractVerifier.java @@ -9,21 +9,28 @@ import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; import java.util.List; +import java.util.Map; import java.util.Optional; import java.util.Set; +import java.util.TreeMap; import java.util.TreeSet; import java.util.regex.Matcher; import java.util.regex.Pattern; /** Repository policy for the operator-facing environment contract. No Gradle API. */ public final class EnvContractVerifier { - private static final Pattern ENV_LINE = Pattern.compile("^([A-Z][A-Z0-9_]*)=.*"); + private static final Pattern ENV_LINE = Pattern.compile("^([A-Z][A-Z0-9_]*)=(.*)$"); private static final Pattern PLACEHOLDER = Pattern.compile("\\$\\{([A-Z][A-Z0-9_]*)(:[^}]*)?}"); private static final Pattern SECRET_REFERENCE = Pattern.compile("secret://environment/(APP_[A-Z][A-Z0-9_]*)"); + /** + * A registry row of any name. It used to match {@code APP_} rows only, so the framework-named + * rows ({@code MANAGEMENT_SERVER_ADDRESS}, {@code SPRING_MAIL_*}) were invisible to every rule + * below and a placeholder outside {@code APP_} needed no row at all. + */ private static final Pattern REGISTRY_NAME = - Pattern.compile("^\\s*- name: (APP_[A-Z0-9_]+)"); + Pattern.compile("^\\s*- name: ([A-Z][A-Z0-9_]*)\\s*$"); private static final Pattern REGISTRY_FIELD = Pattern.compile("^\\s*([a-z_]+):\\s*(\\S.*)?$"); private static final Pattern APP_KEY = Pattern.compile("APP_[A-Z][A-Z0-9_]*"); @@ -114,23 +121,34 @@ public final class EnvContractVerifier { requireFile(registryFile, "missing " + registryFile); Set envKeys = new TreeSet<>(); + Map envValues = new TreeMap<>(); for (String line : readLines(envFile)) { Matcher matcher = ENV_LINE.matcher(line); if (matcher.matches()) { envKeys.add(matcher.group(1)); + envValues.put(matcher.group(1), matcher.group(2).trim()); } } Set requiredPlaceholders = new TreeSet<>(); Set allPlaceholders = new TreeSet<>(); Set environmentSecretReferences = new TreeSet<>(); + // name -> the literal defaults the non-profile shipped files give it ("" for ${KEY:}). A + // profile file (application-.yml) overrides on purpose and is not compared; a default + // that nests another placeholder is not a literal and is not compared either. + Map> shippedDefaults = new TreeMap<>(); for (File configurationFile : configurationFiles) { String configuration = read(configurationFile); + boolean profileFile = configurationFile.getName().startsWith("application-"); Matcher placeholderMatcher = PLACEHOLDER.matcher(configuration); while (placeholderMatcher.find()) { allPlaceholders.add(placeholderMatcher.group(1)); if (placeholderMatcher.group(2) == null) { requiredPlaceholders.add(placeholderMatcher.group(1)); + } else if (!profileFile && !placeholderMatcher.group(2).contains("${")) { + shippedDefaults + .computeIfAbsent(placeholderMatcher.group(1), name -> new TreeSet<>()) + .add(normalizedValue(placeholderMatcher.group(2).substring(1))); } } Matcher secretMatcher = SECRET_REFERENCE.matcher(configuration); @@ -139,10 +157,9 @@ public final class EnvContractVerifier { } } - Set applicationAppReferences = new TreeSet<>(); - allPlaceholders.stream() - .filter(name -> name.startsWith("APP_")) - .forEach(applicationAppReferences::add); + // Every name the shipped configuration reads, whatever its prefix: a placeholder outside APP_ + // (SECURITY_PUBLIC_PATHS opens paths to anonymous callers) needs a row as much as an APP_ one. + Set applicationAppReferences = new TreeSet<>(allPlaceholders); applicationAppReferences.addAll(environmentSecretReferences); failUnlessEmpty( @@ -152,26 +169,80 @@ public final class EnvContractVerifier { List registryRows = parseRegistryRows(registryFile); Set registryAppKeys = new TreeSet<>(); Set registryProperties = new TreeSet<>(); + Set liveAppRows = new TreeSet<>(); + Set deprecatedRows = new TreeSet<>(); for (EnvRegistryRow row : registryRows) { registryAppKeys.add(row.name()); row.property().ifPresent(registryProperties::add); + if (row.deprecatedOrphaned()) { + deprecatedRows.add(row.name()); + } else if (row.name().startsWith("APP_")) { + liveAppRows.add(row.name()); + } } failUnlessEmpty( - difference(registryAppKeys, envKeys), + difference(liveAppRows, envKeys), "docs/registries/env-keys.yaml registers APP_ keys absent from .env.example, so an " + "adopter copying the example never sees them: "); - - Set envAppKeys = new TreeSet<>(); - envKeys.stream().filter(name -> name.startsWith("APP_")).forEach(envAppKeys::add); failUnlessEmpty( - difference(envAppKeys, registryAppKeys), - ".env.example declares APP_ keys absent from docs/registries/env-keys.yaml " - + "(registry is the SSOT for APP_ keys): "); + intersection(deprecatedRows, envKeys), + ".env.example sets keys the registry marks deprecated_orphaned — an adopter who copies it" + + " sets a variable nothing reads and believes it is in force: ", + " — take the line out; the registry row stays to tell a deployment that still sets it."); + failUnlessEmpty( + intersection(deprecatedRows, applicationAppReferences), + "docs/registries/env-keys.yaml marks keys deprecated_orphaned that the shipped" + + " configuration still reads: ", + " — the row says nothing reads them and tells deployments to stop setting them; restore" + + " the row (and its default) or remove the placeholder."); + + failUnlessEmpty( + difference(envKeys, registryAppKeys), + ".env.example declares keys absent from docs/registries/env-keys.yaml " + + "(registry is the SSOT): "); failUnlessEmpty( difference(applicationAppReferences, registryAppKeys), - "shipped configuration references APP_ keys absent from docs/registries/env-keys.yaml " - + "(optional defaults and environment secret references are included): "); + "shipped configuration references env keys absent from docs/registries/env-keys.yaml " + + "(any prefix; optional defaults and environment secret references are included): "); + + List valueMismatches = new ArrayList<>(); + for (EnvRegistryRow row : registryRows) { + String expected = row.exampleValue(); + String written = envValues.get(row.name()); + if (written != null && !normalizedValue(written).equals(expected)) { + valueMismatches.add( + row.name() + + ": .env.example writes '" + + written + + "', the registry " + + (row.example().isPresent() ? "example" : "default") + + " is '" + + expected + + "'" + + (written.isEmpty() + ? " (a blank line sets an empty string, which replaces the default)" + : "")); + } + Set defaults = shippedDefaults.getOrDefault(row.name(), Set.of()); + String registered = row.defaultValue().orElse(""); + for (String shipped : defaults) { + if (!shipped.equals(registered)) { + valueMismatches.add( + row.name() + + ": the shipped configuration defaults to '" + + shipped + + "', the registry default is '" + + registered + + "'"); + } + } + } + failUnlessEmpty( + valueMismatches, + "env values disagree with docs/registries/env-keys.yaml: ", + " — the registry default is what the shipped configuration falls back to, and" + + " .env.example writes that default (or the row's example:)."); Set declared = ConfigurationMetadataClasspath.propertiesUnder(metadataClasspath, ""); Set typedProperties = new TreeSet<>(); @@ -351,6 +422,10 @@ public final class EnvContractVerifier { current.property = value; } else if (key.equals("deprecated_orphaned")) { current.deprecatedOrphaned = Boolean.parseBoolean(value); + } else if (key.equals("default")) { + current.defaultValue = normalizedValue(value); + } else if (key.equals("example")) { + current.example = normalizedValue(value); } } if (current != null) { @@ -391,6 +466,25 @@ public final class EnvContractVerifier { } } + private static Set intersection(Collection left, Collection right) { + Set result = new TreeSet<>(left); + result.retainAll(new HashSet<>(right)); + return result; + } + + /** A registry or env value without YAML quotes; {@code null}, {@code ~} and blank are "". */ + private static String normalizedValue(String raw) { + String value = raw.trim(); + if (value.length() >= 2 + && (value.startsWith("\"") && value.endsWith("\"") + || value.startsWith("'") && value.endsWith("'"))) { + value = value.substring(1, value.length() - 1); + } else if (value.equals("null") || value.equals("~")) { + value = ""; + } + return value; + } + private static Set difference(Collection left, Collection right) { Set result = new TreeSet<>(left); result.removeAll(new HashSet<>(right)); @@ -417,13 +511,20 @@ public final class EnvContractVerifier { private final String name; private String property; private boolean deprecatedOrphaned; + private String defaultValue; + private String example; private RowBuilder(String name) { this.name = name; } private EnvRegistryRow build() { - return new EnvRegistryRow(name, Optional.ofNullable(property), deprecatedOrphaned); + return new EnvRegistryRow( + name, + Optional.ofNullable(property), + deprecatedOrphaned, + Optional.ofNullable(defaultValue).filter(value -> !value.isEmpty()), + Optional.ofNullable(example)); } } } diff --git a/build-logic/src/main/java/dev/caskeleton/buildlogic/config/EnvRegistryRow.java b/build-logic/src/main/java/dev/caskeleton/buildlogic/config/EnvRegistryRow.java index 77ffd3fc..8b1f6810 100644 --- a/build-logic/src/main/java/dev/caskeleton/buildlogic/config/EnvRegistryRow.java +++ b/build-logic/src/main/java/dev/caskeleton/buildlogic/config/EnvRegistryRow.java @@ -3,10 +3,33 @@ package dev.caskeleton.buildlogic.config; import java.util.Objects; import java.util.Optional; +/** + * One {@code env-keys.yaml} row as the environment contract reads it. + * + * @param defaultValue the row's {@code default:}, empty when it is {@code null} or blank — the + * value the shipped configuration falls back to and {@code .env.example} writes + * @param example the row's {@code example:}, the value {@code .env.example} writes instead of the + * default (a recommended production value such as the SMTP submission port) + */ public record EnvRegistryRow( - String name, Optional property, boolean deprecatedOrphaned) { + String name, + Optional property, + boolean deprecatedOrphaned, + Optional defaultValue, + Optional example) { public EnvRegistryRow { Objects.requireNonNull(name, "name"); property = property == null ? Optional.empty() : property; + defaultValue = defaultValue == null ? Optional.empty() : defaultValue; + example = example == null ? Optional.empty() : example; + } + + public EnvRegistryRow(String name, Optional property, boolean deprecatedOrphaned) { + this(name, property, deprecatedOrphaned, Optional.empty(), Optional.empty()); + } + + /** What {@code .env.example} must write for this row: the example, else the default. */ + public String exampleValue() { + return example.or(() -> defaultValue).orElse(""); } } diff --git a/build-logic/src/main/java/dev/caskeleton/buildlogic/convention/SpringLibraryConventionPlugin.java b/build-logic/src/main/java/dev/caskeleton/buildlogic/convention/SpringLibraryConventionPlugin.java index f4757d60..46905c75 100644 --- a/build-logic/src/main/java/dev/caskeleton/buildlogic/convention/SpringLibraryConventionPlugin.java +++ b/build-logic/src/main/java/dev/caskeleton/buildlogic/convention/SpringLibraryConventionPlugin.java @@ -3,6 +3,14 @@ package dev.caskeleton.buildlogic.convention; import org.gradle.api.Plugin; import org.gradle.api.Project; +/** + * Quality conventions plus the Spring Boot test starter for a Spring library leaf. + * + *

Only {@code spring-boot-starter-test}. The web MVC test starter (MockMvc, {@code @WebMvcTest}, + * and an embedded Tomcat with them) used to be added to every leaf here, so thirty leaves resolved + * and locked a servlet container for tests that never start one. A leaf whose tests use MockMvc + * declares {@code spring-boot-starter-webmvc-test} in its own build script (2026-11-12 review). + */ public final class SpringLibraryConventionPlugin implements Plugin { @Override public void apply(Project project) { @@ -10,8 +18,5 @@ public final class SpringLibraryConventionPlugin implements Plugin { project .getDependencies() .add("testImplementation", "org.springframework.boot:spring-boot-starter-test"); - project - .getDependencies() - .add("testImplementation", "org.springframework.boot:spring-boot-starter-webmvc-test"); } } diff --git a/build-logic/src/main/java/dev/caskeleton/buildlogic/java/JavaConventionsPlugin.java b/build-logic/src/main/java/dev/caskeleton/buildlogic/java/JavaConventionsPlugin.java index e3cf9012..7b75200e 100644 --- a/build-logic/src/main/java/dev/caskeleton/buildlogic/java/JavaConventionsPlugin.java +++ b/build-logic/src/main/java/dev/caskeleton/buildlogic/java/JavaConventionsPlugin.java @@ -310,7 +310,14 @@ public final class JavaConventionsPlugin implements Plugin { return catalog; } - private static Map containerImages(File catalog) { + /** + * The catalog, refused when an image is not pinned by digest. + * + *

The catalog's header promises digests: a red lane should mean this repository changed, not + * that a registry moved a tag. Two images were tag-only for weeks with a note to pin them later + * (2026-11-12 review), and nothing noticed, so the promise is checked where the file is read. + */ + static Map containerImages(File catalog) { Properties properties = new Properties(); try (var in = Files.newInputStream(catalog.toPath())) { properties.load(in); @@ -319,6 +326,18 @@ public final class JavaConventionsPlugin implements Plugin { } Map images = new TreeMap<>(); properties.stringPropertyNames().forEach(key -> images.put(key, properties.getProperty(key))); + List unpinned = + images.entrySet().stream() + .filter(entry -> !entry.getValue().contains("@sha256:")) + .map(Map.Entry::getKey) + .toList(); + if (!unpinned.isEmpty()) { + throw new GradleException( + catalog.getName() + + ": pin every image by digest (repository@sha256:...), with its tag in a comment;" + + " not pinned: " + + unpinned); + } return Map.copyOf(images); } } diff --git a/build-logic/src/test/java/dev/caskeleton/buildlogic/apisurface/ApiSurfaceConventionTest.java b/build-logic/src/test/java/dev/caskeleton/buildlogic/apisurface/ApiSurfaceConventionTest.java index 06869bc6..ab4550d8 100644 --- a/build-logic/src/test/java/dev/caskeleton/buildlogic/apisurface/ApiSurfaceConventionTest.java +++ b/build-logic/src/test/java/dev/caskeleton/buildlogic/apisurface/ApiSurfaceConventionTest.java @@ -173,6 +173,27 @@ class ApiSurfaceConventionTest { """); } + @Test + @org.junit.jupiter.api.DisplayName("없는 추가 source root는 건너뛰지 않고 그 경로를 짚어 실패한다") + void aMissingAdditionalSourceRootFailsInsteadOfShrinkingTheSurface() throws Exception { + // given + Files.writeString( + projectDir.resolve("build.gradle"), + Files.readString(projectDir.resolve("build.gradle")) + .replace( + "baseline = file('surface.txt')", + "baseline = file('surface.txt')\n additionalSourceRoots = ['../moved/src/main/java']")); + + // when + BuildResult result = + runner("updateFixtureApiSurface", "-PapproveFixtureApiSurfaceChange").buildAndFail(); + + // then + assertTrue( + result.getOutput().contains("additionalSourceRoots names a folder that does not exist"), + result.getOutput()); + } + private void writeConfiguredBuild(String sourceRoot) throws Exception { Files.writeString( projectDir.resolve("build.gradle"), diff --git a/build-logic/src/test/java/dev/caskeleton/buildlogic/config/EnvContractVerifierTest.java b/build-logic/src/test/java/dev/caskeleton/buildlogic/config/EnvContractVerifierTest.java index f3c4f9d1..4cb1250d 100644 --- a/build-logic/src/test/java/dev/caskeleton/buildlogic/config/EnvContractVerifierTest.java +++ b/build-logic/src/test/java/dev/caskeleton/buildlogic/config/EnvContractVerifierTest.java @@ -102,7 +102,7 @@ class EnvContractVerifierTest { Files.readString(fixture.registry()) + "- name: APP_REDIS_UNUSED\n" + " type: string\n" - + " default: null\n"); + + " default: present-but-unread\n"); IllegalStateException failure = assertThrows( @@ -142,7 +142,7 @@ class EnvContractVerifierTest { List.of("APP_REDIS_"), List.of())); - assertTrue(failure.getMessage().contains("shipped configuration references APP_ keys")); + assertTrue(failure.getMessage().contains("shipped configuration references env keys")); assertTrue(failure.getMessage().contains("APP_SECONDARY_ONLY")); } @@ -356,7 +356,7 @@ class EnvContractVerifierTest { Files.writeString( fixture.registry(), Files.readString(fixture.registry()) - + "- name: APP_GHOST_ENABLED\n property: app.ghost.enabled\n type: boolean\n"); + + "- name: APP_GHOST_ENABLED\n property: app.ghost.enabled\n type: boolean\n default: true\n"); Path compose = fixture.repositoryRoot().resolve("compose.yaml"); Files.writeString( compose, "services:\n app:\n environment:\n APP_GHOST_ENABLED: \"true\"\n"); @@ -381,7 +381,7 @@ class EnvContractVerifierTest { Files.writeString( fixture.registry(), Files.readString(fixture.registry()) - + "- name: APP_GHOST_ENABLED\n property: app.ghost.enabled\n type: boolean\n"); + + "- name: APP_GHOST_ENABLED\n property: app.ghost.enabled\n type: boolean\n default: true\n"); Path ghostClasses = fixture.repositoryRoot().resolve("adapter/ghost/build/classes/java/main"); Files.createDirectories(ghostClasses.resolve("META-INF")); Files.writeString( @@ -398,6 +398,167 @@ class EnvContractVerifierTest { assertEquals(3, result.envKeyCount()); } + @Test + @DisplayName("APP_ 밖 이름의 placeholder도 레지스트리에 없으면 실패한다") + void aPlaceholderOutsideTheAppPrefixMustBeRegistered(@TempDir Path temp) throws Exception { + // given + Fixture fixture = fixture(temp); + Files.writeString( + fixture.applicationYaml(), + Files.readString(fixture.applicationYaml()) + "paths: ${SECURITY_PUBLIC_PATHS:/v1/health}\n"); + + // when + IllegalStateException failure = assertThrows(IllegalStateException.class, () -> verify(fixture)); + + // then + assertTrue(failure.getMessage().contains("shipped configuration references env keys absent")); + assertTrue(failure.getMessage().contains("SECURITY_PUBLIC_PATHS")); + } + + @Test + @DisplayName("APP_ 밖 이름의 레지스트리 행도 placeholder를 등록한 것으로 친다") + void aFrameworkNamedRegistryRowRegistersItsPlaceholder(@TempDir Path temp) throws Exception { + // given + Fixture fixture = fixture(temp); + Files.writeString( + fixture.applicationYaml(), + Files.readString(fixture.applicationYaml()) + + "address: ${MANAGEMENT_SERVER_ADDRESS:127.0.0.1}\n"); + Files.writeString( + fixture.registry(), + Files.readString(fixture.registry()) + + "- name: MANAGEMENT_SERVER_ADDRESS\n type: string\n default: 127.0.0.1\n"); + + // when + EnvContractResult result = verify(fixture); + + // then + assertEquals(3, result.applicationReferenceCount()); + } + + @Test + @DisplayName("deprecated_orphaned 행의 키를 .env.example이 아직 쓰면 실패한다") + void aDeprecatedKeyTheExampleStillSetsFails(@TempDir Path temp) throws Exception { + // given + Fixture fixture = fixture(temp); + Files.writeString( + fixture.envFile(), Files.readString(fixture.envFile()) + "APP_REDIS_OLD=2s\n"); + Files.writeString( + fixture.registry(), + Files.readString(fixture.registry()) + + "- name: APP_REDIS_OLD\n deprecated_orphaned: true\n type: duration\n default: 2s\n"); + + // when + IllegalStateException failure = assertThrows(IllegalStateException.class, () -> verify(fixture)); + + // then + assertTrue(failure.getMessage().contains("marks deprecated_orphaned")); + assertTrue(failure.getMessage().contains("APP_REDIS_OLD")); + } + + @Test + @DisplayName("deprecated_orphaned 행의 키를 배포 설정이 아직 읽으면 실패한다") + void aDeprecatedKeyTheConfigurationStillReadsFails(@TempDir Path temp) throws Exception { + // given + Fixture fixture = fixture(temp); + Files.writeString( + fixture.applicationYaml(), + Files.readString(fixture.applicationYaml()) + "timeout: ${APP_REDIS_OLD:200ms}\n"); + Files.writeString( + fixture.registry(), + Files.readString(fixture.registry()) + + "- name: APP_REDIS_OLD\n deprecated_orphaned: true\n type: duration\n default: 200ms\n"); + + // when + IllegalStateException failure = assertThrows(IllegalStateException.class, () -> verify(fixture)); + + // then + assertTrue(failure.getMessage().contains("that the shipped configuration still reads")); + assertTrue(failure.getMessage().contains("APP_REDIS_OLD")); + } + + @Test + @DisplayName(".env.example 값이 레지스트리 기본값과 다르면 실패하고, 빈 줄은 빈 문자열로 친다") + void anExampleValueThatIsNotTheRegistryDefaultFails(@TempDir Path temp) throws Exception { + // given + Fixture fixture = fixture(temp); + Files.writeString(fixture.envFile(), "APP_REQUIRED=required\nAPP_REDIS_HOST=\n"); + + // when + IllegalStateException failure = assertThrows(IllegalStateException.class, () -> verify(fixture)); + + // then + assertTrue(failure.getMessage().contains("APP_REDIS_HOST: .env.example writes ''")); + assertTrue(failure.getMessage().contains("a blank line sets an empty string")); + } + + @Test + @DisplayName("행의 example 값을 .env.example이 쓰면 기본값과 달라도 통과한다") + void anExampleValueTheRowNamesPasses(@TempDir Path temp) throws Exception { + // given + Fixture fixture = fixture(temp); + Files.writeString( + fixture.envFile(), Files.readString(fixture.envFile()) + "SPRING_MAIL_PORT=587\n"); + Files.writeString( + fixture.registry(), + Files.readString(fixture.registry()) + + "- name: SPRING_MAIL_PORT\n type: integer\n default: null\n example: 587\n"); + + // when + EnvContractResult result = verify(fixture); + + // then + assertEquals(3, result.envKeyCount()); + } + + @Test + @DisplayName("배포 설정의 기본값이 레지스트리 기본값과 다르면 실패하고, profile 파일은 비교하지 않는다") + void aShippedDefaultThatIsNotTheRegistryDefaultFails(@TempDir Path temp) throws Exception { + // given + Fixture fixture = fixture(temp); + Path profile = fixture.applicationYaml().resolveSibling("application-local.yml"); + Files.writeString(profile, "redis: ${APP_REDIS_HOST:127.0.0.1}\n"); + Files.writeString( + fixture.applicationYaml(), + "required: ${APP_REQUIRED}\nredis: ${APP_REDIS_HOST:redis.internal}\n"); + + // when + IllegalStateException failure = + assertThrows( + IllegalStateException.class, + () -> + EnvContractVerifier.verify( + fixture.envFile().toFile(), + List.of(fixture.applicationYaml().toFile(), profile.toFile()), + fixture.registry().toFile(), + List.of(), + fixture.metadataClasspath(), + List.of("app.redis."), + List.of("APP_REDIS_"), + List.of())); + + // then + assertTrue( + failure + .getMessage() + .contains( + "APP_REDIS_HOST: the shipped configuration defaults to 'redis.internal', the" + + " registry default is 'localhost'")); + assertTrue(!failure.getMessage().contains("127.0.0.1"), failure.getMessage()); + } + + private static EnvContractResult verify(Fixture fixture) { + return EnvContractVerifier.verify( + fixture.envFile().toFile(), + List.of(fixture.applicationYaml().toFile()), + fixture.registry().toFile(), + List.of(), + fixture.metadataClasspath(), + List.of("app.redis."), + List.of("APP_REDIS_"), + List.of()); + } + private static EnvContractResult verifyWithOperatorFiles( Fixture fixture, Path operatorFile, Path... otherModuleClasses) { List classpath = new ArrayList<>(fixture.metadataClasspath()); @@ -435,7 +596,7 @@ class EnvContractVerifierTest { applicationYaml, "required: ${APP_REQUIRED}\nredis: ${APP_REDIS_HOST:localhost}\n"); Files.writeString( registry, - "- name: APP_REQUIRED\n type: string\n default: none\n" + "- name: APP_REQUIRED\n type: string\n default: required\n" + "- name: APP_REDIS_HOST\n property: app.redis.host\n type: string\n default: localhost\n"); Files.writeString(metadata, "{\"properties\":[{\"name\":\"app.redis.host\"}]}"); return new Fixture(repositoryRoot, envFile, applicationYaml, registry, redisClasses, metadata); diff --git a/build-logic/src/test/java/dev/caskeleton/buildlogic/java/ContainerImageCatalogTest.java b/build-logic/src/test/java/dev/caskeleton/buildlogic/java/ContainerImageCatalogTest.java new file mode 100644 index 00000000..2c5035c7 --- /dev/null +++ b/build-logic/src/test/java/dev/caskeleton/buildlogic/java/ContainerImageCatalogTest.java @@ -0,0 +1,50 @@ +package dev.caskeleton.buildlogic.java; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.catchThrowable; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import org.gradle.api.GradleException; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + +class ContainerImageCatalogTest { + + @Test + @DisplayName("digest 없이 tag만 적은 이미지는 목록을 읽는 단계에서 그 키를 짚어 실패한다") + void aTagOnlyImageFailsNamingItsKey(@TempDir Path directory) throws IOException { + // given + Path catalog = directory.resolve("container-images.properties"); + Files.writeString( + catalog, + "pinned=postgres@sha256:" + + "0".repeat(64) + + "\nfloating=postgres:17-alpine\n"); + + // when + Throwable failure = catchThrowable(() -> JavaConventionsPlugin.containerImages(catalog.toFile())); + + // then + assertThat(failure) + .isInstanceOf(GradleException.class) + .hasMessageEndingWith("not pinned: [floating]"); + } + + @Test + @DisplayName("모든 이미지가 digest로 고정된 목록은 키와 값을 그대로 돌려준다") + void aDigestPinnedCatalogIsReadAsIs(@TempDir Path directory) throws IOException { + // given + Path catalog = directory.resolve("container-images.properties"); + String image = "postgres@sha256:" + "a".repeat(64); + Files.writeString(catalog, "# postgres:17-alpine\npostgres-17=" + image + "\n"); + + // when + var images = JavaConventionsPlugin.containerImages(catalog.toFile()); + + // then + assertThat(images).containsExactly(java.util.Map.entry("postgres-17", image)); + } +} diff --git a/compose.yaml b/compose.yaml index bb145c2e..992355d4 100644 --- a/compose.yaml +++ b/compose.yaml @@ -85,10 +85,11 @@ services: required: false ports: - "${APP_SERVER_PORT:-8080}:8080" - # Management (health, info, prometheus — answered without authentication) on loopback only: - # published on every interface it reaches the whole LAN (07-13). The smoke lanes read it from - # inside the container, so they need no host port at all. - - "127.0.0.1:9001:9001" + # Management (health, info, prometheus — answered without authentication) is not published. + # It binds the container's loopback (MANAGEMENT_SERVER_ADDRESS, default 127.0.0.1), so a host + # port mapped to it would answer nothing, and binding 0.0.0.0 to publish it would open it to + # every container on the network as well. The healthcheck and the smoke lanes read it from + # inside the container: `docker compose exec app wget -qO- http://localhost:9001/actuator/health`. environment: # Explicit, not inherited. A Compose profile selects services; it says nothing about which # environment the application believes it is in. The dev and prod-smoke lane overlays set @@ -107,13 +108,17 @@ services: APP_DATASOURCE_USERNAME: "${APP_DATASOURCE_USERNAME:-ca_skeleton}" APP_DATASOURCE_PASSWORD: "${APP_DATASOURCE_PASSWORD:-ca_skeleton}" # ---- Read-only root filesystem (D2) ------------------------------------- - # The application must write only to the tmpfs mounts declared below. + # The application must write only to the tmpfs mount declared below. # /tmp — Tomcat basedir (see -Dserver.tomcat.basedir=/tmp in Dockerfile). - # /var/tmp/heap — heap dump landing zone (see -XX:HeapDumpPath=/var/tmp/heap). + # /var/tmp/heap — the heap dump path (-XX:HeapDumpPath) — is deliberately not a tmpfs. A tmpfs is + # charged to this container's mem_limit and is gone once the container exits, so a dump written + # there at an OutOfMemoryError could only turn the clean exit 3 into an OOM kill, and was never + # there to read. On the read-only root the JVM cannot create the file and exits 3 at once. The + # dev lane mounts a volume there to keep dumps; scripts/verify-compose-profile-contracts.sh + # refuses a tmpfs at that path in every lane. read_only: true tmpfs: - /tmp:mode=1777,size=128m - - /var/tmp/heap:mode=1777,size=512m # No volume: the shipped composition keeps nothing on disk. A capability that does brings its # mount in its own overlay, added with -f when the capability is selected, so this file never # names one (07-08). diff --git a/config/spotbugs/exclude.xml b/config/spotbugs/exclude.xml index 99a0419c..2ee07473 100644 --- a/config/spotbugs/exclude.xml +++ b/config/spotbugs/exclude.xml @@ -59,16 +59,6 @@ - - - - - - -