kit-data-manager / kit-data-manager/repo-core

Cyclic dependencies during bean initialization

Open
#32 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
0
Forks
2
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
As of spring-boot 2.6 it is no longer allowed to have cycles during dependency injection. Before, spring-boot tried to resolve cycles as far as possible (which seemed to work for repo-core) but it doesn't anymore. Most of the existing cycles could be resolved in repo-core v1.0.3, but some cleanup will be required.

This bug mostly affects the way of using RepoBaseConfiguration. This class is used as carrier for all properties and beans, which are then propagated to each other and used as required. While creating this Bean, cycles may occur as the order of creating RepoBaseConfiguration matters.

E.g., the IRepoStorageService has to be identified and configured before IRepoVersioningService is configured, as IRepoVersioningService uses IRepoStorageService. Otherwise, an error will be thrown at startup time.

A solution would only be implementing a proper dependency injection, which probably requires a lot of restructuring and should be part of the next major release.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by examining RepoBaseConfiguration and the initialization relationship between IRepoStorageService and IRepoVersioningService under Spring Boot 2.6. Reproduce the startup failure and map the dependency cycles before deciding on the required restructuring. Done means the affected configuration starts without cyclic-dependency errors and the services initialize in a valid order.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring-boot
Domain
backend
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.