From ecc1400486f3df9968d8337f2fef5fe90d77cd79 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Thu, 12 Nov 2026 01:16:56 +0900 Subject: [PATCH 01/22] =?UTF-8?q?fix(objectstorage):=20Minio=20TLS=20?= =?UTF-8?q?=EC=8B=9C=ED=97=98=EC=9D=B4=20CI=20job=20=EC=95=88=EC=97=90?= =?UTF-8?q?=EC=84=9C=EB=8F=84=20=EC=BB=A8=ED=85=8C=EC=9D=B4=EB=84=88?= =?UTF-8?q?=EC=97=90=20=EB=8B=BF=EB=8A=94=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제: MinioS3ManagedObjectProviderContractTest는 endpoint를 `https://localhost:<포트>`로 고정했다. Gitea runner의 job 컨테이너 안에서 localhost는 job 컨테이너 자신이고, Testcontainers가 띄운 MinIO는 dind daemon 쪽에 있다. 그래서 main의 integration job이 run 52·63·79 세 번 모두 이 시험의 연결 거부로 빨갛다. desktop에서는 둘이 같아 통과한다. 시험 인증서도 localhost와 127.0.0.1만 이름으로 가졌다. 고른 방법: 같은 lane의 평문 시험(MinioManagedObjectContractTest)처럼 Testcontainers가 알려 주는 Docker 호스트 주소로 붙고, 그 주소를 인증서 SAN에 더한다(IP면 ip:, 이름이면 dns:). 인증서는 컨테이너보다 먼저 만들어야 하므로 주소는 DockerClientFactory에서 받는다. 버린 대안: 인증서 검증을 끄는 것. 이 시험은 운영 클라이언트 그대로 HTTPS로 붙는 것이 목적이라 검증을 끄면 시험이 다른 경로를 본다. 위험·한계: IPv6 호스트는 URI에 대괄호를 씌우는 것만 넣었고 그 환경에서 돌려 보지 않았다. 검증: desktop integrationCheck, runner main 수동 실행(이 PR 본문에 적는다). --- ...ioS3ManagedObjectProviderContractTest.java | 19 +++++++++++++-- .../s3/SelfSignedServerCertificate.java | 23 +++++++++++++++---- 2 files changed, 35 insertions(+), 7 deletions(-) diff --git a/src/adapter/outbound/objectstorage/src/integrationTest/java/dev/caskeleton/adapter/outbound/objectstorage/s3/MinioS3ManagedObjectProviderContractTest.java b/src/adapter/outbound/objectstorage/src/integrationTest/java/dev/caskeleton/adapter/outbound/objectstorage/s3/MinioS3ManagedObjectProviderContractTest.java index f4409a48..c1547434 100644 --- a/src/adapter/outbound/objectstorage/src/integrationTest/java/dev/caskeleton/adapter/outbound/objectstorage/s3/MinioS3ManagedObjectProviderContractTest.java +++ b/src/adapter/outbound/objectstorage/src/integrationTest/java/dev/caskeleton/adapter/outbound/objectstorage/s3/MinioS3ManagedObjectProviderContractTest.java @@ -15,6 +15,7 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; +import org.testcontainers.DockerClientFactory; import org.testcontainers.containers.GenericContainer; import org.testcontainers.utility.MountableFile; import software.amazon.awssdk.services.s3.S3AsyncClient; @@ -53,7 +54,11 @@ class MinioS3ManagedObjectProviderContractTest extends ObjectStorageProviderCont String secretKey = UUID.randomUUID().toString().replace("-", "") + UUID.randomUUID(); byte[] keyBytes = new byte[32]; SECURE_RANDOM.nextBytes(keyBytes); - Path certificates = SelfSignedServerCertificate.writeTo(Files.createTempDirectory("minio-tls")); + // The host the mapped port is published on: localhost on a workstation, the Docker daemon's + // address inside a CI job container. The certificate has to name it. + String containerHost = DockerClientFactory.instance().dockerHostIpAddress(); + Path certificates = + SelfSignedServerCertificate.writeTo(Files.createTempDirectory("minio-tls"), containerHost); trustStoreBefore = SelfSignedServerCertificate.trustForThisJvm(certificates); minio = new GenericContainer<>(QualificationImages.minio()) @@ -90,7 +95,12 @@ class MinioS3ManagedObjectProviderContractTest extends ObjectStorageProviderCont .retryBaseDelay(Duration.ofMillis(10)) .retryMaximumBackoff(Duration.ofMillis(20)) .shutdownGrace(Duration.ofSeconds(2)) - .endpointOverride(URI.create("https://localhost:" + minio.getMappedPort(9000))) + .endpointOverride( + URI.create( + "https://" + + endpointHost(containerHost) + + ":" + + minio.getMappedPort(9000))) .pathStyleAccess(true) .staticCredentials(accessKey, secretKey) .build()); @@ -138,4 +148,9 @@ class MinioS3ManagedObjectProviderContractTest extends ObjectStorageProviderCont protected ObjectStorageProvider provider() { return provider; } + + // An IPv6 literal needs brackets in a URI authority. + private static String endpointHost(String containerHost) { + return containerHost.contains(":") ? "[" + containerHost + "]" : containerHost; + } } diff --git a/src/adapter/outbound/objectstorage/src/integrationTest/java/dev/caskeleton/adapter/outbound/objectstorage/s3/SelfSignedServerCertificate.java b/src/adapter/outbound/objectstorage/src/integrationTest/java/dev/caskeleton/adapter/outbound/objectstorage/s3/SelfSignedServerCertificate.java index 35624b4b..c02a22fb 100644 --- a/src/adapter/outbound/objectstorage/src/integrationTest/java/dev/caskeleton/adapter/outbound/objectstorage/s3/SelfSignedServerCertificate.java +++ b/src/adapter/outbound/objectstorage/src/integrationTest/java/dev/caskeleton/adapter/outbound/objectstorage/s3/SelfSignedServerCertificate.java @@ -11,10 +11,14 @@ import java.util.UUID; import java.util.concurrent.TimeUnit; /** - * A throwaway localhost server certificate for one lane run, made with the running JDK's keytool so - * no key material is committed. MinIO reads {@code public.crt} and {@code private.key} (PKCS#8 PEM) - * from its certs directory; the JVM trusts the same certificate through its default trust store + * A throwaway server certificate for one lane run, made with the running JDK's keytool so no key + * material is committed. MinIO reads {@code public.crt} and {@code private.key} (PKCS#8 PEM) from + * its certs directory; the JVM trusts the same certificate through its default trust store * properties, which the SDK's Netty client reads. + * + *

