Skip to content

Commit

Permalink
Merge pull request #1753 from OPCFoundation/master
Browse files Browse the repository at this point in the history
Merge bug fixes in release 1.4.368 branch for Nuget update
  • Loading branch information
mregen committed Apr 1, 2022
2 parents 2a0c5c1 + eda38cb commit 586a63c
Show file tree
Hide file tree
Showing 324 changed files with 2,069 additions and 1,606 deletions.
34 changes: 27 additions & 7 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,16 @@ csharp_style_expression_bodied_accessors =
csharp_style_expression_bodied_constructors = false : suggestion
csharp_style_expression_bodied_methods = false : suggestion
csharp_style_expression_bodied_properties = true : silent
csharp_style_expression_bodied_lambdas = true : silent
csharp_style_expression_bodied_local_functions = false : silent


#Style - expression level options
csharp_prefer_braces = true : silent
csharp_style_deconstructed_variable_declaration = true : suggestion
csharp_prefer_simple_default_expression = true : suggestion
csharp_style_inlined_variable_declaration = false : suggestion
csharp_prefer_simple_using_statement = false : suggestion

#Style - implicit and explicit types
csharp_style_var_for_built_in_types = false : silent
Expand Down Expand Up @@ -161,6 +165,7 @@ dotnet_style_prefer_conditional_expression_over_return =

# 'using' directive preferences
csharp_using_directive_placement = outside_namespace : silent
csharp_style_namespace_declarations = block_scoped : silent

# Naming rules

Expand Down Expand Up @@ -226,12 +231,23 @@ dotnet_naming_rule.instance_fields_should_be_camel_case.severity =
dotnet_naming_rule.instance_fields_should_be_camel_case.symbols = instance_fields
dotnet_naming_rule.instance_fields_should_be_camel_case.style = instance_field_style

dotnet_naming_symbols.instance_fields.applicable_kinds = field, event
dotnet_naming_symbols.instance_fields.applicable_kinds = field
dotnet_naming_symbols.instance_fields.applicable_accessibilities = private, protected, private_protected, protected_friend

dotnet_naming_style.instance_field_style.capitalization = camel_case
dotnet_naming_style.instance_field_style.required_prefix = m_

# Private event fields are PascalCase and start with m_
dotnet_naming_rule.instance_events_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.instance_events_should_be_pascal_case.symbols = instance_events
dotnet_naming_rule.instance_events_should_be_pascal_case.style = instance_events_style

dotnet_naming_symbols.instance_events.applicable_kinds = event
dotnet_naming_symbols.instance_events.applicable_accessibilities = private, protected, private_protected, protected_friend

dotnet_naming_style.instance_events_style.capitalization = pascal_case
dotnet_naming_style.instance_events_style.required_prefix = m_

# Locals and parameters are camelCase
dotnet_naming_rule.locals_should_be_camel_case.severity = suggestion
dotnet_naming_rule.locals_should_be_camel_case.symbols = locals_and_parameters
Expand Down Expand Up @@ -260,7 +276,10 @@ dotnet_naming_symbols.all_members.applicable_kinds =
dotnet_naming_style.pascal_case_style.capitalization = pascal_case

# Diagnostic settings (windows only)
dotnet_analyzer_diagnostic.category-reliability.severity = suggestion
dotnet_analyzer_diagnostic.category-style.severity = suggestion
dotnet_analyzer_diagnostic.category-globalization.severity = silent
dotnet_analyzer_diagnostic.category-design.severity = suggestion
dotnet_analyzer_diagnostic.category-reliability.severity = warning
dotnet_analyzer_diagnostic.category-performance.severity = warning
dotnet_analyzer_diagnostic.category-security.severity = warning

Expand All @@ -275,10 +294,11 @@ dotnet_diagnostic.CA1822.severity =
dotnet_code_quality.CA1822.api_surface = private, internal

# CA3075: Insecure DTD processing in XML
dotnet_diagnostic.CA3075.severity = warning
dotnet_diagnostic.CA3077.severity = warning
dotnet_diagnostic.CA3075.severity = error
dotnet_diagnostic.CA3077.severity = error

# RCS1090: Add call to 'ConfigureAwait' (or vice versa)
# Opt-In to avoid many warnings in WinForms apps
dotnet_diagnostic.RCS1090.severity = silent
# IDE0049: Simplify Names
dotnet_diagnostic.IDE0049.severity = silent

# CA1507: Use nameof in place of string
dotnet_diagnostic.CA1507.severity = warning
51 changes: 0 additions & 51 deletions .github/ISSUE_TEMPLATE/issue_report.md

