문제: 앞 커밋 뒤에도 알림·파일 서버 묶음이 합쳐지지 않았고, 포트 다수에 fake와 실제 구현이 함께 통과하는 공유 계약이 없었고, SpotBugs가 신뢰도 HIGH만 봤고, application-core에 관계없는 클래스 묶음 패키지(outbound)가 있었다. 묶음을 합치자 lane·검사가 새로 드러낸 결함도 있었다(JpaOutbox Store가 읽기 전용 트랜잭션에서 이벤트를 조용히 잃음, gRPC admission controller가 public synchronized라 외부 lock에 막힘, 소비자 decode 타입 등록 경로 없음, compose Redis 익명 접근, local-fileserver lane DB 없음). 방법: 리뷰 README 15절에 남은 결정을 모두 적고 그대로 고쳤다. 트랜잭션· 멱등성·발행·notification 포트에 testFixtures 계약 키트를 두고 fake와 PG·Redis 구현이 상속한다(fake 변이로 계약이 잡는지 확인). SpotBugs는 MEDIUM으로 내리고 진짜 결함은 고치고 오탐은 위치·패턴별 이유를 단 제외로 처리했다. 업무 기능 패키지 규칙을 application-core/CLAUDE.md에 정본으로 두고 ArchUnit 2개와 생성 명령이 강제한다. compose Redis는 infra/redis-sdk ACL로 뜬다. 묶음별 결과는 리뷰 README 16절에 있다. 위험·한계: APP_FLYWAY_ENABLED가 dev·prod에도 적용된다. app.security 오타 키가 이제 기동을 막는다. SES 콜백 replay 창 기본값이 1시간이다. 템플릿 패키지 목록은 CLAUDE.md 표와 TemplatePackageOwnership 두 곳에 있고 일치 검사는 없다. 실제 CI runner 실행은 확인하지 못했다. 검증: ci, mainCheck, integrationCheck, -p optional-platforms ci integrationCheck, performanceCheck, releaseCheck(-PgitRevision), verify-compose-profile-contracts(18 lane) 통과. compose lane 실제 기동: local-fileserver, notification ingest·serving·handoff, local-redis, all-adapters(smoke 3개 포함). Refs: docs/reviews/2026-11-01-maturity-review/README.md 15·16절 BREAKING CHANGE: APP_FLYWAY_ENABLED가 dev·prod 프로필에도 적용되고, app.security의 모르는 키는 기동을 거부한다. MessageHandler에 schemaVersions()가 생겨 decode 목록을 handler 선언에서 만든다.
78 lines
3.6 KiB
Bash
Executable File
78 lines
3.6 KiB
Bash
Executable File
#!/bin/sh
|
|
# =============================================================================
|
|
# Install capability schema streams. Installation only — promotion is a separate step, and a
|
|
# separate container, because it is a separate decision.
|
|
#
|
|
# Capability streams are not one Flyway run. Each of db/migration/jpa/* declares its own V1 and keeps
|
|
# its own history table, so pointing a single Flyway at all of them fails with "Found more than one
|
|
# migration with version 1" — which is what nine Compose lanes discovered the moment Wave 2 stopped
|
|
# PostgreSqlPersistenceConfig from discarding spring.flyway.locations.
|
|
#
|
|
# Two things come first regardless of what was requested, and the order between them is not a
|
|
# preference:
|
|
#
|
|
# 1. db/migration/postgresql, the application's own stream, into the default flyway_schema_history.
|
|
# The application ships baseline-on-migrate: false as policy (FLYWAY-C6, and re-enabling it under
|
|
# prod is a boot failure), so it refuses to start against a schema that has tables but no history
|
|
# table of its own. Installing any capability stream before this one produces exactly that state:
|
|
# the lane's first run applied ten notification migrations and then the application refused with
|
|
# "Found non-empty schema(s) but no schema history table" — correctly.
|
|
# 2. db/migration/jpa/core, which creates capability_schema_registry, the table every other stream
|
|
# registers itself into.
|
|
#
|
|
# Each stream registers itself INSTALLED_INACTIVE. Nothing here promotes anything — a table existing
|
|
# is not the same as a capability being sanctioned to use it, and this image has no psql to blur the
|
|
# two with even if that were wanted. infra/postgres/promote-capability-streams.sh is the operator
|
|
# half, and NotificationSchemaActivation refusing startup until it has run is the fail-closed third.
|
|
#
|
|
# CAPABILITY_STREAMS is a space-separated list of stream names (the directory names under
|
|
# db/migration/jpa). A stream is read from /flyway/streams/<name> when its owning leaf's directory is
|
|
# mounted there, and from the persistence-jpa tree under /flyway/sql/jpa otherwise (core, idempotency).
|
|
# =============================================================================
|
|
set -eu
|
|
|
|
: "${PGHOST:?PGHOST is required}"
|
|
: "${PGUSER:?PGUSER is required}"
|
|
: "${PGDATABASE:?PGDATABASE is required}"
|
|
: "${CAPABILITY_STREAMS:=}"
|
|
|
|
MIGRATIONS=/flyway/sql
|
|
STREAMS=/flyway/streams
|
|
JDBC="jdbc:postgresql://${PGHOST}:${PGPORT:-5432}/${PGDATABASE}"
|
|
|
|
run_flyway() {
|
|
directory="$1"
|
|
history="$2"
|
|
baseline="$3"
|
|
[ -d "${directory}" ] || {
|
|
echo "capability-streams: no such stream '${directory}'" >&2
|
|
exit 1
|
|
}
|
|
echo "capability-streams: applying ${directory} into ${history}"
|
|
# shellcheck disable=SC2086
|
|
flyway \
|
|
-url="${JDBC}" -user="${PGUSER}" -password="${PGPASSWORD:-}" \
|
|
-locations="filesystem:${directory}" \
|
|
-table="${history}" \
|
|
${baseline} \
|
|
migrate
|
|
}
|
|
|
|
apply_stream() {
|
|
stream="$1"
|
|
# Capability streams baseline at 0 because each is installed into a database the core stream has
|
|
# already put tables in; the application's own stream must not, for the reason above.
|
|
directory="${STREAMS}/${stream}"
|
|
[ -d "${directory}" ] || directory="${MIGRATIONS}/jpa/${stream}"
|
|
run_flyway "${directory}" "flyway_jpa_$(echo "${stream}" | tr '-' '_')_history" \
|
|
"-baselineOnMigrate=true -baselineVersion=0"
|
|
}
|
|
|
|
run_flyway "${MIGRATIONS}/postgresql" flyway_schema_history ""
|
|
apply_stream core
|
|
for stream in ${CAPABILITY_STREAMS}; do
|
|
apply_stream "${stream}"
|
|
done
|
|
|
|
echo "capability-streams: installed postgresql, core, [${CAPABILITY_STREAMS}]; none promoted"
|