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

Various cherry picked changes from dev branch #2212

Merged
merged 4 commits into from
Apr 15, 2024
Merged
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
7 changes: 5 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ dotnet_diagnostic.CA1003.severity = silent
dotnet_diagnostic.CA1008.severity = silent

[*.{cs,vb}]
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_coalesce_expression = true:silent
dotnet_style_null_propagation = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
dotnet_style_prefer_auto_properties = true:silent
Expand Down Expand Up @@ -512,4 +512,7 @@ dotnet_diagnostic.CA2251.severity = suggestion
dotnet_style_prefer_collection_expression = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
dotnet_style_prefer_conditional_expression_over_assignment = true:silent

# IDE0270: Use coalesce expression
dotnet_diagnostic.IDE0270.severity = silent
4 changes: 2 additions & 2 deletions common.props
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
<!--<TreatWarningsAsErrors>true</TreatWarningsAsErrors>-->
</PropertyGroup>
<ItemGroup Condition="$(NO_RCS) == ''">
<PackageReference Include="Roslynator.Analyzers" Version="4.11.0" PrivateAssets="All"/>
<PackageReference Include="Roslynator.Formatting.Analyzers" Version="4.11.0" PrivateAssets="All"/>
<PackageReference Include="Roslynator.Analyzers" Version="4.12.0" PrivateAssets="All"/>
<PackageReference Include="Roslynator.Formatting.Analyzers" Version="4.12.0" PrivateAssets="All"/>
</ItemGroup>
<!-- only create the SARIF files for the SDL build step in cloud builds -->
<PropertyGroup Condition="'$(NBGV_NugetPackageVersion)' != ''">
Expand Down
10 changes: 9 additions & 1 deletion docs/opc-publisher/commandline.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Secrets such as `EdgeHubConnectionString`, other connection strings, or the `Api
██║ ██║██╔═══╝ ██║ ██╔═══╝ ██║ ██║██╔══██╗██║ ██║╚════██║██╔══██║██╔══╝ ██╔══██╗
╚██████╔╝██║ ╚██████╗ ██║ ╚██████╔╝██████╔╝███████╗██║███████║██║ ██║███████╗██║ ██║
╚═════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝╚═╝╚══════╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
2.9.5 (.NET 8.0.2/win-x64/OPC Stack 1.5.373.121)
2.9.6 (.NET 8.0.2/win-x64/OPC Stack 1.5.373.121)

General
-------
Expand Down Expand Up @@ -610,6 +610,10 @@ Subscription settings
messages but also prevents transcoding of
unknown complex types in outgoing messages.
Default: `false`.
--dtr, --disabletransferonreconnect, --DisableSubscriptionTransfer[=VALUE]
Do not attempt to transfer subscriptions when
reconnecting but re-establish the subscription.
Default: `false`.

OPC UA Client configuration
---------------------------
Expand Down Expand Up @@ -922,6 +926,10 @@ Diagnostic options
The interval in milliseconds when OpenTelemetry is
exported to the collector endpoint.
Default: `15000` (15 seconds).
--mms, --maxmetricstreams, --OtlpMaxMetricStreams=VALUE
Specifiy the max number of streams to collect in
the default view.
Default: `3000`.
--em, --enableprometheusendpoint, --EnableMetrics=VALUE
Explicitly enable or disable exporting prometheus
metrics directly on the standard path.
Expand Down
2 changes: 2 additions & 0 deletions docs/opc-publisher/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ The configuration schema is used with the file based configuration, but also wit
"OpcAuthenticationUsername": "string",
"OpcAuthenticationPassword": "string",
"UseReverseConnect": "bool",
"DisableSubscriptionTransfer": "bool",
"DataSetWriterId": "string",
"DataSetClassId": "guid",
"DataSetName": "string",
Expand Down Expand Up @@ -454,6 +455,7 @@ Each [published nodes entry model](./definitions.md#publishednodesentrymodel) ha
| `LastChangeTimespan` | No | String | `null` | The time the Publisher configuration was last updated.<br>Read only and informational only. |
| `EndpointUrl` | Yes | String | N/A | The OPC UA server endpoint URL |
| `UseReverseConnect` | No | Boolean | `false` | Controls whether to use OPC UA reverse connect to connect to the OPC UA server.<br>A publisher wide default value can be set using the [command line](./commandline.md) |
| `DisableSubscriptionTransfer` | No | Boolean | `false` | This setting allows you to disable subscription transfer on reconnect to fix interoperability issues with servers that do not support it.<br>A publisher wide default value can be set using the [command line](./commandline.md) |
| `UseSecurity` | No | Boolean | `false` | Controls whether to use a secure OPC UA mode to establish a session to the OPC UA server endpoint.<br>`true` corresponds to `EndpointSecurityMode` = `SignAndEncrypt`, `false` to `EndpointSecurityMode` = `None` |
| `EndpointSecurityMode` | No | Enum | `null` | Enum to specify a requested security mode of the chosen session endpoint. Overrides `UseSecurity` value.<br>Options: `Sign`, `SignAndEncrypt`, `None`, and `Best` (security mode possible which might include `None`) |
| `EndpointSecurityPolicy` | No | String | `null` | String to specify a security policy the chosen endpoint must meet. Refines the endpoint chosen through `EndpointSecurityMode` and overrides `UseSecurity` value. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
<PackageReference Include="SSH.NET" Version="2024.0.0" />
<PackageReference Include="RestSharp" Version="110.2.0" />
<PackageReference Include="xunit" Version="2.7.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7">
<PackageReference Include="xunit" Version="2.7.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.8">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.1">
<PackageReference Include="coverlet.collector" Version="6.0.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@
<None Remove="TestResults\**" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Azure.Identity" Version="1.10.4" />
<PackageReference Include="Azure.Messaging.EventHubs" Version="5.11.0" />
<PackageReference Include="Azure.Identity" Version="1.11.0" />
<PackageReference Include="Azure.Messaging.EventHubs" Version="5.11.2" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Microsoft.Azure.Management.Fluent" Version="1.38.1" />
<PackageReference Include="Azure.ResourceManager" Version="1.10.1" />
<PackageReference Include="Azure.ResourceManager" Version="1.11.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="Microsoft.Azure.Devices" Version="1.39.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
<PackageReference Include="SSH.NET" Version="2024.0.0" />
<PackageReference Include="System.Linq.Async" Version="6.0.1" />
<PackageReference Include="xunit" Version="2.7.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7">
<PackageReference Include="xunit" Version="2.7.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.8">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.1">
<PackageReference Include="coverlet.collector" Version="6.0.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion samples/IoTHub/MonitorMessages/MonitorMessages.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Azure.Messaging.EventHubs" Version="5.11.0" />
<PackageReference Include="Azure.Messaging.EventHubs" Version="5.11.2" />
<PackageReference Include="Microsoft.Azure.Devices" Version="1.39.1" />
<PackageReference Include="CommandLineParser" Version="2.9.1" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Furly.Extensions.Abstractions" Version="1.0.30" />
<PackageReference Include="Furly.Extensions.Abstractions" Version="1.0.40" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ public enum ConnectionOptions
/// Do not load complex types
/// </summary>
[EnumMember(Value = "NoComplexTypeSystem")]
NoComplexTypeSystem = 0x10
NoComplexTypeSystem = 0x10,

/// <summary>
/// Do not transfer subscription on reconnect
/// </summary>
[EnumMember(Value = "NoSubscriptionTransfer")]
NoSubscriptionTransfer = 0x20
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@
<PackageReference Include="AutoFixture" Version="4.18.1" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="coverlet.msbuild" Version="6.0.1">
<PackageReference Include="coverlet.msbuild" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit" Version="2.7.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7">
<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</IncludeAssets>
</PackageReference>
<PackageReference Include="Furly.Extensions.Json" Version="1.0.30" />
<PackageReference Include="Furly.Extensions.MessagePack" Version="1.0.30" />
<PackageReference Include="Furly.Extensions.Newtonsoft" Version="1.0.30" />
<PackageReference Include="Furly.Extensions.Json" Version="1.0.40" />
<PackageReference Include="Furly.Extensions.MessagePack" Version="1.0.40" />
<PackageReference Include="Furly.Extensions.Newtonsoft" Version="1.0.40" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\src\Azure.IIoT.OpcUa.Publisher.Models.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public void SerializerDeserializeScalarTypeToBufferWithFixture(Type type)
[MemberData(nameof(TypeFixture.GetDataContractTypes), MemberType = typeof(TypeFixture))]
public void SerializerDeserializeArrayTypeToBufferWithFixture(Type type)
{
var fixture = new Fixture();
var fixture = new Fixture { RepeatCount = 2 };
fixture.Customizations.Add(new TypeRelay(typeof(IReadOnlySet<>), typeof(HashSet<>)));
fixture.Customizations.Add(new TypeRelay(typeof(IReadOnlyList<>), typeof(List<>)));
fixture.Customizations.Add(new TypeRelay(typeof(IReadOnlyDictionary<,>), typeof(Dictionary<,>)));
Expand All @@ -93,7 +93,6 @@ public void SerializerDeserializeArrayTypeToBufferWithFixture(Type type)
new MultipleRequest(new SeededRequest(type, null)))).Cast<object>().ToArray();

var buffer = _serializer.SerializeObjectToMemory(instance, instance.GetType());
var s = _serializer.SerializeObjectToString(instance, instance.GetType(), SerializeOption.Indented);
var result = _serializer.Deserialize(buffer.ToArray(), type.MakeArrayType());

result.Should().BeEquivalentTo(instance, options => options.AllowingInfiniteRecursion());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public void SerializerDeserializeScalarTypeToBufferWithFixture(Type type)
[MemberData(nameof(TypeFixture.GetDataContractTypes), MemberType = typeof(TypeFixture))]
public void SerializerDeserializeArrayTypeToBufferWithFixture(Type type)
{
var fixture = new Fixture();
var fixture = new Fixture { RepeatCount = 2 };
fixture.Customizations.Add(new TypeRelay(typeof(IReadOnlySet<>), typeof(HashSet<>)));
fixture.Customizations.Add(new TypeRelay(typeof(IReadOnlyList<>), typeof(List<>)));
fixture.Customizations.Add(new TypeRelay(typeof(IReadOnlyDictionary<,>), typeof(Dictionary<,>)));
Expand All @@ -93,7 +93,6 @@ public void SerializerDeserializeArrayTypeToBufferWithFixture(Type type)
new MultipleRequest(new SeededRequest(type, null)))).Cast<object>().ToArray();

var buffer = _serializer.SerializeObjectToMemory(instance, instance.GetType());
var s = _serializer.SerializeObjectToString(instance, instance.GetType(), SerializeOption.Indented);
var result = _serializer.Deserialize(buffer.ToArray(), type.MakeArrayType());

result.Should().BeEquivalentTo(instance, options => options.AllowingInfiniteRecursion());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<TieredPGO>true</TieredPGO>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Furly.Azure.IoT" Version="1.0.30" />
<PackageReference Include="Furly.Azure.KeyVault" Version="1.0.30" />
<PackageReference Include="Furly.Azure.IoT" Version="1.0.40" />
<PackageReference Include="Furly.Azure.KeyVault" Version="1.0.40" />
<PackageReference Include="System.IO.FileSystem" Version="4.3.0" />
<PackageReference Include="System.Net.Primitives" Version="4.3.1" />
</ItemGroup>
Expand All @@ -19,6 +19,9 @@
<ProjectReference Include="..\src\Azure.IIoT.OpcUa.Publisher.Module.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="Profiles\KeyFrames.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Profiles\DataSetTopics.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
Expand Down
5 changes: 1 addition & 4 deletions src/Azure.IIoT.OpcUa.Publisher.Module/cli/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
namespace Azure.IIoT.OpcUa.Publisher.Module.Runtime
{
using Azure.IIoT.OpcUa.Publisher.Services;
using Azure.IIoT.OpcUa.Publisher.Stack;
using Azure.IIoT.OpcUa.Publisher.Stack.Sample;
using Azure.IIoT.OpcUa.Publisher.Stack.Services;
using Autofac;
Expand All @@ -25,10 +26,6 @@ namespace Azure.IIoT.OpcUa.Publisher.Module.Runtime
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Azure.IIoT.OpcUa.Publisher.Stack;
using Azure.IIoT.OpcUa.Publisher.Models;
using System.Text.Json;
using Microsoft.AspNetCore.Hosting.Server;

/// <summary>
/// Publisher module host process
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,19 @@
<None Remove="pki\**" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Furly.Extensions.AspNetCore" Version="1.0.30" />
<PackageReference Include="Furly.Extensions.Mqtt" Version="1.0.30" />
<PackageReference Include="Furly.Extensions.Dapr" Version="1.0.30" />
<PackageReference Include="Furly.Extensions.MessagePack" Version="1.0.30" />
<PackageReference Include="Furly.Tunnel" Version="1.0.30" />
<PackageReference Include="Furly.Extensions.AspNetCore" Version="1.0.40" />
<PackageReference Include="Furly.Extensions.Mqtt" Version="1.0.40" />
<PackageReference Include="Furly.Extensions.Dapr" Version="1.0.40" />
<PackageReference Include="Furly.Extensions.MessagePack" Version="1.0.40" />
<PackageReference Include="Furly.Tunnel" Version="1.0.40" />
<PackageReference Include="Mono.Options" Version="6.12.0.148" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.7.0" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.7.0" />
<PackageReference Include="OpenTelemetry.Exporter.Prometheus.AspNetCore" Version="1.7.0-rc.1" />
<PackageReference Include="OpenTelemetry.Exporter.Console" Version="1.7.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.7.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.7.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.7.0" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.8.0" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.8.0" />
<PackageReference Include="OpenTelemetry.Exporter.Prometheus.AspNetCore" Version="1.8.0-rc.1" />
<PackageReference Include="OpenTelemetry.Exporter.Console" Version="1.8.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.8.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.8.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.8.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Azure.IIoT.OpcUa.Publisher\src\Azure.IIoT.OpcUa.Publisher.csproj" />
Expand Down
Loading