test(core): guard Bedrock admission startup path#61
Open
robinbraemer wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
BedrockAdmissionCoordinatorfrom the pre-configuration parent injector and verifies it remainsConnectConfig-agnostic.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
ConnectConfigbinding, 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: trueEvidence: Gradle test report
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=plainDirect runtime smoke check resolvingBedrockAdmissionCoordinatorbefore config load, then bindingConnectConfigin a child injector./gradlew :core:clean :api:clean :build-logic:clean --console=plainFinalgit statusand transient-output checks✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.