Skip to content

refactor: config#26

Merged
GregoryAlbouy merged 11 commits intomainfrom
refactor/config
Oct 8, 2022
Merged

refactor: config#26
GregoryAlbouy merged 11 commits intomainfrom
refactor/config

Conversation

@GregoryAlbouy
Copy link
Member

@GregoryAlbouy GregoryAlbouy commented Jul 30, 2022

⚠️ NO MERGE until this PR targets main. Currently targeting #48

Description

This PR follows #48 (extraction of CLI app from this repo).

Here we expose configparse as an external package, so it can be used by the newly standalone CLI app.

Some improvements around Config came in the process (see commits for details)

Changes

Linked issues

Notes

@GregoryAlbouy GregoryAlbouy added nice to have Non-blocking feature for the targeted release scope:core scope:server scope:cli labels Jul 30, 2022
@GregoryAlbouy GregoryAlbouy added this to the Next milestone Jul 30, 2022
@GregoryAlbouy GregoryAlbouy added must have Blocking feature for the targeted release and removed nice to have Non-blocking feature for the targeted release scope:server labels Oct 8, 2022
@GregoryAlbouy GregoryAlbouy changed the base branch from main to chore/extract-cli-app October 8, 2022 09:53
@codecov-commenter
Copy link

codecov-commenter commented Oct 8, 2022

Codecov Report

Merging #26 (c733c2a) into main (ebab0a7) will increase coverage by 0.52%.
The diff coverage is 75.55%.

@@            Coverage Diff             @@
##             main      #26      +/-   ##
==========================================
+ Coverage   73.35%   73.88%   +0.52%     
==========================================
  Files          27       28       +1     
  Lines         867      873       +6     
==========================================
+ Hits          636      645       +9     
+ Misses        205      203       -2     
+ Partials       26       25       -1     
Flag Coverage Δ
unittests 73.88% <75.55%> (+0.52%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
runner/internal/config/default.go 100.00% <ø> (ø)
runner/internal/config/field.go 100.00% <ø> (ø)
runner/runner.go 0.00% <ø> (ø)
configparse/parse.go 15.38% <40.00%> (ø)
runner/internal/config/config.go 88.76% <92.00%> (+1.42%) ⬆️
configparse/parser_json.go 92.30% <92.30%> (ø)
configparse/json.go 77.77% <100.00%> (ø)
configparse/parser_yaml.go 91.89% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@GregoryAlbouy GregoryAlbouy force-pushed the chore/extract-cli-app branch from 75a6598 to 5dad955 Compare October 8, 2022 09:57
@GregoryAlbouy GregoryAlbouy marked this pull request as ready for review October 8, 2022 09:58
@GregoryAlbouy GregoryAlbouy force-pushed the refactor/config branch 3 times, most recently from 6a17c5f to 55bcf64 Compare October 8, 2022 11:27
Copy link
Member

@moreirathomas moreirathomas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finally made it ! Great work 😄

I have some suggestions for more explicit (?) names.

Copy link
Member

@moreirathomas moreirathomas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After reading through benchttp/cli#1, isn't Config.Output.Silence deprecated in the scope of this pr and should be remove?

@GregoryAlbouy
Copy link
Member Author

After reading through benchttp/cli#1, isn't Config.Output.Silence deprecated in the scope of this pr and should be remove?

Already done, forgot to push 🙃

@GregoryAlbouy GregoryAlbouy changed the base branch from chore/extract-cli-app to main October 8, 2022 17:41
Integrate the fields memorizing logics into runner.Config

- implement Config.WithFields
- update tests accordingly
- configparse: remove parsedConfig intermediary
- ./internal/configparse -> ./configparse
- rename nesParsedConfig -> ParseRepresentation
- prev.Override(next) -> next.Override(prev)
We cannot rely on reflect.DeepEqual anymore as private field
config.fieldsSet can vary for 2 identical configs.

- implement Config.Equal that ignores Config.fieldsSet
- write unit tests for Config.Equal
- use Config.Equal in tests
- improve documentation of Config.Override
- rename Config.fieldsSet -> Config.assignedFields
- refactor Config.WithFields
@GregoryAlbouy GregoryAlbouy merged commit d1162e9 into main Oct 8, 2022
@moreirathomas moreirathomas deleted the refactor/config branch October 9, 2022 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

must have Blocking feature for the targeted release scope:cli scope:core

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Decorrelate CLI config from runner config

3 participants