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

upgrade to net 8 #2

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v2
with:
dotnet-version: "6.0.x"
dotnet-version: "8.0.x"
- name: Install dependencies
run: dotnet restore src
- name: Use GitVersion
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v2
with:
dotnet-version: "6.0.x"
dotnet-version: "8.0.x"
- name: Install dependencies
run: dotnet restore src
- name: Use GitVersion
Expand Down
2 changes: 1 addition & 1 deletion GitVersion.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
next-version: 1.0.0
next-version: 2.0.0
mode: Mainline
major-version-bump-message: '\+semver:\s?(breaking|major)'
minor-version-bump-message: '\+semver:\s?(feature|minor)'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>

<IsPackable>false</IsPackable>

<LangVersion>default</LangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="LittleBlocks.Testing" Version="1.0.2" />
<PackageReference Include="FluentAssertions" Version="6.8.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="6.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PackageReference Include="LittleBlocks.Testing" Version="2.0.0" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="xunit" Version="2.7.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.8">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.2.0">
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Title>LittleBlocks.Exports.Agent</Title>
<Authors>Mohammad Moattar, Lewis Percival</Authors>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public static ContainerBuilder RegisterCsv(this ContainerBuilder builder,
public static ContainerBuilder RegisterS3BucketStorageWithSamlSupport(this ContainerBuilder builder,
IConfiguration configuration, Action<IHaveProfile> configure)
{
if (builder == null) throw new ArgumentNullException(nameof(builder));
ArgumentNullException.ThrowIfNull(builder);

var options = new BucketOptions();
configuration.GetSection(nameof(BucketOptions)).Bind(options);
Expand All @@ -74,7 +74,7 @@ public static ContainerBuilder RegisterS3BucketStorageWithSamlSupport(this Conta
public static ContainerBuilder RegisterS3BucketStorage(this ContainerBuilder builder,
IConfiguration configuration, Action<IHaveProfile> configure)
{
if (builder == null) throw new ArgumentNullException(nameof(builder));
ArgumentNullException.ThrowIfNull(builder);

var options = new BucketOptions();
configuration.GetSection(nameof(BucketOptions)).Bind(options);
Expand All @@ -94,7 +94,7 @@ public static ContainerBuilder RegisterS3BucketStorage(this ContainerBuilder bui

public static ContainerBuilder RegisterInMemoryStorage(this ContainerBuilder builder)
{
if (builder == null) throw new ArgumentNullException(nameof(builder));
ArgumentNullException.ThrowIfNull(builder);

builder.RegisterType<CsvStorageTargetResolver>().IfNotRegistered(typeof(CsvStorageTargetResolver))
.AsImplementedInterfaces();
Expand All @@ -109,7 +109,7 @@ public static ContainerBuilder RegisterInMemoryStorage(this ContainerBuilder bui

public static ContainerBuilder RegisterLocalDiskStorage(this ContainerBuilder builder)
{
if (builder == null) throw new ArgumentNullException(nameof(builder));
ArgumentNullException.ThrowIfNull(builder);

builder.RegisterType<CsvStorageTargetResolver>().IfNotRegistered(typeof(CsvStorageTargetResolver))
.AsImplementedInterfaces();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Title>LittleBlocks.Exports.Autofac</Title>
<Authors>Mohammad Moattar</Authors>
Expand All @@ -11,7 +11,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Autofac" Version="6.2.0" />
<PackageReference Include="Autofac" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>

<IsPackable>false</IsPackable>

<LangVersion>default</LangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="LittleBlocks.Testing" Version="1.0.2" />
<PackageReference Include="FluentAssertions" Version="6.8.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="6.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PackageReference Include="LittleBlocks.Testing" Version="2.0.0" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="xunit" Version="2.7.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.8">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.2.0">
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
4 changes: 2 additions & 2 deletions src/LittleBlocks.Exports.Client/ExporterClientBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ public IExporterClient Build(string name)

public IExporterClientRegistry AddClient(string name, string clientUrl)
{
if (name == null) throw new ArgumentNullException(nameof(name));
if (clientUrl == null) throw new ArgumentNullException(nameof(clientUrl));
ArgumentNullException.ThrowIfNull(name);
ArgumentNullException.ThrowIfNull(clientUrl);

if (_exporterCache.ContainsKey(name))
throw new DuplicateExporterException($"Duplicate exporter with name {name} exists in the cache");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Title>LittleBlocks.Exports.Client</Title>
<Authors>Mohammad Moattar, Lewis Percival</Authors>
Expand All @@ -11,8 +11,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="LittleBlocks.RestEase" Version="1.0.2" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.3" />
<PackageReference Include="LittleBlocks.RestEase" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Title>LittleBlocks.Exports.Common</Title>
<Authors>Mohammad Moattar, Lewis Percival</Authors>
Expand All @@ -11,7 +11,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="LittleBlocks.RestEase.Client" Version="1.0.2" />
<PackageReference Include="LittleBlocks.RestEase.Client" Version="2.0.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -129,35 +129,7 @@ public async Task Should_ThrowError_WhenTheConfigurationDoesntHaveMappingForTheT
.Be(
$"Error in creating export configuration '{typeof(SampleEntity2)}'. Make sure the ClassMap has been registered");
}

// [Fact]
// TODO: Should be revised
public async Task Should_ExportAsync_UploadTheFileInAws()
{
var configPath = Path.Combine(Path.GetDirectoryName(GetType().Assembly.Location) ?? string.Empty,
"appsettings.json");
var entities = _fixture.FakeEntityList<SampleEntity>(5);
var configuration = new ConfigurationBuilder().AddJsonFile(configPath, false).Build();
var storageTargets = new[]
{
new StorageTarget
{
TargetLocation = "Mezz/Valuations/Automated/", StorageTargetType = StorageTargetType.S3Bucket
}
};
var services = new ServiceCollection();
services.AddLogging();
services.AddS3BucketStorageWithSamlSupport(configuration);
services.AddCsv(c => { c.Register<SampleEntityMap, SampleEntity>(); });

var serviceProvider = services.BuildServiceProvider();
var sut = serviceProvider.GetRequiredService<IFileExporter>();

var actual = await sut.ExportAsync(entities, new ExporterOptions(DateTime.Today, storageTargets));

actual.Should().NotBe(null);
}


[Fact]
public async Task Should_ExportAsync_UploadTheFileInAzureBlobStorageWithSharedKey()
{
Expand All @@ -169,7 +141,7 @@ public async Task Should_ExportAsync_UploadTheFileInAzureBlobStorageWithSharedKe
{
new StorageTarget
{
TargetLocation = "mezz/valuations/automated/", StorageTargetType = StorageTargetType.BlobStorage
TargetLocation = "test/targets/automated/", StorageTargetType = StorageTargetType.BlobStorage
}
};
var services = new ServiceCollection();
Expand Down Expand Up @@ -198,7 +170,7 @@ public async Task Should_ExportAsync_UploadTheFileInAzureBlobStorageWithAzureAd(
{
new StorageTarget
{
TargetLocation = "mezz/valuations/manual/", StorageTargetType = StorageTargetType.BlobStorage
TargetLocation = "test/targets/manual/", StorageTargetType = StorageTargetType.BlobStorage
}
};
var services = new ServiceCollection();
Expand All @@ -215,30 +187,5 @@ public async Task Should_ExportAsync_UploadTheFileInAzureBlobStorageWithAzureAd(
actual.Should().NotBe(null);
actual.HasError.Should().BeFalse();
}

//[Fact]
public async Task Should_ExportAsync_UploadTheFileInAzureBlobStorageWithEmulator()
{
var entities = _fixture.FakeEntityList<SampleEntity>(5);
var storageTargets = new[]
{
new StorageTarget
{
TargetLocation = "mezz/valuations/manual/", StorageTargetType = StorageTargetType.BlobStorage
}
};
var services = new ServiceCollection();
services.AddLogging();
services.AddAccountWithEmulatorStorage();
services.AddCsv(c => { c.Register<SampleEntityMap, SampleEntity>(); });

var serviceProvider = services.BuildServiceProvider();
var sut = serviceProvider.GetRequiredService<IFileExporter>();

var actual = await sut.ExportAsync(entities, new ExporterOptions(DateTime.Today, storageTargets));

actual.Should().NotBe(null);
actual.HasError.Should().BeFalse();
}
}
}
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>

<IsPackable>false</IsPackable>

<LangVersion>default</LangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Autofac" Version="6.2.0" />
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="7.1.0" />
<PackageReference Include="LittleBlocks.Testing" Version="1.0.2" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PackageReference Include="Autofac" Version="8.0.0" />
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="9.0.0" />
<PackageReference Include="LittleBlocks.Testing" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="xunit" Version="2.7.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.8">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.2.0">
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>

<IsPackable>false</IsPackable>

<LangVersion>default</LangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="LittleBlocks.Testing" Version="1.0.2" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PackageReference Include="LittleBlocks.Testing" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="xunit" Version="2.7.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.8">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.2.0">
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ public async Task Should_Resolve_ReturnCorrectStorageTarget_WhenItIsPresented(IB
{
// Arrange
var sut = new GenericCsvStorageTarget(StorageTargetType.InMemory, blobStorage);
var expected = "Mezz/Valuation/File.csv";
var expected = "Test/Storage/File.csv";

// Act
await sut.WriteAsync("Mezz/Valuation/", "File.csv", new byte[] {1, 12, 123});
await sut.WriteAsync("Test/Storage/", "File.csv", new byte[] {1, 12, 123});

// Assert
await blobStorage.Received(1)
Expand Down
Loading
Loading