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

#226 - Migration from .NET 7.0 to .NET 8.0 #236

Open
wants to merge 30 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
b9448a3
First attempt to upgrade to .NET 8.0
peterliapin Jan 23, 2024
94f4348
Unused using has been removed
peterliapin Jan 23, 2024
d48fa34
Migration to NpgsqlDataSourceBuilder and support for EnableDynamicJson
peterliapin Jan 23, 2024
4e8f28a
Fix for singletone object being created multiple times
peterliapin Jan 23, 2024
203cd39
Do not filter the plugin's entities (#234)
AlexInSriLanka Feb 4, 2024
a245d6f
Login with user name and password. (#233)
SerEgoroff Feb 4, 2024
ad63339
Tests use real authentication (#237)
SerEgoroff Feb 5, 2024
67a85c4
Support for two letter language codes in email templates and groups
Feb 6, 2024
f696f9a
Merge branch 'develop' of github.com:peterliapin/onlinesales.core int…
Feb 6, 2024
720d171
Login improvement after review. (#238)
SerEgoroff Feb 6, 2024
fd950e4
Version 1.2.17-pre - JWT login + two letter culture support
Feb 6, 2024
e89da38
Nuget packages upgrade
Feb 6, 2024
fa54f66
Version 1.2.18-pre
Feb 6, 2024
55a0970
Media controller for all authenticated users + identity configuration…
Feb 6, 2024
e8b4739
Helper files location and namespaces refactoring
Feb 6, 2024
5463609
Small authentication logic refactoring + cookies settings moved to co…
Feb 8, 2024
ef5f39b
Wrongly commited plugin reference has been removed
Feb 8, 2024
f0ec065
Some redundant changes rolled back
Feb 8, 2024
7f9ad4f
Attempt to support multi Auth (unsuccessfull yet)
Feb 9, 2024
da19f68
User logged in via AzureAd now have Admin role if they included in sp…
Feb 9, 2024
3dd283d
Merge pull request #242 from peterliapin/development/multi-auth-support
peterliapin Feb 9, 2024
41b3f2e
testreporter.yml -> test_reporter.yml in sln file
Feb 9, 2024
1b1cba3
Version 1.2.19-pre
Feb 9, 2024
d061445
Fix of the problem with multiple email being sent in case contact was…
Feb 12, 2024
f9ddc72
Version 1.2.20-pre - emails scheduling improved
Feb 12, 2024
bbc8b65
Open AI based code review pipeline
Feb 22, 2024
8ef3118
AI pipeline moved to an appropriate folder
Feb 22, 2024
85f0604
Minor code refactoring
Feb 22, 2024
89a9f3e
Merge with develop branch
Feb 22, 2024
f072ce6
Obsolete exception constructor type removed
Feb 22, 2024
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
4 changes: 2 additions & 2 deletions .azure/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ steps:
displayName: 'docker compose -f ./docker-compose/docker-compose.tests.yml up -d'

- task: UseDotNet@2
displayName: 'install .net sdk 7.x'
displayName: 'install .net sdk 8.x'
inputs:
version: 7.x
version: 8.x
installationPath: $(Agent.ToolsDirectory)/dotnet

- script: |
Expand Down
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ insert_final_newline = false
trim_trailing_whitespace = true
dotnet_diagnostic.SA1000.severity = silent
dotnet_diagnostic.SA1009.severity = silent
end_of_line = lf

# Code files
[*.{cs,csx,vb,vbx}]
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/ai_code_reviewer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: AI Code Reviewer

on:
pull_request:
types:
- opened
- synchronize

permissions: write-all

jobs:
review:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: AI Code Reviewer
uses: freeedcom/ai-codereviewer@main
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # The GITHUB_TOKEN is there by default so you just need to keep it like it is and not necessarily need to add it as secret as it will throw an error. [More Details](https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret)
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
OPENAI_API_MODEL: "gpt-4" # Optional: defaults to "gpt-4"
exclude: "**/*.json, **/*.md" # Optional: exclude patterns separated by commas
2 changes: 1 addition & 1 deletion .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x

- name: docker compose -f ./docker-compose/docker-compose.tests.yml up -d
run: docker compose -f ./docker-compose/docker-compose.tests.yml up -d
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_test_and_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x

- name: Setup NuGet
uses: nuget/setup-nuget@v1
Expand Down
4 changes: 2 additions & 2 deletions OnlineSales.sln
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{
ProjectSection(SolutionItems) = preProject
.github\workflows\build_and_test.yml = .github\workflows\build_and_test.yml
.github\workflows\build_test_and_publish.yml = .github\workflows\build_test_and_publish.yml
.github\workflows\testreporter.yml = .github\workflows\testreporter.yml
.github\workflows\test_reporter.yml = .github\workflows\test_reporter.yml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "plugins", "plugins", "{0F2716C8-A043-4743-A8AD-54B86635D567}"
Expand Down Expand Up @@ -126,6 +126,6 @@ Global
$0.DotNetNamingPolicy = $1
$1.DirectoryNamespaceAssociation = PrefixedHierarchical
$0.TextStylePolicy = $3
version = 1.2.16-pre
version = 1.2.19-pre
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ public class AutoMapperProfiles : Profile
{
public AutoMapperProfiles()
{
this.CreateMap<ImapAccount, ImapAccountCreateDto>().ReverseMap();
this.CreateMap<ImapAccount, ImapAccountUpdateDto>()
CreateMap<ImapAccount, ImapAccountCreateDto>().ReverseMap();
CreateMap<ImapAccount, ImapAccountUpdateDto>()
.ForAllMembers(m => m.Condition(PropertyNeedsMapping));
this.CreateMap<ImapAccountUpdateDto, ImapAccount>()
CreateMap<ImapAccountUpdateDto, ImapAccount>()
.ForAllMembers(m => m.Condition(PropertyNeedsMapping));
this.CreateMap<ImapAccount, ImapAccountDetailsDto>();
CreateMap<ImapAccount, ImapAccountDetailsDto>();
}

private static bool PropertyNeedsMapping(object source, object target, object sourceValue, object targetValue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using EntityFrameworkCore.EncryptColumn.Util;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Npgsql;
using OnlineSales.Data;
using OnlineSales.Interfaces;
using OnlineSales.Plugin.EmailSync.Entities;
Expand All @@ -22,8 +23,8 @@ public EmailSyncDbContext()
{
}

public EmailSyncDbContext(DbContextOptions<PgDbContext> options, IConfiguration configuration, IHttpContextHelper httpContextHelper)
: base(options, configuration, httpContextHelper)
public EmailSyncDbContext(DbContextOptions<PgDbContext> options, IConfiguration configuration, IHttpContextHelper httpContextHelper, NpgsqlDataSource dataSource)
: base(options, configuration, httpContextHelper, dataSource)
{
var key = configuration.GetSection("EmailSync:EncryptionKey").Get<string>();
if (key == null )
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<ReleaseVersion>1.2.16-pre</ReleaseVersion>
<ReleaseVersion>1.2.20-pre</ReleaseVersion>
<EnableDynamicLoading>true</EnableDynamicLoading>
<Configurations>Debug;Release;Migration</Configurations>
</PropertyGroup>
Expand Down
10 changes: 5 additions & 5 deletions plugins/OnlineSales.Plugin.EmailSync/Tasks/EmailSyncTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,21 @@ public EmailSyncTask(IConfiguration configuration, EmailSyncDbContext dbContext,
this.dbContext = dbContext;
this.domainService = domainService;

var config = configuration.GetSection(this.configKey)!.Get<TaskWithBatchConfig>();
var config = configuration.GetSection(configKey)!.Get<TaskWithBatchConfig>();
if (config is not null)
{
this.batchSize = config.BatchSize;
batchSize = config.BatchSize;
}
else
{
throw new MissingConfigurationException($"The specified configuration section for the provided configKey {this.configKey} could not be found in the settings file.");
throw new MissingConfigurationException($"The specified configuration section for the provided configKey {configKey} could not be found in the settings file.");
}

var domains = configuration.GetSection("EmailSync:InternalDomains")!.Get<string[]>();
this.internalDomains = (domains != null) ? domains : new string[0];
internalDomains = (domains != null) ? domains : new string[0];

var ignored = configuration.GetSection("EmailSync:IgnoredEmails")!.Get<string[]>();
this.ignoredEmails = (ignored != null) ? ignored : new string[0];
ignoredEmails = (ignored != null) ? ignored : new string[0];
}

public override async Task<bool> Execute(TaskExecutionLog currentJob)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<Nullable>enable</Nullable>
<ReleaseVersion>1.2.16-pre</ReleaseVersion>
<ReleaseVersion>1.2.20-pre</ReleaseVersion>
<Configurations>Release;Debug</Configurations>
</PropertyGroup>

Expand Down
5 changes: 3 additions & 2 deletions plugins/OnlineSales.Plugin.SendGrid/Data/SendgridDbContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Npgsql;
using OnlineSales.Data;
using OnlineSales.Interfaces;
using OnlineSales.Plugin.SendGrid.Entities;
Expand All @@ -17,8 +18,8 @@ public SendgridDbContext()
{
}

public SendgridDbContext(DbContextOptions<PgDbContext> options, IConfiguration configuration, IHttpContextHelper httpContextHelper)
: base(options, configuration, httpContextHelper)
public SendgridDbContext(DbContextOptions<PgDbContext> options, IConfiguration configuration, IHttpContextHelper httpContextHelper, NpgsqlDataSource dataSource)
: base(options, configuration, httpContextHelper, dataSource)
{
}

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

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<ReleaseVersion>1.2.16-pre</ReleaseVersion>
<ReleaseVersion>1.2.20-pre</ReleaseVersion>
<EnableDynamicLoading>true</EnableDynamicLoading>
<Configurations>Debug;Release;Migration</Configurations>
</PropertyGroup>
Expand Down
5 changes: 3 additions & 2 deletions plugins/OnlineSales.Plugin.Sms/Data/SmsDbContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@

using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Npgsql;
using OnlineSales.Data;
using OnlineSales.Plugin.Sms.Entities;

namespace OnlineSales.Plugin.Sms.Data;

public class SmsDbContext : PluginDbContextBase
{
public SmsDbContext(DbContextOptions<PgDbContext> options, IConfiguration configuration, IHttpContextHelper httpContextHelper)
: base(options, configuration, httpContextHelper)
public SmsDbContext(DbContextOptions<PgDbContext> options, IConfiguration configuration, IHttpContextHelper httpContextHelper, NpgsqlDataSource dataSource)
: base(options, configuration, httpContextHelper, dataSource)
{
}

Expand Down
5 changes: 0 additions & 5 deletions plugins/OnlineSales.Plugin.Sms/Exceptions/AwsSnsException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,5 @@ public AwsSnsException(string? message, Exception? innerException)
: base(message, innerException)
{
}

protected AwsSnsException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,4 @@ public GetshoutoutException(string? message, Exception? innerException)
: base(message, innerException)
{
}

protected GetshoutoutException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,5 @@ public NotifyLkException(string? message, Exception? innerException)
: base(message, innerException)
{
}

protected NotifyLkException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,5 @@ public SmsPluginException(string? message, Exception? innerException)
: base(message, innerException)
{
}

protected SmsPluginException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
}
}
5 changes: 0 additions & 5 deletions plugins/OnlineSales.Plugin.Sms/Exceptions/SmscException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,5 @@ public SmscException(string? message, Exception? innerException)
: base(message, innerException)
{
}

protected SmscException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
}
}
5 changes: 0 additions & 5 deletions plugins/OnlineSales.Plugin.Sms/Exceptions/TwilioException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,5 @@ public TwilioException(string? message, Exception? innerException)
: base(message, innerException)
{
}

protected TwilioException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,5 @@ public UnknownCountryCodeException(string? message, Exception? innerException)
: base(message, innerException)
{
}

protected UnknownCountryCodeException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
}
}
6 changes: 3 additions & 3 deletions plugins/OnlineSales.Plugin.Sms/OnlineSales.Plugin.Sms.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<ReleaseVersion>1.2.16-pre</ReleaseVersion>
<ReleaseVersion>1.2.20-pre</ReleaseVersion>
<EnableDynamicLoading>true</EnableDynamicLoading>
<Configurations>Debug;Release;Migration</Configurations>
</PropertyGroup>
Expand All @@ -27,7 +27,7 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="AWSSDK.SimpleNotificationService" Version="3.7.300.44" />
<PackageReference Include="AWSSDK.SimpleNotificationService" Version="3.7.300.46" />
<PackageReference Include="libphonenumber-csharp" Version="8.13.29" />
<PackageReference Include="Twilio" Version="6.16.1" />
<!-- Insert additional references above this line -->
Expand Down
2 changes: 0 additions & 2 deletions plugins/OnlineSales.Plugin.Sms/Services/SmscService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
// Licensed under the MIT license. See LICENSE file in the samples root for full license information.
// </copyright>

using System.Reflection;
using System.Web;
using Newtonsoft.Json;
using OnlineSales.Plugin.Sms.Configuration;
using OnlineSales.Plugin.Sms.Exceptions;
using Serilog;

namespace OnlineSales.Plugin.Sms.Services;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
// Licensed under the MIT license. See LICENSE file in the samples root for full license information.
// </copyright>

using System.Data.Common;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.Extensions.Configuration;
using Npgsql;
using OnlineSales.Data;
using OnlineSales.Interfaces;
using OnlineSales.Plugin.TestPlugin.Entities;
Expand All @@ -23,8 +25,8 @@ public TestPluginDbContext()
migrations = new SortedSet<string>();
}

public TestPluginDbContext(DbContextOptions<PgDbContext> options, IConfiguration configuration, IHttpContextHelper httpContextHelper)
: base(options, configuration, httpContextHelper)
public TestPluginDbContext(DbContextOptions<PgDbContext> options, IConfiguration configuration, IHttpContextHelper httpContextHelper, NpgsqlDataSource dataSource)
: base(options, configuration, httpContextHelper, dataSource)
{
migrations = new SortedSet<string>(Database.GetPendingMigrations());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<ReleaseVersion>1.2.16-pre</ReleaseVersion>
<ReleaseVersion>1.2.20-pre</ReleaseVersion>
<EnableDynamicLoading>true</EnableDynamicLoading>
<Configurations>Debug;Release;Migration</Configurations>
</PropertyGroup>
Expand Down
5 changes: 3 additions & 2 deletions plugins/OnlineSales.Plugin.Vsto/Data/VstoDbContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Npgsql;
using OnlineSales.Data;
using OnlineSales.Plugin.Vsto.Entities;

Expand All @@ -16,8 +17,8 @@ public VstoDbContext()
{
}

public VstoDbContext(DbContextOptions<PgDbContext> options, IConfiguration configuration, IHttpContextHelper httpContextHelper)
: base(options, configuration, httpContextHelper)
public VstoDbContext(DbContextOptions<PgDbContext> options, IConfiguration configuration, IHttpContextHelper httpContextHelper, NpgsqlDataSource dataSource)
: base(options, configuration, httpContextHelper, dataSource)
{
}

Expand Down
Loading
Loading