Files
grpc-library/config/spotbugs/exclude-test.xml
DongHyeonka 414666cfc7 build: 템플릿 밖에서 혼자 빌드·배포되는 Gradle 루트를 만든다
옮겨 온 gRPC 모듈은 템플릿의 두 번째 빌드(optional build)였다. 그 빌드는
템플릿 build-logic·카탈로그·registry·config를 상대 경로로 읽었고,
grpc-operation-ledger-jpa는 템플릿 persistence-jpa의 testFixtures 파일
셋을 빌드 때 복사해 왔다. 별도 repo에는 그 경로가 없다.

repo 루트를 Gradle 루트로 둔다.
- build-logic: 템플릿 22df3525의 src/build-logic을 복사하고 쓰지 않는
  플러그인(bootrun-dotenv, redis topology, config contract,
  spring-library, optional registry, purity 태스크)을 뺐다. 출처와 고친
  곳은 build-logic/UPSTREAM.md에 적었다(설계 10.3절 L1).
- registry config/architecture/modules.json: 템플릿의 optional-grpc 9행,
  source_path는 Gradle 루트 기준.
- 카탈로그·config: 이 repo가 쓰는 항목만. SpotBugs 제외는 이 repo
  클래스와 일반 규칙만 남겼다.
- group은 gradle.properties의 libraryGroup(com.hyeonworks.grpc)에서
  읽는다. 버전은 -PreleaseVersion 말고 RELEASE_TAG(vX.Y.Z)에서도 읽고,
  다른 모양의 태그는 빌드 전에 거부한다.
- 배포: 새 ca.library-publishing이 모듈마다 Maven publication(sources·
  javadoc jar, versionMapping으로 해석된 버전)과 저장소 gitea·staging,
  SIGNING_KEY가 있으면 PGP 서명을 단다. 루트는 SBOM artifact
  grpc-library와 단계 태스크 ci·mainCheck·releaseCheck·release·
  releaseRehearsal을 가진다. Trivy·Buf는 scripts/tool.sh가 SHA-256으로
  고정해 받는다.
- testFixtures 결합(설계 4.6절 2번)은 integrationTest 안 사본으로 끊었다.
- Buf lint·breaking은 Gradle 태스크(scripts/buf.sh)로 ci에 넣었다.

버린 대안: build-logic을 템플릿이 배포(L2, 순환), 공통 repo(L3, repo가
하나 더), 표준 플러그인만으로 새로 쓰기(L4, strict lane과 방향 검사를
잃음). SBOM은 CycloneDX Gradle 플러그인 대신 이미 고정해 쓰는 Trivy로
만든다(도구를 늘리지 않는다).

위험: strictlane 단계 검사는 included build 태스크를 따라가다 실패해서
그 태스크를 건너뛰게 고쳤다(UPSTREAM.md). Gitea에 실제로 올리는 경로는
비밀 값이 없어 이 커밋에서는 시험하지 못했다.

검증(desktop, 이 트리): ./gradlew ci rc=0, 테스트 739개(build-logic
포함) 중 첫 실행 실패 1개(템플릿 경로를 찾던 GrpcPackageOwnershipTest)를
고친 뒤 통과. ./gradlew verifyStrictLaneStages --dry-run rc=0.

Refs: design-docs repo-structure/05-library-repos.md 4.6·7·10절
2026-11-08 11:10:21 +09:00

65 lines
3.6 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!--
SpotBugs + FindSecBugs exclude filter for test code: every source set but main (test,
testFixtures, integrationTest, systemTest, architectureTest and the other lanes). Production code
is analysed by spotbugsMain against config/spotbugs/exclude.xml; this file is never applied to it
(QualityConventionsPlugin, testQualityCheck).
Until 2026-11-04 these tasks existed, ran in no gate, and 53 of them failed with 300 findings.
Each finding was judged. A rule is excluded below only when its reason holds for every test
class it can ever match; everything else was fixed, or is a Match scoped to one class with its
own reason (same rule as exclude.xml).
Test code never reaches a production classpath: test fixtures are consumed only by test suites
(`testImplementation testFixtures(...)`, `implementation testFixtures(project())` inside a
JvmTestSuite), which the dependency-direction gate keeps out of production configurations.
-->
<FindBugsFilter>
<!-- FindSecBugs (category SECURITY): taint, injection, deserialization, crypto, SSRF, path,
ReDoS, hard-coded credential and CSRF rules model untrusted input reaching a production
sink. A test writes its own input, runs only under the test runner, and holds fixture
credentials on purpose. The same code moved to main is analysed with these rules on. -->
<Match>
<Bug category="SECURITY" />
</Match>
<!-- MALICIOUS_CODE (EI_EXPOSE_REP, EI_EXPOSE_REP2, MS_*): these protect a production object from
a caller that mutates state it was handed. Fakes and fixtures hand their state to the test
on purpose — that is how the test observes them. -->
<Match>
<Bug category="MALICIOUS_CODE" />
</Match>
<!-- CT_CONSTRUCTOR_THROW: the risk is a finalizer attack by untrusted code that subclasses the
class. Test classes are instantiated by JUnit or by the test itself; a constructor that
throws fails the test. -->
<Match>
<Bug pattern="CT_CONSTRUCTOR_THROW" />
</Match>
<!-- NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE: a test dereferences a value it expects to be there
(a response body, a header, a map entry). If it is null the NullPointerException fails the
test, which is the failure an unmet expectation should produce; a requireNonNull in front
adds a line and changes nothing. -->
<Match>
<Bug pattern="NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE" />
</Match>
<!-- DLS_DEAD_LOCAL_STORE into a local named `unused` or `ignored`: Error Prone's
CheckReturnValue makes a test keep the result it means to drop (`var unused =
catchThrowable(...)` when only the side effect is asserted), and the name says the value is
dropped on purpose. A dead store to any other name is still reported. -->
<Match>
<Bug pattern="DLS_DEAD_LOCAL_STORE" />
<Local name="~unused|ignored" />
</Match>
<!-- RV_RETURN_VALUE_IGNORED_INFERRED / _NO_SIDE_EFFECT inside a lambda: in test code these are
the ThrowingCallable / Executable handed to assertThatThrownBy, isThrownBy, catchThrowable
or assertThrows. Their type is void, so the value cannot be kept, and the call is made for
the exception it throws. RV_RETURN_VALUE_IGNORED (a must-check result such as
CountDownLatch.await) stays reported in lambdas too. -->
<Match>
<Or>
<Bug pattern="RV_RETURN_VALUE_IGNORED_INFERRED" />
<Bug pattern="RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT" />
</Or>
<Method name="~lambda\$.*" />
</Match>
</FindBugsFilter>