This file was deleted.

77 changes: 77 additions & 0 deletions .github/ISSUE_TEMPLATE/issue_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: 🐞Bug/Issue report
description: Create an issue report to help us improve
title: "<title>"
labels: [Needs Triage]
body:
- type: checkboxes
attributes:
label: Type of issue
description: Please provide information on the type of issue.
options:
- label: Bug
required: false
- label: Enhancement
required: false
- label: Compliance
required: false
- label: Question
required: false
- label: Help wanted
required: false
- type: textarea
attributes:
label: Current Behavior
description: A clear and concise description of what the issue is.
validations:
required: true
- type: textarea
attributes:
label: Expected Behavior
description: A clear and concise description of what you expected to happen.
validations:
required: false
- type: textarea
attributes:
label: Steps To Reproduce
description: Steps to reproduce the behavior.
placeholder: |
1. Compile Sample '...'
2. Connect to Server '....'
3. Browse Address space '....'
4. Subscribe to Node '....'
5. See error
validations:
required: false
- type: textarea
attributes:
label: Environment
description: |
examples:
- **OS**: [Windows 10, Ubuntu, macOS]
- **Environment**: [e.g. Visual Studio 2019 16.7.2]
- **Runtime**: [e.g. .NET 4.6.2, .NET Core 3.1]
- **Nuget Version**: [e.g. 1.4.368.33]
- **Component**: [e.g. Opc.Ua.Core]
- **Server**: [e.g. Reference Server]
- **Client**: [e.g. UA Expert]
value: |
- OS:
- Environment:
- Runtime:
- Nuget Version:
- Component:
- Server:
- Client:
render: markdown
validations:
required: false
- type: textarea
attributes:
label: Anything else?
description: |
Links? References? Log files? Code snippets?
Anything that will give us more context about the issue you are encountering!
Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
validations:
required: false
33 changes: 33 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/pull_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
## Proposed changes

Describe the changes here to communicate to the maintainers why we should accept this pull request. If it fixes a bug or resolves a feature request, be sure to link to that issue.

## Related Issues

- Fixes #

## Types of changes

What types of changes does your code introduce to Appium?
_Put an `x` in the boxes that apply_

- [ ] Bugfix (non-breaking change which fixes an issue)
- [ ] Enhancement (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected, requires version increase of Nuget packages)
- [ ] Documentation Update (if none of the other choices apply)

## Checklist

_Put an `x` in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code._

- [ ] I have read the [CONTRIBUTING](https://github.com/OPCFoundation/UA-.NETStandard/blob/master/CONTRIBUTING.md) doc.
- [ ] I have signed the [CLA](https://opcfoundation.org/license/cla/ContributorLicenseAgreementv1.0.pdf).
- [ ] I ran tests locally with my changes, all passed.
- [ ] I fixed all failing tests in the CI pipelines.
- [ ] I have added tests that prove my fix is effective or that my feature works.
- [ ] I have added necessary documentation (if appropriate).
- [ ] Any dependent changes have been merged and published in downstream modules.

## Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...
62 changes: 62 additions & 0 deletions .github/workflows/buildandtest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Build and Test .NET 6.0

on:
push:
pull_request:
branches: [ master ]
paths:
- '**.cs'
- '**.csproj'

env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'

jobs:
build-and-test:
name: build-and-test-${{matrix.os}}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
include:
- framework: 'net6.0'
dotnet-version: '6.0.x'
configuration: 'Release'

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup .NET ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ matrix.dotnet-version }}

- name: Build
run: dotnet build --force --framework ${{ matrix.framework }} --configuration ${{ matrix.configuration }} "UA Core Library.sln"

- name: Test
# note: /p:CollectCoverage=true is only used to disable deterministc builds
run: dotnet test --no-build --framework ${{ matrix.framework }} --logger trx --configuration ${{ matrix.configuration }} /p:CollectCoverage=true --collect:"XPlat Code Coverage" --settings ./Tests/coverlet.runsettings.xml --results-directory "TestResults-${{matrix.os}}-${{matrix.framework}}-${{matrix.configuration}}" "UA Core Library.sln"

- name: Upload test results
uses: actions/upload-artifact@v3
with:
name: dotnet-results-${{matrix.os}}-${{matrix.framework}}-${{matrix.configuration}}
path: "TestResults-${{matrix.os}}-${{matrix.framework}}-${{matrix.configuration}}"
# Use always() to always run this step to publish test results when there are test failures
if: ${{ always() }}