The certificate names localhost and the host the test reaches the container on. They differ + * when the tests run inside a CI job container: there the Docker daemon is another host, and {@code + * localhost} is the job container itself. */ final class SelfSignedServerCertificate { @@ -23,7 +27,7 @@ final class SelfSignedServerCertificate { private SelfSignedServerCertificate() {} - static Path writeTo(Path directory) throws Exception { + static Path writeTo(Path directory, String containerHost) throws Exception { String password = password(directory); Path keytool = Path.of(System.getProperty("java.home"), "bin", "keytool"); Process process = @@ -44,7 +48,7 @@ final class SelfSignedServerCertificate { "-dname", "CN=localhost", "-ext", - "SAN=dns:localhost,ip:127.0.0.1", + subjectAlternativeNames(containerHost), "-storetype", "PKCS12", "-keystore", @@ -74,6 +78,15 @@ final class SelfSignedServerCertificate { return directory; } + private static String subjectAlternativeNames(String containerHost) { + String names = "SAN=dns:localhost,ip:127.0.0.1"; + if (containerHost.equals("localhost") || containerHost.equals("127.0.0.1")) { + return names; + } + boolean ipLiteral = containerHost.contains(":") || containerHost.matches("[0-9.]+"); + return names + (ipLiteral ? ",ip:" : ",dns:") + containerHost; + } + /** Points the JVM default trust store at the certificate; the returned action restores it. */ static Runnable trustForThisJvm(Path directory) throws Exception { String[] names = { -- 2.54.0 From 6325b5183f220a530e2477742ef3f29a03d0717b Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Thu, 12 Nov 2026 01:16:57 +0900 Subject: [PATCH 02/22] =?UTF-8?q?fix(compose):=20root=EB=A1=9C=20=EB=8F=84?= =?UTF-8?q?=EB=8A=94=20CI=EC=97=90=EC=84=9C=EB=8F=84=20Keycloak=EC=9D=B4?= =?UTF-8?q?=20smoke=20lane=20secret=EC=9D=84=20=EC=9D=BD=EB=8A=94=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제: compose smoke는 실행마다 Keycloak client secret을 0600 파일로 만든다. Compose는 파일을 소유자·권한 그대로 붙이고 Keycloak은 이미지 사용자 uid 1000으로 읽는다. runner job은 root라 파일이 root 소유가 되고, Keycloak entrypoint가 읽지 못해 exit 78로 끝난다. auth profile을 쓰는 8 lane이 run 52·63에서 모두 이것으로 실패했다. desktop은 만든 사람이 uid 1000이라 통과했다. 고른 방법: root면 파일을 uid 1000에게 넘기고 0600을 지킨다. uid 1000도 root도 아니면 같은 스크립트의 Mailpit 키처럼 0644로 둔다(값은 실행마다 새로 만들고, Git이 무시하는 폴더에 있고, 끝나면 지운다). 위험·한계: Keycloak 이미지의 사용자가 1000이 아니게 바뀌면 상수를 고쳐야 한다. 이미지 태그(26.0)를 올릴 때 확인할 것으로 주석에 적었다. 검증: runner main 수동 실행의 compose-smoke(이 PR 본문에 적는다). --- scripts/run-compose-runtime-smoke.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scripts/run-compose-runtime-smoke.sh b/scripts/run-compose-runtime-smoke.sh index c07b5e8e..2f2033f2 100755 --- a/scripts/run-compose-runtime-smoke.sh +++ b/scripts/run-compose-runtime-smoke.sh @@ -83,6 +83,8 @@ done # The lane-only TLS overlay's keypair directory (src/bootstrap/app/compose-lanes/tls.yaml). LANE_POSTGRES_TLS="${REPO_ROOT}/src/bootstrap/app/compose-lanes/postgres/tls" +# The user quay.io/keycloak/keycloak runs as (the image's USER), which reads the realm's client secret. +KEYCLOAK_IMAGE_UID=1000 # ---- per-lane state, cleaned up by the trap --------------------------------- PROJECT="" @@ -178,6 +180,15 @@ run_lane() { local client_secret; client_secret="$(random_secret)" GENERATED_SECRETS+=("${client_secret}") (umask 077 && printf '%s' "${client_secret}" >"${secret_file}") + # Compose mounts the file with its owner and mode, and Keycloak reads it as its image user, uid + # 1000. A developer with that uid owns the file already. A CI job runs as root, so the file is + # handed to uid 1000 and stays 0600. Anyone else gets 0644, as the Mailpit key below does: the + # value is random, lives for one run and sits in a Git-ignored directory removed on teardown. + if [[ "$(id -u)" == 0 ]]; then + chown "${KEYCLOAK_IMAGE_UID}:0" "${secret_file}" + elif [[ "$(id -u)" != "${KEYCLOAK_IMAGE_UID}" ]]; then + chmod 0644 "${secret_file}" + fi # A CA and a server certificate for the host name `db`, when the lane brings the TLS overlay. # -- 2.54.0 From 8648825676703e8622ca1f3fe877f6efa965fcbe Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Thu, 12 Nov 2026 01:16:57 +0900 Subject: [PATCH 03/22] =?UTF-8?q?fix(web):=20=EC=9D=91=EB=8B=B5=20?= =?UTF-8?q?=EC=9C=A0=EC=8B=A4=20=EC=8B=9C=ED=97=98=EC=9D=98=20=EC=A4=80?= =?UTF-8?q?=EB=B9=84=20=EC=9A=94=EC=B2=AD=EC=9D=B4=20=EC=9E=A5=EC=95=A0?= =?UTF-8?q?=EC=9A=A9=20=EC=A7=A7=EC=9D=80=20=EC=9D=BD=EA=B8=B0=20=EC=A0=9C?= =?UTF-8?q?=ED=95=9C=EC=9D=84=20=EC=93=B0=EC=A7=80=20=EC=95=8A=EB=8A=94?= =?UTF-8?q?=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제: HttpResponseLossFixture.reset()은 시나리오 전에 부수 효과 카운터를 지우는 DELETE다. 이 요청이 응답을 일부러 버리는 호출용 읽기 제한(750ms)을 그대로 썼다. 부하가 높은 runner에서 평범한 reset 응답이 그보다 늦어 JettyCommitThenConnectionResetIT가 시나리오를 시작하기도 전에 SocketTimeoutException으로 실패했다(main run 24, 2026-11-08, 세 번 중 한 번). 고른 방법: 재시도와 부수 효과 조회처럼 넉넉한 HttpFixtureTimeouts.READ_MILLIS를 쓴다. 짧은 제한은 장애를 건 호출에만 남는다. 위험·한계: 시험이 보는 동작은 바뀌지 않는다. 준비 단계가 기다릴 수 있는 시간만 늘었다. 검증: desktop mainCheck(webJettyCompatTest 포함), runner main 수동 실행. --- .../inbound/web/testkit/fault/HttpResponseLossFixture.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/adapter/inbound/web/src/testFixtures/java/dev/caskeleton/adapter/inbound/web/testkit/fault/HttpResponseLossFixture.java b/src/adapter/inbound/web/src/testFixtures/java/dev/caskeleton/adapter/inbound/web/testkit/fault/HttpResponseLossFixture.java index fe9fecbe..c0ba1513 100644 --- a/src/adapter/inbound/web/src/testFixtures/java/dev/caskeleton/adapter/inbound/web/testkit/fault/HttpResponseLossFixture.java +++ b/src/adapter/inbound/web/src/testFixtures/java/dev/caskeleton/adapter/inbound/web/testkit/fault/HttpResponseLossFixture.java @@ -41,6 +41,10 @@ public final class HttpResponseLossFixture implements ResponseLossFixture { private void reset() { try { HttpURLConnection connection = open(FaultFixtureProtocol.SIDE_EFFECTS_PATH, "DELETE"); + // The generous timeout, like the retry and the side-effect count. The armed one (750 ms) is + // for the call whose reply the container drops; on a loaded runner an ordinary reset reply + // took longer than that, and the scenario failed before it began (main run 24, 2026-11-08). + connection.setReadTimeout(HttpFixtureTimeouts.READ_MILLIS); connection.getResponseCode(); connection.disconnect(); } catch (IOException e) { -- 2.54.0 From c7aff0f4f019a6f1dae0324b76a693167721c2d0 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Thu, 12 Nov 2026 01:17:11 +0900 Subject: [PATCH 04/22] =?UTF-8?q?ci(links):=20lychee-action=EC=9D=84=20v2.?= =?UTF-8?q?9.0=EC=9C=BC=EB=A1=9C=20=EC=98=AC=EB=A0=A4=20--root-dir?= =?UTF-8?q?=EC=9D=84=20=EC=9D=BD=EA=B2=8C=20=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제: main의 links job이 run 52·63·79 모두 `lychee: unexpected argument '--root-dir'`로 실패한다. 고정한 lychee-action v2.0.2는 lychee v0.16.1을 받는데, 그 버전에는 --root-dir이 없다. 상대 경로 --root-dir은 lychee v0.22.0부터 읽는다. 고른 방법: action을 v2.9.0(lychee v0.24.2, 2026-07-09)의 커밋 SHA로 올린다. Gitea의 job token은 lychee가 보낼 GitHub 쪽에서 의미가 없어 token을 비우고, Gitea에 없는 job summary를 끈다. DeveloperExperienceContractTest가 고정한 SHA를 함께 바꾼다. 버린 대안: v2.0.2에 lycheeVersion만 새로 주기. v2.0.2의 내려받기 경로는 lychee 0.16 이전의 자산 이름을 쓴다. 위험·한계: 새 lychee가 전보다 많은 외부 링크를 깨졌다고 볼 수 있다. 그러면 링크를 고치거나 .lycheeignore에 이유와 함께 넣는다. 검증: runner main 수동 실행의 links job(이 PR 본문에 적는다). --- .gitea/workflows/main.yml | 7 ++++++- .../contract/DeveloperExperienceContractTest.java | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/main.yml b/.gitea/workflows/main.yml index fe9319f8..6b668b46 100644 --- a/.gitea/workflows/main.yml +++ b/.gitea/workflows/main.yml @@ -84,9 +84,14 @@ jobs: timeout-minutes: 15 steps: - uses: https://github.com/actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # actions/checkout@v4.2.2 + # v2.9.0 runs lychee v0.24.2. v2.0.2 ran v0.16.1, which has no --root-dir at all; a relative + # --root-dir works from lychee v0.22.0. The job token is this Gitea's and means nothing to the + # GitHub hosts lychee would send it to, so none is passed, and Gitea has no job summary page. - name: Check committed documentation links - uses: https://github.com/lycheeverse/lychee-action@7cd0af4c74a61395d455af97419279d86aafaede # lycheeverse/lychee-action@v2.0.2 + uses: https://github.com/lycheeverse/lychee-action@e7477775783ea5526144ba13e8db5eec57747ce8 # lycheeverse/lychee-action@v2.9.0 with: + token: "" + jobSummary: false args: >- --no-progress --root-dir . diff --git a/src/bootstrap/app/src/test/java/dev/caskeleton/bootstrap/contract/DeveloperExperienceContractTest.java b/src/bootstrap/app/src/test/java/dev/caskeleton/bootstrap/contract/DeveloperExperienceContractTest.java index 67c5b4eb..92dda415 100644 --- a/src/bootstrap/app/src/test/java/dev/caskeleton/bootstrap/contract/DeveloperExperienceContractTest.java +++ b/src/bootstrap/app/src/test/java/dev/caskeleton/bootstrap/contract/DeveloperExperienceContractTest.java @@ -170,7 +170,7 @@ class DeveloperExperienceContractTest { .as("a conditional link check is one nobody sees run") .isFalse(); assertThat(String.valueOf(lycheeStep.get("uses"))) - .endsWith("lycheeverse/lychee-action@7cd0af4c74a61395d455af97419279d86aafaede"); + .endsWith("lycheeverse/lychee-action@e7477775783ea5526144ba13e8db5eec57747ce8"); Map with = requireMap(lycheeStep, "with"); assertThat(with.get("fail")).isEqualTo(true); assertThat(shellWords(requireString(with, "args"))) -- 2.54.0 From 7054d179bd6e85ba2f927c0f2ecc359d8e120671 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Thu, 12 Nov 2026 01:17:35 +0900 Subject: [PATCH 05/22] =?UTF-8?q?ci(main):=20notification-chaos=EA=B0=80?= =?UTF-8?q?=20=EB=84=A4=20suite=EB=A5=BC=20=ED=95=9C=20=EB=B2=88=EC=97=90?= =?UTF-8?q?=20=EB=8F=8C=EB=A6=AC=EA=B3=A0=20=EA=B2=B0=EA=B3=BC=EB=A5=BC=20?= =?UTF-8?q?=ED=99=95=EC=9D=B8=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제: notification-chaos는 같은 `:adapter:outbound:notification:test`를 필터를 바꿔 `--rerun`으로 두 번 돌린 뒤 「이름 붙인 suite가 정말 돌았나」를 본다. 두 번째 실행이 첫 실행의 결과 XML을 지워서 ChaosSecurity 결과가 없다고 매번 실패한다(run 52·63). 시험 자체는 두 번 다 통과했다. 고른 방법: 네 필터를 한 번의 실행에 넣고, 확인 step을 PostgreSQL 재실행 step보다 앞에 둔다. Gradle 시작과 시험 JVM 기동도 한 번 준다. 버린 대안: 실행마다 결과 폴더를 옮겨 두기. step이 셸 스크립트가 되고, 같은 태스크를 두 번 돌릴 이유가 없다. 위험·한계: 두 묶음이 같은 JVM에서 돈다. 묶음끼리 상태를 나누면 드러날 수 있는데, 그것은 이 job이 찾으려는 종류의 결함이다. 검증: runner main 수동 실행의 notification-chaos(이 PR 본문에 적는다). --- .gitea/workflows/main.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/main.yml b/.gitea/workflows/main.yml index 6b668b46..13543c02 100644 --- a/.gitea/workflows/main.yml +++ b/.gitea/workflows/main.yml @@ -207,12 +207,13 @@ jobs: steps: - uses: https://github.com/actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # actions/checkout@v4.2.2 - uses: ./.gitea/actions/setup-java-gradle - - name: Ambiguity and fault harness - run: ./gradlew :adapter:outbound:notification:test --tests '*ChaosSecurity*' --tests '*CrossProviderContractSuite*' --rerun - - name: Concurrency and rotation races - run: ./gradlew :adapter:outbound:notification:test --tests '*ConcurrencyTest' --tests '*ProviderRuntimeStateTest' --rerun - - name: Restart recovery and lease fencing (real PostgreSQL) - run: ./gradlew :adapter:outbound:persistence-jpa:jpaPlatformContractTest :adapter:outbound:persistence-jpa:jpaPlatformFailureTest + # One invocation for the four suites. A second `test --rerun` deletes the first one's result + # files, and the check below then finds no results for the suites that ran first. + - name: Ambiguity and fault harness, concurrency and rotation races + run: >- + ./gradlew :adapter:outbound:notification:test --rerun + --tests '*ChaosSecurity*' --tests '*CrossProviderContractSuite*' + --tests '*ConcurrencyTest' --tests '*ProviderRuntimeStateTest' # A filter that matches nothing passes. Each filter above names classes that exist today; if # one is renamed the job fails rather than quietly stops covering it. - name: Every named suite actually ran @@ -223,6 +224,8 @@ jobs: exit 1 } done + - name: Restart recovery and lease fencing (real PostgreSQL) + run: ./gradlew :adapter:outbound:persistence-jpa:jpaPlatformContractTest :adapter:outbound:persistence-jpa:jpaPlatformFailureTest # Advisory probes for the next JPA, Hibernate and PostgreSQL majors. The targets are not resolvable # yet, so each records NOT_EXECUTABLE with its reason instead of implying compatibility evidence. -- 2.54.0 From 575aa1f766f4fcc801ba4d8977431e5aba354dd2 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Thu, 12 Nov 2026 01:17:52 +0900 Subject: [PATCH 06/22] =?UTF-8?q?ci:=20needs=EC=99=80=20if=EB=A5=BC=20?= =?UTF-8?q?=ED=95=A8=EA=BB=98=20=EC=93=B0=EB=8A=94=20job=EC=9D=84=20?= =?UTF-8?q?=EC=97=86=EC=95=A0=20Blocked=EC=97=90=20=EB=A9=88=EC=B6=94?= =?UTF-8?q?=EC=A7=80=20=EC=95=8A=EA=B2=8C=20=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제: main.yml의 `performance`는 한 번도 돌지 않았다. 수동 실행(run 63)에서는 2.5일 동안, main push(run 79)에서는 지금까지 Blocked다. Gitea API의 job 상태 `waiting`은 runner를 기다리는 것(`queued`)이 아니라 서버의 Blocked다. Gitea 1.27은 앞 job이 끝나면 `needs`가 있는 job의 `if`를 서버에서 계산하고, 계산이 실패하면 Blocked로 둔다. 일회용 workflow 세 가지(입력 있음·없음, concurrency 있음·없음)를 수동 실행해 보니, `needs`와 `if`를 함께 가진 job 여섯 개가 `if` 내용(`!cancelled()`, `always()`, 이벤트 이름만)과 앞 job 결과에 상관없이 모두 Blocked였다. `if`가 없는 `needs` job과 `needs`가 없는 `if` job은 제대로 풀렸다. release.yml의 `app-image-signing`도 같은 모양이라 수동 실행이 끝나지 않는다. 고른 방법: - performance: `needs`를 지우고 파일 맨 끝에 둔다. `needs` 없는 job은 run이 시작할 때 대기열에 들어가고, capacity 1인 runner 하나는 run의 job을 만든 순서(파일 순서)대로 돈다. 조건은 `github.event_name != 'push'` 하나다. build.gradle의 strict lane 단계 선언도 같은 조건으로 바꾼다. - app-image-signing: job 조건을 두 step의 조건으로 옮긴다. 수동 실행에서는 job이 뜨고 step이 모두 건너뛴다. 키를 가진 job이 하나뿐이라는 시험은 그대로 두고, 조건을 보는 단언만 step으로 옮긴다. 버린 대안: performance를 별도 workflow로 빼기. workflow는 셋(pr·main·release)만 둔다는 규칙(docs/work/reference/gates.md)을 바꾸게 된다. 위험·한계: runner가 둘이 되거나 capacity가 1보다 커지면 performance가 다른 job과 겹칠 수 있다. 그래도 돌기는 한다. 원인이 Gitea 서버 쪽이라 Gitea를 올리면 다시 확인할 일이다. 수동 실행으로만 재현했고 push 실행의 원인은 같은 증상으로 판단했다. 검증: verifyStrictLaneStages --dry-run(desktop·runner PR), runner main 수동 실행에서 performance가 마지막에 도는지(이 PR 본문에 적는다). --- .gitea/workflows/main.yml | 22 +++++++++---------- .gitea/workflows/release.yml | 8 ++++++- build.gradle | 2 +- .../DeveloperExperienceContractTest.java | 10 ++++++++- 4 files changed, 27 insertions(+), 15 deletions(-) diff --git a/.gitea/workflows/main.yml b/.gitea/workflows/main.yml index 13543c02..b5390504 100644 --- a/.gitea/workflows/main.yml +++ b/.gitea/workflows/main.yml @@ -286,19 +286,17 @@ jobs: # Load, slow-client, shutdown, pool and resource bounds. Last, after every other heavy job of the # run, so the bounds are measured on a runner that is not building something else. + # + # Last by position, not by `needs`. This Gitea (1.27) decides a job's `if` on the server once the + # jobs it needs finish, and it left this job Blocked in every run it reached: 2.5 days on a manual + # run (63), and on every push, where the nightly jobs it waited for are skipped (79). A throwaway + # workflow started by hand reproduced it with nothing else in it (2026-11-11, three variants): + # every job with both `needs` and `if` stayed Blocked, whatever the `if` said and whether or not + # the jobs it needed had passed. A job without `needs` is queued when the run starts, and the one + # runner (capacity 1) takes a run's jobs in the order they were created, which is their order in + # this file. A second runner would let this job overlap the others; it would still run. performance: - needs: - - main - - integration - - build-logic - - configuration-cache - - jpa-postgresql - - httpclient-transport - - redis-topology - - fileserver-nfs-ambiguity - - notification-chaos - - compose-smoke - if: ${{ !cancelled() && github.event_name != 'push' }} + if: ${{ github.event_name != 'push' }} runs-on: ubuntu-latest timeout-minutes: 120 steps: diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 99f1b740..f879ade4 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -235,10 +235,14 @@ jobs: # Signs the pushed digest with the release key pair and verifies the signature before the release # counts as done, so a signature a cluster would reject fails here rather than at admission. A job # of its own, so the private key exists only in a job that checks nothing out and builds nothing. + # + # The tag condition is on each step, not on the job. This Gitea (1.27) leaves a job that has both + # `needs` and `if` Blocked (main.yml `performance` says how that was found), so a manual run never + # finished: the job waited forever. With no job `if` it starts after app-image-release, and on a + # manual run every step is skipped. app-image-signing: needs: - app-image-release - if: ${{ github.ref_type == 'tag' }} runs-on: ubuntu-latest timeout-minutes: 30 env: @@ -248,6 +252,7 @@ jobs: # lines of the official v3.1.3 cosign_checksums.txt. The checksum file is fetched again and must # still carry the pinned line, so a re-published asset fails the job. - name: Install pinned cosign + if: ${{ github.ref_type == 'tag' }} run: | set -euo pipefail readonly COSIGN_VERSION='3.1.3' @@ -271,6 +276,7 @@ jobs: chmod 0755 "${install_dir}/cosign" echo "${install_dir}" >> "${GITHUB_PATH}" - name: Sign the image digest and verify the signature + if: ${{ github.ref_type == 'tag' }} env: PACKAGE_TOKEN: ${{ secrets.PACKAGE_TOKEN }} COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }} diff --git a/build.gradle b/build.gradle index ed0fee65..47aa92ac 100644 --- a/build.gradle +++ b/build.gradle @@ -248,7 +248,7 @@ strictLaneStages { 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\' }}' + condition: '${{ github.event_name != \'push\' }}' stage ':releaseCheck', workflow: 'release.yml', event: 'push', filter: 'tags: ["v*"]', job: 'release' } diff --git a/src/bootstrap/app/src/test/java/dev/caskeleton/bootstrap/contract/DeveloperExperienceContractTest.java b/src/bootstrap/app/src/test/java/dev/caskeleton/bootstrap/contract/DeveloperExperienceContractTest.java index 92dda415..c12a565a 100644 --- a/src/bootstrap/app/src/test/java/dev/caskeleton/bootstrap/contract/DeveloperExperienceContractTest.java +++ b/src/bootstrap/app/src/test/java/dev/caskeleton/bootstrap/contract/DeveloperExperienceContractTest.java @@ -321,7 +321,15 @@ class DeveloperExperienceContractTest { assertThat(jobsWithTheKey).containsExactly("app-image-signing"); Map signing = requireMap(jobs, "app-image-signing"); assertThat(requireStringList(signing, "needs")).containsExactly("app-image-release"); - assertThat(requireString(signing, "if")).contains("github.ref_type == 'tag'"); + assertThat(signing.containsKey("if")) + .as("a job with both needs and if never leaves Blocked on this Gitea") + .isFalse(); + assertThat(requireList(signing, "steps")) + .as("every step runs only for a tag") + .allSatisfy( + step -> + assertThat(String.valueOf(((Map) step).get("if"))) + .contains("github.ref_type == 'tag'")); String script = String.join( "\n", -- 2.54.0 From deeb1126b55f3e95088ebe7adc979b45af200192 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Thu, 12 Nov 2026 01:18:07 +0900 Subject: [PATCH 07/22] =?UTF-8?q?ci(pr):=20PR=20=EB=8B=A8=EA=B3=84?= =?UTF-8?q?=EB=A5=BC=20job=20=ED=95=98=EB=82=98=EB=A1=9C=20=EC=A0=91?= =?UTF-8?q?=EB=8A=94=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제: pr.yml은 gradle·vulnerabilities·done 세 job이고 필수 검사는 `done`이다. `done`은 앞 두 job이 끝나야 runner 대기열에 들어가는데, Gitea는 대기열에 들어온 순서로 job을 집는다. 그래서 그사이에 줄 선 다른 run의 job이 먼저 돈다. 2026-11-08 PR #7의 run 61은 gradle이 22:55에 끝났는데 `done`은 release 수동 실행(13 job)과 main 수동 실행(30 job)이 다 끝난 01:47에야 돌았다. job마다 checkout과 준비도 다시 한다. 고른 방법: `done` job 하나가 `./gradlew :prCheck`, `verifyStrictLaneStages --dry-run`, Trivy 검사를 차례로 돈다. 필수 검사 이름 `pr / done (pull_request)`은 그대로라 저장소 보호 규칙은 바꾸지 않는다. strict lane 단계 선언의 PR job을 `done`으로 바꾼다. 단계 job의 step은 `./gradlew` 한 줄만 허용했는데, 저장소 스크립트 한 줄(`bash scripts/<이름>.sh <단어>...`)도 허용한다. 자기 step이라 종료 코드가 job을 실패시키고 단계 줄의 결과를 가릴 수 없다. 셸 문법을 붙인 스크립트와 저장소 밖 명령은 여전히 막는다(TestKit 시험 셋을 더했다). 버린 대안: trivy를 Gradle Exec 태스크로 감싸 `./gradlew` 줄로 만들기. desktop verify가 도구를 내려받아 설치하게 된다(docs/work/operate.md 4.1절이 막는다). 위험·한계: Trivy가 마지막 step이라 Gradle이 실패하면 그 PR의 취약점 결과는 Gradle을 고친 뒤에 보인다. main push와 nightly가 같은 트리를 다시 검사한다. 검증: build-logic 시험(desktop), runner에서 이 PR의 `pr / done`. --- .gitea/workflows/pr.yml | 41 ++++++------------- .github/dependency-vulnerability-policy.md | 8 ++-- build-logic/AGENTS.md | 2 +- .../strictlane/StrictLaneStagesExtension.java | 2 +- .../strictlane/StrictLaneStagesPlugin.java | 17 ++++++-- .../StrictLaneStagesFunctionalTest.java | 33 +++++++++++++++ build.gradle | 2 +- docs/build.md | 4 +- docs/ci-cd/template-vs-consumer.md | 2 +- docs/work/reference/gates.md | 8 ++-- 10 files changed, 72 insertions(+), 47 deletions(-) diff --git a/.gitea/workflows/pr.yml b/.gitea/workflows/pr.yml index 7885b4a7..32d8ae8a 100644 --- a/.gitea/workflows/pr.yml +++ b/.gitea/workflows/pr.yml @@ -1,5 +1,5 @@ # Pull-request stage. Everything here blocks a merge, and the branch protection requires one check: -# `done`. Which leaves, lanes and checks the stage means is decided by the Gradle task `prCheck` +# `done`, which is the whole stage. Which leaves, lanes and checks the stage means is decided by the Gradle task `prCheck` # (build.gradle), not here; `verifyStrictLaneStages` fails when this job stops running it as one # line (docs/work/reference/gates.md). # @@ -22,39 +22,22 @@ env: TESTCONTAINERS_REUSE_ENABLE: "false" jobs: - gradle: + # The whole stage is this one job, and it is the one required check (`pr / done`). Separate + # gradle, scan and `done` jobs made `done` wait for the runner a second time: a job that `needs` + # others joins the runner's queue only when they finish, behind everything queued meanwhile, and + # on 2026-11-08 that put a finished pull request's `done` three hours behind a manual main run. + # One job also pays the checkout, JDK and Gradle start once instead of twice. + # + # The scan runs last. A Gradle failure therefore hides the scan's result until it is fixed; the + # main stage and the nightly run scan the same tree again. + done: runs-on: ubuntu-latest - timeout-minutes: 60 + timeout-minutes: 75 steps: - uses: https://github.com/actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # actions/checkout@v4.2.2 - uses: ./.gitea/actions/setup-java-gradle - run: ./gradlew :prCheck # Plans every stage (--dry-run: nothing executes), so it cannot be a dependency of prCheck. - run: ./gradlew :verifyStrictLaneStages --dry-run - - # Known High and Critical vulnerabilities and CISA KEV matches in the dependency tree. - vulnerabilities: - runs-on: ubuntu-latest - timeout-minutes: 20 - steps: - - uses: https://github.com/actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # actions/checkout@v4.2.2 + # Known High and Critical vulnerabilities and CISA KEV matches in the dependency tree. - run: bash scripts/ci/trivy-scan.sh filesystem - - # The one required check. A job added above joins `needs` here, and the branch protection does - # not change. - done: - needs: [gradle, vulnerabilities] - if: ${{ always() }} - runs-on: ubuntu-latest - steps: - - name: Require every job of this stage to have succeeded - env: - RESULTS: ${{ needs.gradle.result }} ${{ needs.vulnerabilities.result }} - run: | - for result in ${RESULTS}; do - if [ "${result}" != success ]; then - echo "pr / done: a job of this stage ended with ${result}" - exit 1 - fi - done - echo "pr / done: every job of this stage succeeded." diff --git a/.github/dependency-vulnerability-policy.md b/.github/dependency-vulnerability-policy.md index 79ee9832..6b58f388 100644 --- a/.github/dependency-vulnerability-policy.md +++ b/.github/dependency-vulnerability-policy.md @@ -1,16 +1,16 @@ # 의존성 취약점 정책 이 정책을 강제하는 것은 -[`scripts/ci/trivy-scan.sh`](../scripts/ci/trivy-scan.sh)(pull request·main·nightly workflow의 -`vulnerabilities` job과 release workflow의 이미지 job이 부른다), +[`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)이다. ## 실행 위치와 플랫폼 경계 workflow는 `.gitea/workflows`의 `pr.yml`·`main.yml`·`release.yml`이고 Gitea Actions(desktop runner)에서 돈다. -`vulnerabilities` job은 pull request, `main` push, 매일 예약 실행, 손으로 부른 실행에서 돈다. pull request의 -필수 검사 `pr / done`이 그 결과를 포함한다. +검사는 pull request(필수 검사 `pr / done`의 마지막 step), `main` push, 매일 예약 실행, 손으로 부른 실행에서 +돈다. 외부 action은 확인한 전체 커밋 SHA로만 실행한다. 리뷰를 위해 같은 줄 주석에 바뀌지 않는 릴리스 태그를 남긴다. 스캐너는 action이 아니라 체크섬을 고정한 릴리스 실행 파일이다. diff --git a/build-logic/AGENTS.md b/build-logic/AGENTS.md index a05bc501..10d81125 100644 --- a/build-logic/AGENTS.md +++ b/build-logic/AGENTS.md @@ -26,7 +26,7 @@ registry, settings, build-logic, 루트 라이프사이클이 정하는 것을 ## 단계 job의 모양 - `verifyStrictLaneStages --dry-run`(PR)은 `explicitOnly`가 아닌 strict lane마다 `build.gradle`의 `strictLaneStages`가 선언한 단계 태스크 하나의 계획에 들어 있는지 본다(그래프 검사). -- 단계마다 선언한 workflow job은 step의 `run: ./gradlew <단계> <옵션>` 줄을 가지고, 다른 step `run:`도 셸 문법 없는 `./gradlew` 한 줄이며, 선언 밖의 `if:`, 선언한 조건이 `!cancelled()`·`always()`가 아닌데 `needs:`, `continue-on-error`·`shell:`·`defaults:`, 따옴표 키·flow 형식, 이 빌드 밖의 `working-directory`가 없다. workflow는 선언한 이벤트로, 선언한 필터 한 줄만 달고 시작하고, PR 단계 job 하나가 이 검사를 돌린다(형식 검사, 셸을 해석하지 않는다). +- 단계마다 선언한 workflow job은 step의 `run: ./gradlew <단계> <옵션>` 줄을 가지고, 다른 step `run:`도 셸 문법 없는 `./gradlew` 한 줄이나 `bash scripts/<이름>.sh` 한 줄이며, 선언 밖의 `if:`, 선언한 조건이 `!cancelled()`·`always()`가 아닌데 `needs:`, `continue-on-error`·`shell:`·`defaults:`, 따옴표 키·flow 형식, 이 빌드 밖의 `working-directory`가 없다. workflow는 선언한 이벤트로, 선언한 필터 한 줄만 달고 시작하고, PR 단계 job 하나가 이 검사를 돌린다(형식 검사, 셸을 해석하지 않는다). - 단계를 더하거나 job을 바꾸면 `strictLaneStages`의 `stage` 줄과 workflow를 같은 커밋에서 고친다. ## 테스트 diff --git a/build-logic/src/main/java/dev/caskeleton/buildlogic/strictlane/StrictLaneStagesExtension.java b/build-logic/src/main/java/dev/caskeleton/buildlogic/strictlane/StrictLaneStagesExtension.java index 5ee12ee9..3cd5c32c 100644 --- a/build-logic/src/main/java/dev/caskeleton/buildlogic/strictlane/StrictLaneStagesExtension.java +++ b/build-logic/src/main/java/dev/caskeleton/buildlogic/strictlane/StrictLaneStagesExtension.java @@ -13,7 +13,7 @@ import org.gradle.api.file.DirectoryProperty; *

  * strictLaneStages {
  *   workflowDirectory = layout.projectDirectory.dir('.gitea/workflows')
- *   stage ':prCheck', workflow: 'pr.yml', event: 'pull_request', job: 'gradle'
+ *   stage ':prCheck', workflow: 'pr.yml', event: 'pull_request', job: 'done'
  *   stage ':mainCheck', workflow: 'main.yml', event: 'push', filter: 'branches: [main]',
  *       job: 'main', options: '--continue'
  *   stage ':performanceCheck', workflow: 'main.yml', event: 'schedule', job: 'performance',
diff --git a/build-logic/src/main/java/dev/caskeleton/buildlogic/strictlane/StrictLaneStagesPlugin.java b/build-logic/src/main/java/dev/caskeleton/buildlogic/strictlane/StrictLaneStagesPlugin.java
index 493887fb..b7eeffe3 100644
--- a/build-logic/src/main/java/dev/caskeleton/buildlogic/strictlane/StrictLaneStagesPlugin.java
+++ b/build-logic/src/main/java/dev/caskeleton/buildlogic/strictlane/StrictLaneStagesPlugin.java
@@ -33,8 +33,9 @@ import org.gradle.api.execution.TaskExecutionGraph;
  *       declared stage. The plan is Gradle's own: this task depends on the stages, so its {@code
  *       --dry-run} builds the real plan, and the check reads it when the graph is ready.
  *   
  • Form. Each stage names the workflow job that runs it, and that job has one shape. - * Its steps' {@code run:} lines are single {@code ./gradlew} commands with no shell syntax, and - * one of them is {@code ./gradlew }. It has no {@code if:} but the declared + * Its steps' {@code run:} lines are single {@code ./gradlew} commands or single {@code bash + * scripts/.sh} commands with no shell syntax, and one of them is {@code ./gradlew + * }. It has no {@code if:} but the declared * condition, no {@code needs:} unless that condition runs it after a skipped or failed job, no * {@code continue-on-error}, {@code shell:} or {@code defaults:}, no quoted keys or flow * mappings, and every {@code working-directory} in it or in the workflow's {@code defaults} @@ -59,6 +60,9 @@ public final class StrictLaneStagesPlugin implements Plugin { private static final Pattern STEP_RUN = Pattern.compile("^(?: {6}- | {8})run: (.*?)\\s*$"); /** One Gradle invocation and nothing a shell would read as more than words. */ private static final Pattern GRADLE_LINE = Pattern.compile("^\\./gradlew(?: [\\w:.=-]+)+$"); + /** One repository script and plain words: its own step, so its exit code fails the job. */ + private static final Pattern REPOSITORY_SCRIPT = + Pattern.compile("^bash scripts/[\\w./-]+\\.sh(?: [\\w:.=/-]+)*$"); private static final Pattern IF = Pattern.compile("^(\\s*)(?:-\\s+)?if:\\s*(.*?)\\s*$"); private static final Pattern WORKING_DIRECTORY = Pattern.compile("^\\s*(?:-\\s+)?working-directory:\\s*(.*?)\\s*$"); @@ -252,8 +256,13 @@ public final class StrictLaneStagesPlugin implements Plugin { Matcher run = STEP_RUN.matcher(line); if (!run.matches()) { problems.add(where + " has `" + line.strip() + "`, which is not a step's command"); - } else if (!GRADLE_LINE.matcher(run.group(1)).matches()) { - problems.add(where + " runs `" + run.group(1) + "`, which is not one ./gradlew line"); + } else if (!GRADLE_LINE.matcher(run.group(1)).matches() + && !REPOSITORY_SCRIPT.matcher(run.group(1)).matches()) { + problems.add( + where + + " runs `" + + run.group(1) + + "`, which is not one ./gradlew line or one repository script"); } else { runsStage |= run.group(1).equals(stage.command()); } diff --git a/build-logic/src/test/java/dev/caskeleton/buildlogic/strictlane/StrictLaneStagesFunctionalTest.java b/build-logic/src/test/java/dev/caskeleton/buildlogic/strictlane/StrictLaneStagesFunctionalTest.java index f30c3502..373b7e95 100644 --- a/build-logic/src/test/java/dev/caskeleton/buildlogic/strictlane/StrictLaneStagesFunctionalTest.java +++ b/build-logic/src/test/java/dev/caskeleton/buildlogic/strictlane/StrictLaneStagesFunctionalTest.java @@ -107,6 +107,24 @@ class StrictLaneStagesFunctionalTest { assertThat(result.getOutput()).contains("every strict lane is in a stage its workflow job runs"); } + @Test + @DisplayName("단계 job에 저장소 스크립트 한 줄 step이 있어도 통과한다") + void passesWithARepositoryScriptStepBesideTheStageLine() throws Exception { + // given + workflow( + "pr.yml", + PR_WORKFLOW.replace( + " - run: ./gradlew :verifyStrictLaneStages --dry-run\n", + " - run: ./gradlew :verifyStrictLaneStages --dry-run\n" + + " - run: bash scripts/ci/trivy-scan.sh filesystem\n")); + + // when + BuildResult result = runner(":verifyStrictLaneStages", "--dry-run").build(); + + // then + assertThat(result.getOutput()).contains("every strict lane is in a stage its workflow job runs"); + } + @Test @DisplayName("① 어느 단계에도 들지 않는 strict lane을 더하면 그 lane 이름으로 실패한다") void failsNamingALaneThatNoStageReaches() throws Exception { @@ -189,6 +207,21 @@ class StrictLaneStagesFunctionalTest { "- run: ./gradlew :verifyStrictLaneStages --dry-run\n", "- run: ./gradlew :verifyStrictLaneStages --dry-run\n - run: exit 0\n", "pr.yml job gradle runs `exit 0`, which is not one ./gradlew line"), + Arguments.of( + "셸로 이은 저장소 스크립트", + "pr.yml", + "- run: ./gradlew :verifyStrictLaneStages --dry-run\n", + "- run: ./gradlew :verifyStrictLaneStages --dry-run\n" + + " - run: bash scripts/ci/scan.sh filesystem || true\n", + "pr.yml job gradle runs `bash scripts/ci/scan.sh filesystem || true`, which is not one" + + " ./gradlew line or one repository script"), + Arguments.of( + "저장소 밖 스크립트", + "pr.yml", + "- run: ./gradlew :verifyStrictLaneStages --dry-run\n", + "- run: ./gradlew :verifyStrictLaneStages --dry-run\n" + + " - run: bash -c 'exit 0'\n", + "pr.yml job gradle runs `bash -c 'exit 0'`, which is not one ./gradlew line"), Arguments.of( "셸로 이은 명령", "pr.yml", diff --git a/build.gradle b/build.gradle index 47aa92ac..fd8da614 100644 --- a/build.gradle +++ b/build.gradle @@ -242,7 +242,7 @@ tasks.register('prCheck') { // 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 ':prCheck', workflow: 'pr.yml', event: 'pull_request', job: 'done' 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', diff --git a/docs/build.md b/docs/build.md index 2472a93c..f23d30eb 100644 --- a/docs/build.md +++ b/docs/build.md @@ -197,8 +197,8 @@ drift하기 시작하면 그때 자동화한다. 진짜 항목을 상대로, 진 > `.github/scripts/verify-gate-matrix.sh`(568줄)는 삭제했다. 그 표는 이미 두 그래프에 있는 정보의 > 세 번째 사본이었고, 검사기는 세 사본을 서로 같게 유지하는 일을 했다. 결과적으로 체크 하나를 > 추가하려면 Gradle · workflow · 표 · 검사기 기대값 · Java 계약 테스트 다섯 곳을 같이 고쳐야 했다. -- **워크플로.** `.gitea/workflows/`의 세 파일이다. `pr.yml`의 `done` job이 PR 단계의 모든 job(`gradle`: - `./gradlew :prCheck`와 `verifyStrictLaneStages --dry-run`, `vulnerabilities`: Trivy)을 모으는 단일 필수 검사다. +- **워크플로.** `.gitea/workflows/`의 세 파일이다. `pr.yml`의 `done` job 하나가 PR 단계 전체(`./gradlew :prCheck`, + `verifyStrictLaneStages --dry-run`, Trivy)이고 단일 필수 검사다. job을 나누면 뒤 job이 runner 대기열 맨 뒤로 간다. `main.yml`이 main 단계(`mainCheck`·`integrationCheck`·build-logic 시험·configuration cache·링크)와 nightly(행렬 job, compose smoke, 마지막에 `performanceCheck`)를, `release.yml`이 태그 단계를 돌린다. 무엇을 돌릴지는 Gradle 단계 태스크가 정하고, `verifyStrictLaneStages`가 단계 job의 모양을 지킨다. diff --git a/docs/ci-cd/template-vs-consumer.md b/docs/ci-cd/template-vs-consumer.md index 3a96b59e..cafd9cde 100644 --- a/docs/ci-cd/template-vs-consumer.md +++ b/docs/ci-cd/template-vs-consumer.md @@ -31,7 +31,7 @@ | `pr.yml`(`./gradlew :prCheck`, 필수 검사 `pr / done`) | PR 단계. 무엇을 돌리는지는 Gradle 태스크 `prCheck`가 정한다 | | `main.yml`의 `main`·`integration`·`build-logic`·`configuration-cache` job | main 단계(`mainCheck`, `integrationCheck`) | | `main.yml`의 `performance` job | nightly 성능 단계(`performanceCheck`) | -| `vulnerabilities` job(`scripts/ci/trivy-scan.sh`) | Trivy와 CISA KEV | +| `pr.yml` `done`의 Trivy step과 `main.yml`의 `vulnerabilities` job(`scripts/ci/trivy-scan.sh`) | Trivy와 CISA KEV | | `release.yml` | `releaseCheck`, 이미지 · SBOM · 서명 | | `scripts/verify.sh` | 사람·세션이 workflow와 같은 단계를 돌리는 진입점 | | `prCheck`의 `documentCheck`·`testDocumentChecks` | 문서 규칙(`scripts/check-docs.py`: 언어·머리 블록·참조·숫자·지도·링크·문체)과 Gradle 밖 스크립트·편집 훅의 시험(`scripts/tests/`). 파생 서비스의 문서도 같은 규칙을 따른다(`docs/README.md`) | diff --git a/docs/work/reference/gates.md b/docs/work/reference/gates.md index f995a095..7591dc1c 100644 --- a/docs/work/reference/gates.md +++ b/docs/work/reference/gates.md @@ -16,14 +16,14 @@ Gradle 명령과 `scripts/verify.sh`는 모두 저장소 루트(Gradle 루트) | --- | --- | --- | | `docs` | `check-work-docs.py`, `check-docs.py`, `scripts/tests` 자기 시험, `check-repo-layout.py`(Gradle 없음, 노트북 가능) | `pr.yml`의 `prCheck` 안 | | `leaf ` | 그 leaf의 `check` | — | -| `pr` | `./gradlew :prCheck`, `./gradlew :verifyStrictLaneStages --dry-run` | `pr.yml` `gradle` | +| `pr` | `./gradlew :prCheck`, `./gradlew :verifyStrictLaneStages --dry-run` | `pr.yml` `done` | | `main` | `:mainCheck --continue`, `:integrationCheck --continue`, `-p build-logic test`, `scripts/ci/verify-configuration-cache.sh` | `main.yml`(push) | | `nightly` | compose smoke 전부, 마지막에 `:performanceCheck --continue` | `main.yml`(schedule·수동) | | `release` | `:releaseCheck`(지금 커밋을 provenance로) | `release.yml` `release` | | `app` | `scripts/bootstrap-local.sh`(앱을 띄워 health와 기본 endpoint 확인) | — | | `round` | `pr` → `main` → `nightly` → `release`, 첫 실패에서 멈춘다 | — | -workflow에만 있는 job: `pr.yml`·`main.yml`의 `vulnerabilities`(trivy, `scripts/ci/trivy-scan.sh`), `main.yml`의 `links`(lychee), nightly 행렬(`jpa-postgresql`·`httpclient-transport`·`redis-topology`·`fileserver-nfs-ambiguity`·`notification-chaos`·`jpa-next`), `release.yml`의 release lane과 이미지 job. 도구를 내려받거나 runner 환경이 필요해 `verify.sh`에 넣지 않았다. 손으로 돌리는 법은 3절 (다)다. +workflow에만 있는 job: `pr.yml` `done`의 마지막 step과 `main.yml`의 `vulnerabilities`(trivy, `scripts/ci/trivy-scan.sh`), `main.yml`의 `links`(lychee), nightly 행렬(`jpa-postgresql`·`httpclient-transport`·`redis-topology`·`fileserver-nfs-ambiguity`·`notification-chaos`·`jpa-next`), `release.yml`의 release lane과 이미지 job. 도구를 내려받거나 runner 환경이 필요해 `verify.sh`에 넣지 않았다. 손으로 돌리는 법은 3절 (다)다. 게이트 하나씩: @@ -35,8 +35,8 @@ workflow에만 있는 job: `pr.yml`·`main.yml`의 `vulnerabilities`(trivy, `scr | `qualityCheck` | SpotBugs, FindSecBugs(운영 코드) | PR(`ci` 안) | `build.gradle` | | `testQualityCheck` | 같은 분석을 모든 테스트 source set에(`config/spotbugs/exclude-test.xml` 기준) | main(`mainCheck` 안) | `build.gradle` | | `ci` | leaf `check`(API surface 포함) + `architectureCheck` + `qualityCheck` | PR(`prCheck` 안) | `build.gradle` | -| `prCheck` | `ci` + `verifyDependencyLocks` + `verifyComposeProfiles`(compose lane이 선언대로 렌더링되는가) + `verifyRepositoryLayout`(`check-repo-layout.py`) + `documentCheck`(`check-docs.py`, 앞에 `scripts/tests` 자기 시험) | PR | `pr.yml` `gradle`: `./gradlew :prCheck` | -| `verifyStrictLaneStages --dry-run` | `explicitOnly`가 아닌 strict lane이 단계 태스크 하나의 계획에 들어 있는가(그래프 검사), 단계마다 선언한 workflow job이 `./gradlew <단계>` 한 줄을 정해진 조건으로 돌리는가(형식 검사) | PR | `pr.yml` `gradle` 둘째 줄. 형식은 `build-logic/AGENTS.md` | +| `prCheck` | `ci` + `verifyDependencyLocks` + `verifyComposeProfiles`(compose lane이 선언대로 렌더링되는가) + `verifyRepositoryLayout`(`check-repo-layout.py`) + `documentCheck`(`check-docs.py`, 앞에 `scripts/tests` 자기 시험) | PR | `pr.yml` `done`: `./gradlew :prCheck` | +| `verifyStrictLaneStages --dry-run` | `explicitOnly`가 아닌 strict lane이 단계 태스크 하나의 계획에 들어 있는가(그래프 검사), 단계마다 선언한 workflow job이 `./gradlew <단계>` 한 줄을 정해진 조건으로 돌리는가(형식 검사) | PR | `pr.yml` `done` 둘째 줄. 형식은 `build-logic/AGENTS.md` | | `python3 scripts/check-repo-layout.py` | 저장소 루트와 `src/` 최상위에 허용 목록 밖의 항목이 없는가, registry 경로가 허용 폴더 안인가. 아무도 가리키지 않는 compose·스크립트 파일은 경고 | PR(`prCheck` 안) | `verifyRepositoryLayout` | | `python3 scripts/check-docs.py` | 살아 있는 문서의 언어, 기록·ADR 머리 블록, 문서의 인라인 코드 경로·Gradle 경로가 지금 있는가, 복사한 숫자, 상대 링크(`docs/README.md` 「문서 검사」) | PR(`prCheck` 안) | `documentCheck` | | `mainCheck` | `configContractCheck` + `qualificationCheck`(`testQualityCheck` 포함) + 공개 경로 스냅숏 + 전송·메시징 qualification lane + 생성 명령 왕복(`verifyFeatureScaffold`) + 모든 leaf의 `mainCheck`(document-contract lane 등) | main | `main.yml` `main`: `./gradlew :mainCheck --continue` | -- 2.54.0 From 96caf997f85809a77b12284b91059c0a4faaedd8 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Thu, 12 Nov 2026 01:18:24 +0900 Subject: [PATCH 08/22] =?UTF-8?q?ci:=20Gradle=20job=EB=A7=88=EB=8B=A4=20JD?= =?UTF-8?q?K=EB=A5=BC=20=EB=82=B4=EB=A0=A4=EB=B0=9B=EC=A7=80=20=EC=95=8A?= =?UTF-8?q?=EA=B3=A0=20runner=20=EC=BA=90=EC=8B=9C=EC=97=90=EC=84=9C=20?= =?UTF-8?q?=EB=B3=B5=EC=9B=90=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제: job 컨테이너가 매번 새것이라 setup-java가 빈 tool cache를 보고 Temurin 21.0.11(약 190MB)을 job마다 GitHub에서 받는다. job 하나에 21~23초, nightly 한 번(Gradle job 28개)에 약 9.5분, release 수동 한 번에 약 4분이다. 11-09에는 같은 GitHub 내려받기가 504로 실패한 job도 있었다. 고른 방법: setup-java 앞에서 actions/cache v4.3.0(node20, 커밋 SHA 고정)으로 setup-java가 설치하는 tool cache 폴더를 복원한다. setup-java는 tool cache를 먼저 보므로 복원되면 내려받지 않는다. 키는 Temurin 빌드 하나를 가리키므로 어느 브랜치에서 저장해도 내용이 같다. pull request는 읽기만 한다(검토 중인 코드가 JDK를 바꿔 넣지 못하게). push·schedule·수동 실행은 쓰기 권한자만 시작할 수 있어 저장을 허용한다. 버린 대안: JDK가 든 runner 이미지 쓰기. runner 설정은 다른 저장소(platform-core)다. 위험·한계: runner 캐시 상한은 5GB다. 이 항목은 압축 후 약 150~200MB다. 검증: runner 수동 실행 두 번째 Gradle job부터 「Trying to download」가 없는지, setup 시간(이 PR 본문에 적는다). --- .gitea/actions/setup-java-gradle/action.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.gitea/actions/setup-java-gradle/action.yml b/.gitea/actions/setup-java-gradle/action.yml index 00aba415..867704df 100644 --- a/.gitea/actions/setup-java-gradle/action.yml +++ b/.gitea/actions/setup-java-gradle/action.yml @@ -11,9 +11,27 @@ description: >- # and a pinned commit SHA, the only immutable action reference. The JDK is the version in # .tool-versions under the name Temurin publishes it (`+10.0.LTS`); setup-java rejects `+10`. +# The JDK comes from the runner's cache when it can. Every job starts in a fresh container, so +# setup-java found an empty tool cache and downloaded the same 190 MB from GitHub in every job (about +# 22 of the 25 seconds a job spent before Gradle, and the step that failed with 504s). setup-java +# looks in the tool cache first, so restoring the directory it installs into is enough. A pull +# request only reads the entry, so code under review cannot put a JDK in it; a push, a schedule or +# a manual run, which only a writer can start, may save it. The key names one Temurin build, so the +# entry is the same whichever branch saves it. setup-gradle below is stricter (main only), because +# a Gradle home differs by branch. runs: using: composite steps: + - if: ${{ github.event_name != 'pull_request' }} + uses: https://github.com/actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # actions/cache@v4.3.0 + with: + path: /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk + key: jdk-temurin-21.0.11+10.0.LTS-${{ runner.os }}-${{ runner.arch }} + - if: ${{ github.event_name == 'pull_request' }} + uses: https://github.com/actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # actions/cache/restore@v4.3.0 + with: + path: /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk + key: jdk-temurin-21.0.11+10.0.LTS-${{ runner.os }}-${{ runner.arch }} - uses: https://github.com/actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # actions/setup-java@v4.7.1 with: distribution: temurin -- 2.54.0 From cfc80ae8d471956c1b4f943bf14378a07ebdab34 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Thu, 12 Nov 2026 01:18:24 +0900 Subject: [PATCH 09/22] =?UTF-8?q?build(release):=20=EA=B8=B0=EB=B3=B8=20?= =?UTF-8?q?=EC=9D=B4=EB=AF=B8=EC=A7=80=EB=A5=BC=20noble=EB=A1=9C=20?= =?UTF-8?q?=EC=98=AC=EB=A6=AC=EA=B3=A0=20=EC=9D=B4=EB=AF=B8=EC=A7=80=20?= =?UTF-8?q?=EA=B2=80=EC=82=AC=EB=A5=BC=20=EC=B7=A8=EC=95=BD=EC=A0=90?= =?UTF-8?q?=EA=B3=BC=20=EB=9D=BC=EC=9D=B4=EC=84=A0=EC=8A=A4=EB=A1=9C=20?= =?UTF-8?q?=EB=82=98=EB=88=88=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제: release 수동 실행(run 62)의 app-image-release가 Trivy에서 실패한다. 기본 이미지 eclipse-temurin:21-jre-jammy(ubuntu 22.04)에 고친 버전이 있는 OS 취약점 HIGH 7건(apt, libssl3/openssl, libbrotli1 등)과 OS 패키지 라이선스 HIGH 370건이 걸렸다. 앱 jar는 0건이다. 고른 방법(2026-11-11 소유자 결정 「권하는 안」): - builder·runtime을 eclipse-temurin:21-{jdk,jre}-noble(ubuntu 24.04.5)의 2026-10-29 digest로 올린다. noble 이미지에는 uid·gid 1000인 `ubuntu` 계정이 있어, 앱 계정(uid 1000)을 만들기 전에 지운다. wget(healthcheck)과 C.UTF-8은 noble에도 있다(desktop에서 확인). - 취약점: OS·앱 모두 High/Critical이면 실패를 유지한다. 고친 버전이 있으면 새 digest로 고치고, 아직 없는 것만 .trivyignore.yaml에 만료일 예외로 둔다. - 라이선스: 앱 의존성(`--pkg-types library`)의 금지 라이선스(Trivy CRITICAL)만 실패. OS 패키지 것을 포함한 나머지는 보고만 한다. - 정책 문서(.github/dependency-vulnerability-policy.md)에 같은 내용을 적는다. 위험·한계: noble로 바꾸며 아직 고친 버전이 없는 High가 새로 보일 수 있다. 그때는 이유와 만료일을 달아 예외로 둔다. PR의 filesystem 검사는 그대로라 앱 의존성의 restricted(HIGH) 라이선스는 PR에서 여전히 막힌다. 검증: runner release 수동 실행의 app-image-release(이 PR 본문에 적는다), desktop compose smoke(같은 Dockerfile로 qualification 이미지를 만든다). --- .github/dependency-vulnerability-policy.md | 9 +++++++++ Dockerfile | 21 ++++++++++++++------- scripts/ci/trivy-scan.sh | 17 ++++++++++++++--- 3 files changed, 37 insertions(+), 10 deletions(-) diff --git a/.github/dependency-vulnerability-policy.md b/.github/dependency-vulnerability-policy.md index 6b58f388..7063a1c5 100644 --- a/.github/dependency-vulnerability-policy.md +++ b/.github/dependency-vulnerability-policy.md @@ -21,6 +21,15 @@ GitHub dependency review와 dependency submission은 GitHub.com API에만 있어 이미지 빌드·스캔, SBOM, 서명, 태그 릴리스는 `.gitea/workflows/release.yml`이 맡는다. 이미지 스캔도 같은 스크립트(`image` 모드)와 같은 예외 파일을 쓴다. +릴리스 이미지(2026-11-11 소유자 결정): + +- 기본 이미지는 고칠 수 있는 최신 digest로 둔다(`Dockerfile`, 지금 `eclipse-temurin:21-jre-noble`). + OS 패키지의 High/Critical도 아래 표대로 막는다. 고친 버전이 있으면 새 digest로 고친다. +- 아직 고친 버전이 없는 High/Critical만 `.trivyignore.yaml`에 이유와 `expired_at`을 달아 둔다. +- 라이선스: 앱 의존성(`--pkg-types library`)의 금지 라이선스(Trivy CRITICAL)만 막는다. 그 밖의 라이선스 + 결과는 OS 패키지 것까지 보고만 한다. 배포판의 GPL 패키지는 이 애플리케이션의 이용 조건이 아니다. +- pull request의 `filesystem` 검사는 그대로다(앱 의존성의 High/Critical 라이선스도 막는다). + ## 심각도와 대응 | 심각도 | CI 처리 | 고칠 기한 | diff --git a/Dockerfile b/Dockerfile index 962163a7..5fc53fa5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,8 +23,9 @@ ARG GIT_SHA ARG SOURCE_URL # ---- Stage 1: builder ------------------------------------------------------- -# Uses the full JDK only in the build stage, never in the final image. -FROM eclipse-temurin:21-jdk-jammy@sha256:801b7e1a9c4befaf82bf9a2a58025ef43a7694bbc84779187ad0524d84742772 AS builder +# Uses the full JDK only in the build stage, never in the final image. Same Ubuntu release as the +# runtime stage below. +FROM eclipse-temurin:21-jdk-noble@sha256:114cabb73033ca4ce7ceec3deb62396bc1b716282bae051ed3c1d82e38fcab2d AS builder ARG RELEASE_VERSION ARG GIT_SHA @@ -104,8 +105,11 @@ RUN java -Djarmode=tools \ # ---- Stage 2: runtime image ------------------------------------------------- # JRE-only slim image (D3: no full JDK in production image). -# Uses eclipse-temurin:21-jre-jammy — the Adoptium-supported JRE variant. -FROM eclipse-temurin:21-jre-jammy@sha256:199aebeb3adcde4910695cdebfe782ada38dadb6cc8013159b58d3724451befd AS runtime +# Uses eclipse-temurin:21-jre-noble (Ubuntu 24.04), the Adoptium-supported JRE variant. The release +# scan fails on a High or Critical finding that has a fix (2026-11-11 owner decision), and jammy +# (22.04) carried seven OS findings with a fix (apt, openssl, libbrotli1, ...). When the scan +# reports one again, the fix is a newer digest of this same tag. +FROM eclipse-temurin:21-jre-noble@sha256:0eda5830ed7b669abc246a8dc520ea8a23cab06f9a8d4b6964109e2f2394e46f AS runtime ARG BUILD_VERSION ARG GIT_SHA @@ -121,7 +125,7 @@ LABEL org.opencontainers.image.title="caskeleton" \ RUN test -n "${BUILD_VERSION}" && test -n "${GIT_SHA}" && test -n "${SOURCE_URL}" # ---- Locale / timezone (D4) ------------------------------------------------- -# C.UTF-8 is available in eclipse-temurin:21-jre-jammy without installing extra packages. +# C.UTF-8 is available in eclipse-temurin:21-jre-noble without installing extra packages. # Do NOT use en_US.UTF-8 — it requires the locales package and may not exist in a slim image. ENV TZ=UTC \ LANG=C.UTF-8 \ @@ -157,7 +161,10 @@ ENV JAVA_TOOL_OPTIONS="\ RUN mkdir -p /var/tmp/heap && chmod 1777 /var/tmp/heap # ---- Non-root user (D3) ----------------------------------------------------- -RUN groupadd --system --gid 1000 app \ +# The noble base image ships a login user `ubuntu` with uid and gid 1000, which are the app user's. +# It is removed first, so uid 1000 is this account and nothing else. +RUN userdel --remove ubuntu \ + && groupadd --system --gid 1000 app \ && useradd --system --uid 1000 --gid app --no-create-home --shell /usr/sbin/nologin app # No data directory and no VOLUME. The image is the shipped composition, which keeps nothing on @@ -204,7 +211,7 @@ EXPOSE 8080 9001 # Kubernetes ignores HEALTHCHECK and uses its own probes against the same path; this exists for # docker and Compose. # -# wget is present in eclipse-temurin:21-jre-jammy, so nothing is installed for it. +# 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 \ CMD wget --no-verbose --tries=1 --spider \ http://localhost:9001/actuator/health/readiness || exit 1 diff --git a/scripts/ci/trivy-scan.sh b/scripts/ci/trivy-scan.sh index 07d4ae31..e1f74bba 100755 --- a/scripts/ci/trivy-scan.sh +++ b/scripts/ci/trivy-scan.sh @@ -6,7 +6,8 @@ # bash scripts/ci/trivy-scan.sh filesystem dependency tree: block High/Critical, report # Medium/Low, fail on any CISA KEV match # bash scripts/ci/trivy-scan.sh image release image: write image-sbom.cdx.json, -# block High/Critical, report Medium/Low +# block High/Critical vulnerabilities and +# forbidden application licenses, report the rest # # Tools are pinned release binaries with an asserted SHA-256, installed under RUNNER_TEMP (or a # temporary directory): a checksum is a supply-chain claim that can be checked offline, an action @@ -97,8 +98,18 @@ scan_filesystem() { scan_image() { trivy image --format cyclonedx --scanners license --output image-sbom.cdx.json "$1" test -s image-sbom.cdx.json - trivy image --scanners vuln,license --severity CRITICAL,HIGH --exit-code 1 --ignorefile .trivyignore.yaml "$1" - trivy image --scanners vuln,license --severity MEDIUM,LOW --exit-code 0 --ignorefile .trivyignore.yaml "$1" + # Vulnerabilities, OS and application packages alike: High or Critical fails the release. A + # finding with a fix is fixed (a newer base image digest or dependency); one with no fix yet is + # carried in .trivyignore.yaml with its expiry (owner decision 2026-11-11). + trivy image --scanners vuln --severity CRITICAL,HIGH --exit-code 1 --ignorefile .trivyignore.yaml "$1" + trivy image --scanners vuln --severity MEDIUM,LOW --exit-code 0 --ignorefile .trivyignore.yaml "$1" + # Licenses (same decision): an application dependency under a forbidden license (Trivy's + # CRITICAL) fails the release. Every other license finding, the OS packages' included, is + # reported and does not block: a distribution's GPL packages are not this application's terms. + trivy image --scanners license --pkg-types library --severity CRITICAL --exit-code 1 \ + --ignorefile .trivyignore.yaml "$1" + trivy image --scanners license --severity HIGH,MEDIUM,LOW,UNKNOWN --exit-code 0 \ + --ignorefile .trivyignore.yaml "$1" } case "${1:-}" in -- 2.54.0 From 000a59ed5f0d511b720ae79a0e3a7cf514ef1eb1 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Thu, 12 Nov 2026 01:25:53 +0900 Subject: [PATCH 10/22] =?UTF-8?q?fix(redis):=20Redis=208=20=EA=B5=AC?= =?UTF-8?q?=EC=84=B1=20lane=EC=9D=B4=20search=20=EB=AA=A8=EB=93=88?= =?UTF-8?q?=EC=9D=84=20=EC=8B=A3=EA=B3=A0=20admin=EC=9D=B4=20FT.INFO?= =?UTF-8?q?=EB=A5=BC=20=EB=B0=9B=EB=8A=94=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제: nightly의 redis-topology 8.2 standalone·sentinel·cluster가 run 63에서 RedisTopologyContractTest 「admin 계정이 ADMIN_ONLY 진단을 모두 쓸 수 있다」로 실패한다. 7.2·7.4는 통과한다. 원인은 둘이다. - 명령 정책 catalog는 search 모듈의 FT.INFO를 8.0부터 ADMIN_ONLY로 둔다. fixture ACL의 admin 줄에는 그 권한이 없다(standalone: 거부). - sentinel·cluster lane은 entrypoint를 덮어써 `redis-server`를 바로 실행한다. Redis 8 이미지의 docker-entrypoint.sh가 모듈을 싣는데 그것을 건너뛰어 FT.INFO 자체가 없다(「있어야 할 서버에 없다」). desktop에서 확인: Redis 7.2·7.4는 ACL 규칙 `+ft.info`가 있으면 시작을 거부하고, 8.2는 모듈을 실었을 때만 받는다. cluster 모드에서도 search 모듈은 실리고 FT.INFO가 생긴다. 고른 방법: - sentinel·cluster 데이터 노드가 `exec docker-entrypoint.sh redis-server`로 standalone처럼 이미지 entrypoint를 거친다. 서버도 root가 아니라 이미지의 redis 사용자로 돈다. - 네 구성의 ACL 마운트 원본을 `REDIS_ACL_DIR`로 바꿀 수 있게 한다(기본값은 지금 폴더). redis-topology.sh가 8 이상에서만 커밋한 ACL 파일에서 admin 줄 끝에 `+ft.info`를 더한 사본을 build/ 아래 만들어 쓴다. 실행마다 원본에서 만들어 어긋날 수 없다. ACL README에 이 예외를 적는다. 버린 대안: 버전별 ACL 파일을 하나 더 커밋하기. README가 금하는 두 번째 사본이다. catalog에서 FT.INFO를 빼기. SDK가 문서로 지원한다고 한 진단이다. 위험·한계: entrypoint를 거치며 7.x에서도 서버 사용자가 redis로 바뀐다. /tmp의 nodes.conf와 읽기 전용 ACL 마운트는 그 사용자도 읽고 쓸 수 있다. 검증: runner redis-topology 11칸(nightly 수동 실행, 이 PR 본문에 적는다). --- compose/redis/acl/README.md | 7 +++++++ scripts/ci/redis-topology.sh | 19 +++++++++++++++++++ .../redis-sdk/compose/cluster/compose.yml | 8 ++++++-- .../redis-sdk/compose/sentinel/compose.yml | 8 ++++++-- .../redis-sdk/compose/standalone/compose.yml | 2 +- .../redis-sdk/compose/tls/compose.yml | 2 +- 6 files changed, 40 insertions(+), 6 deletions(-) diff --git a/compose/redis/acl/README.md b/compose/redis/acl/README.md index 19be08f8..87e3b1d2 100644 --- a/compose/redis/acl/README.md +++ b/compose/redis/acl/README.md @@ -56,6 +56,13 @@ Redis ACL 파일은 완전한 `user` 줄만 받는다. 주석도, 줄 이어 쓰 모두 이 폴더를 읽기 전용으로 마운트한다. 복사본을 두지 않는다. 이 줄들의 두 번째 사본은 비밀번호나 key 패턴이 따로 어긋날 두 번째 자리다. +예외 하나: Redis 8 이상의 구성 lane은 `scripts/ci/redis-topology.sh`가 이 파일에서 만든 사본을 마운트한다. +admin 줄 끝에 `+ft.info` 하나만 더한다. Redis 8에 들어 있는 search 모듈의 `FT.INFO`를 명령 정책 catalog가 +8.0부터 admin 진단(`ADMIN_ONLY`)으로 두기 때문이다. Redis 7은 자기에게 없는 명령을 부르는 ACL 규칙이 있으면 +시작하지 않으므로, 이 파일 자체에는 그 줄을 넣을 수 없다. 사본은 실행할 때마다 이 파일에서 다시 만들어 어긋날 +수 없고, 커밋하지 않는다(`build/` 아래). Redis 8에 같은 admin 계정을 두는 배포는 자기 ACL 파일에 +`+ft.info`를 더한다. + Compose lane은 애플리케이션을 `ca-skeleton-application`과 `ca-skeleton-application-advanced`로 연결한다. 연결은 `secret://@environment/` 참조를 거치고, 그 변수가 위 fixture 비밀번호를 가진다. 여기의 모든 계정이 `~prod:*`로 묶여 있어서, lane은 Redis namespace 환경을 `prod`로 두고 돈다. diff --git a/scripts/ci/redis-topology.sh b/scripts/ci/redis-topology.sh index d8f212bb..94aa747b 100755 --- a/scripts/ci/redis-topology.sh +++ b/scripts/ci/redis-topology.sh @@ -35,6 +35,25 @@ case "${topology}" in *) echo "redis-topology: unknown topology ${topology}" >&2; exit 2 ;; esac +# Redis 8 ships the search module, and the command catalog makes its FT.INFO an admin diagnostic +# from 8.0 (ADMIN_ONLY). The committed fixture ACL cannot grant it: one file serves every version, +# and Redis 7 refuses to start on a rule that names a command it does not have. On 8 and later the +# lane mounts a copy whose admin line also grants +ft.info, made here from that one file so the two +# cannot drift (compose/redis/acl/README.md). +if [ "${version%%.*}" -ge 8 ]; then + acl_dir="${PWD}/src/adapter/outbound/redis-sdk/build/redis-topology-acl" + rm -rf "${acl_dir}" + mkdir -p "${acl_dir}" + sed '/^user ca-skeleton-admin-readonly /s/$/ +ft.info/' compose/redis/acl/lane-fixture-accounts.acl \ + > "${acl_dir}/lane-fixture-accounts.acl" + grep -q '^user ca-skeleton-admin-readonly .* +ft\.info$' "${acl_dir}/lane-fixture-accounts.acl" \ + || { echo "redis-topology: the admin line of the fixture ACL was not found" >&2; exit 1; } + # Read by the image's redis user, which is not the user that made the copy. + chmod 0755 "${acl_dir}" + chmod 0644 "${acl_dir}/lane-fixture-accounts.acl" + export REDIS_ACL_DIR="${acl_dir}" +fi + REDIS_VERSION=${version} "${compose[@]}" up -d --wait # Inside a CI job container the Docker daemon's ports are on the daemon host, not on localhost, and diff --git a/src/adapter/outbound/redis-sdk/compose/cluster/compose.yml b/src/adapter/outbound/redis-sdk/compose/cluster/compose.yml index 3439d338..d2e8585a 100644 --- a/src/adapter/outbound/redis-sdk/compose/cluster/compose.yml +++ b/src/adapter/outbound/redis-sdk/compose/cluster/compose.yml @@ -25,12 +25,16 @@ x-node: &node image: "redis:${REDIS_VERSION:-7.4}" network_mode: host volumes: - - ../../../../../../compose/redis/acl:/etc/redis/acl:ro + - ${REDIS_ACL_DIR:-../../../../../../compose/redis/acl}:/etc/redis/acl:ro + # Through the image's own entrypoint, as the standalone lane is: on Redis 8 that is what loads + # the bundled modules (search, JSON, time series, probabilistic), and without them a topology lane + # would test a different server from the standalone one (FT.INFO absent, 2026-11-09 run 63). It + # also runs the server as the image's redis user instead of root. entrypoint: - /bin/sh - -c - | - exec redis-server \ + exec docker-entrypoint.sh redis-server \ --port $$NODE_PORT \ --cluster-enabled yes \ --cluster-config-file /tmp/nodes.conf \ diff --git a/src/adapter/outbound/redis-sdk/compose/sentinel/compose.yml b/src/adapter/outbound/redis-sdk/compose/sentinel/compose.yml index db059a38..2ba205c8 100644 --- a/src/adapter/outbound/redis-sdk/compose/sentinel/compose.yml +++ b/src/adapter/outbound/redis-sdk/compose/sentinel/compose.yml @@ -29,7 +29,11 @@ x-data-node: &data-node image: "redis:${REDIS_VERSION:-7.4}" network_mode: host volumes: - - ../../../../../../compose/redis/acl:/etc/redis/acl:ro + - ${REDIS_ACL_DIR:-../../../../../../compose/redis/acl}:/etc/redis/acl:ro + # Through the image's own entrypoint, as the standalone lane is: on Redis 8 that is what loads + # the bundled modules (search, JSON, time series, probabilistic), and without them a topology lane + # would test a different server from the standalone one (FT.INFO absent, 2026-11-09 run 63). It + # also runs the server as the image's redis user instead of root. entrypoint: - /bin/sh - -c @@ -42,7 +46,7 @@ x-data-node: &data-node # into an explicit NOREPLICAS refusal the caller can see and act on. Any deployment where an # acknowledgement is supposed to mean something has to set these. - | - exec redis-server \ + exec docker-entrypoint.sh redis-server \ --port $$NODE_PORT \ $$REPLICA_OF \ --appendonly no \ diff --git a/src/adapter/outbound/redis-sdk/compose/standalone/compose.yml b/src/adapter/outbound/redis-sdk/compose/standalone/compose.yml index 5d983bbc..d3882261 100644 --- a/src/adapter/outbound/redis-sdk/compose/standalone/compose.yml +++ b/src/adapter/outbound/redis-sdk/compose/standalone/compose.yml @@ -16,7 +16,7 @@ services: - --aclfile - /etc/redis/acl/lane-fixture-accounts.acl volumes: - - ../../../../../../compose/redis/acl:/etc/redis/acl:ro + - ${REDIS_ACL_DIR:-../../../../../../compose/redis/acl}:/etc/redis/acl:ro ports: - "${REDIS_PORT:-6379}:6379" healthcheck: diff --git a/src/adapter/outbound/redis-sdk/compose/tls/compose.yml b/src/adapter/outbound/redis-sdk/compose/tls/compose.yml index a679849f..48cc99d7 100644 --- a/src/adapter/outbound/redis-sdk/compose/tls/compose.yml +++ b/src/adapter/outbound/redis-sdk/compose/tls/compose.yml @@ -38,7 +38,7 @@ services: certs: condition: service_completed_successfully volumes: - - ../../../../../../compose/redis/acl:/etc/redis/acl:ro + - ${REDIS_ACL_DIR:-../../../../../../compose/redis/acl}:/etc/redis/acl:ro - tls:/tls:ro command: - redis-server -- 2.54.0 From 5a95db45233b3a9a464716a654a11ed675fff446 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Thu, 12 Nov 2026 01:27:06 +0900 Subject: [PATCH 11/22] =?UTF-8?q?ci(main):=20NFS=20job=EC=9D=98=20compose?= =?UTF-8?q?=20=EA=B2=BD=EB=A1=9C=EB=A5=BC=20=EC=9E=AC=EB=B0=B0=EC=B9=98?= =?UTF-8?q?=EC=97=90=20=EB=A7=9E=EC=B6=94=EA=B3=A0=20=ED=98=B8=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=20nfsd=20=EB=AA=A8=EB=93=88=EC=9D=84=20=EB=A8=BC?= =?UTF-8?q?=EC=A0=80=20=EB=B3=B8=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제: 두 가지다. - 재배치(PR #10)로 workflow의 기본 작업 폴더 `src`가 없어졌는데 fileserver-nfs-ambiguity의 두 compose 줄이 `adapter/outbound/...`로 남았다. 지금 main에서는 파일을 찾지 못해 실패한다. - 그 전에도 이 job은 run 52·63에서 NFS 서버 컨테이너가 바로 끝나 「dependency failed to start」로만 실패했다. 서버는 호스트 커널의 nfsd를 쓰고, desktop 호스트에는 그 모듈이 올라가 있지 않다(`lsmod`에 없음, 모듈 파일은 있음). runner 안쪽 daemon에는 /lib/modules가 없어 컨테이너가 올릴 수 없다. 고른 방법: 경로에 `src/`를 붙인다. 첫 step이 /proc/filesystems에서 nfsd를 확인하고, 없으면 호스트에서 한 번 돌릴 명령을 출력하고 실패한다. 원인을 로그에서 바로 읽을 수 있다. 버린 대안: job이 privileged 컨테이너로 호스트에 모듈을 올리게 하기. CI가 runner 호스트의 커널 상태를 바꾸게 된다. 위험·한계: 호스트에 모듈을 올리기 전까지 이 job은 빨갛다. 올리는 것은 runner 호스트 관리자(소유자)의 일이다. 검증: 경로는 workflow의 run 줄 경로를 모두 대조하는 스크립트로 확인했다 (빠진 경로는 이 두 줄뿐). runner nightly 수동 실행. --- .gitea/workflows/main.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/main.yml b/.gitea/workflows/main.yml index b5390504..24f09a98 100644 --- a/.gitea/workflows/main.yml +++ b/.gitea/workflows/main.yml @@ -192,11 +192,22 @@ jobs: FILESERVER_NFS_TESTS: "true" steps: - uses: https://github.com/actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # actions/checkout@v4.2.2 + # The NFS server is the host kernel's nfsd, which a container cannot load: the runner's daemon + # has no /lib/modules. Without the module the server exits at once and the compose step only + # says "dependency failed to start" (runs 52 and 63). The runner host loads it once, at boot: + # echo nfsd | sudo tee /etc/modules-load.d/nfsd.conf && sudo modprobe nfsd + - name: The runner host has the nfsd kernel module + run: | + grep -qw nfsd /proc/filesystems || { + echo "fileserver-nfs: the runner host kernel has no nfsd module; load it on the host:" >&2 + echo " echo nfsd | sudo tee /etc/modules-load.d/nfsd.conf && sudo modprobe nfsd" >&2 + exit 1 + } - uses: ./.gitea/actions/setup-java-gradle - - run: docker compose -f adapter/outbound/fileserver/compose/nfs/compose.yml up -d --wait + - run: docker compose -f src/adapter/outbound/fileserver/compose/nfs/compose.yml up -d --wait - run: ./gradlew :adapter:outbound:fileserver:test --tests '*NfsAmbiguityIntegrationTest' - if: ${{ always() }} - run: docker compose -f adapter/outbound/fileserver/compose/nfs/compose.yml down -v + run: docker compose -f src/adapter/outbound/fileserver/compose/nfs/compose.yml down -v # The notification fault, race and restart suites run again on their own: one green run says least # about exactly these. -- 2.54.0 From d237bacc149a5e71986fb1b28038324ae9e794db Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Thu, 12 Nov 2026 01:28:35 +0900 Subject: [PATCH 12/22] =?UTF-8?q?ci:=20JDK=20=EC=BA=90=EC=8B=9C=EB=8A=94?= =?UTF-8?q?=20main=EC=97=90=EC=84=9C=EB=A7=8C=20=EC=A0=80=EC=9E=A5?= =?UTF-8?q?=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 앞 커밋은 pull request만 읽기 전용으로 두고 push·schedule·수동 실행은 어느 브랜치에서든 저장하게 했다. 키가 Temurin 빌드 하나로 고정이고 처음 저장한 항목이 계속 쓰이므로, 쓰기 권한자가 브랜치에서 수동 실행으로 먼저 저장하면 그 뒤 모든 main 실행이 리뷰 없이 그 JDK를 복원한다. setup-gradle과 같은 규칙(main ref만 저장)으로 맞춘다. 위험·한계: 브랜치의 수동 실행에서는 main이 저장하기 전까지 캐시가 비어 있어 효과를 볼 수 없다. 효과는 병합 뒤 첫 main push에서 확인한다. --- .gitea/actions/setup-java-gradle/action.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.gitea/actions/setup-java-gradle/action.yml b/.gitea/actions/setup-java-gradle/action.yml index 867704df..afa88fdf 100644 --- a/.gitea/actions/setup-java-gradle/action.yml +++ b/.gitea/actions/setup-java-gradle/action.yml @@ -14,20 +14,19 @@ description: >- # The JDK comes from the runner's cache when it can. Every job starts in a fresh container, so # setup-java found an empty tool cache and downloaded the same 190 MB from GitHub in every job (about # 22 of the 25 seconds a job spent before Gradle, and the step that failed with 504s). setup-java -# looks in the tool cache first, so restoring the directory it installs into is enough. A pull -# request only reads the entry, so code under review cannot put a JDK in it; a push, a schedule or -# a manual run, which only a writer can start, may save it. The key names one Temurin build, so the -# entry is the same whichever branch saves it. setup-gradle below is stricter (main only), because -# a Gradle home differs by branch. +# looks in the tool cache first, so restoring the directory it installs into is enough. Only a run +# on main saves the entry, the rule setup-gradle follows below: the key is fixed and the first entry +# saved under it stays, so a branch that saved it first would decide the JDK every later main run +# restores, without review. runs: using: composite steps: - - if: ${{ github.event_name != 'pull_request' }} + - if: ${{ github.ref == 'refs/heads/main' }} uses: https://github.com/actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # actions/cache@v4.3.0 with: path: /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk key: jdk-temurin-21.0.11+10.0.LTS-${{ runner.os }}-${{ runner.arch }} - - if: ${{ github.event_name == 'pull_request' }} + - if: ${{ github.ref != 'refs/heads/main' }} uses: https://github.com/actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # actions/cache/restore@v4.3.0 with: path: /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk -- 2.54.0 From 7284b581c1ae94bc312f8005217507cfe09729e7 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Thu, 12 Nov 2026 01:30:20 +0900 Subject: [PATCH 13/22] =?UTF-8?q?ci(main):=20nightly=EA=B0=80=20main?= =?UTF-8?q?=EC=97=90=EC=84=9C=20PR=20=EB=8B=A8=EA=B3=84=EB=A5=BC=20?= =?UTF-8?q?=EB=8F=8C=EB=A0=A4=20PR=EC=9D=B4=20=EC=93=B8=20=EB=B9=8C?= =?UTF-8?q?=EB=93=9C=20=EC=BA=90=EC=8B=9C=EB=A5=BC=20=EC=B1=84=EC=9A=B4?= =?UTF-8?q?=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제: PR 단계는 한 줄만 바꾼 PR도 526개 태스크를 모두 처음부터 돈다(run 64·85, FROM-CACHE 0). PR은 캐시를 읽기만 하는데, main push는 PR 단계 태스크 (spotbugsMain, test, checkstyle 등)를 돌리지 않아 읽을 항목이 없다. desktop PR 단계 태스크 시간 1,919초 가운데 컴파일 30%, SpotBugs 26%, 시험 35%다. 고른 방법: main.yml에 nightly·수동 전용 job `done`을 둔다. `:prCheck`를 main에서 한 번 더 돌리고, setup-gradle이 job 끝에 그 결과를 캐시에 저장한다. setup-gradle은 캐시 키에 job 이름을 넣고 같은 이름의 항목부터 찾으므로, pr.yml의 job과 같은 이름이어야 PR이 이 항목을 복원한다. 게이트가 아니라 문서(gates.md)에 그렇게 적는다. 버린 대안: main push마다 돌리기. 모든 push가 약 8분 늦어진다. PR이 캐시를 쓰게 하기. 검토 전 코드가 main이 복원할 캐시를 바꿀 수 있다. 위험·한계: 효과는 이 job이 main에서 한 번 돈 뒤부터다(브랜치 수동 실행은 캐시를 저장하지 않는다). 그날 병합으로 바뀐 모듈은 다음 nightly까지 PR에서 다시 돈다. enhanced 캐시 제공자의 키 규칙은 공개되지 않아, 같은 이름으로 복원되는지는 첫 nightly 뒤 PR 로그의 FROM-CACHE 수로 확인한다. nightly에 약 8분이 더해진다. 검증: 병합 뒤 첫 nightly와 그 뒤 PR의 setup-gradle 복원 줄·FROM-CACHE 수(이 PR 본문에 적는다). desktop에서 캐시가 찬 PR 단계 시간(pr-bc2)으로 효과의 상한을 잰다. --- .gitea/workflows/main.yml | 15 +++++++++++++++ docs/work/reference/gates.md | 4 ++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/main.yml b/.gitea/workflows/main.yml index 24f09a98..bb370d42 100644 --- a/.gitea/workflows/main.yml +++ b/.gitea/workflows/main.yml @@ -295,6 +295,21 @@ jobs: - uses: https://github.com/actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # actions/checkout@v4.2.2 - run: bash scripts/run-compose-runtime-smoke.sh --matrix src/bootstrap/app/compose-lanes/compose-profile-contracts.json + # Not a gate: the pull-request stage once more, on main, so that a pull request finds main's + # results in the build cache and runs only what its change touches. setup-gradle keys its cache by + # job name and a job first restores the newest entry of its own name, so this job is named after + # pr.yml's one job. Main saves, a pull request only reads (.gitea/actions/setup-java-gradle). + # Nightly and manual runs only: a push does not wait for it, and a pull request after a day's + # merges reruns the modules those changed. + done: + if: ${{ github.event_name != 'push' }} + runs-on: ubuntu-latest + timeout-minutes: 75 + steps: + - uses: https://github.com/actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # actions/checkout@v4.2.2 + - uses: ./.gitea/actions/setup-java-gradle + - run: ./gradlew :prCheck + # Load, slow-client, shutdown, pool and resource bounds. Last, after every other heavy job of the # run, so the bounds are measured on a runner that is not building something else. # diff --git a/docs/work/reference/gates.md b/docs/work/reference/gates.md index 7591dc1c..68a9885c 100644 --- a/docs/work/reference/gates.md +++ b/docs/work/reference/gates.md @@ -23,7 +23,7 @@ Gradle 명령과 `scripts/verify.sh`는 모두 저장소 루트(Gradle 루트) | `app` | `scripts/bootstrap-local.sh`(앱을 띄워 health와 기본 endpoint 확인) | — | | `round` | `pr` → `main` → `nightly` → `release`, 첫 실패에서 멈춘다 | — | -workflow에만 있는 job: `pr.yml` `done`의 마지막 step과 `main.yml`의 `vulnerabilities`(trivy, `scripts/ci/trivy-scan.sh`), `main.yml`의 `links`(lychee), nightly 행렬(`jpa-postgresql`·`httpclient-transport`·`redis-topology`·`fileserver-nfs-ambiguity`·`notification-chaos`·`jpa-next`), `release.yml`의 release lane과 이미지 job. 도구를 내려받거나 runner 환경이 필요해 `verify.sh`에 넣지 않았다. 손으로 돌리는 법은 3절 (다)다. +workflow에만 있는 job: `pr.yml` `done`의 마지막 step과 `main.yml`의 `vulnerabilities`(trivy, `scripts/ci/trivy-scan.sh`), `main.yml`의 `links`(lychee), nightly 행렬(`jpa-postgresql`·`httpclient-transport`·`redis-topology`·`fileserver-nfs-ambiguity`·`notification-chaos`·`jpa-next`), `release.yml`의 release lane과 이미지 job. `main.yml`의 `done`은 게이트가 아니다: nightly에 main에서 `:prCheck`를 한 번 더 돌려 빌드 캐시를 채우고, 같은 이름의 PR job이 그 캐시를 읽는다(setup-gradle이 job 이름으로 캐시를 찾는다). 도구를 내려받거나 runner 환경이 필요해 `verify.sh`에 넣지 않았다. 손으로 돌리는 법은 3절 (다)다. 게이트 하나씩: @@ -41,7 +41,7 @@ workflow에만 있는 job: `pr.yml` `done`의 마지막 step과 `main.yml`의 `v | `python3 scripts/check-docs.py` | 살아 있는 문서의 언어, 기록·ADR 머리 블록, 문서의 인라인 코드 경로·Gradle 경로가 지금 있는가, 복사한 숫자, 상대 링크(`docs/README.md` 「문서 검사」) | PR(`prCheck` 안) | `documentCheck` | | `mainCheck` | `configContractCheck` + `qualificationCheck`(`testQualityCheck` 포함) + 공개 경로 스냅숏 + 전송·메시징 qualification lane + 생성 명령 왕복(`verifyFeatureScaffold`) + 모든 leaf의 `mainCheck`(document-contract lane 등) | main | `main.yml` `main`: `./gradlew :mainCheck --continue` | | `integrationCheck` | 선언된 strict integration lane 전체(실 컨테이너). 입력이 없는 lane은 빼고 이름을 댄다 | main·nightly | `main.yml` `integration` | -| `performanceCheck` | 선언된 performance lane 전체(부하·종료·풀·자원 한계, 실 서버와 컨테이너). 상한을 매번 단언한다. 손으로 돌리든 workflow든 같은 상한이다 | nightly(다른 무거운 job 뒤) | `main.yml` `performance`. 5절 | +| `performanceCheck` | 선언된 performance lane 전체(부하·종료·풀·자원 한계, 실 서버와 컨테이너). 상한을 매번 단언한다. 손으로 돌리든 workflow든 같은 상한이다 | nightly(다른 무거운 job 뒤: 파일 맨 끝 job이고 runner 하나가 job을 만든 순서대로 돈다. `needs`는 쓰지 않는다 — Gitea 1.27이 `needs`와 `if`를 함께 가진 job을 Blocked에 둔다) | `main.yml` `performance`. 5절 | | `releaseCheck` | 릴리스 provenance + 공개 경로 스냅숏. 커밋을 `GITHUB_SHA`·`GIT_SHA`·`-PgitRevision=`로 받고, 없으면 설계대로 실패한다 | 태그 | `release.yml` `release` | | `:app-bootstrap:verifyEnvKeys` | env 키 레지스트리와 profile YAML·`.env.example` | `mainCheck` 안(`configContractCheck`) | build-logic `ca.config-contract` | | `verifyPublicPathSnapshot` | 기본 공개 경로가 `docs/security/public-paths-snapshot.txt`와 같은가 | `mainCheck`·`releaseCheck` 안 | `build.gradle` | -- 2.54.0 From 140530607066a4443b28c58bce9401f106cf774a Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Thu, 12 Nov 2026 01:32:11 +0900 Subject: [PATCH 14/22] =?UTF-8?q?fix(httpclient):=20HTTP/2=20=ED=98=91?= =?UTF-8?q?=EC=83=81=20=EC=8B=9C=ED=97=98=EC=9D=B4=20=EA=B3=B5=EC=9A=A9=20?= =?UTF-8?q?=ED=94=84=EB=A1=9C=ED=95=84=EC=9D=98=20=EC=A7=A7=EC=9D=80=20?= =?UTF-8?q?=EC=97=B0=EA=B2=B0=20=EC=A0=9C=ED=95=9C=EC=97=90=20=EA=B1=B8?= =?UTF-8?q?=EB=A6=AC=EC=A7=80=20=EC=95=8A=EB=8A=94=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제: NegotiatedProtocolContractTest의 JDK transport 시험 둘은 공용 시험 프로필 (연결 500ms, TLS 핸드셰이크 1s)을 그대로 쓴다. 부하가 높을 때 TLS 핸드셰이크와 ALPN이 그 안에 끝나지 않아 HttpConnectTimeoutException으로 실패한다. main push run 93(2026-11-11, spring70CompatibilityTest lane)과 desktop(부하 18~24, 2026-11-08)에서 봤다. 이 시험이 보는 것은 협상된 프로토콜이지 시간 예산이 아니다. 고른 방법: 두 시험만 넉넉한 TimeoutSettings(연결·핸드셰이크·헤더·유휴 10s, 전체 30s)를 쓴다. DNS 값은 플랫폼이 받는 유일한 값인 기본값으로 둔다. 시간 제한을 보는 다른 시험은 공용 프로필 그대로다. 위험·한계: 공용 프로필을 쓰는 다른 실서버 시험도 같은 부하에서 걸릴 수 있다. 관측된 것은 이 시험뿐이라 이것만 고쳤다. 검증: desktop mainCheck, runner main 수동 실행. --- .../NegotiatedProtocolContractTest.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/adapter/outbound/httpclient/src/test/java/dev/caskeleton/adapter/outbound/httpclient/contract/NegotiatedProtocolContractTest.java b/src/adapter/outbound/httpclient/src/test/java/dev/caskeleton/adapter/outbound/httpclient/contract/NegotiatedProtocolContractTest.java index 804e6db0..957cde6d 100644 --- a/src/adapter/outbound/httpclient/src/test/java/dev/caskeleton/adapter/outbound/httpclient/contract/NegotiatedProtocolContractTest.java +++ b/src/adapter/outbound/httpclient/src/test/java/dev/caskeleton/adapter/outbound/httpclient/contract/NegotiatedProtocolContractTest.java @@ -8,6 +8,7 @@ import dev.caskeleton.adapter.outbound.httpclient.api.error.HttpConfigurationExc import dev.caskeleton.adapter.outbound.httpclient.jdk.JdkClientFactory; import dev.caskeleton.adapter.outbound.httpclient.profile.ClientProfile; import dev.caskeleton.adapter.outbound.httpclient.profile.HttpProtocol; +import dev.caskeleton.adapter.outbound.httpclient.profile.TimeoutSettings; import dev.caskeleton.adapter.outbound.httpclient.profile.TransportType; import dev.caskeleton.adapter.outbound.httpclient.testkit.ClientProfiles; import dev.caskeleton.adapter.outbound.httpclient.testkit.MockHttpServer; @@ -17,6 +18,7 @@ import dev.caskeleton.adapter.outbound.httpclient.transport.TransportCapabilityV import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; +import java.time.Duration; import java.util.Optional; import java.util.Set; import org.junit.jupiter.api.Tag; @@ -36,6 +38,19 @@ import org.junit.jupiter.api.Test; @Tag("httpclient-contract") class NegotiatedProtocolContractTest { + // What these tests measure is the protocol, not a budget. The shared fixture profile allows + // 500 ms to connect and 1 s for the handshake, which a loaded CI runner missed (connect timeout, + // main push 2026-11-11; the desktop too under load 18-24 on 2026-11-08). The DNS budget stays + // the shipped default, the only value the platform accepts for it. + private static final TimeoutSettings OUT_OF_THE_WAY = + new TimeoutSettings( + TimeoutSettings.DEFAULT_DNS, + Duration.ofSeconds(10), + Duration.ofSeconds(10), + Duration.ofSeconds(10), + Duration.ofSeconds(10), + Duration.ofSeconds(30)); + @Test void theJdkTransportNegotiatesHttp2WhenTheProfileAsksForIt() throws Exception { TlsFixture fixture = TlsFixture.trusted(); @@ -44,6 +59,7 @@ class NegotiatedProtocolContractTest { ClientProfile profile = ClientProfiles.builder("h2") .baseUrl(server.uri("/")) + .timeout(OUT_OF_THE_WAY) .transport(TransportType.JDK) .protocols(Set.of(HttpProtocol.HTTP_2, HttpProtocol.HTTP_1_1)) .build(); @@ -70,6 +86,7 @@ class NegotiatedProtocolContractTest { ClientProfile profile = ClientProfiles.builder("h1") .baseUrl(server.uri("/")) + .timeout(OUT_OF_THE_WAY) .transport(TransportType.JDK) .protocols(Set.of(HttpProtocol.HTTP_1_1)) .build(); -- 2.54.0 From 7dbf11caf5db794f5febc6822550a1dade1ce10c Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Thu, 12 Nov 2026 01:34:40 +0900 Subject: [PATCH 15/22] =?UTF-8?q?ci(release):=20web=C2=B7WebSocket=C2=B7HT?= =?UTF-8?q?TP=20client=20release=20lane=EC=9D=84=20job=20=ED=95=98?= =?UTF-8?q?=EB=82=98=EB=A1=9C=20=ED=95=A9=EC=B9=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제: release 수동 실행(run 62)은 gate job 12개를 하나씩 돈다(runner capacity 1). web·websocket·httpclient 세 gate는 각각 2.4~3.2분인데 그중 약 2분이 checkout, JDK, Gradle 시작, 세 lane이 함께 쓰는 모듈의 컴파일이다. 고른 방법: `stable-release-gates` job 하나가 세 job의 태스크를 Gradle 한 번에 `--continue`로 돈다. 한 lane이 실패해도 나머지 lane의 결과가 나온다. app-image-release의 needs와 capability-status 문서의 job 이름을 맞춘다. 버린 대안: JPA·fileserver job까지 합치기. JpaReleaseRenderingTest가 PostgreSQL major마다 job 하나인 행렬을, FileserverDocumentationCoverageTest와 지원 문서가 fileserver job 이름을 근거로 읽는다. `--tests` 필터를 쓰는 jpa-registry-and-docs는 같은 Gradle 실행에 넣으면 필터가 다른 시험 태스크에도 걸린다. 위험·한계: 세 영역의 로그가 한 job에 섞인다. 실패한 lane 이름은 Gradle이 끝에 모아 적는다. 검증: runner release 수동 실행(이 PR 본문에 적는다). --- .gitea/workflows/release.yml | 39 +++++++++++++----------------------- docs/capability-status.md | 2 +- 2 files changed, 15 insertions(+), 26 deletions(-) diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index f879ade4..2b178cfc 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -38,38 +38,29 @@ jobs: - uses: ./.gitea/actions/setup-java-gradle - run: ./gradlew :releaseCheck - # Every web lane `check` cannot reach. webAdvancedTest selects tests `:web-advanced:test` already - # runs; what it adds is failing closed when its tag selects nothing. - web-stable-release-gate: + # The web, WebSocket and HTTP client release lanes, one Gradle run with --continue. They were three + # jobs, and each paid checkout, JDK, Gradle start and the compile of the modules it shares with the + # others (about two minutes of a 2.5-minute job, release run 62); --continue still reports every + # lane that fails. The JPA and fileserver jobs below stay jobs of their own: their names and the + # PostgreSQL matrix are what JpaReleaseRenderingTest and the fileserver support matrix read. + # webAdvancedTest selects tests `:web-advanced:test` already runs; what it adds is failing closed + # when its tag selects nothing. + stable-release-gates: runs-on: ubuntu-latest - timeout-minutes: 90 - steps: - - uses: https://github.com/actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # actions/checkout@v4.2.2 - - uses: ./.gitea/actions/setup-java-gradle - - run: ./gradlew :adapter:inbound:web:systemTest :adapter:inbound:web:webJettyCompatTest :adapter:inbound:web-advanced:webAdvancedTest - - websocket-stable-release-gate: - runs-on: ubuntu-latest - timeout-minutes: 60 + timeout-minutes: 120 steps: - uses: https://github.com/actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # actions/checkout@v4.2.2 - uses: ./.gitea/actions/setup-java-gradle - run: >- - ./gradlew + ./gradlew --continue + :adapter:inbound:web:systemTest + :adapter:inbound:web:webJettyCompatTest + :adapter:inbound:web-advanced:webAdvancedTest :adapter:inbound:websocket:test :adapter:inbound:websocket:systemTest :adapter:inbound:websocket:websocketJettyTest :adapter:inbound:websocket:websocketNginxTest :adapter:inbound:websocket:websocketTransportQualificationTest - - httpclient-release-gate: - runs-on: ubuntu-latest - timeout-minutes: 60 - steps: - - uses: https://github.com/actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # actions/checkout@v4.2.2 - - uses: ./.gitea/actions/setup-java-gradle - - run: >- - ./gradlew :adapter:outbound:httpclient:test :adapter:outbound:httpclient:spring62ApiSurfaceScan :adapter:outbound:httpclient:spring70CompatibilityTest @@ -149,9 +140,7 @@ jobs: app-image-release: needs: - release - - web-stable-release-gate - - websocket-stable-release-gate - - httpclient-release-gate + - stable-release-gates - httpclient-documentation - jpa-release-gate - jpa-registry-and-docs diff --git a/docs/capability-status.md b/docs/capability-status.md index 6c2b5cae..9e0706f1 100644 --- a/docs/capability-status.md +++ b/docs/capability-status.md @@ -41,7 +41,7 @@ lanes and CI; it is not a deployment artifact. | gRPC platform | — (separate repository) | no | **no** | no | Moved out on 2026-11-08 to the `grpc-library` repository (Maven group `dev.cakit.grpc`); this repository builds and tests none of it. `adapter:inbound:grpc` uses `io.grpc` directly and is unaffected. See `docs/work/reference/related-repos.md`. | | gRPC transport (`adapter:inbound:grpc`) | `app.grpc.server.enabled` / `APP_GRPC_SERVER_ENABLED`, `true` | yes | yes (one line: `runtimeOnly project(':adapter:inbound:grpc')`) | leaf-level | Own `AutoConfiguration.imports` (`GrpcServerConfig`); on when present, and the loopback plaintext listener still needs `app.grpc.server.allow-insecure-local=true` (`GrpcSafeActivationTest`, `grpcTransportQualificationTest`). | | WebSocket transport | `app.websocket.enabled` / `APP_WEBSOCKET_ENABLED`, `true` | yes | yes (one line: `runtimeOnly project(':adapter:inbound:websocket')`) | — | Own `AutoConfiguration.imports` (`WebSocketConfig`), on in a servlet app when present (`WebSocketAutoConfigurationTest`); `ConditionalTransportBuildContractTest` asserts it has no default production edge. | -| Web Advanced library (`adapter:inbound:web-advanced`) | — (build-level; three `backend.web.advanced.*.enabled` switches inside) | yes | **no** | — | No composition root depends on it; `app-bootstrap` takes it `testRuntimeOnly` for the ArchUnit import. No real-provider lane: `webAdvancedTest` (the `web-advanced` tag, run by `release.yml` → `web-stable-release-gate`) is unit and context-runner level. The Nginx lane went with the proxy library on 2026-09-25. | +| Web Advanced library (`adapter:inbound:web-advanced`) | — (build-level; three `backend.web.advanced.*.enabled` switches inside) | yes | **no** | — | No composition root depends on it; `app-bootstrap` takes it `testRuntimeOnly` for the ArchUnit import. No real-provider lane: `webAdvancedTest` (the `web-advanced` tag, run by `release.yml` → `stable-release-gates`) is unit and context-runner level. The Nginx lane went with the proxy library on 2026-09-25. | ## Reading the "no" rows -- 2.54.0 From 2c180b90595e8d312da974997a49fe27ca25eeeb Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Thu, 12 Nov 2026 01:37:37 +0900 Subject: [PATCH 16/22] =?UTF-8?q?ci(main):=20main=EA=B3=BC=20integration?= =?UTF-8?q?=20=EB=8B=A8=EA=B3=84=EB=A5=BC=20job=20=ED=95=98=EB=82=98,=20Gr?= =?UTF-8?q?adle=20=EC=8B=A4=ED=96=89=20=ED=95=9C=20=EB=B2=88=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=EB=8F=88=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제: main push는 `main`(17.1분)과 `integration`(17.4분) 두 job을 차례로 돈다 (run 79, runner capacity 1). 두 job이 같은 모듈을 각자 설정·컴파일하고, integration의 컨테이너 lane은 실서버 슬롯(ExclusiveRealServerLaneService) 하나를 차례로 쓰는 동안 나머지 worker가 놀고, main의 분석(testQualityCheck, 생성 명령 왕복의 안쪽 빌드)은 다른 job이라 그 시간에 겹치지 못한다. 고른 방법: `./gradlew :mainCheck :integrationCheck --continue` 한 줄을 `main` job이 돈다. strict lane 단계 선언에 `line`을 더해, 같은 job을 쓰는 단계가 선언한 한 줄을 나눠 쓸 수 있게 한다. 「단계마다 정해진 한 줄」 규칙은 그대로다: 두 단계 모두 그 정확한 줄을 요구하고, line에는 태스크 경로만 쓸 수 있고 자기 단계를 빼면 설정 단계에서 거절한다(TestKit 시험 셋). scripts/verify.sh의 main 단계도 같은 줄을 쓴다. 버린 대안: 한 job에 두 줄을 차례로 두기. mainCheck가 실패하면 integration이 돌지 않는다. 실서버 슬롯을 둘로 늘리기. 시간에 민감한 lane이 서로 겹쳐 불안정해진다 (그 서비스가 생긴 이유). 위험·한계: 컨테이너 lane이 main 단계의 CPU 작업과 겹친다. 시간에 민감한 system lane은 지금도 main 단계 안에서 같은 겹침을 견디고, integration lane은 대부분 컨테이너 계약이다. 한 job이 길어져(예상 22~25분) timeout을 240분으로 둔다. 검증: build-logic 시험(desktop), verifyStrictLaneStages --dry-run, runner main 수동 실행의 main job 시간(이 PR 본문에 적는다). --- .gitea/workflows/main.yml | 34 ++++------ build-logic/AGENTS.md | 2 +- .../strictlane/StrictLaneStagesExtension.java | 19 ++++-- .../StrictLaneStagesFunctionalTest.java | 66 +++++++++++++++++++ build.gradle | 10 ++- docs/ci-cd/template-vs-consumer.md | 2 +- docs/work/reference/gates.md | 6 +- scripts/verify.sh | 3 +- 8 files changed, 108 insertions(+), 34 deletions(-) diff --git a/.gitea/workflows/main.yml b/.gitea/workflows/main.yml index bb370d42..4c48b774 100644 --- a/.gitea/workflows/main.yml +++ b/.gitea/workflows/main.yml @@ -4,12 +4,13 @@ # On every push to main: the main stage, the container lanes, the build-logic tests, configuration # cache, links and the dependency scan. Nightly (and on a manual run) also the jobs that need a matrix # or an environment the stage tasks do not have, and last the performance lanes, which need a -# machine nothing else is using: the runner takes one job at a time, and `needs` puts them after -# every other heavy job (owner decision 2026-11-07). +# machine nothing else is using: the runner takes one job at a time, and the performance job is the +# last one in this file (owner decision 2026-11-07; the job says why not `needs`). # -# Which lanes a stage means is decided by its Gradle task (build.gradle). The stage jobs -# (`main`, `integration`, `performance`) run it as one line; `verifyStrictLaneStages` fails a pull -# request that changes that line, its condition, or adds a way for it to pass quietly. +# Which lanes a stage means is decided by its Gradle task (build.gradle). The stage jobs (`main` +# for the main and integration stages, `performance`) run them as one line; +# `verifyStrictLaneStages` fails a pull request that changes that line, its condition, or adds a +# way for it to pass quietly. name: main on: @@ -37,27 +38,20 @@ env: TESTCONTAINERS_REUSE_ENABLE: "false" jobs: - # Environment contract, full-boot qualification, public-path baseline, transport and messaging - # qualification, document-contract lanes, test-code analysis, the feature generator round trip. - # `--continue`: one failed lane must not hide the others. + # Both main-branch stages in one Gradle run (build.gradle `strictLaneStages` says why). + # mainCheck: environment contract, full-boot qualification, public-path baseline, transport and + # messaging qualification, document-contract lanes, test-code analysis, the feature generator + # round trip. integrationCheck: every integration-category strict lane, against real PostgreSQL, + # MongoDB, Kafka, MinIO, nginx and Toxiproxy; a lane joins by declaring `integration()`, no line + # here names it, and lanes that need an input this job does not have are explicitOnly and named + # in the output. `--continue`: one failed lane must not hide the others. main: - runs-on: ubuntu-latest - timeout-minutes: 120 - steps: - - uses: https://github.com/actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # actions/checkout@v4.2.2 - - uses: ./.gitea/actions/setup-java-gradle - - run: ./gradlew :mainCheck --continue - - # Every integration-category strict lane: real PostgreSQL, MongoDB, Kafka, MinIO, nginx, Toxiproxy. - # A lane joins by declaring `integration()`; no line here names it. Lanes that need an input this - # job does not have are explicitOnly and named in the output. - integration: runs-on: ubuntu-latest timeout-minutes: 240 steps: - uses: https://github.com/actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # actions/checkout@v4.2.2 - uses: ./.gitea/actions/setup-java-gradle - - run: ./gradlew :integrationCheck --continue + - run: ./gradlew :mainCheck :integrationCheck --continue # The included build's own tests (TestKit for the convention plugins). The main task graph does # not reach them; `ci` already runs every plugin they test (owner decision 2026-11-07: main stage). diff --git a/build-logic/AGENTS.md b/build-logic/AGENTS.md index 10d81125..85a4cb4c 100644 --- a/build-logic/AGENTS.md +++ b/build-logic/AGENTS.md @@ -26,7 +26,7 @@ registry, settings, build-logic, 루트 라이프사이클이 정하는 것을 ## 단계 job의 모양 - `verifyStrictLaneStages --dry-run`(PR)은 `explicitOnly`가 아닌 strict lane마다 `build.gradle`의 `strictLaneStages`가 선언한 단계 태스크 하나의 계획에 들어 있는지 본다(그래프 검사). -- 단계마다 선언한 workflow job은 step의 `run: ./gradlew <단계> <옵션>` 줄을 가지고, 다른 step `run:`도 셸 문법 없는 `./gradlew` 한 줄이나 `bash scripts/<이름>.sh` 한 줄이며, 선언 밖의 `if:`, 선언한 조건이 `!cancelled()`·`always()`가 아닌데 `needs:`, `continue-on-error`·`shell:`·`defaults:`, 따옴표 키·flow 형식, 이 빌드 밖의 `working-directory`가 없다. workflow는 선언한 이벤트로, 선언한 필터 한 줄만 달고 시작하고, PR 단계 job 하나가 이 검사를 돌린다(형식 검사, 셸을 해석하지 않는다). +- 단계마다 선언한 workflow job은 step의 `run: ./gradlew <단계> <옵션>` 줄을 가지고(같은 job을 쓰는 단계는 선언한 `line`대로 한 줄을 나눠 쓸 수 있다: `./gradlew :mainCheck :integrationCheck --continue`), 다른 step `run:`도 셸 문법 없는 `./gradlew` 한 줄이나 `bash scripts/<이름>.sh` 한 줄이며, 선언 밖의 `if:`, 선언한 조건이 `!cancelled()`·`always()`가 아닌데 `needs:`, `continue-on-error`·`shell:`·`defaults:`, 따옴표 키·flow 형식, 이 빌드 밖의 `working-directory`가 없다. workflow는 선언한 이벤트로, 선언한 필터 한 줄만 달고 시작하고, PR 단계 job 하나가 이 검사를 돌린다(형식 검사, 셸을 해석하지 않는다). - 단계를 더하거나 job을 바꾸면 `strictLaneStages`의 `stage` 줄과 workflow를 같은 커밋에서 고친다. ## 테스트 diff --git a/build-logic/src/main/java/dev/caskeleton/buildlogic/strictlane/StrictLaneStagesExtension.java b/build-logic/src/main/java/dev/caskeleton/buildlogic/strictlane/StrictLaneStagesExtension.java index 3cd5c32c..1aa3c22e 100644 --- a/build-logic/src/main/java/dev/caskeleton/buildlogic/strictlane/StrictLaneStagesExtension.java +++ b/build-logic/src/main/java/dev/caskeleton/buildlogic/strictlane/StrictLaneStagesExtension.java @@ -21,7 +21,10 @@ import org.gradle.api.file.DirectoryProperty; * } *
  • * - *

    The job runs the stage as {@code ./gradlew } on a line of its own. {@code + *

    The job runs the stage as {@code ./gradlew } on a line of its own. Stages + * that share a job may share that line: each then declares the same {@code line}, the stage tasks + * in the order the line names them, and the line is {@code ./gradlew }. One Gradle + * run compiles once and lets the stages' work overlap. {@code * filter} is the one line under the event (none if absent; a schedule takes its cron lines), and * {@code condition} is the job's {@code if:}: both are written out here so that changing when a * stage runs is a reviewed change of the build rather than an edit to a workflow. Single quotes, @@ -45,7 +48,14 @@ public abstract class StrictLaneStagesExtension { job.get("filter"), required(job, "job", taskPath), job.getOrDefault("options", ""), - job.get("condition")); + job.get("condition"), + job.getOrDefault("line", taskPath)); + List lineTasks = List.of(stage.line().split(" ", -1)); + if (!lineTasks.contains(taskPath) + || !lineTasks.stream().allMatch(task -> task.startsWith(":") && task.length() > 1)) { + throw new GradleException( + "stage " + taskPath + ": line '" + stage.line() + "' must name task paths, this one too"); + } for (String option : stage.options().split(" ", -1)) { if (!option.isEmpty() && !STAGE_OPTIONS.contains(option)) { throw new GradleException( @@ -75,9 +85,10 @@ public abstract class StrictLaneStagesExtension { String filter, String job, String options, - String condition) { + String condition, + String line) { String command() { - return options.isEmpty() ? "./gradlew " + taskPath : "./gradlew " + taskPath + " " + options; + return options.isEmpty() ? "./gradlew " + line : "./gradlew " + line + " " + options; } } } diff --git a/build-logic/src/test/java/dev/caskeleton/buildlogic/strictlane/StrictLaneStagesFunctionalTest.java b/build-logic/src/test/java/dev/caskeleton/buildlogic/strictlane/StrictLaneStagesFunctionalTest.java index 373b7e95..3c140e24 100644 --- a/build-logic/src/test/java/dev/caskeleton/buildlogic/strictlane/StrictLaneStagesFunctionalTest.java +++ b/build-logic/src/test/java/dev/caskeleton/buildlogic/strictlane/StrictLaneStagesFunctionalTest.java @@ -358,6 +358,54 @@ class StrictLaneStagesFunctionalTest { assertThat(result.getOutput()).contains("run it with --dry-run"); } + @Test + @DisplayName("같은 job을 쓰는 두 단계는 선언한 line대로 한 줄을 나눠 쓸 수 있다") + void twoStagesOfOneJobMayShareTheLineTheyDeclare() throws Exception { + // given + shareTheIntegrationLineWithAMainStage(":mainCheck :integrationCheck"); + workflow( + "main.yml", + MAIN_WORKFLOW.replace( + "run: ./gradlew :integrationCheck --continue", + "run: ./gradlew :mainCheck :integrationCheck --continue")); + + // when + BuildResult result = runner(":verifyStrictLaneStages", "--dry-run").build(); + + // then + assertThat(result.getOutput()).contains("every strict lane is in a stage its workflow job runs"); + } + + @Test + @DisplayName("선언한 한 줄 대신 단계마다 따로 된 줄이 있으면 두 단계 모두 실패한다") + void aSharedLineDeclaredButNotRunFailsBothStages() throws Exception { + // given + shareTheIntegrationLineWithAMainStage(":mainCheck :integrationCheck"); + + // when + BuildResult result = runner(":verifyStrictLaneStages", "--dry-run").buildAndFail(); + + // then + assertThat(result.getOutput()) + .contains( + "main.yml job integration has no line `run: ./gradlew :mainCheck :integrationCheck" + + " --continue`"); + } + + @Test + @DisplayName("단계 자신을 부르지 않는 line은 설정 단계에서 거절한다") + void refusesALineThatLeavesItsOwnStageOut() throws Exception { + // given + shareTheIntegrationLineWithAMainStage(":mainCheck"); + + // when + BuildResult result = runner(":verifyStrictLaneStages", "--dry-run").buildAndFail(); + + // then + assertThat(result.getOutput()) + .contains("stage :integrationCheck: line ':mainCheck' must name task paths, this one too"); + } + @Test @DisplayName("단계 줄의 옵션이 정해진 것 밖이면 설정 단계에서 거절한다") void refusesAStageOptionThatChangesWhatRuns() throws Exception { @@ -435,6 +483,24 @@ class StrictLaneStagesFunctionalTest { .formatted(lanes)); } + /** Declares a `:mainCheck` stage on the integration job, both stages naming {@code line}. */ + private void shareTheIntegrationLineWithAMainStage(String line) throws Exception { + Files.writeString( + gradleRoot.resolve("build.gradle"), + Files.readString(gradleRoot.resolve("build.gradle")) + .replace( + "tasks.register('integrationCheck')", + "tasks.register('mainCheck')\ntasks.register('integrationCheck')") + .replace( + "job: 'integration', options: '--continue', condition: '${{ !cancelled() }}'", + "job: 'integration', options: '--continue', condition: '${{ !cancelled() }}'," + + " line: ':mainCheck :integrationCheck'\n" + + " stage ':mainCheck', workflow: 'main.yml', event: 'push'," + + " filter: 'branches: [main]', job: 'integration', options: '--continue'," + + " condition: '${{ !cancelled() }}', line: ':mainCheck :integrationCheck'") + .replace("line: ':mainCheck :integrationCheck'\n", "line: '" + line + "'\n")); + } + private void workflow(String name, String content) throws Exception { Files.writeString(repository.resolve(".gitea/workflows").resolve(name), content); } diff --git a/build.gradle b/build.gradle index fd8da614..8df4fdb1 100644 --- a/build.gradle +++ b/build.gradle @@ -243,10 +243,14 @@ tasks.register('prCheck') { strictLaneStages { workflowDirectory = layout.projectDirectory.dir('.gitea/workflows') stage ':prCheck', workflow: 'pr.yml', event: 'pull_request', job: 'done' + // One job and one Gradle run for both main-branch stages: it compiles once, and the + // main stage's analysis and the feature generator's nested build run while the integration + // lanes take turns on the one real-server slot. Two jobs spent about 34 runner minutes on a push + // (run 79), two of them compiling the same modules twice. 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' + options: '--continue', line: ':mainCheck :integrationCheck' + stage ':integrationCheck', workflow: 'main.yml', event: 'push', filter: 'branches: [main]', job: 'main', + options: '--continue', line: ':mainCheck :integrationCheck' stage ':performanceCheck', workflow: 'main.yml', event: 'schedule', job: 'performance', options: '--continue', condition: '${{ github.event_name != \'push\' }}' stage ':releaseCheck', workflow: 'release.yml', event: 'push', filter: 'tags: ["v*"]', job: 'release' diff --git a/docs/ci-cd/template-vs-consumer.md b/docs/ci-cd/template-vs-consumer.md index cafd9cde..3cb6295a 100644 --- a/docs/ci-cd/template-vs-consumer.md +++ b/docs/ci-cd/template-vs-consumer.md @@ -29,7 +29,7 @@ | `configContractCheck` | 환경변수 계약 | | `verifyDependencyLocks` | 재현 가능한 의존성 해석 | | `pr.yml`(`./gradlew :prCheck`, 필수 검사 `pr / done`) | PR 단계. 무엇을 돌리는지는 Gradle 태스크 `prCheck`가 정한다 | -| `main.yml`의 `main`·`integration`·`build-logic`·`configuration-cache` job | main 단계(`mainCheck`, `integrationCheck`) | +| `main.yml`의 `main`(두 단계를 한 줄로)·`build-logic`·`configuration-cache` job | main 단계(`mainCheck`, `integrationCheck`) | | `main.yml`의 `performance` job | nightly 성능 단계(`performanceCheck`) | | `pr.yml` `done`의 Trivy step과 `main.yml`의 `vulnerabilities` job(`scripts/ci/trivy-scan.sh`) | Trivy와 CISA KEV | | `release.yml` | `releaseCheck`, 이미지 · SBOM · 서명 | diff --git a/docs/work/reference/gates.md b/docs/work/reference/gates.md index 68a9885c..1e76a01a 100644 --- a/docs/work/reference/gates.md +++ b/docs/work/reference/gates.md @@ -17,7 +17,7 @@ Gradle 명령과 `scripts/verify.sh`는 모두 저장소 루트(Gradle 루트) | `docs` | `check-work-docs.py`, `check-docs.py`, `scripts/tests` 자기 시험, `check-repo-layout.py`(Gradle 없음, 노트북 가능) | `pr.yml`의 `prCheck` 안 | | `leaf ` | 그 leaf의 `check` | — | | `pr` | `./gradlew :prCheck`, `./gradlew :verifyStrictLaneStages --dry-run` | `pr.yml` `done` | -| `main` | `:mainCheck --continue`, `:integrationCheck --continue`, `-p build-logic test`, `scripts/ci/verify-configuration-cache.sh` | `main.yml`(push) | +| `main` | `:mainCheck :integrationCheck --continue`, `-p build-logic test`, `scripts/ci/verify-configuration-cache.sh` | `main.yml`(push) | | `nightly` | compose smoke 전부, 마지막에 `:performanceCheck --continue` | `main.yml`(schedule·수동) | | `release` | `:releaseCheck`(지금 커밋을 provenance로) | `release.yml` `release` | | `app` | `scripts/bootstrap-local.sh`(앱을 띄워 health와 기본 endpoint 확인) | — | @@ -39,8 +39,8 @@ workflow에만 있는 job: `pr.yml` `done`의 마지막 step과 `main.yml`의 `v | `verifyStrictLaneStages --dry-run` | `explicitOnly`가 아닌 strict lane이 단계 태스크 하나의 계획에 들어 있는가(그래프 검사), 단계마다 선언한 workflow job이 `./gradlew <단계>` 한 줄을 정해진 조건으로 돌리는가(형식 검사) | PR | `pr.yml` `done` 둘째 줄. 형식은 `build-logic/AGENTS.md` | | `python3 scripts/check-repo-layout.py` | 저장소 루트와 `src/` 최상위에 허용 목록 밖의 항목이 없는가, registry 경로가 허용 폴더 안인가. 아무도 가리키지 않는 compose·스크립트 파일은 경고 | PR(`prCheck` 안) | `verifyRepositoryLayout` | | `python3 scripts/check-docs.py` | 살아 있는 문서의 언어, 기록·ADR 머리 블록, 문서의 인라인 코드 경로·Gradle 경로가 지금 있는가, 복사한 숫자, 상대 링크(`docs/README.md` 「문서 검사」) | PR(`prCheck` 안) | `documentCheck` | -| `mainCheck` | `configContractCheck` + `qualificationCheck`(`testQualityCheck` 포함) + 공개 경로 스냅숏 + 전송·메시징 qualification lane + 생성 명령 왕복(`verifyFeatureScaffold`) + 모든 leaf의 `mainCheck`(document-contract lane 등) | main | `main.yml` `main`: `./gradlew :mainCheck --continue` | -| `integrationCheck` | 선언된 strict integration lane 전체(실 컨테이너). 입력이 없는 lane은 빼고 이름을 댄다 | main·nightly | `main.yml` `integration` | +| `mainCheck` | `configContractCheck` + `qualificationCheck`(`testQualityCheck` 포함) + 공개 경로 스냅숏 + 전송·메시징 qualification lane + 생성 명령 왕복(`verifyFeatureScaffold`) + 모든 leaf의 `mainCheck`(document-contract lane 등) | main | `main.yml` `main`: `./gradlew :mainCheck :integrationCheck --continue` | +| `integrationCheck` | 선언된 strict integration lane 전체(실 컨테이너). 입력이 없는 lane은 빼고 이름을 댄다 | main·nightly | `main.yml` `main`: `./gradlew :mainCheck :integrationCheck --continue`(두 단계를 Gradle 한 번에. 한 번 컴파일하고, 직렬 lane이 도는 동안 나머지가 겹친다) | | `performanceCheck` | 선언된 performance lane 전체(부하·종료·풀·자원 한계, 실 서버와 컨테이너). 상한을 매번 단언한다. 손으로 돌리든 workflow든 같은 상한이다 | nightly(다른 무거운 job 뒤: 파일 맨 끝 job이고 runner 하나가 job을 만든 순서대로 돈다. `needs`는 쓰지 않는다 — Gitea 1.27이 `needs`와 `if`를 함께 가진 job을 Blocked에 둔다) | `main.yml` `performance`. 5절 | | `releaseCheck` | 릴리스 provenance + 공개 경로 스냅숏. 커밋을 `GITHUB_SHA`·`GIT_SHA`·`-PgitRevision=`로 받고, 없으면 설계대로 실패한다 | 태그 | `release.yml` `release` | | `:app-bootstrap:verifyEnvKeys` | env 키 레지스트리와 profile YAML·`.env.example` | `mainCheck` 안(`configContractCheck`) | build-logic `ca.config-contract` | diff --git a/scripts/verify.sh b/scripts/verify.sh index bb816b03..6d5d386d 100755 --- a/scripts/verify.sh +++ b/scripts/verify.sh @@ -71,8 +71,7 @@ run_pr() { } run_main() { - gradle :mainCheck --continue - gradle :integrationCheck --continue + gradle :mainCheck :integrationCheck --continue gradle -p build-logic test bash scripts/ci/verify-configuration-cache.sh } -- 2.54.0 From 24dde5867d1f924445318d409f791d7e2da12dbb Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Thu, 12 Nov 2026 01:37:54 +0900 Subject: [PATCH 17/22] =?UTF-8?q?docs(capability):=20=EC=BB=A8=ED=85=8C?= =?UTF-8?q?=EC=9D=B4=EB=84=88=20lane=EC=9D=84=20=EB=8F=8C=EB=A6=AC?= =?UTF-8?q?=EB=8A=94=20job=20=EC=9D=B4=EB=A6=84=EC=9D=84=20=EC=A7=80?= =?UTF-8?q?=EA=B8=88=20workflow=EC=97=90=20=EB=A7=9E=EC=B6=98=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit capability-status의 네 행이 2026-11-08에 지운 integration-main.yml의 integration-check job을 가리켰다. 지금은 main.yml의 main job이 :integrationCheck를 돈다. --- docs/capability-status.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/capability-status.md b/docs/capability-status.md index 9e0706f1..3fcaf608 100644 --- a/docs/capability-status.md +++ b/docs/capability-status.md @@ -27,15 +27,15 @@ lanes and CI; it is not a deployment artifact. | Capability | Enabled key (property / env, default) | IMPLEMENTED | WIRED | QUALIFIED | Evidence | | --- | --- | --- | --- | --- | --- | -| Relational persistence (JPA/PostgreSQL) | `ca-skeleton.persistence-jpa.enabled` / `APP_PERSISTENCE_JPA_ENABLED`, `true` | yes | yes (one line: `runtimeOnly project(':adapter:outbound:persistence-jpa')`) | yes | Not in the default composition. The one line brings everything — its own `AutoConfiguration.imports` (`PersistenceJpaAutoConfiguration`, `PersistenceJpaRuntimeConfig`, `JpaStartupAutoConfiguration`), its environment handling (`JpaActivationEnvironmentPostProcessor`, `spring.factories`: readiness `db` while on; with `false` it also excludes Boot's JDBC, Hibernate, Spring Data JPA and Flyway auto-configuration, so no DataSource is bound), the startup guards (Flyway strategy, datasource/OSIV/DDL/pool/TLS/vendor checks, exit codes unchanged) and its settings (`config/module-defaults/persistence-jpa.yml`). `persistence-jpa:PersistenceJpaCapabilityAssemblyTest` proves the module assembles on its own; the `postgresql*IntegrationTest` readiness lanes, run by `integration-main.yml` → `integration-check` (`:integrationCheck`), qualify it against PostgreSQL. `bootRunH2` adds the module to its own classpath only. | -| Document persistence (MongoDB) | `ca-skeleton.persistence-mongo.enabled` / `APP_PERSISTENCE_MONGO_ENABLED`, `true` | yes | yes (one line: `runtimeOnly project(':adapter:outbound:persistence-mongo')`) | yes | On when present; `false` also excludes Boot's Mongo auto-configuration (`MongoCapabilityActivationTest`). The connection-source rule (`SPRING_MONGODB_URI` or the selected profile's `uri-secret`) is checked by the module's own `MongoDefaultsEnvironmentPostProcessor`. Six container lanes (`mongoReplicaSetTest`, `mongoFailoverTest`, …), run by `integration-main.yml` → `integration-check` (`:integrationCheck`) | +| Relational persistence (JPA/PostgreSQL) | `ca-skeleton.persistence-jpa.enabled` / `APP_PERSISTENCE_JPA_ENABLED`, `true` | yes | yes (one line: `runtimeOnly project(':adapter:outbound:persistence-jpa')`) | yes | Not in the default composition. The one line brings everything — its own `AutoConfiguration.imports` (`PersistenceJpaAutoConfiguration`, `PersistenceJpaRuntimeConfig`, `JpaStartupAutoConfiguration`), its environment handling (`JpaActivationEnvironmentPostProcessor`, `spring.factories`: readiness `db` while on; with `false` it also excludes Boot's JDBC, Hibernate, Spring Data JPA and Flyway auto-configuration, so no DataSource is bound), the startup guards (Flyway strategy, datasource/OSIV/DDL/pool/TLS/vendor checks, exit codes unchanged) and its settings (`config/module-defaults/persistence-jpa.yml`). `persistence-jpa:PersistenceJpaCapabilityAssemblyTest` proves the module assembles on its own; the `postgresql*IntegrationTest` readiness lanes, run by `main.yml` → `main` (`:integrationCheck`), qualify it against PostgreSQL. `bootRunH2` adds the module to its own classpath only. | +| Document persistence (MongoDB) | `ca-skeleton.persistence-mongo.enabled` / `APP_PERSISTENCE_MONGO_ENABLED`, `true` | yes | yes (one line: `runtimeOnly project(':adapter:outbound:persistence-mongo')`) | yes | On when present; `false` also excludes Boot's Mongo auto-configuration (`MongoCapabilityActivationTest`). The connection-source rule (`SPRING_MONGODB_URI` or the selected profile's `uri-secret`) is checked by the module's own `MongoDefaultsEnvironmentPostProcessor`. Six container lanes (`mongoReplicaSetTest`, `mongoFailoverTest`, …), run by `main.yml` → `main` (`:integrationCheck`) | | Messaging (Kafka) | `app.messaging.enabled` / `APP_MESSAGING_ENABLED`, `true` | yes | yes (one line: `runtimeOnly project(':adapter:outbound:messaging-kafka')`, which brings the application bridge and the messaging library `dev.cakit.messaging` (messaging-library repo, catalog `messagingLibrary`) with its Kafka transport) | Kafka only | On when present (`KafkaCapabilityActivationTest`). The application's own publish and consume paths run against a live Kafka in `messagingKafkaRelayIntegrationTest` and `messagingInboxRedeliveryIntegrationTest`. The library's broker certification (`verifyMessagingCertificationEvidence`) runs in the messaging-library repo's main stage since 2026-11-08. Kafka is the only registered broker; the RabbitMQ broker keys were removed (no transport). | | Redis capabilities (cache / rate-limit / lease / idempotency) | `app.redis.enabled` / `APP_REDIS_ENABLED`, `true` | yes | yes (one line: `runtimeOnly project(':adapter:outbound:cache-redis')`, which brings `redis-runtime`) | yes | `cache-redis:redisContainerContractTest` (Testcontainers Redis, `integrationCheck`); `cache-redis:redisTopologyTest`, run by `redis-sdk-topology.yml`. Not in the default composition. On when present; `false` contributes no Redis bean — no settings, client, connection, thread or health contributor. The module owns its readiness contribution (`RedisReadinessGroupPostProcessor`, `spring.factories`) and its settings (`config/module-defaults/cache-redis.yml`: `app.redis.enabled`, `app.rate-limit.*`, the Redis `ca-skeleton.capabilities.*`). No `app-bootstrap` main source names a Redis type. | -| Request idempotency | `APP_IDEMPOTENCY_PROVIDER` (`disabled` \| `redis` \| `postgresql`; a selector, not an on/off key) | yes | yes | Redis and PostgreSQL | One generation: the application `IdempotencyExecutor`, built once by `composition:idempotency` (`IdempotencyAutoConfiguration`) over the one store the selected provider contributes (`cache-redis` or `persistence-jpa`); startup is refused unless exactly one store exists. `app-bootstrap`이 그 모듈을 `runtimeOnly` 한 줄로 받고, 다른 조립은 없다. Redis is covered by the row above. PostgreSQL has `persistence-jpa:postgresqlIdempotencyIntegrationTest`, run by `integration-main.yml` → `integration-check` (`:integrationCheck`). The `postgresql` provider refuses a non-PostgreSQL data source, so `bootRunH2` uses `disabled` or `redis`. Each store comes with its module: `postgresql` needs the persistence-jpa line, `redis` the cache-redis one. | +| Request idempotency | `APP_IDEMPOTENCY_PROVIDER` (`disabled` \| `redis` \| `postgresql`; a selector, not an on/off key) | yes | yes | Redis and PostgreSQL | One generation: the application `IdempotencyExecutor`, built once by `composition:idempotency` (`IdempotencyAutoConfiguration`) over the one store the selected provider contributes (`cache-redis` or `persistence-jpa`); startup is refused unless exactly one store exists. `app-bootstrap`이 그 모듈을 `runtimeOnly` 한 줄로 받고, 다른 조립은 없다. Redis is covered by the row above. PostgreSQL has `persistence-jpa:postgresqlIdempotencyIntegrationTest`, run by `main.yml` → `main` (`:integrationCheck`). The `postgresql` provider refuses a non-PostgreSQL data source, so `bootRunH2` uses `disabled` or `redis`. Each store comes with its module: `postgresql` needs the persistence-jpa line, `redis` the cache-redis one. | | Transactional outbox relay | `ca-skeleton.outbox.enabled` / `APP_OUTBOX_ENABLED`, `false` (+ `APP_OUTBOX_RELAY_ENABLED`, `false`; persistence-jpa settings) | yes | yes (with the persistence-jpa line; the scheduler also needs the messaging-kafka line) | yes | The store and its settings are persistence-jpa's; the relay (`OutboxConfig`) is application composition in `app-bootstrap` because a driven adapter must not build or call a use case. It turns on only when an `OutboxStorePort` bean exists, and the scheduler only when an `OutboxMessagePublishPort` does (the messaging bridge), each ordered after its contributor by `afterName` — so an environment with no publisher keeps its PENDING rows. The bridge registers no stand-in publisher: a present-and-enabled bridge with a blank broker and no canonical transport is refused at startup. `postgresqlLegacyOutboxConcurrentRelayIntegrationTest` qualifies claim/fencing against PostgreSQL. | | Notification platform | `ca-skeleton.notification.platform.enabled` / `APP_NOTIFICATION_PLATFORM_ENABLED`, `true` | yes | yes (one line: `runtimeOnly project(':composition:notification-platform')`, plus the persistence-jpa line) | claim-scoped | Not in the default composition. The one line brings the use-case assembly, `adapter:outbound:notification`, the HTTP surface `adapter:inbound:web-notification` and its own settings (`config/module-defaults/notification.yml`), each registered through the module's own `AutoConfiguration.imports`; `adapter:inbound:web` no longer depends on `application-notification`. `verifyNotificationEvidence` refuses a grade in `docs/notification/support-matrix.md` that no proven claim backs; run by `notification-platform.yml`. There is no real-SMTP lane, and the matrix says so rather than implying one. | -| File server platform | `app.fileserver-platform.enabled` / `APP_FILESERVER_PLATFORM_ENABLED`, `true` | yes | yes (one line: `runtimeOnly project(':composition:fileserver-platform')`, plus the persistence-jpa line) | yes | On when present; module-owned `config/module-defaults/fileserver.yml` also carries the servlet multipart ceiling. `app-bootstrap:integrationTest` → `FileserverCompositionIntegrationTest` (required by the strict lane), run by `integration-main.yml` → `integration-check` (`:integrationCheck`) | -| Outbound HTTP client | `app.httpclient.enabled` / `APP_HTTPCLIENT_ENABLED`, `true` | yes | yes (one line: `runtimeOnly project(':adapter:outbound:httpclient')`) | yes | On when present (`HttpClientPlatformActivationTest`). `httpclient:httpClientFailureInjectionTest` against a faulted upstream, run by `integration-main.yml` → `integration-check` (`:integrationCheck`) | +| File server platform | `app.fileserver-platform.enabled` / `APP_FILESERVER_PLATFORM_ENABLED`, `true` | yes | yes (one line: `runtimeOnly project(':composition:fileserver-platform')`, plus the persistence-jpa line) | yes | On when present; module-owned `config/module-defaults/fileserver.yml` also carries the servlet multipart ceiling. `app-bootstrap:integrationTest` → `FileserverCompositionIntegrationTest` (required by the strict lane), run by `main.yml` → `main` (`:integrationCheck`) | +| Outbound HTTP client | `app.httpclient.enabled` / `APP_HTTPCLIENT_ENABLED`, `true` | yes | yes (one line: `runtimeOnly project(':adapter:outbound:httpclient')`) | yes | On when present (`HttpClientPlatformActivationTest`). `httpclient:httpClientFailureInjectionTest` against a faulted upstream, run by `main.yml` → `main` (`:integrationCheck`) | | GraphQL transport | `backend.graphql.enabled` / `APP_GRAPHQL_ENABLED`, `true` | yes | yes (one line: `runtimeOnly project(':adapter:inbound:graphql')`) | leaf-level | On when present; `false` also excludes Spring GraphQL's own auto-configuration, so no `/graphql` (`GraphQlCapabilityActivationTest`). `graphqlTransportQualificationTest` runs the HTTP boundary. The deployment-mode/runtime-profile rule is the module's own `GraphQlPlatformStartupValidator`. The default jar does not ship GraphQL, so a compose lane that exercises it runs the qualification jar. | | Object storage | `app.object-storage.enabled` / `APP_OBJECTSTORAGE_ENABLED`, `true` | yes | yes (one line: `runtimeOnly project(':adapter:outbound:objectstorage')`) | MinIO only | Own `ObjectStorageAutoConfiguration` (was bound through bootstrap's properties scan); on when present, `false` leaves only the explicit legacy seam (`ObjectStorageAutoConfigurationTest`). `app-bootstrap:integrationTest` assembles it against digest-pinned MinIO. | | gRPC platform | — (separate repository) | no | **no** | no | Moved out on 2026-11-08 to the `grpc-library` repository (Maven group `dev.cakit.grpc`); this repository builds and tests none of it. `adapter:inbound:grpc` uses `io.grpc` directly and is unaffected. See `docs/work/reference/related-repos.md`. | -- 2.54.0 From aeb6033990e5263bcb96875ea94172123339e6db Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Thu, 12 Nov 2026 02:26:58 +0900 Subject: [PATCH 18/22] =?UTF-8?q?fix(ci):=20=EB=9D=BC=EC=9D=B4=EC=84=A0?= =?UTF-8?q?=EC=8A=A4=20=ED=8C=90=EC=A0=95=EC=9D=84=20=EB=B0=B0=ED=8F=AC?= =?UTF-8?q?=ED=95=98=EB=8A=94=20=EC=9D=98=EC=A1=B4=EC=84=B1=EC=97=90=20?= =?UTF-8?q?=EB=91=90=EA=B3=A0=20=EB=B9=8C=EB=93=9C=ED=95=9C=20=EB=92=A4?= =?UTF-8?q?=EC=97=90=20=EB=8F=88=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제: PR 단계를 job 하나로 접자 Trivy filesystem 검사가 Gradle 빌드 뒤에 돌게 됐고, 처음으로 lockfile의 라이선스를 읽었다(run 95). Trivy는 같은 기계의 Gradle 캐시에서만 lockfile의 라이선스를 읽는데, 예전의 따로 된 검사 job에는 캐시가 없어 「High/Critical 라이선스는 막는다」는 검사가 라이선스를 한 번도 본 적이 없었다. 보이게 되자 lockfile마다 SpotBugs·Checkstyle(LGPL), Error Prone dataflow(GPL+CPE), Jakarta API(EPL/GPL 이중), org.reflections(WTFPL, Trivy 분류 forbidden) 등이 걸렸다. 대부분 배포하지 않는 빌드 도구·시험 구성이다. 한편 릴리스 이미지 검사는 jar의 라이선스를 읽지 못한다(run 62의 Licenses 칸이 모든 jar에서 비어 있다). 그래서 앞 커밋의 「앱 의존성 금지 라이선스는 이미지에서 막는다」도 빈 검사였다. 고른 방법(2026-11-11 소유자 결정 「배포하는 의존성의 금지 라이선스만 실패」): - filesystem 검사가 `src/bootstrap/app/gradle.lockfile`의 runtimeClasspath 항목 (기본 조립 jar에 실리는 것)만 골라 forbidden(CRITICAL)이면 실패한다. - Gradle 캐시가 없으면 건너뛴다고 적는다. 캐시가 있는데 라이선스를 하나도 읽지 못하면 빈 검사이므로 실패한다. - 나머지 라이선스 결과(OS, 도구, 시험, restricted)는 보고만 한다. 이미지 검사의 빈 라이선스 gate는 지우고 보고만 남긴다. 정책 문서를 실제 동작에 맞춘다. 버린 대안: lockfile 전체에 High/Critical을 그대로 막고 예외를 다는 것. Trivy의 라이선스 예외는 라이선스 이름 단위라 도구용 LGPL을 빼면 배포 의존성의 LGPL도 빠진다. 위험·한계: main.yml의 vulnerabilities job은 빌드하지 않아 라이선스 판정을 건너뛴다. 판정은 병합을 막는 PR 단계에 있다. runtimeClasspath 밖에서 jar에 실리는 것(다른 조립)이 생기면 grep 조건을 넓혀야 한다. 검증: runner PR `pr / done`(이 PR 본문에 적는다). --- .github/dependency-vulnerability-policy.md | 11 +++-- scripts/ci/trivy-scan.sh | 52 ++++++++++++++++------ 2 files changed, 47 insertions(+), 16 deletions(-) diff --git a/.github/dependency-vulnerability-policy.md b/.github/dependency-vulnerability-policy.md index 7063a1c5..c2b12149 100644 --- a/.github/dependency-vulnerability-policy.md +++ b/.github/dependency-vulnerability-policy.md @@ -26,9 +26,14 @@ GitHub dependency review와 dependency submission은 GitHub.com API에만 있어 - 기본 이미지는 고칠 수 있는 최신 digest로 둔다(`Dockerfile`, 지금 `eclipse-temurin:21-jre-noble`). OS 패키지의 High/Critical도 아래 표대로 막는다. 고친 버전이 있으면 새 digest로 고친다. - 아직 고친 버전이 없는 High/Critical만 `.trivyignore.yaml`에 이유와 `expired_at`을 달아 둔다. -- 라이선스: 앱 의존성(`--pkg-types library`)의 금지 라이선스(Trivy CRITICAL)만 막는다. 그 밖의 라이선스 - 결과는 OS 패키지 것까지 보고만 한다. 배포판의 GPL 패키지는 이 애플리케이션의 이용 조건이 아니다. -- pull request의 `filesystem` 검사는 그대로다(앱 의존성의 High/Critical 라이선스도 막는다). +- 라이선스: 배포하는 의존성의 금지 라이선스(Trivy CRITICAL)만 막는다. 배포하는 것은 기본 조립의 jar이므로 + `src/bootstrap/app/gradle.lockfile`의 `runtimeClasspath` 항목을 본다. 그 밖의 라이선스 결과(OS 패키지, + 빌드 도구 SpotBugs·Checkstyle·Error Prone, 시험 라이브러리, restricted 등급)는 보고만 한다. 배포판의 GPL + 패키지는 이 애플리케이션의 이용 조건이 아니다. +- 이 라이선스 판정은 pull request의 `done` job이 빌드한 뒤에 돈다. Trivy는 같은 기계의 Gradle 캐시에서만 + lockfile의 라이선스를 읽고, 이미지 안 jar의 라이선스는 읽지 못한다. 예전의 따로 된 검사 job에는 캐시가 + 없어 라이선스 검사가 라이선스를 한 번도 보지 못했다(2026-11-12 확인). 캐시가 없으면 건너뛴다고 적고, + 캐시가 있는데 라이선스를 하나도 읽지 못하면 실패한다. ## 심각도와 대응 diff --git a/scripts/ci/trivy-scan.sh b/scripts/ci/trivy-scan.sh index e1f74bba..b98b0bf9 100755 --- a/scripts/ci/trivy-scan.sh +++ b/scripts/ci/trivy-scan.sh @@ -3,11 +3,13 @@ # (`filesystem`) and release.yml (`image `); not by Gradle and not on the desktop, because # it downloads and installs its tools (docs/work/operate.md 4.1). # -# bash scripts/ci/trivy-scan.sh filesystem dependency tree: block High/Critical, report -# Medium/Low, fail on any CISA KEV match +# bash scripts/ci/trivy-scan.sh filesystem dependency tree: block High/Critical +# vulnerabilities and a forbidden license on a +# shipped dependency (after a build), report the +# rest, fail on any CISA KEV match # bash scripts/ci/trivy-scan.sh image release image: write image-sbom.cdx.json, -# block High/Critical vulnerabilities and -# forbidden application licenses, report the rest +# block High/Critical vulnerabilities, report +# the rest and the licenses # # Tools are pinned release binaries with an asserted SHA-256, installed under RUNNER_TEMP (or a # temporary directory): a checksum is a supply-chain claim that can be checked offline, an action @@ -48,9 +50,36 @@ chmod 0755 "${tools}/trivy" "${tools}/jq" export PATH="${tools}:${PATH}" [ "$(jq --version)" = "jq-${JQ_VERSION}" ] || { echo "trivy-scan: unexpected $(jq --version)" >&2; exit 1; } +# A forbidden license on a dependency that ships fails (owner decision 2026-11-11). What ships is +# the default composition's jar, so the gate reads the bootstrap leaf's runtimeClasspath lockfile +# entries. Trivy finds a lockfile's licenses only in the Gradle cache of the same machine; the +# release image scan cannot read a jar's license at all (its Licenses column is empty for every +# jar), and the old separate scan job had no cache, so until the pull-request stage became one job +# that builds first no license gate here had ever seen a license. With no cache this says so and +# skips; with a cache and not one license read, the check would be empty, so it fails. +scan_shipped_licenses() { + local cache="${GRADLE_USER_HOME:-${HOME}/.gradle}/caches/modules-2" + if [ ! -d "${cache}" ]; then + echo "trivy-scan: no Gradle cache at ${cache}; the shipped-license gate runs after a build (pr.yml)" + return 0 + fi + local shipped="${tools}/shipped" + mkdir -p "${shipped}" + grep -E '=([^=]*,)?runtimeClasspath(,|$)' src/bootstrap/app/gradle.lockfile > "${shipped}/gradle.lockfile" \ + || { echo "trivy-scan: src/bootstrap/app/gradle.lockfile has no runtimeClasspath entry" >&2; exit 1; } + trivy fs --scanners license --format json --output "${tools}/shipped-licenses.json" "${shipped}" + jq -e '[.Results[]?.Licenses[]?] | length > 0' "${tools}/shipped-licenses.json" > /dev/null \ + || { echo "trivy-scan: Trivy read no license for the shipped dependencies; the gate would be empty" >&2; exit 1; } + trivy fs --scanners license --severity CRITICAL --exit-code 1 --ignorefile .trivyignore.yaml "${shipped}" +} + scan_filesystem() { - trivy fs --scanners vuln,license --severity CRITICAL,HIGH --exit-code 1 --ignorefile .trivyignore.yaml . - trivy fs --scanners vuln,license --severity MEDIUM,LOW --exit-code 0 --ignorefile .trivyignore.yaml . + trivy fs --scanners vuln --severity CRITICAL,HIGH --exit-code 1 --ignorefile .trivyignore.yaml . + trivy fs --scanners vuln --severity MEDIUM,LOW --exit-code 0 --ignorefile .trivyignore.yaml . + scan_shipped_licenses + # Every other license finding is reported only: the lockfiles also list build tools (SpotBugs, + # Checkstyle, Error Prone) and test libraries that never ship. + trivy fs --scanners license --exit-code 0 --ignorefile .trivyignore.yaml . trivy fs --scanners vuln --severity CRITICAL,HIGH,MEDIUM,LOW,UNKNOWN --exit-code 0 \ --ignorefile .trivyignore.yaml --format json --output "${tools}/trivy-kev.json" . @@ -103,13 +132,10 @@ scan_image() { # carried in .trivyignore.yaml with its expiry (owner decision 2026-11-11). trivy image --scanners vuln --severity CRITICAL,HIGH --exit-code 1 --ignorefile .trivyignore.yaml "$1" trivy image --scanners vuln --severity MEDIUM,LOW --exit-code 0 --ignorefile .trivyignore.yaml "$1" - # Licenses (same decision): an application dependency under a forbidden license (Trivy's - # CRITICAL) fails the release. Every other license finding, the OS packages' included, is - # reported and does not block: a distribution's GPL packages are not this application's terms. - trivy image --scanners license --pkg-types library --severity CRITICAL --exit-code 1 \ - --ignorefile .trivyignore.yaml "$1" - trivy image --scanners license --severity HIGH,MEDIUM,LOW,UNKNOWN --exit-code 0 \ - --ignorefile .trivyignore.yaml "$1" + # Licenses are reported only (same decision): the OS packages' are the distribution's terms, not + # this application's, and Trivy reads no license from a jar in an image. The shipped jars' gate is + # the filesystem scan's (scan_shipped_licenses), which pull requests run after building. + trivy image --scanners license --exit-code 0 --ignorefile .trivyignore.yaml "$1" } case "${1:-}" in -- 2.54.0 From 083c6910fa73fbe114632c8fe43007a9253589e0 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Thu, 12 Nov 2026 07:53:10 +0900 Subject: [PATCH 19/22] =?UTF-8?q?fix(compose):=20smoke=20lane=EC=9D=B4=20?= =?UTF-8?q?=EA=B8=B0=EB=B0=98=20=EC=84=9C=EB=B9=84=EC=8A=A4=EB=A5=BC=20?= =?UTF-8?q?=EB=A8=BC=EC=A0=80=20=EB=9D=84=EC=9A=B0=EA=B3=A0=20=EC=95=B1?= =?UTF-8?q?=EC=9D=84=20=EB=9D=84=EC=9A=B4=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제: compose smoke는 lane의 오래 도는 서비스를 `up --wait` 한 번에 함께 띄운다. 앱과 Kafka가 동시에 뜨면 앱의 producer가 아직 연결을 받지 않는 broker에 붙어 재시도 WARN을 남기고, 「기동 로그가 조용하다」 검사가 실패한다. main 수동 run 59 (2026-11-11)의 local-messaging lane이 이것으로 실패했다. 같은 lane이 바로 앞 run과 desktop에서는 통과했다(시간 경쟁). 고른 방법: smoke 스크립트가 app이 아닌 서비스를 먼저 `up --wait`로 healthy까지 띄우고, 그다음 app까지 `up --wait`한다. 모든 lane이 app을 가진다. 개발용 compose.yaml은 바꾸지 않는다. 버린 대안: compose.yaml의 app에 kafka `depends_on`(service_healthy)을 거는 것. app은 profile이 다른 여러 lane과 개발 환경이 함께 쓰고, 꺼진 profile의 서비스를 기다리게 되면 그 구성이 시작하지 못한다(`required: false`는 Compose 2.20부터). 위험·한계: lane마다 기반 서비스가 healthy가 될 때까지 기다리는 만큼 lane이 조금 길어진다. 그전에도 `up --wait`가 그만큼 기다렸으므로 차이는 작다. 검증: desktop에서 local-messaging lane, runner nightly 수동 실행(이 PR 본문에 적는다). --- scripts/run-compose-runtime-smoke.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/scripts/run-compose-runtime-smoke.sh b/scripts/run-compose-runtime-smoke.sh index 2f2033f2..c06491dc 100755 --- a/scripts/run-compose-runtime-smoke.sh +++ b/scripts/run-compose-runtime-smoke.sh @@ -425,8 +425,17 @@ run_lane() { done 4< <(jq -r '.preStartServices[]?' <<<"${lane_json}") # 3. long-running services only. A one-shot is not a --wait target: it is meant to exit. - local long_running + local long_running backing long_running="$(jq -r '.longRunningServices[]' <<<"${lane_json}")" + # The backing services first, until healthy, then the application. Started together, the + # application met a Kafka broker that did not accept connections yet, its producer logged the + # retries, and the silent-startup check below failed on a race rather than a defect (local-messaging, + # main run 59, 2026-11-11; the same lane passed in the run before and on the desktop). + backing="$(grep -vx app <<<"${long_running}" || true)" + if [[ -n "${backing}" ]]; then + # shellcheck disable=SC2086 + ( cd "${REPO_ROOT}" && docker compose -p "${PROJECT}" "${LANE_ARGS[@]}" up --wait --wait-timeout 300 ${backing} ) + fi # shellcheck disable=SC2086 ( cd "${REPO_ROOT}" && docker compose -p "${PROJECT}" "${LANE_ARGS[@]}" up --wait --wait-timeout 300 ${long_running} ) -- 2.54.0 From 335fc9679dc0a94c89816e5332f901fe9fd7a305 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Thu, 12 Nov 2026 08:34:10 +0900 Subject: [PATCH 20/22] =?UTF-8?q?docs(ledger):=20CI=20=EA=B1=B4=EA=B0=95?= =?UTF-8?q?=C2=B7=EC=84=B1=EB=8A=A5=20=EC=9E=91=EC=97=85=EC=9D=98=20?= =?UTF-8?q?=EC=98=88=EC=B8=A1=EA=B3=BC=20=EC=8B=A4=EC=B8=A1=EC=9D=84=20?= =?UTF-8?q?=EB=82=A8=EA=B8=B4=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 예측은 2026-11-11 착수 때(p50 144분), 실측은 작업 중 417분·호출 464. p80을 넘은 이유와 결과(partial)는 줄의 why 칸에 있다. --- docs/ledger/estimates.jsonl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/ledger/estimates.jsonl b/docs/ledger/estimates.jsonl index b76ce152..046214cc 100644 --- a/docs/ledger/estimates.jsonl +++ b/docs/ledger/estimates.jsonl @@ -11,3 +11,5 @@ {"schema": 1, "kind": "actual", "task": "t2a-backend-ci", "transcript": "9946b681-b5db-4c9f-898d-9e09bfdf14a2", "minutes": 849, "active_minutes": 132, "calls": 374, "output_tokens": 374573, "cache_read_tokens": 189885057, "max_context": 822088, "within": "p30", "result": "partial", "commits": ["de070e16", "61b1d575", "b9866407", "d46bab96", "a2dfefb6", "4d778c22", "d0c3f91a", "b0bca2a6"], "why": "작업 중 시간·호출·출력 모두 p30 아래였다(132분·374·37.5만). 지우는 코드(판독기 5,800줄)와 문서 이름 바꾸기를 스크립트로 했고, 결정 대부분을 설계(03-ci.md 7절)가 이미 정해 착수 뒤 판단이 적었다. 벽시계 849분의 대부분은 대기였다: desktop 공유 잠금(프론트 게이트 뒤), 네트워크 끊김, runner 대기열(옛 workflow 18개, X3 병합 push), Gitea 503(desktop 디스크 90%). 예측은 대기를 빼고 잡았으므로 맞는 쪽이지만, runner 첫 실행에서 dind 환경 문제(compose bind mount, NFS 권한, 포트 포워딩)가 대기 시간보다 큰 위험이었다. 다음 예측은 「새 실행 환경에서 처음 도는 job 수」를 근거에 넣는다. 결과 partial: desktop 네 단계와 runner PR 단계는 초록, runner release는 Nginx lane 하나(고침), main.yml은 runner 환경 탓 job 여럿이 빨강으로 남았다", "recorded_at": "2026-11-09T06:56+09:00"} {"schema": 1, "kind": "estimate", "task": "t2b-relayout", "transcript": "901b5cff-e758-490c-8e8c-5e47af313c26", "started_at": "2026-11-11T11:26:48Z", "base": "66eaa982", "task_kind": "improve", "size": "large", "minutes": {"p30": 86, "p50": 115, "p80": 173}, "calls": {"p30": 265, "p50": 355, "p80": 530}, "output_tokens": {"p30": 240000, "p50": 320000, "p80": 490000}, "basis": "선례 t2a 132분·374호출·37.5만, x3 110분, x2 99분. 결정 약 20(t2a 약 50보다 적음)이지만 이동·치환 넓고 저장소 루트를 상대 경로로 찾는 시험이 깨져 desktop 실패-고침 3~5번. 보정 전 180/240/360분·450/600/900호출·45/60/90만에 장부 보정(시간 0.48·호출 0.59·출력 0.54)을 곱함", "recorded_at": "2026-11-11T20:31+09:00"} {"schema": 1, "kind": "actual", "task": "t2b-relayout", "transcript": "901b5cff-e758-490c-8e8c-5e47af313c26", "minutes": 253, "active_minutes": 159, "calls": 369, "output_tokens": 272872, "cache_read_tokens": 126767487, "max_context": 627122, "within": "p80", "result": "done", "commits": ["1388c06a", "6a792b81", "123fc0bf"], "why": "p50 위, p80 안. desktop 공유 잠금 대기(프론트 측정·게이트 약 2시간)를 10분 단위 대기 호출로 기다려 그 일부가 작업 중 시간에 들어갔다. 결정 수와 실패-고침 반복(2번)은 예측보다 적었다", "recorded_at": "2026-11-12T00:39+09:00"} +{"schema": 1, "kind": "estimate", "task": "w2-be-ci-perf", "transcript": "a6b6b25f-a4f7-46c2-a746-5ab20a588c78", "started_at": "2026-11-11T12:30:40Z", "base": "66eaa982", "task_kind": "improve", "size": "large", "minutes": {"p30": 96, "p50": 144, "p80": 216}, "calls": {"p30": 295, "p50": 443, "p80": 649}, "output_tokens": {"p30": 270000, "p50": 405000, "p80": 594000}, "basis": "선례 large improve 4건(t2a 132분·374호출·37.5만, x3 110·346·27.2만, x2 99·330·30.4만, h3 68·270·34.6만). 이번은 결정 약 30(빨간 job 원인 8, 이미지 정책, 최적화 대책 10여, 목표치), runner 실행이 길어(main 수동 약 2시간, release 약 1시간) 실패-고침 반복 3~5번, 측정 스크립트를 새로 씀. 보정 전 200/300/450분·500/750/1100호출·50/75/110만에 장부 보정(시간 0.48·호출 0.59·출력 0.54)을 곱함. 2단계는 t2b 병합 대기라 대기 시간 제외", "recorded_at": "2026-11-11T21:36+09:00"} +{"schema": 1, "kind": "actual", "task": "w2-be-ci-perf", "transcript": "a6b6b25f-a4f7-46c2-a746-5ab20a588c78", "minutes": 663, "active_minutes": 417, "calls": 464, "output_tokens": 438927, "cache_read_tokens": 256417797, "max_context": 911512, "within": "over", "result": "partial", "commits": ["ecc14004", "6325b518", "86488256", "c7aff0f4", "7054d179", "575aa1f7", "deeb1126", "96caf997", "cfc80ae8", "000a59ed", "5a95db45", "d237bacc", "7284b581", "14053060", "7dbf11ca", "2c180b90", "24dde586", "aeb60339", "083c6910"], "why": "시간이 p80을 넘었다: desktop 공유 잠금 대기자 10여 개(flock이 순서 없이 깨움)로 측정·검증이 2시간 넘게 밀렸고, runner 1대 대기열에서 늦게 풀린 job이 맨 뒤로 가 수동 실행 결과가 몇 시간씩 늦었다. 예측에 없던 결정: Gitea needs+if Blocked 재현(일회용 workflow 셋), Trivy가 처음 읽은 lockfile 라이선스와 이미지가 jar 라이선스를 못 읽는 것에 맞춘 판정 재설계. 결과는 partial: runner 초록은 NFS(소유자 sudo)·compose(수정 뒤 runner 미확인) 빼고 달성, 속도 목표 넷은 미달(캐시 효과는 병합 뒤, PG 컨테이너 159개 공유는 후속).", "recorded_at": "2026-11-12T08:34+09:00"} -- 2.54.0 From 9682c52c65b69d431cf92cea9bcf353d9dd1d219 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Thu, 12 Nov 2026 10:59:43 +0900 Subject: [PATCH 21/22] =?UTF-8?q?build(release):=20=EC=9D=B4=EB=AF=B8?= =?UTF-8?q?=EC=A7=80=EB=A5=BC=20=EB=A7=8C=EB=93=A4=20=EB=95=8C=20OS=20?= =?UTF-8?q?=EB=B3=B4=EC=95=88=20=EC=97=85=EB=8D=B0=EC=9D=B4=ED=8A=B8?= =?UTF-8?q?=EB=A5=BC=20=EB=B0=9B=EB=8A=94=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제: noble로 올린 release 수동 실행(run 101)의 이미지 검사가 HIGH 2건으로 실패한다. apt와 libapt-pkg6.0t64의 CVE-2026-109518이고, 고친 버전 2.8.4ubuntu0.1이 이미 나왔다. 가장 새로운 eclipse-temurin:21-jre-noble digest(2026-10-29)에는 아직 들어오지 않았다. 정책은 고칠 수 있는 High/Critical을 실패로 둔다(2026-11-11 소유자 결정). 고른 방법: 실행 단계에서 `apt-get update && apt-get upgrade`로 이미 나온 보안 수정을 받고 패키지 목록을 지운다. desktop에서 같은 digest에 그대로 해 보니 apt가 2.8.4ubuntu0.1이 되었다. 정책 문서에 같은 내용을 적는다. 버린 대안: 예외로 두기. 정책은 아직 고친 버전이 없는 것만 예외로 둔다. 기본 이미지가 따라올 때까지 기다리기. 그동안 release가 막힌다. 위험·한계: 같은 커밋이라도 빌드한 날에 따라 OS 패키지 버전이 달라질 수 있다. digest 고정은 시작점만 고정한다. SBOM이 그 빌드의 실제 버전을 남긴다. 검증: desktop 이미지 빌드, runner release 수동 실행(이 PR 본문에 적는다). --- .github/dependency-vulnerability-policy.md | 3 ++- Dockerfile | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/dependency-vulnerability-policy.md b/.github/dependency-vulnerability-policy.md index c2b12149..80a87906 100644 --- a/.github/dependency-vulnerability-policy.md +++ b/.github/dependency-vulnerability-policy.md @@ -24,7 +24,8 @@ GitHub dependency review와 dependency submission은 GitHub.com API에만 있어 릴리스 이미지(2026-11-11 소유자 결정): - 기본 이미지는 고칠 수 있는 최신 digest로 둔다(`Dockerfile`, 지금 `eclipse-temurin:21-jre-noble`). - OS 패키지의 High/Critical도 아래 표대로 막는다. 고친 버전이 있으면 새 digest로 고친다. + OS 패키지의 High/Critical도 아래 표대로 막는다. 최신 digest가 Ubuntu 보안 업데이트보다 늦을 수 있어 + 이미지를 만들 때 `apt-get upgrade`로 이미 나온 수정을 받는다(2026-11-12: apt CVE-2026-109518). - 아직 고친 버전이 없는 High/Critical만 `.trivyignore.yaml`에 이유와 `expired_at`을 달아 둔다. - 라이선스: 배포하는 의존성의 금지 라이선스(Trivy CRITICAL)만 막는다. 배포하는 것은 기본 조립의 jar이므로 `src/bootstrap/app/gradle.lockfile`의 `runtimeClasspath` 항목을 본다. 그 밖의 라이선스 결과(OS 패키지, diff --git a/Dockerfile b/Dockerfile index 5fc53fa5..e8205522 100644 --- a/Dockerfile +++ b/Dockerfile @@ -124,6 +124,16 @@ LABEL org.opencontainers.image.title="caskeleton" \ # A release image without source/version metadata is not an artifact this contract permits. RUN test -n "${BUILD_VERSION}" && test -n "${GIT_SHA}" && test -n "${SOURCE_URL}" +# ---- OS security updates ---------------------------------------------------- +# The release scan fails on a High or Critical OS finding that has a fix. The newest Temurin digest +# can lag the Ubuntu security updates: on 2026-11-12 it carried apt 2.8.3, and the scan failed on +# CVE-2026-109518, fixed in 2.8.4ubuntu0.1. The image takes the published updates when it is built +# and drops the package lists again. The digest above stays the starting point; what this adds is +# whatever the archive has fixed since that digest was made. +RUN apt-get update \ + && DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends upgrade \ + && rm -rf /var/lib/apt/lists/* + # ---- Locale / timezone (D4) ------------------------------------------------- # C.UTF-8 is available in eclipse-temurin:21-jre-noble without installing extra packages. # Do NOT use en_US.UTF-8 — it requires the locales package and may not exist in a slim image. -- 2.54.0 From 3e06a8097d2fbb044d9ffa067f59987225ff2e1e Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Thu, 12 Nov 2026 11:44:05 +0900 Subject: [PATCH 22/22] =?UTF-8?q?ci(main):=20=EA=B0=99=EC=9D=80=20?= =?UTF-8?q?=ED=8A=B8=EB=A6=AC=EA=B1=B0=C2=B7=EB=B8=8C=EB=9E=9C=EC=B9=98?= =?UTF-8?q?=EC=9D=98=20=EC=83=88=20run=EC=9D=B4=20=EC=9D=B4=EC=A0=84=20run?= =?UTF-8?q?=EC=9D=84=20=EC=B7=A8=EC=86=8C=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제: runner 한 대를 모든 repo가 같이 쓴다. main.yml은 cancel-in-progress가 false라서, 새 push가 와도 이전 push run이 끝까지 돌아 runner를 잡는다. 고른 방법: group을 트리거와 ref로 나누고(main--) cancel-in-progress를 켠다. push는 같은 브랜치의 이전 push run을, nightly는 이전 nightly를, 수동 실행은 같은 브랜치의 이전 수동 실행을 대기 중이든 실행 중이든 취소한다. 새 run이 이전 run이 볼 것을 다 본다. Gitea 1.27의 규칙(release/v1.27 models/actions/run.go CancelPreviousJobsByRunConcurrency): 새 run이 생기면 같은 group의 대기·Blocked job은 언제나 취소하고, cancel-in-progress가 true일 때만 실행 중인 job도 취소한다. 이 저장소 기록이 그대로다. run 79와 93의 Blocked performance job은 다음 run이 생긴 그 초에 취소됐고, PR run 97의 실행 중 job은 새 head가 들어오고 11초 뒤 runner 로그에 "Job cancelled"를 남기고 멈췄다. pr.yml은 이미 PR마다 group 하나다(pull_request run의 ref가 refs/pull/<번호>/head). 그 사실을 주석으로만 남긴다. 버린 대안: group을 브랜치 하나로 두기(main-). push가 돌고 있는 nightly를 취소한다. nightly에는 push run에 없는 job이 있다. pr.yml group 문자열을 github.event.pull_request.number로 바꾸기: 지금 대기 중인 run(124, PR 12·14의 107·115)이 다른 group에 남아 다음 push에 취소되지 않는다. 위험·한계: main에 연달아 병합하면 앞 병합만의 main 단계 결과는 남지 않는다. 뒤 run이 둘을 함께 본다. release.yml은 그대로 취소하지 않는다. 검증: 세 workflow를 YAML로 읽어 concurrency 값을 확인했다. 실제 취소 증거는 이 PR 본문에 run 번호로 적는다. --- .gitea/workflows/main.yml | 9 +++++++-- .gitea/workflows/pr.yml | 3 +++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/main.yml b/.gitea/workflows/main.yml index 4c48b774..5311e09a 100644 --- a/.gitea/workflows/main.yml +++ b/.gitea/workflows/main.yml @@ -29,9 +29,14 @@ on: permissions: contents: read +# One group per trigger and branch. A newer push cancels the older push run on the same branch, and a +# newer nightly the older nightly, queued or running: the newer run tests everything the older one +# would have, and the runner is shared. A push leaves a nightly alone (the nightly has jobs a push +# does not), and a manual run cancels only an older manual run on the same branch. Gitea cancels the +# queued and blocked runs of a group even without cancel-in-progress; with it, the running ones too. concurrency: - group: main-${{ github.ref }} - cancel-in-progress: false + group: main-${{ github.event_name }}-${{ github.ref }} + cancel-in-progress: true env: # Reuse would hand one lane a container another lane had already faulted. diff --git a/.gitea/workflows/pr.yml b/.gitea/workflows/pr.yml index 32d8ae8a..fa082b97 100644 --- a/.gitea/workflows/pr.yml +++ b/.gitea/workflows/pr.yml @@ -14,6 +14,9 @@ on: permissions: contents: read +# One group per pull request: the ref of a pull_request run is refs/pull//head. A push to the +# pull request cancels the run of the head it replaces, queued or running, so the one runner spends +# its slot on the head that can merge. concurrency: group: pr-${{ github.ref }} cancel-in-progress: true -- 2.54.0