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

Refactor configs to allow unmarshalling instead of accessing them by string paths #146

Merged
merged 5 commits into from Jul 29, 2021

Conversation

felippeduran
Copy link
Member

This PR is separated into two isolated commits:

  • The first one refactors configs into nested structs to allow unmarshalling instead of accessing them by string paths
  • The second one standardizes constructors to always return pointers instead of values (more aligned with the common use of the new keyword)
    It's recommended to review them independently.

There's an open issue in viper related to the use of env var overrides and unmarshalling, but one of the suggested workarounds is already covered by our code here.

config/config.go Outdated Show resolved Hide resolved
config/viper_config.go Outdated Show resolved Hide resolved
builder.go Show resolved Hide resolved
@coveralls
Copy link

coveralls commented Nov 12, 2020

Pull Request Test Coverage Report for Build 1076509610

  • 281 of 387 (72.61%) changed or added relevant lines in 10 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+1.09%) to 68.245%

Changes Missing Coverage Covered Lines Changed/Added Lines %
metrics/prometheus_reporter.go 0 2 0.0%
metrics/statsd_reporter.go 1 3 33.33%
config/viper_config.go 38 41 92.68%
worker/worker.go 0 8 0.0%
builder.go 18 28 64.29%
config/config.go 201 282 71.28%
Totals Coverage Status
Change from base Build 1059958609: 1.09%
Covered Lines: 4973
Relevant Lines: 7287

💛 - Coveralls

@gabrielcorado gabrielcorado added this to the v2 milestone Jan 18, 2021
@henriqueoelze henriqueoelze requested review from gabrielcorado and luizmiranda7 and removed request for leohahn July 28, 2021 21:34
@henriqueoelze henriqueoelze merged commit 74bc847 into v2 Jul 29, 2021
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.

None yet

7 participants