- name: Upload to Codecov
uses: codecov/codecov-action@v2
with:
name: codecov-umbrella
#token: ${{ secrets.CODECOV_TOKEN }}
directory: "TestResults-${{matrix.os}}-${{matrix.framework}}-${{matrix.configuration}}"
env_vars: matrix.os,matrix.dotnet-version,matrix.configuration
fail_ci_if_error: false
path_to_write_report: "./coverage/codecov_report-${{matrix.os}}-${{matrix.framework}}-${{matrix.configuration}}/"
verbose: true
if: ${{ always() }}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
<PackageReference Include="Mono.Options" Version="6.12.0.148" />
<PackageReference Include="Serilog" Version="2.10.0" />
<PackageReference Include="Serilog.Expressions" Version="3.2.1" />
<PackageReference Include="Serilog.Expressions" Version="3.3.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="4.0.1" />
<PackageReference Include="Serilog.Extensions.Logging" Version="3.1.0" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
Expand Down
6 changes: 6 additions & 0 deletions Applications/ConsoleReferenceClient/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
* ======================================================================*/

using System;
using System.Globalization;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
Expand All @@ -50,6 +51,11 @@ public static async Task Main(string[] args)
TextWriter output = Console.Out;
output.WriteLine("OPC UA Console Reference Client");

output.WriteLine("OPC UA library: {0} @ {1} -- {2}",
Utils.GetAssemblyBuildNumber(),
Utils.GetAssemblyTimestamp().ToString("G", CultureInfo.InvariantCulture),
Utils.GetAssemblySoftwareVersion());

// The application name and config file names
var applicationName = "ConsoleReferenceClient";
var configSectionName = "Quickstarts.ReferenceClient";
Expand Down
19 changes: 17 additions & 2 deletions Applications/ConsoleReferenceServer/ConsoleReferenceServer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,26 @@
<ProjectReference Include="..\Quickstarts.Servers\Quickstarts.Servers.csproj" />
</ItemGroup>

<Choose>
<!-- Note: Due to incompatibilities of Microsoft.Extensions Nuget packages between versions 3.x and 6.0,
use latest versions only on .NET 5/6, otherwise 3.1.x -->
<When Condition="'$(TargetFramework)' == 'net5.0' OR '$(TargetFramework)' == 'net6.0'">
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
</ItemGroup>
</When>
<Otherwise>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.1.23" />
<PackageReference Include="Microsoft.Extensions.Primitives" Version="3.1.23" />
</ItemGroup>
</Otherwise>
</Choose>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
<PackageReference Include="Mono.Options" Version="6.12.0.148" />
<PackageReference Include="Serilog" Version="2.10.0" />
<PackageReference Include="Serilog.Expressions" Version="3.2.1" />
<PackageReference Include="Serilog.Expressions" Version="3.3.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="4.0.1" />
<PackageReference Include="Serilog.Extensions.Logging" Version="3.1.0" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
Expand Down
6 changes: 6 additions & 0 deletions Applications/ConsoleReferenceServer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
* ======================================================================*/

using System;
using System.Globalization;
using System.IO;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
Expand All @@ -45,6 +46,11 @@ public static async Task<int> Main(string[] args)
TextWriter output = Console.Out;
output.WriteLine("{0} OPC UA Reference Server", Utils.IsRunningOnMono() ? "Mono" : ".NET Core");

output.WriteLine("OPC UA library: {0} @ {1} -- {2}",
Utils.GetAssemblyBuildNumber(),
Utils.GetAssemblyTimestamp().ToString("G", CultureInfo.InvariantCulture),
Utils.GetAssemblySoftwareVersion());

// The application name and config file names
var applicationName = Utils.IsRunningOnMono() ? "MonoReferenceServer" : "ConsoleReferenceServer";
var configSectionName = Utils.IsRunningOnMono() ? "Quickstarts.MonoReferenceServer" : "Quickstarts.ReferenceServer";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
<!-- Allows anonymous users -->
<ua:UserTokenPolicy>
<ua:TokenType>Anonymous_0</ua:TokenType>
<!-- passwords must be encrypted - no setting lets the stack select a secure profile -->
<!-- <ua:SecurityPolicyUri>http://opcfoundation.org/UA/SecurityPolicy#None</ua:SecurityPolicyUri> -->
</ua:UserTokenPolicy>

<!-- Allows username/password -->
Expand Down
Loading

0 comments on commit 586a63c

Please sign in to comment.