Skip to content

[CU-86b9ybg6d] Migrate to java-libraries-monorepo 4.0.0-rc2#160

Open
jfuerth wants to merge 6 commits into
mainfrom
update-libraries-CU-86b9ybg6d
Open

[CU-86b9ybg6d] Migrate to java-libraries-monorepo 4.0.0-rc2#160
jfuerth wants to merge 6 commits into
mainfrom
update-libraries-CU-86b9ybg6d

Conversation

@jfuerth
Copy link
Copy Markdown
Contributor

@jfuerth jfuerth commented May 14, 2026

Summary

Migrates data-connect-trino off the pre-monorepo DNAstack 1.x libraries and onto com.dnastack.starter:spring-boot-parent:4.0.0-rc2-9-gd79f5a8. This is part of the parent ticket CU-86b9yb0pe to roll all services onto the consolidated java-libraries-monorepo.

Headline changes:

  • Parent POM: swap org.springframework.boot:spring-boot-starter-parent:3.5.13 for com.dnastack.starter:spring-boot-parent:4.0.0-rc2-9-gd79f5a8. Removes the local Jackson 2.18.x pin (no longer needed — every remaining caller uses PropertyNamingStrategies.SNAKE_CASE). Drops duplicate <dependencyManagement> entries (logback, jdbi, spring-cloud) and per-dep version pins for libs now managed by the parent (token-validator, audit-event-logger, oauth-client-factory-starter, jdbi, resilience4j, zonky).
  • Tracing: brave.Tracing / brave.Tracerio.micrometer.tracing.Tracer + io.micrometer.observation.ObservationRegistry. micrometer-tracing-bridge-bravebridge-otel. traceIdString() (16 hex) → traceId() (32 hex / 128-bit) everywhere it surfaces (audit events, X-Trino-Trace-Token, QueryJob.originalTraceId, trace_id in error responses).
  • Token validator: JwtTokenParserFactory, PermissionCheckerFactory, and TokenActionsHttpClientFactory migrated to their new (ObservationRegistry, ConnectionPool) signatures. Added tokenValidatorConnectionPool and OidcHttpClient beans; switched to CachingIssuerPubKeyJwksResolver.create(issuerUri, oidcHttpClient).
  • OAuth Feign clients: collection-service and indexing-service clients migrated from OAuthClientFactory.builderWithCommonSetup(...) to FeignClients.newBuilder(cfg.withOverrides(oauthClient), feignClient, feignClient), with per-resource OkHttp clients built via OkHttpClients.buildOkHttpClient(name, observationRegistry, type) so metrics get meaningful resource dimensions.
  • Trino propagation: TrinoHttpClient.execute() no longer emits a B3 single-format header inside X-Trino-Extra-Credential (Brave is gone). Replaced with W3C traceparent so the SAC plugin / tables connector can still correlate downstream activity; X-Trino-Trace-Token continues to carry the raw traceId.
  • Jackson 2.19 cleanup: PropertyNamingStrategy.SNAKE_CASEPropertyNamingStrategies.SNAKE_CASE; PropertyNamingStrategy.KebabCaseStrategyPropertyNamingStrategies.KebabCaseStrategy (touches DataConnectAuthRequest and the two deprecated tables-registry client configs).
  • application.yml: drop the now-dormant spring.zipkin: block (with Brave/Zipkin gone there's nothing to disable). Intentionally not adding management.tracing.sampling.probability — it's a no-op without an exporter.
  • Tests: TrinoDataConnectAdapterTest swapped its live brave.Tracing fixture for a thin Mockito Tracer stub returning a fixed 128-bit traceId.

Commits are split logically so each is independently reviewable: parent bump, Jackson naming fixups, Brave + OAuthClientFactory migration, application.yml cleanup, test fixture swap.

Test plan

  • ./mvnw clean test — 49 tests pass locally (Java 21)
  • ./mvnw dependency:tree -Dincludes='com.dnastack:*' — every DNAstack jar resolves to 4.0.0-rc2-9-gd79f5a8 (with logback-extensions correctly remaining on its standalone 1.0.1 line)
  • Verified audit events emit 128-bit (32-char) trace_id values
  • CI green
  • Integration deploy + smoke test against a real Trino + wallet

jfuerth and others added 5 commits May 14, 2026 16:41
Adopt the java-libraries-monorepo parent (4.0.0-rc2-9-gd79f5a8). The
parent now manages versions for: spring-boot 3.5.14, spring-cloud
2024.0.3, dnastack-token-validator, spring-boot-audit-event-logger,
dnastack-oauth-client-factory-spring-starter, logback-extensions,
jdbi 3.52.1, resilience4j 2.4.0, zonky embedded-postgres, postgresql
42.7.11 (CVE-2026-42198), bouncycastle 1.84 (CVE-2026-5598).

Drop the local Jackson 2.18.x pin (was needed when oauth-client-factory
1.0.5 used the removed-in-2.19 PropertyNamingStrategy.SNAKE_CASE).

Switch micrometer-tracing-bridge-brave -> bridge-otel. The bridge-otel
artifact comes from OTel; Brave is going away in the monorepo libs.

Remove duplicate dependencyManagement entries that the new parent
already provides (logback, jdbi BOM, spring-cloud BOM).

Remove the audit-event-logger zipkin-reporter exclusions; those were
needed for the 1.0.x lib and don't apply to the 4.x version.

This commit only updates the POM and intentionally does not touch
the source code yet; subsequent commits migrate the affected APIs
(brave -> micrometer, OAuthClientFactory -> FeignClients, etc.) to
keep the diff reviewable.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…eStrategy

Jackson 2.19 removed the deprecated PropertyNamingStrategy.SNAKE_CASE
constant and KebabCaseStrategy inner class. The replacements have lived
in PropertyNamingStrategies since 2.12, so this is a drop-in swap:

  PropertyNamingStrategy.SNAKE_CASE          -> PropertyNamingStrategies.SNAKE_CASE
  PropertyNamingStrategy.KebabCaseStrategy   -> PropertyNamingStrategies.KebabCaseStrategy

Touches DataConnectAuthRequest (JSON serialization of the auth challenge
returned to clients), and the two tablesregistry config classes used by
the deprecated tables-registry feature.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…gnClients

Threads Micrometer Observation / OpenTelemetry through every previous
Brave integration point, in line with the rest of the platform's 4.0
library migration:

- brave.Tracing / brave.Tracer injection sites replaced with
  io.micrometer.tracing.Tracer and io.micrometer.observation.ObservationRegistry.
  Span creation rewritten with tracer.nextSpan().name(...).start(),
  tracer.withSpan(span), span.end(). The 128-bit traceId() string
  replaces brave's 16-char traceIdString() everywhere
  (X-Trino-Trace-Token, QueryJob.originalTraceId,
  GlobalControllerExceptionHandler trace_id response field).

- JwtTokenParserFactory / PermissionCheckerFactory /
  TokenActionsHttpClientFactory migrated to their new
  (ObservationRegistry, ConnectionPool) signatures. Added a
  tokenValidatorConnectionPool bean and an OidcHttpClient bean;
  CachingIssuerPubKeyJwksResolver.create(issuerUri, oidcHttpClient)
  replaces the old constructor.

- OAuthClientFactory.builderWithCommonSetup(...) callers (the
  collection-service and indexing-service Feign clients) migrated to
  FeignClients.newBuilder(config.withOverrides(...), feignClient,
  feignClient), with a per-resource OkHttp client built via
  OkHttpClients.buildOkHttpClient(name, observationRegistry, type) so
  metrics get a meaningful resource dimension. The same client is
  passed for the main and token slots — neither client has different
  network requirements from the other.

- TrinoHttpClient.execute(): drop B3 single-format propagation through
  the X-Trino-Extra-Credential header. B3 isn't available without
  Brave; substituted W3C traceparent built from the current
  TraceContext so the SAC plugin / tables connector can still correlate
  downstream activity. X-Trino-Trace-Token continues to carry the raw
  traceId.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Was only setting enabled: false. With the Brave -> Micrometer/OTel
migration there is no Zipkin sender on the classpath at all, so the
block has nothing to disable.

Not adding management.tracing.sampling.probability either; it's a no-op
without an exporter and we'd just have to remove it later.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
TrinoDataConnectAdapterTest used a live brave.Tracing instance plus a
span-in-scope to satisfy the adapter's tracer dependency. Brave is no
longer on the classpath, and the adapter now takes
io.micrometer.tracing.Tracer.

The test only needs tracer.currentTraceContext().context().traceId()
(used when persisting QueryJob.originalTraceId), so a thin Mockito stub
returning a fixed 128-bit traceId is enough. No tearDown needed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@platform-automation-dnastack
Copy link
Copy Markdown

…gin compatibility

The publisher SAC plugin (CU-86b9ybr65) and ga4gh-tables-connector
(CU-86b9ybr0e) still read `b3` from Trino's extra-credentials map and
parse it via brave's B3SingleFormat. Brave's parser handles 128-bit
(32-hex) trace IDs natively, so the new OTel trace context can be
hand-formatted into the same B3 single-format header without bringing
brave back as a dependency. Sending both b3 and traceparent keeps
existing plugins working unchanged while pre-positioning new plugins
to consume the W3C traceparent once they migrate to the OpenTelemetry
SPI. The b3 line can be dropped in a follow-up to CU-86b9ybg6d after
both plugins ship.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants