fix(api): autowire multi-constructor beans (hotfix part 2) #1115
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/spring-multi-ctor-autowire"
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?
Hotfix part 2
Deploy run 4109 failed at Deploy API with
NoSuchMethodException: AdminBootstrapService.<init>()— the same failure family as #1113 (StorageAvailabilityService): package-private test-seam constructors disable Spring's implicit single-constructor autowiring, so Spring looks up the no-arg constructor and startup fails.Fixed in this PR:
AdminBootstrapService:@Autowiredon the public production constructor (3 constructors total)StoragePathsAdminController:@Autowiredon the public production constructor (would have been the next startup failure)A repo-wide scan of all
@Service/@Component/@RestController/@Configurationclasses found no further multi-constructor beans without@Autowired.Validation:
rtk ./gradlew :apps:api:compileJava+ storage/setup test packages green; rescan clean.Follow-up (non-blocking): add a
@SpringBootTestcontext-load smoke test so wiring failures are caught pre-deploy instead of during the live Deploy API job.