refactor(architecture): restore clean architecture dependency direction via ports and DI#121
Open
kangeunchan wants to merge 1 commit intoaltuslabsxyz:mainfrom
Conversation
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
Restore clean architecture dependency direction by removing application-layer infrastructure coupling and enforcing port-driven boundaries.
Summary
This PR removes dependency-direction violations in the application layer and moves concrete wiring to DI/composition boundaries.
Previously, parts of the application layer depended on infrastructure details:
Now application packages depend on ports/interfaces, and infrastructure stays at outer layers.
What Changed
1) Replaced outward dependencies with port-based contracts
Updated application/ports boundaries in:
internal/application/ports/export_dependencies.gointernal/application/ports/provisioner.gointernal/application/ports/repositories.go2) Moved concrete wiring to DI/composition roots
Updated:
internal/di/container.gointernal/di/providers/devnet.goConcrete adapter selection now remains in composition, not use cases.
3) Updated affected use-case and command paths
Updated:
internal/application/devnet/provision.gointernal/application/devnet/docker_deploy.gointernal/application/devnet/export.gointernal/application/service.gocmd/devnet-builder/commands/manage/deploy.go4) Tests
Added/updated tests:
internal/application/devnet/export_test.goWhy This Is Needed
This is an architectural correctness refactor.
It restores dependency inversion, reduces coupling, and improves testability and review confidence.
Behavior Notes / Regression Impact
No intentional runtime behavior change.
The change is focused on dependency boundaries and wiring location.
Validation Performed
go test ./internal/application/...go test ./internal/di/...go test ./...golangci-lint run