Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

APPS-1283 Introduce DTO layer #230

Merged
merged 51 commits into from
Sep 3, 2024
Merged

Conversation

korotkov-aerospike
Copy link
Contributor

No description provided.

@codecov-commenter
Copy link

codecov-commenter commented Sep 2, 2024

Codecov Report

Attention: Patch coverage is 19.77186% with 844 lines in your changes missing coverage. Please review.

Project coverage is 39.00%. Comparing base (a15567c) to head (3d8c4f5).

Files with missing lines Patch % Lines
pkg/dto/config.go 24.00% 80 Missing and 15 partials ⚠️
pkg/dto/aerospike_cluster.go 35.83% 71 Missing and 6 partials ⚠️
pkg/dto/backup_policy.go 22.10% 62 Missing and 12 partials ⚠️
pkg/dto/backup_routine.go 28.71% 63 Missing and 9 partials ⚠️
pkg/dto/restore_policy.go 0.00% 68 Missing ⚠️
pkg/dto/storage.go 25.00% 50 Missing and 7 partials ⚠️
pkg/dto/logger_config.go 23.61% 50 Missing and 5 partials ⚠️
pkg/dto/restore_request.go 0.00% 53 Missing ⚠️
pkg/dto/base_dto.go 0.00% 43 Missing ⚠️
pkg/dto/time_bounds.go 0.00% 39 Missing ⚠️
... and 11 more
Additional details and impacted files
@@             Coverage Diff             @@
##               v2     #230       +/-   ##
===========================================
- Coverage   80.65%   39.00%   -41.66%     
===========================================
  Files          14       30       +16     
  Lines         641     1564      +923     
===========================================
+ Hits          517      610       +93     
- Misses         97      876      +779     
- Partials       27       78       +51     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

# Conflicts:
#	cmd/backup/main.go
#	internal/server/configuration/configuration_manager.go
#	internal/server/configuration/configuration_manager_local.go
#	internal/server/handlers/backup.go
#	internal/server/handlers/config.go
#	internal/server/handlers/config_cluster.go
#	internal/server/handlers/config_cluster_test.go
#	internal/server/handlers/config_policy.go
#	internal/server/handlers/config_policy_test.go
#	internal/server/handlers/config_routine.go
#	internal/server/handlers/config_routines_test.go
#	internal/server/handlers/config_storage.go
#	internal/server/handlers/config_storage_test.go
#	internal/server/handlers/config_test.go
#	internal/server/handlers/handlers_test.go
#	internal/server/handlers/restore.go
#	internal/server/handlers/restore_test.go
#	internal/server/handlers/service.go
#	internal/server/server.go
#	pkg/model/backup_policy.go
#	pkg/model/config_default.go
#	pkg/model/restore_policy.go
#	pkg/service/configuration_manager_http.go
#	pkg/service/configuration_manager_s3.go
#	pkg/service/configuration_manager_test.go
#	pkg/service/configuration_service_cluster.go
#	pkg/service/configuration_service_cluster_test.go
#	pkg/service/configuration_service_policy.go
#	pkg/service/configuration_service_policy_test.go
#	pkg/service/configuration_service_routine.go
#	pkg/service/configuration_service_routine_test.go
#	pkg/service/configuration_service_storage.go
#	pkg/service/configuration_service_storage_test.go
#	pkg/service/restore_go.go
#	pkg/service/s3_context_test.go
#	pkg/service/storage_accessor.go
@korotkov-aerospike
Copy link
Contributor Author

Brief overview:

  1. split dto/model
    all validation in dto
    logic in model
    dtos have to/From model methods
    serialization for dto.

  2. config validation in model. Config is always valid, it's checked on add/remove elements

  3. configuration manager moved to internal package

  4. use actual objects instead of names in business logic, e.g. ClientManager now stores pointers to actual cluster structs.

all tests pass: http://3.65.168.247:8080/ui/#backup/launches/all

@korotkov-aerospike korotkov-aerospike marked this pull request as ready for review September 3, 2024 10:58
pkg/dto/backup_routine.go Outdated Show resolved Hide resolved
pkg/dto/backup_routine.go Outdated Show resolved Hide resolved
pkg/dto/config.go Show resolved Hide resolved
pkg/dto/backup_policy.go Show resolved Hide resolved
pkg/dto/backup_details.go Show resolved Hide resolved
pkg/dto/aerospike_cluster.go Show resolved Hide resolved
pkg/dto/restore_namespace.go Show resolved Hide resolved
pkg/dto/secret_agent.go Show resolved Hide resolved
@korotkov-aerospike korotkov-aerospike merged commit 657b791 into v2 Sep 3, 2024
3 checks passed
@korotkov-aerospike korotkov-aerospike deleted the APPS-1283/DTO_refactoring branch September 3, 2024 14:08
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.

4 participants