Skip to content

refactor(di): consolidate DI containers into a single tested implementation#124

Open
kangeunchan wants to merge 2 commits intoaltuslabsxyz:mainfrom
kangeunchan:refactor/consolidate-di-containers
Open

refactor(di): consolidate DI containers into a single tested implementation#124
kangeunchan wants to merge 2 commits intoaltuslabsxyz:mainfrom
kangeunchan:refactor/consolidate-di-containers

Conversation

@kangeunchan
Copy link
Collaborator

Enhancement Description

Consolidate DI container implementations into a single tested path to reduce ambiguity and wiring drift.

Summary

This PR standardizes DI construction on one canonical implementation and adds focused tests for wiring behavior.

Previously, multiple container paths increased maintenance risk:

  • overlapping responsibilities across container/factory code
  • inconsistent wiring behavior was harder to detect
  • test coverage for integration points was limited

Now DI creation and wiring follow one clear path with dedicated tests.

What Changed

1) Consolidated DI creation path

Updated:

  • internal/di/container_v2.go
  • internal/di/factory.go

2) Removed duplicate wiring ambiguity

  • unified adapter/container creation flow
  • reduced parallel code paths for container assembly

3) Kept external behavior stable

  • no public CLI/API contracts were changed
  • composition semantics are preserved while code paths are simplified

4) Tests

Added/updated tests:

  • internal/di/container_test.go
  • internal/di/factory_test.go

Why This Is Needed

This is a maintainability and correctness refactor.
One container path improves readability, lowers review risk, and increases confidence in wiring changes.

Behavior Notes / Regression Impact

No intentional runtime behavior change.
Refactor scope is limited to DI internals and tests.

Validation Performed

  • go test ./internal/di/...
  • go test ./...
  • golangci-lint run

Signed-off-by: kangeunchan <kangeunchan080310@gmail.com>
Signed-off-by: kangeunchan <kangeunchan080310@gmail.com>
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