fix(apicurio): order schema-registry after OTEL starter — same noop hijack (#343) #23
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/apicurio-otel-fallback-no-hijack-343"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
#343 (sibling) —
apicurio-clienthas the identical OTEL no-op hijackFound while ripple-checking PR #22 (the outbox-publisher fix).
SchemaRegistryAutoConfiguration.schemaRegistryOpenTelemetry()returnsOpenTelemetry.noop()under@ConditionalOnMissingBeanwith no ordering relative to the OpenTelemetry Spring Boot starter — the same defect class fixed in PR #22.If a service enables
im2be.schema-registryAND carries the starter, this fallback could win the auto-config ordering race, register the no-op, and make the starter's realOpenTelemetrybean (itself@ConditionalOnMissingBean) back off → all OTel export silently disabled. The threeSchemaRegistryClientbeans (apicurio/confluent/dual) take a requiredOpenTelemetryconstructor param, so the fallback must still provide the no-op when the starter is genuinely absent.Dormant — no live impact, no rebuild
No aim2be service depends on
apicurio-client(verified across user/social-login/family/diary/calendar/admin/notification/identity), so there is no running service affected and no image rebuild is required. Fixed pre-emptively (rule 18/52) so the landmine is defused before apicurio-client is adopted for the Avro schema-registry path.Fix
Class-level
@AutoConfigureAfter(name = "io.opentelemetry.instrumentation.spring.autoconfigure.OpenTelemetryAutoConfiguration")— orders this auto-config after the starter so the real SDK bean is registered before the fallback's@ConditionalOnMissingBeanis evaluated → real bean wins; no-op covers starter-absent/excluded. Mirrors PR #22 exactly.Tests (
SchemaRegistryAutoConfigurationTest)enabled_providesNoopOpenTelemetryWhenStarterAbsent— bare-consumer path still supplies the no-op (required param satisfied).fallbackOrderingIsGuardedByAutoConfigureAfterOfOtelStarter— pins the@AutoConfigureAftercontract (containsExactly).mvn -pl apicurio-client -am install -DskipITs→ 38/38 unit, 0 warnings. Memora #3651.Show previous round
hib-pr-reviewer review — PR #23 (affinity-intelligence-rework/im2be-platform-libs)
Round 1 — head
f048970dab1b, basemain, triggeropenedTL;DR: CONDITIONAL_APPROVE — both unique-to-one findings verified and kept; two minor test-coverage gaps in the new annotation-pinning and user-bean-yield cases; no blocking issues.
Summary
Reconciliation: 2 unique-to-one findings, both verified and kept.
This is the first arbitration run for this PR (no prior Memora history). Neither A nor B agreed on a shared finding — they flagged two distinct gaps in the new test suite added to
SchemaRegistryAutoConfigurationTest.java.Finding A (unique to A) verified at lines 115–124: the test asserts
after.name()withcontainsExactly(...)but there is no assertion onafter.value(). The@AutoConfigureAfterannotation exposes bothname()andvalue()axes; a developer addingvalue = {SomeClass.class}alongside the existingnameentry would introduce an undetected ordering constraint. Confirmed valid.Finding B (unique to B) verified by cross-reading
OutboxOpenTelemetryFallbackTest.java(lines 74–84): the parallel outbox test carries a third case (fallbackYieldsToAUserProvidedOpenTelemetryBean) that exercises@ConditionalOnMissingBeanyielding to a user-suppliedOpenTelemetrybean viawithBean("userOpenTelemetry", ...). The newSchemaRegistryAutoConfigurationTestomits this case entirely. TheSchemaRegistryAutoConfiguration.schemaRegistryOpenTelemetry()bean has@ConditionalOnMissingBeanso the test is achievable in-module without the OTel starter. Confirmed valid.Both are minor. Production fix is correct. Memora run summary persisted as memory ID 468.
Blast Radius
Changes are scoped to one auto-configuration class and its test in the
apicurio-clientsubmodule. The production fix adds@AutoConfigureAfterwith a name-only reference that Spring silently ignores when the target class is absent, so blast radius is limited to consumers ofapicurio-clientthat also carry the OTel starter — the fix corrects a silent misbehavior (noop hijack) rather than introducing a new one.BLAST_SCORE: 2/10
CI status (head
f048970dab1b)Overall: ⏳ pending
2 checks: 2 pending
Findings (2)
[MINOR] Annotation-pinning test checks
name()but notvalue()— partial contract coverageapicurio-client/src/test/java/com/aim2be/platform/schema/SchemaRegistryAutoConfigurationTest.java:120
@AutoConfigureAfterexposes two axes:name()(String FQCNs, used here) andvalue()(Class references). The test at lines 115–124 correctly prevents removing or mutating thenameentry, andcontainsExactlyprevents extra string-form names. However, a developer who addsvalue = {SomeClass.class}alongside the existingnameentry introduces an extra ordering constraint that passes this test undetected.Suggested addition immediately after line 123:
This fully pins both axes of the annotation and matches the stated rationale in the comment at lines 110–114.
[MINOR] Missing
fallbackYieldsToUserProvidedOpenTelemetryBeantest — gap vs.OutboxOpenTelemetryFallbackTestapicurio-client/src/test/java/com/aim2be/platform/schema/SchemaRegistryAutoConfigurationTest.java:106
OutboxOpenTelemetryFallbackTestcarries a third case (fallbackYieldsToAUserProvidedOpenTelemetryBean, lines 74–84) that verifies@ConditionalOnMissingBeanonschemaRegistryOpenTelemetryyields when the application registers its ownOpenTelemetrybean. That test does NOT require the OTel starter on the classpath — it useswithBean("userOpenTelemetry", OpenTelemetry.class, () -> userOtel)on the runner. This PR's new tests omit it, leaving the@ConditionalOnMissingBeanyield-to-user-bean contract untested.Suggested addition after
enabled_providesNoopOpenTelemetryWhenStarterAbsent(line 106):This brings
SchemaRegistryAutoConfigurationTestinto parity withOutboxOpenTelemetryFallbackTestand covers the user-bean-wins deployment path that@ConditionalOnMissingBeanis supposed to handle.Verdict
CONDITIONAL_APPROVE
hib-pr-reviewer • round 1 • 2 findings (2m) • 2026-05-31T22:00:25.367Z → 2026-05-31T22:01:52.485Z • posted-as: pr-reviewer-bot • model: auto
R1 CONDITIONAL_APPROVE findings (kept=2, both MINOR test-coverage, no blockers): (1) the ordering-guard test pinned name() but not value() — a stray value={SomeClass.class} would add an ordering constraint undetected → added assertThat(after.value()).isEmpty() (name-only refs; the OTel starter is not a compile-time dep). (2) missing the user-bean-yield case present in OutboxOpenTelemetryFallbackTest → added enabled_fallbackYieldsToUserProvidedOpenTelemetryBean (a user-supplied OpenTelemetry bean wins; @ConditionalOnMissingBean yields). mvn -pl apicurio-client install -DskipITs → 39/39 unit, 0 warnings.hib-pr-reviewer review — PR #23 (affinity-intelligence-rework/im2be-platform-libs)
Round 2 — head
1db54dc30210, basemain, triggersynchronizeTL;DR: NO_NEW_FINDINGS — No new findings this round.
Summary
[quorum-converged] A=0 = B=0. Both prior-round findings are resolved in this synchronize push:
name()only) — fixed:fallbackOrderingIsGuardedByAutoConfigureAfterOfOtelStarternow asserts bothafter.name()(containsExactly the OTel starter class name) andafter.value().isEmpty()(lines 120–127).enabled_fallbackYieldsToUserProvidedOpenTelemetryBeanis added at lines 130–143, matching the OutboxOpenTelemetryFallbackTest parity requirement.The production change (
@AutoConfigureAfter(name = "…OpenTelemetryAutoConfiguration")) is correct and safe: usingnamerather thanvalueavoids a hard compile-time dependency on the OTEL starter, Spring silently ignores unknown class names in@AutoConfigureAfter, and the@ConditionalOnMissingBeanfallback path remains intact for starter-absent deployments. The Javadoc update accurately describes the ordering invariant. No new actionable issues found.CI status (head
1db54dc30210)Overall: ⏳ pending
2 checks: 2 pending
Findings
No new findings this round.
Quorum converged on empty findings (A + B both returned 0).
Verdict
NO_NEW_FINDINGS
hib-pr-reviewer • round 2 • 0 findings • 2026-05-31T22:02:59.283Z → 2026-05-31T22:04:00.318Z • posted-as: pr-reviewer-bot • model: auto • [bookkeeping fallback]