Skip to content

Commit

Permalink
fix: some updates
Browse files Browse the repository at this point in the history
  • Loading branch information
KULBIDA Pavel authored and KULBIDA Pavel committed Jan 11, 2024
1 parent fe648e3 commit a97ebd6
Show file tree
Hide file tree
Showing 9 changed files with 77 additions and 47 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ jobs:
run: dotnet restore

- name: Build
env:
GitVersion_NuGetVersion: $GITVERSION_NUGETVERSIONV
GitVersion_AssemblySemVer: $GITVERSION_ASSEMBLYSEMVER
GitVersion_InformationalVersion: $GITVERSION_INFORMATIONALVERSION
run: |
dotnet build "$PROJECT_NAME" -c Release --nologo --no-restore
Expand All @@ -104,6 +108,10 @@ jobs:

- name: Pack
if: github.ref == 'refs/heads/master'
env:
GitVersion_NuGetVersion: $GITVERSION_NUGETVERSIONV
GitVersion_AssemblySemVer: $GITVERSION_ASSEMBLYSEMVER
GitVersion_InformationalVersion: $GITVERSION_INFORMATIONALVERSION
run: dotnet pack $PROJECT_NAME -c Release -o ./nupkgs --nologo --no-build

- name: Push nuget packages
Expand Down
42 changes: 21 additions & 21 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
# v0016 (03.03.2022)
1. Add missed host lifetime hook: ApplicationStopping
2. Rename AddOnStopAction to AddOnStoppedAction for ApplicationStopped lifetime hook
# 8.x [Release 8.0] (30.12.2023)
1. Upgrade target framework to .NET 8 and a lot of refactoring

