Skip to content

Commit

Permalink
Merge branch 'sessionProvider' of https://github.com/SwissLife-OSS/mo…
Browse files Browse the repository at this point in the history
…ngo-extensions into sessionProvider
  • Loading branch information
glucaci committed Oct 2, 2023
2 parents 361f56b + 68621d0 commit 622b6d7
Show file tree
Hide file tree
Showing 9 changed files with 121 additions and 43 deletions.
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"dotnet-sonarscanner": {
"version": "4.8.0",
"version": "5.13.1",
"commands": [
"dotnet-sonarscanner"
]
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Pull Request

on:
pull_request:
branches: ['master']

jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
6
7
- name: Build, Test and Sonar
uses: swisslife-oss/actions/pull-request@main
with:
sonar_token: ${{ secrets.SONAR_TOKEN }}
sonar_project_key: 'SwissLife-OSS_Mongo-Extensions'
sonar_project_name: "mongo-extensions"
pr_number: ${{ github.event.pull_request.number }}
pr_source_branch: ${{ github.head_ref }}
pr_target_branch: ${{ github.base_ref }}
github_repository: ${{ github.repository }}
sonar_exclusions: ${{ vars.SONAR_EXCLUSIONS }}
44 changes: 44 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Release

on:
push:
tags:
- "*"

jobs:
release:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Use .NET SDK from global.json
uses: actions/setup-dotnet@v3
- name: Build, Test and Push
uses: swisslife-oss/actions/release-packages@main
with:
tag: ${{ github.ref_name }}
nuget_api_key: ${{ secrets.NUGET_API_KEY }}
enable_push: 'yes'

sonar:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
6
7
- name: Restore tools
run: dotnet tool restore
- name: Build, Test and Sonar
uses: swisslife-oss/actions/release-sonar@main
with:
tag: ${{ github.ref_name }}
sonar_token: ${{ secrets.SONAR_TOKEN }}
sonar_project_key: 'SwissLife-OSS_Mongo-Extensions'
sonar_project_name: "mongo-extensions"
sonar_exclusions: ${{ vars.SONAR_EXCLUSIONS }}
8 changes: 4 additions & 4 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@

<ItemGroup>
<PackageVersion Include="Moq" Version="4.16.1" />
<PackageVersion Include="Snapshooter.Xunit" Version="0.12.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageVersion Include="Squadron.Mongo" Version="0.17.0" />
<PackageVersion Include="Snapshooter.Xunit" Version="0.13.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageVersion Include="Squadron.Mongo" Version="0.18.0" />
<PackageVersion Include="xunit" Version="2.4.2" />
<PackageVersion Include="Xunit.Priority" Version="1.1.6" />
<PackageVersion Include="FluentAssertions" Version="6.2.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.4.3" />
<PackageVersion Include="coverlet.msbuild" Version="3.1.0" />
<PackageVersion Include="coverlet.msbuild" Version="6.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
7 changes: 5 additions & 2 deletions src/Context.AllowedTypes.Tests/Helpers/TestHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ public static object GetTypeObjectSerializerContent()
AllowedTypes = TypeObjectSerializer.AllowedTypes
.Select(pair => new KeyValuePair<string?, bool>(pair.Key.FullName, pair.Value))
.OrderBy(pair => pair.Key),
TypeObjectSerializer.AllowedTypesByNamespaces,
TypeObjectSerializer.AllowedTypesByDependencies
AllowedTypesByNamespaces = TypeObjectSerializer.AllowedTypesByNamespaces
.OrderBy(x => x),
AllowedTypesByDependencies = TypeObjectSerializer.AllowedTypesByDependencies
.Except(new[] { "Coverlet" })
.OrderBy(x => x)
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@
"AllowedTypes": [],
"AllowedTypesByNamespaces": [],
"AllowedTypesByDependencies": [
"Newtonsoft",
"Internal",
"Xunit",
"NuGet",
"MongoDB",
"Squadron",
"ThirdParty",
"AWSSDK",
"Amazon",
"AWSSDK",
"Castle",
"DnsClient",
"Docker",
"FluentAssertions",
"SharpCompress",
"TypeNameFormatter",
"ICSharpCode",
"Internal",
"MongoDB",
"Moq",
"Newtonsoft",
"NuGet",
"Polly",
"ICSharpCode",
"SharpCompress",
"Snappier",
"Snapshooter",
"Squadron",
"ThirdParty",
"TypeNameFormatter",
"Xunit",
"ZstdSharp"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@
"AllowedTypes": [],
"AllowedTypesByNamespaces": [],
"AllowedTypesByDependencies": [
"Newtonsoft",
"Internal",
"Xunit",
"NuGet",
"MongoDB",
"Squadron",
"ThirdParty",
"AWSSDK",
"Amazon",
"AWSSDK",
"Castle",
"DnsClient",
"Docker",
"FluentAssertions",
"SharpCompress",
"TypeNameFormatter",
"ICSharpCode",
"Internal",
"MongoDB",
"Moq",
"Newtonsoft",
"NuGet",
"Polly",
"ICSharpCode",
"SharpCompress",
"Snappier",
"Snapshooter",
"Squadron",
"ThirdParty",
"TypeNameFormatter",
"Xunit",
"ZstdSharp"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,26 @@
],
"AllowedTypesByNamespaces": [],
"AllowedTypesByDependencies": [
"Newtonsoft",
"Internal",
"Xunit",
"NuGet",
"MongoDB",
"Squadron",
"ThirdParty",
"AWSSDK",
"Amazon",
"AWSSDK",
"Castle",
"DnsClient",
"Docker",
"FluentAssertions",
"SharpCompress",
"TypeNameFormatter",
"ICSharpCode",
"Internal",
"MongoDB",
"Moq",
"Newtonsoft",
"NuGet",
"Polly",
"ICSharpCode",
"SharpCompress",
"Snappier",
"Snapshooter",
"Squadron",
"ThirdParty",
"TypeNameFormatter",
"Xunit",
"ZstdSharp"
]
}
8 changes: 5 additions & 3 deletions src/Context.Tests/Internal/DependencyTypesResolverTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ public void GetAllowedTypesByDependencies_All_Successful()
// Arrange

// Act
IEnumerable<string> knownNamespaces =
DependencyTypesResolver.GetAllowedTypesByDependencies();
IEnumerable<string> knownNamespaces = DependencyTypesResolver
.GetAllowedTypesByDependencies()
.Except(new[] { "Coverlet" })
.OrderBy(x => x);

// Assert
Snapshot.Match(knownNamespaces.OrderBy(x => x));
Snapshot.Match(knownNamespaces);
}
}

0 comments on commit 622b6d7

Please sign in to comment.