refactor: eliminate global state dependencies with explicit injection#123
Open
kangeunchan wants to merge 2 commits intoaltuslabsxyz:mainfrom
Open
refactor: eliminate global state dependencies with explicit injection#123kangeunchan wants to merge 2 commits intoaltuslabsxyz:mainfrom
kangeunchan wants to merge 2 commits intoaltuslabsxyz:mainfrom
Conversation
Signed-off-by: kangeunchan <kangeunchan080310@gmail.com>
… loggers Signed-off-by: kangeunchan <kangeunchan080310@gmail.com>
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.
Enhancement Description
Eliminate global state dependencies by replacing global logger/registry usage with explicit dependency injection.
Summary
This PR removes global mutable dependencies from critical paths and makes initialization/wiring explicit.
Previously, global dependencies created hidden coupling:
Now collaborators are passed explicitly through constructors/wiring.
What Changed
1) Replaced global logger usage with injected loggers
Updated across application/daemon/infrastructure paths including:
internal/application/service.gointernal/application/version/service.gointernal/daemon/server/server.gointernal/infrastructure/*(targeted logger call sites)2) Replaced global registry access with explicit dependencies
Updated daemon/server and related wiring:
internal/daemon/server/network_service.gointernal/daemon/server/plugins.gointernal/daemon/server/wiring.go3) Updated composition roots and startup wiring
Updated:
cmd/devnet-builder/main.gointernal/di/container.gointernal/di/container_v2.go4) Tests
Added/updated tests:
internal/daemon/server/network_service_test.gointernal/daemon/server/wiring_test.gotests/unit/resume_usecase_test.goWhy This Is Needed
This is a reliability and testability refactor.
Removing global state improves isolation, reduces hidden side effects, and clarifies lifecycle boundaries.
Behavior Notes / Regression Impact
No intentional feature/CLI behavior change.
Initialization paths are now explicit and easier to reason about.
Validation Performed
go test ./internal/daemon/server/...go test ./internal/application/...go test ./...golangci-lint run