Skip to content

Commit

Permalink
Integrate Configy
Browse files Browse the repository at this point in the history
* Advanced config inheritance and variables are now available
* Modified example files to document this and use the shorter format sans types
* Config variable replacement is now in a pipeline
* Helix conventional variables are now usable in predicates and root paths
  • Loading branch information
kamsar committed Feb 22, 2017
1 parent befe41a commit f62ca5d
Show file tree
Hide file tree
Showing 25 changed files with 308 additions and 616 deletions.
2 changes: 1 addition & 1 deletion NuGet.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<!--
Used to specify the default Sources for list, install and update.
Expand Down
8 changes: 7 additions & 1 deletion Unicorn.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25123.0
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unicorn", "src\Unicorn\Unicorn.csproj", "{82C4441B-E11E-4601-B6B7-C5AD71B2AB70}"
EndProject
Expand All @@ -19,6 +19,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unicorn.Users", "src\Unicor
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unicorn.Roles.Tests", "src\Unicorn.Roles.Tests\Unicorn.Roles.Tests.csproj", "{7731968E-8A3E-4F36-860D-CE614C3D9114}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Configy", "..\Configy\src\Configy\Configy.csproj", "{BB66D7F7-6E33-4AC6-B978-E1F4E757F4A5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -57,6 +59,10 @@ Global
{7731968E-8A3E-4F36-860D-CE614C3D9114}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7731968E-8A3E-4F36-860D-CE614C3D9114}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7731968E-8A3E-4F36-860D-CE614C3D9114}.Release|Any CPU.Build.0 = Release|Any CPU
{BB66D7F7-6E33-4AC6-B978-E1F4E757F4A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BB66D7F7-6E33-4AC6-B978-E1F4E757F4A5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BB66D7F7-6E33-4AC6-B978-E1F4E757F4A5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BB66D7F7-6E33-4AC6-B978-E1F4E757F4A5}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
4 changes: 4 additions & 0 deletions src/Unicorn.Roles/Unicorn.Roles.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@
<Compile Include="RolePredicates\ConfigurationRolePredicate.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Configy\src\Configy\Configy.csproj">
<Project>{bb66d7f7-6e33-4ac6-b978-e1f4e757f4a5}</Project>
<Name>Configy</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\Rainbow\src\Rainbow.Storage.Yaml\Rainbow.Storage.Yaml.csproj">
<Project>{371181c9-45dc-4885-8894-43ffc235d124}</Project>
<Name>Rainbow.Storage.Yaml</Name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@

namespace Unicorn.Tests.Configuration
{
public class XmlConfigurationProviderTests
public class ConfigyConfigurationProviderTests
{
[Fact]
public void ShouldLoadExpectedConfigurations()
{
var testProvider = new TestXmlConfigurationProvider();
var testProvider = new TestConfigyConfigurationProvider();

Assert.NotEmpty(testProvider.Configurations);
Assert.Equal("Default Configuration", testProvider.Configurations[0].Name);
Expand All @@ -18,15 +18,15 @@ public void ShouldLoadExpectedConfigurations()
[Fact]
public void ShouldResolveExpectedDefaultDependency()
{
var testProvider = new TestXmlConfigurationProvider();
var testProvider = new TestConfigyConfigurationProvider();

Assert.IsType(typeof(DefaultSerializationLoaderLogger), testProvider.Configurations[0].Resolve<ISerializationLoaderLogger>());
}

[Fact]
public void ShouldResolveExpectedOverriddenDependency()
{
var testProvider = new TestXmlConfigurationProvider();
var testProvider = new TestConfigyConfigurationProvider();

Assert.IsType(typeof(DebugSerializationLoaderLogger), testProvider.Configurations[1].Resolve<ISerializationLoaderLogger>());
}
Expand Down
68 changes: 0 additions & 68 deletions src/Unicorn.Tests/Configuration/MicroConfigurationTests.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Unicorn.Tests.Configuration
{
internal class TestXmlConfigurationProvider : XmlConfigurationProvider
internal class TestConfigyConfigurationProvider : ConfigyConfigurationProvider
{
protected override XmlNode GetConfigurationNode()
{
Expand Down

This file was deleted.

10 changes: 6 additions & 4 deletions src/Unicorn.Tests/Unicorn.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -150,16 +150,14 @@
<Compile Include="Configuration\Dependencies\ConfigurationDependencyResolverTests.Explicit.cs" />
<Compile Include="Configuration\Dependencies\DepTestHelper.cs" />
<Compile Include="Configuration\Dependencies\InterconfigurationDependencyResolverTests.cs" />
<Compile Include="Configuration\MicroConfigurationTests.cs" />
<None Include="app.config" />
<Compile Include="ControlPanel\Security\SitecoreDatabaseChallengeStoreTests.cs" />
<Compile Include="Data\DataProvider\ItemChangeApplyingItemDataTests.cs" />
<Compile Include="Data\DataProvider\UnicornDataProviderTests.AddVersion.cs" />
<Compile Include="Data\DataProvider\UnicornDataProviderTests.SaveItem.cs" />
<Compile Include="Evaluator\SerializedAsMasterEvaluatorTests.cs" />
<Compile Include="Configuration\TestXmlConfigurationProvider.cs" />
<Compile Include="Configuration\XmlConfigurationProviderTests.cs" />
<Compile Include="Configuration\XmlConfigurationTypeActivatorTests.cs" />
<Compile Include="Configuration\TestConfigyConfigurationProvider.cs" />
<Compile Include="Configuration\ConfigyConfigurationProviderTests.cs" />
<Compile Include="Content.cs" />
<Compile Include="ControlPanel\Headings\HeadingServiceTests.cs" />
<Compile Include="Data\DataProvider\DataProviderConfigurationTests.cs" />
Expand Down Expand Up @@ -187,6 +185,10 @@
<EmbeddedResource Include="Configuration\TestXmlConfiguration.xml" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Configy\src\Configy\Configy.csproj">
<Project>{bb66d7f7-6e33-4ac6-b978-e1f4e757f4a5}</Project>
<Name>Configy</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\Rainbow\src\Rainbow.Storage.Sc\Rainbow.Storage.Sc.csproj">
<Project>{956afe8b-51cd-4d61-b8c1-bffdc749fd82}</Project>
<Name>Rainbow.Storage.Sc</Name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ public UnicornConfigurationUsersEventHandler(IConfiguration configuration)
_dataStore = configuration.Resolve<IUserDataStore>();
}


public virtual void UserAlteredOrCreated(string userName)
{
var user = User.FromName(userName, false);
Expand Down
4 changes: 4 additions & 0 deletions src/Unicorn.Users/Unicorn.Users.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Configy\src\Configy\Configy.csproj">
<Project>{bb66d7f7-6e33-4ac6-b978-e1f4e757f4a5}</Project>
<Name>Configy</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\Rainbow\src\Rainbow.Storage.Yaml\Rainbow.Storage.Yaml.csproj">
<Project>{371181c9-45dc-4885-8894-43ffc235d124}</Project>
<Name>Rainbow.Storage.Yaml</Name>
Expand Down
Loading

0 comments on commit f62ca5d

Please sign in to comment.