Skip to content

test(core): guard Bedrock admission startup path#61

Open
robinbraemer wants to merge 2 commits into
mainfrom
fm/connect-java-bedrock-admission-startup-guard
Open

test(core): guard Bedrock admission startup path#61
robinbraemer wants to merge 2 commits into
mainfrom
fm/connect-java-bedrock-admission-startup-guard

Conversation

@robinbraemer

Copy link
Copy Markdown
Member

Intent

Harden the regression guard for the connect-java 0.12.0 Paper/Spigot startup crash (moxy#470; code already fixed in 0.12.1 / PR #59). Root cause: BedrockIdentityEnforcer and BedrockIdentityKeyProvider injected ConnectConfig directly, and they are resolved by the config-agnostic parent/platform injector while SpigotPlatform is constructed (before ConnectPlatform.init() loads config), forcing a JIT ConnectConfig binding on the parent that then collided (JitBindingAlreadySet) with the child ConfigLoadedModule binding — so onLoad crashed and token.json was never generated. 0.12.1 fixed the code by resolving config lazily via ConfigHolder. I verified 0.12.1 fully fixes the crash by reproducing on the 0.12.0 release commit (the graph is unresolvable from a config-agnostic parent) and confirming main passes. This change is TEST-ONLY: the existing BedrockParentInjectorStartupTest guard only exercised the enforcer path, but the bug report and SpigotPlatform/ConnectPlatform inject BedrockAdmissionCoordinator directly. I added a second test method (and extracted shared parent-injector/assertion helpers) that resolves BedrockAdmissionCoordinator from the pre-config parent and asserts the parent stays ConnectConfig-agnostic, closing the coverage gap for the exact injection point named in the report. No production code changed.

What Changed

  • Added regression coverage that resolves BedrockAdmissionCoordinator from the pre-configuration parent injector and verifies it remains ConnectConfig-agnostic.
  • Extracted shared parent-injector setup and assertions while retaining the existing enforcer-path guard.

The full validation pipeline passed.

Risk Assessment

✅ Low: The change is narrowly scoped to test-only injector coverage, preserves the existing guard, and adds the requested direct BedrockAdmissionCoordinator startup-path check.

Testing

The focused regression test passed for both enforcer and coordinator paths; the independent runtime check confirmed coordinator resolution, no parent ConnectConfig binding, and successful child config binding. Evidence was preserved and generated build/cache directories were removed; no UI surface exists for this backend injector change.

Evidence: Runtime startup smoke check

PRE_CONFIG_PARENT coordinator resolution: OK PRE_CONFIG_PARENT ConnectConfig binding: null POST_INIT_CHILD ConnectConfig is loaded instance: true

jshell> jshell> jshell> jshell> jshell> jshell> jshell> PRE_CONFIG_PARENT coordinator resolution: OK
jshell> PRE_CONFIG_PARENT ConnectConfig binding: null
jshell> jshell> jshell> POST_INIT_CHILD ConnectConfig is loaded instance: true
jshell> jshell> 
Evidence: Gradle test report
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="x-ua-compatible" content="IE=edge"/>
<title>Test results - BedrockParentInjectorStartupTest</title>
<link href="../css/base-style.css" rel="stylesheet" type="text/css"/>
<link href="../css/style.css" rel="stylesheet" type="text/css"/>
<script src="../js/report.js" type="text/javascript"></script>
</head>
<body>
<div id="content">
<h1>BedrockParentInjectorStartupTest</h1>
<div class="breadcrumbs">
<a href="../index.html">all</a> &gt; 
<a href="../packages/com.minekube.connect.module.html">com.minekube.connect.module</a> &gt; BedrockParentInjectorStartupTest</div>
<div id="summary">
<table>
<tr>
<td>
<div class="summaryGroup">
<table>
<tr>
<td>
<div class="infoBox" id="tests">
<div class="counter">2</div>
<p>tests</p>
</div>
</td>
<td>
<div class="infoBox" id="failures">
<div class="counter">0</div>
<p>failures</p>
</div>
</td>
<td>
<div class="infoBox" id="ignored">
<div class="counter">0</div>
<p>ignored</p>
</div>
</td>
<td>
<div class="infoBox" id="duration">
<div class="counter">0.291s</div>
<p>duration</p>
</div>
</td>
</tr>
</table>
</div>
</td>
<td>
<div class="infoBox success" id="successRate">
<div class="percent">100%</div>
<p>successful</p>
</div>
</td>
</tr>
</table>
</div>
<div id="tabs">
<ul class="tabLinks">
<li>
<a href="#tab0">Tests</a>
</li>
</ul>
<div id="tab0" class="tab">
<h2>Tests</h2>
<table>
<thead>
<tr>
<th>Test</th>
<th>Duration</th>
<th>Result</th>
</tr>
</thead>
<tr>
<td class="success">resolvingAdmissionCoordinatorDoesNotBindConfigOnParentInjector()</td>
<td class="success">0.272s</td>
<td class="success">passed</td>
</tr>
<tr>
<td class="success">resolvingBedrockGraphDoesNotBindConfigOnParentInjector()</td>
<td class="success">0.019s</td>
<td class="success">passed</td>
</tr>
</table>
</div>
</div>
<div id="footer">
<p>
<div>
<label class="hidden" id="label-for-line-wrapping-toggle" for="line-wrapping-toggle">Wrap lines
<input id="line-wrapping-toggle" type="checkbox" autocomplete="off"/>
</label>
</div>Generated by 
<a href="http://www.gradle.org">Gradle 8.5</a> at Jul 23, 2026, 9:26:28 AM</p>
</div>
</div>
</body>
</html>

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • ./gradlew :core:test --tests com.minekube.connect.module.BedrockParentInjectorStartupTest --rerun-tasks --console=plain
  • Direct runtime smoke check resolving BedrockAdmissionCoordinator before config load, then binding ConnectConfig in a child injector
  • ./gradlew :core:clean :api:clean :build-logic:clean --console=plain
  • Final git status and transient-output checks
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant