This repository was archived by the owner on Jan 24, 2021. It is now read-only.
Migrating diagnostics to the unified configuration API#2012
Merged
khellang merged 7 commits intoNancyFx:v2from Nov 9, 2015
Merged
Migrating diagnostics to the unified configuration API#2012khellang merged 7 commits intoNancyFx:v2from
khellang merged 7 commits intoNancyFx:v2from
Conversation
Member
Author
|
I will rebase this one #2003 has been merged |
3a4e857 to
1795ba1
Compare
Member
Author
|
Rebased, but please do not merge. Read the initial description
However this needs merging before we merge |
11 tasks
1795ba1 to
db9d50b
Compare
Member
|
LGTM I think we should just merge this and get to work on the rest of the configuration stuff. We'll see how it works out down the road. |
khellang
added a commit
that referenced
this pull request
Nov 9, 2015
…iagnostics Migrating diagnostics to the unified configuration API
Contributor
|
Are these v2 builds listed on myget yet? |
Member
|
Some are, but we haven't gotten it building after the merge to master 😛 |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Migrated the configuration of the diagnostics system to the new unified configuration API, according to #1999 and #2000.
The following steps were performed
DiagnosticsConfigurationclass to be immutableDiagnosticsConfiguration.Defaultstatic field that returns the default diagnostics configurationDiagnosticsDefaultConfigurationProviderthat returnsDiagnosticsConfiguration.DefaultDiagnosticsextension method toINancyEnironmentto enable configuration of diagnosticsNancyBootstrapperBase.DiagnosticsConfigurationmethodDiagosticsextension method instead of overridingConfigurableBootstrapper.DiagnosticsConfigurationDiagosticsextension method instead of overridingNancyBootstrapperBase.DiagnosticsConfigurationI want this pull-request to server as a discussion point for how we perform the migrations. I will update #2000 according to review feedback
This looks like a massive pull-request, because I branched of the - yet unmerged - code in #2003 it is only the last 5 commits that are unique to this pull-request
The
DiagnosticsConfigurationclass defines aDefaultstatic field that returns the default diagnostics configurationThe public constructor checks if values are null and if they are it will pull out the values from
DefaultThe
Diagnosticsextension onINancyEnvironmenttakes advantage of thisAll values, except
passwordhave default values, which will force theDiagnosticsConfigurationctor revert back to using the values defined inDefault. Thepasswordis a mandatory value, hence no default fallback. The method was purposly designed this way to cater for the following API when consuming itOf course the parameter names are optional, but they provide a much higher sense of readability and it is the style that I think that we should promote in our documentation for the guidelines for authoring configuration support into extensions.
Update 2015-11-07
This change also includes an
INancyDefaultConfigurationProvidersimplementation for diagnostics (read more about them in #1999)DiagnosticsConfigurationclass could implementINancyDefaultConfigurationProviderinstread of having a completely different class that just returnsDiagnosticsConfiguration.Default? What should be the best-practice approach that we take for our configurations? Unique class or have the config object implement it? Our guidelines should recommend to always have anINancyDefaultConfigurationProviderimplementation so you avoid in an unconfigured state.Update 2015-11-09
Updated
DiagnosticsDefaultConfigurationProviderto inherit fromNancyDefaultConfigurationProviderand use the default key name (Type.FullName)