# v0015 (25.01.2022)
1. Remove using of log4net from all Orm libraries (see ViennaNET.Orm docs for details)
2. Add ViennaNET.Orm.DB2.Osx for macOs users
3. Breaking change: ViennaNET.Orm.MSSQL updated to Microsoft.Data.SqlClient from System.Data.SqlClient, it means that you should set Encrypt parameter in ConnectionString to correct value, because now it is **true** by default (https://github.com/dotnet/SqlClient/blob/main/release-notes/4.0/4.0.0.md#breaking-changes)
4. Breaking change: fix namespace ViennaNET.Orm.DB2.Win.DefaultConfiguration to ViennaNET.Orm.DB2.DefaultConfiguration for ViennaNET DB2 Windows libs
# 6.x [Release 6.0] (08.12.2023)
1. Upgrade target framework to .NET 6 and a lot of refactoring

# v0014 (08.04.2021)
# 5.x [PR #35] (19.05.2021)
1. Upgrade target framework to .NET 5 and a lot of refactoring


# 3.14.x [Release 0014] (08.04.2021)
1. Add ViennaNET.Messaging.ActiveMQ, split ViennaNET.Messaging.Tests
2. Extension ViennaNET.Redis, ViennaNET.Utils.Orm

# v0013 (01.03.2021)
# 3.13.x [Release 0013] (01.03.2021)
1. Minor changes in ViennaNET.Messaging, ViennaNET.Messaging.RabbitMQQueue, ViennaNET.Orm

# v0012 (04.02.2021)
# 3.12.x [Release 0012] (04.02.2021)
1. Minor changes in ViennaNET.Messaging, ViennaNET.Messaging.MQSeriesQueue, ViennaNET.Orm, ViennaNET.Redis, ViennaNET.WebApi
2. Refactor logging

# v0011 (27.11.2020)
# 3.11.x [Release 0011] (27.11.2020)

### Release Summary
1. Various small bugfixes in Excel, Messaging and WebApi


# v0010 (29.10.2020)
# 3.10.x [Release 0010] (29.10.2020)

### Release Summary
1. Change Messaging


# v0009 (4.10.2020)
# 3.9.x [Release 0009] (4.10.2020)

### Release Summary
1. Added ORM DB2 integration
Expand All @@ -53,7 +53,7 @@ In order for the current logging option to continue working as it is, you need t
}
```

# v0007 (30.07.2020)
# 1.7.x [Release 0007] (30.07.2020)

### Release Summary
1. For Rabbit queues, added the ability to create additional bindings through the routings configuration.
Expand All @@ -69,21 +69,21 @@ the exchange point to the queues.
3. Added optional loading of an additional configuration file, which is selected by the value of the environment variable:
https://docs.microsoft.com/en-us/aspnet/core/fundamentals/environments?view=aspnetcore-3.1

# v0006 (30.06.2020)
# 1.6.x [Release 0006] (30.06.2020)

### Release Summary
1. MQSeriesQueue - selectors improved
2. Protection - added the ability to encrypt passwords for connecting to databases
3. HttpClients.NoAuthentication - added the ability to anonymously connect to other services
4. WebApi.CompanyHostBuilder - add enironment variables to configuration

# v0005 (29.05.2020)
# 1.0.1.115 [Release 0005] (29.05.2020)

### Breaking Changes
Changed CallContextHeaders headers. In case of their use, it is necessary to take into account the new formats.


# v0004 (25.04.2020)
# 1.0.1.79 [Release 0004] (25.04.2020)

### Release Summary
We have added ICallContext. This abstraction receive and hold some context data such as request id, user name, domain and so on to pass in microservices by different channels: Http-requests and queue messaging.
Expand All @@ -93,13 +93,13 @@ SecurityContextFactories now uses this context to build authentication data.
If you used manual installation of SimpleInjector packages, you will find that DiagnosticPackage is deleted: since this release it register automatically. Just delete DiagnosticPackage registration in your code.


# v0003 (26.03.2020)
# [Release 0003] (26.03.2020)

### Release Summary
Add more libraries


# v0002 (19.02.2020)
# [Release 0002] (19.02.2020)

### Release Summary
Rebranding Company.Framework to ViennaNET.
Expand Down Expand Up @@ -196,7 +196,7 @@ In the new version, the use of composite configurators has become easier, for ex
3) We update versions of Company libraries to (2. \*.\*) In all assemblies. Version conflicts with third-party libraries (for example, SimpleInjector) may occur, so they need to be synchronized.


# v0001 (14.01.2020)
# [Release 0001] (14.01.2020)

### Release Summary
MVP Company.Framework on NET Core 2.2
30 changes: 30 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Security Policy

To mitigate the risks and ensure the security of this set of libraries,
all submitted pull requests must be checked for vulnerabilities using code scanning tools:
[Sonarqube][3] and [CodeQL][4].
If the PR contains vulnerabilities with severity is greater than or equal middle severity, then the PR cannot be merged.

## Supported Versions

| Version | Supported |
| ------- | ------------------ |
| 8.x.x | :white_check_mark: |
| 6.x.x | :x: |
| 5.x.x | :x: |
| 3.1.x | :x: |
| < 3.1 | :x: |

## Reporting a Vulnerability

Security issues and bugs should be reported privately, via email,
to the Raiffeisen .NET Community through by emailing [DotNetCommunity@raiffeisen.ru][1].
Please, specify **\[SEC\] Reporting a Vulnerability** on the message Subject.
You should receive a response within 48 hours.

>**IMPORTANT: Please do not open issues on the [repository issue tracker][2] for anything you think might have a security implication.**
[1]: <mailto:DotNetCommunity@raiffeisen.ru?subject=\[Sec\]%20Reporting%20a%20Vulnerability> "E-mail Raiffeisen .NET Community"
[2]: <https://github.com/Raiffeisen-DGTL/ViennaNET/issues> "ViennaNET issue tracker"
[3]: <https://sonarcloud.io/dashboard?id=Raiffeisen-DGTL_ViennaNET> "ViennaNET sonarqube project"
[4]: <https://github.com/Raiffeisen-DGTL/ViennaNET/actions/workflows/codeql-analysis.yml> "CodeQL workflow"
8 changes: 4 additions & 4 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
<RepositoryBranch>$(CI_COMMIT_REF_NAME)</RepositoryBranch>
<RepositoryCommit>$(CI_COMMIT_SHA)</RepositoryCommit>
<PackageProjectUrl>$(CI_PROJECT_URL)</PackageProjectUrl>
<PackageVersion>$(GITVERSION_NUGETVERSION)</PackageVersion>
<AssemblyVersion>$(GITVERSION_ASSEMBLYSEMVER)</AssemblyVersion>
<FileVersion>$(GITVERSION_ASSEMBLYSEMFILEVER)</FileVersion>
<InformationalVersion>$(GITVERSION_INFORMATIONALVERSION)</InformationalVersion>
<PackageVersion>$(GitVersion_NuGetVersion)</PackageVersion>
<AssemblyVersion>$(GitVersion_AssemblySemVer)</AssemblyVersion>
<FileVersion>$(GitVersion_AssemblySemFileVer)</FileVersion>
<InformationalVersion>$(GitVersion_InformationalVersion)</InformationalVersion>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public KubernetesConfigurationSource()
/// <summary>
/// Ссылка на объект <see cref="IKubernetesClientBuilder" />.
/// </summary>
public IKubernetesClientBuilder KubernetesClientBuilder { get; }
public IKubernetesClientBuilder KubernetesClientBuilder { get; set; }

/// <exception cref="ArgumentOutOfRangeException">
/// Возникает, если значение свойства <see cref="Kind" />,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class KafkaQueueConfiguration : QueueConfigurationBase, IValidatableObjec
public ProducerConfig? ProducerConfig { get; set; }

/// <summary>
/// Таймат в мс метода включения транзакций (InitTransactions)
/// Таймаут в мс метода включения транзакций (InitTransactions)
/// </summary>
[Range(1, 3_600_000)]
public int InitTransactionsTimeout { get; set; } = 1000;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using k8s;
using k8s.Models;
using Moq;
using ViennaNET.Extensions.Configuration.Kubernetes.Internals;

namespace ViennaNET.Extensions.Configuration.Kubernetes.Tests;

Expand Down Expand Up @@ -172,8 +173,7 @@ public void Dispose_Throws_Nothing()

k8sClientBuilder.Setup(builder => builder.Build()).Returns(k8sClient);

var provider =
new ConfigMapConfigurationProvider(new KubernetesConfigurationSource(), k8sClientBuilder.Object);
var provider = new ConfigMapConfigurationProvider(new KubernetesConfigurationSource(), k8sClientBuilder.Object);

Assert.That(() => provider.Dispose(), Throws.Nothing);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,6 @@ public void Ctor_DoesNotThrows()
Assert.That(() => new KubernetesConfigurationSource(), Throws.Nothing);
}

[TestCase(null, null, null, true)]
[TestCase("./test.kubeconfig", "testcontext", "https://test.kube.api", false)]
public void ParameterizedCtor_DoesNotThrows(string? configPath, string? сontext, string? masterUrl,
bool useRelativePaths)
{
Assert.That(() => new KubernetesConfigurationSource(), Throws.Nothing);
}

[Test]
public void Ctor_Init_DefaultValues()
{
Expand Down Expand Up @@ -66,16 +58,17 @@ public void Initializer_Callbacks_And_FileName_Initialized()

[TestCase(Kinds.ConfigMap)]
[TestCase(Kinds.Secret)]
[Explicit]
public void Build_Returns_ConfigurationProvider(int kind)
{
var builder = Mock.Of<IConfigurationBuilder>();
var clientBuilder = Mock.Of<IKubernetesClientBuilder>();
var source = new KubernetesConfigurationSource
{
FileName = "test.json",
Kind = (Kinds)kind,
OnWatchClose = () => TestContext.WriteLine("WatchCloseTest"),
OnWatchException = TestContext.WriteLine,
KubernetesClientBuilder = clientBuilder
};

Assert.That(source.Build(builder),
Expand All @@ -88,12 +81,14 @@ public void Build_Returns_ConfigurationProvider(int kind)
public void Build_Throws_ArgumentOutOfRangeException()
{
var builder = Mock.Of<IConfigurationBuilder>();
var clientBuilder = Mock.Of<IKubernetesClientBuilder>();
var source = new KubernetesConfigurationSource
{
FileName = "test.json",
Kind = (Kinds)3,
OnWatchClose = () => TestContext.WriteLine("WatchCloseTest"),
OnWatchException = TestContext.WriteLine
OnWatchException = TestContext.WriteLine,
KubernetesClientBuilder = clientBuilder
};

Assert.That(() => source.Build(builder), Throws.InvalidOperationException);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using k8s;
using k8s.Models;
using Moq;
using ViennaNET.Extensions.Configuration.Kubernetes.Internals;

namespace ViennaNET.Extensions.Configuration.Kubernetes.Tests;

Expand Down Expand Up @@ -213,14 +214,10 @@ public void OnEvent_Extract_WithDefaultFileName_Returns_TestOption()
[Test]
public void Dispose_Throws_Nothing()
{
var k8sClient = Mock.Of<IKubernetes>();
var k8sClientBuilder = new Mock<IKubernetesClientBuilder>();

k8sClientBuilder.Setup(builder => builder.Build()).Returns(k8sClient);

var provider =
new SecretConfigurationProvider(new KubernetesConfigurationSource(), k8sClientBuilder.Object);
var client = Mock.Of<IKubernetes>();
var builder = Mock.Of<IKubernetesClientBuilder>(clientBuilder => clientBuilder.Build() == client);
var provider = new SecretConfigurationProvider(new KubernetesConfigurationSource(), builder);

Assert.That(() => provider.Dispose(), Throws.Nothing);
Assert.That(provider.Dispose, Throws.Nothing);
}
}

0 comments on commit a97ebd6

Please sign in to comment.