Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into fix/resource-link-exce…
Browse files Browse the repository at this point in the history
…ption
  • Loading branch information
1nf0rmagician committed Nov 21, 2024
2 parents e601b4b + 3ec5ca0 commit 9050ecb
Show file tree
Hide file tree
Showing 211 changed files with 1,414 additions and 2,932 deletions.
680 changes: 0 additions & 680 deletions .build/BuildToolkit.ps1

This file was deleted.

36 changes: 0 additions & 36 deletions .build/Output.ps1

This file was deleted.

119 changes: 56 additions & 63 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,94 +12,87 @@ on:
branches:
- dev
- future

env:
MORYX_OPTIMIZE_CODE: "false"
MORYX_BUILD_CONFIG: "Release"
MORYX_BUILDNUMBER: ${{github.run_number}}
dotnet_sdk_version: '7.x'
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
dotnet_sdk_version: '8.0.100'
REPOSITORY_NAME: ${{ github.event.repository.name }}
MORYX_PACKAGE_TARGET_DEV: 'https://www.myget.org/F/moryx-oss-ci/api/v2/package'
MORYX_PACKAGE_TARGET_V3_DEV: 'https://www.myget.org/F/moryx-oss-ci/api/v3/index.json'
MORYX_PACKAGE_TARGET_FUTURE: 'https://www.myget.org/F/moryx-oss-ci/api/v2/package'
MORYX_PACKAGE_TARGET_V3_FUTURE: 'https://www.myget.org/F/moryx-oss-ci/api/v3/index.json'
MORYX_PACKAGE_TARGET_RELEASE: 'https://api.nuget.org/v3/index.json'
MORYX_PACKAGE_TARGET_V3_RELEASE: 'https://api.nuget.org/v3/index.json'

jobs:
EnvVar:
runs-on: ubuntu-latest
steps:
- run: echo ""
outputs:
dotnet_sdk_version: ${{ env.dotnet_sdk_version }}
REPOSITORY_NAME: ${{ env.REPOSITORY_NAME }}
MORYX_PACKAGE_TARGET_DEV: ${{ env.MORYX_PACKAGE_TARGET_DEV }}
MORYX_PACKAGE_TARGET_V3_DEV: ${{ env.MORYX_PACKAGE_TARGET_V3_DEV }}
MORYX_PACKAGE_TARGET_FUTURE: ${{ env.MORYX_PACKAGE_TARGET_FUTURE }}
MORYX_PACKAGE_TARGET_V3_FUTURE: ${{ env.MORYX_PACKAGE_TARGET_V3_FUTURE }}
MORYX_PACKAGE_TARGET_RELEASE: ${{ env.MORYX_PACKAGE_TARGET_RELEASE }}
MORYX_PACKAGE_TARGET_V3_RELEASE: ${{ env.MORYX_PACKAGE_TARGET_V3_RELEASE }}

Build:
uses: PHOENIXCONTACT/tools/.github/workflows/build-tool.yml@release-6
needs: [EnvVar]
uses: phoenixcontact/tools/.github/workflows/build-tool.yml@main
with:
MORYX_OPTIMIZE_CODE: "false"
MORYX_BUILD_CONFIG: "Release"
MORYX_BUILDNUMBER: ${{github.run_number}}
dotnet_sdk_version: '7.x'
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
REPOSITORY_NAME: ${{ github.event.repository.name }}
dotnet_sdk_version: ${{ needs.EnvVar.outputs.dotnet_sdk_version }}
REPOSITORY_NAME: ${{ needs.EnvVar.outputs.REPOSITORY_NAME }}

UnitTests:
needs: [Build]
uses: PHOENIXCONTACT/tools/.github/workflows/unittest-tool.yml@release-6
needs: [EnvVar, Build]
uses: phoenixcontact/tools/.github/workflows/unittest-tool.yml@main
with:
MORYX_OPTIMIZE_CODE: "false"
MORYX_BUILD_CONFIG: "Release"
MORYX_BUILDNUMBER: ${{github.run_number}}
dotnet_sdk_version: '7.x'
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
REPOSITORY_NAME: ${{ github.event.repository.name }}
dotnet_sdk_version: ${{ needs.EnvVar.outputs.dotnet_sdk_version }}
REPOSITORY_NAME: ${{ needs.EnvVar.outputs.REPOSITORY_NAME }}

IntegrationTests:
needs: [Build]
uses: PHOENIXCONTACT/tools/.github/workflows/integrationtest-tool.yml@release-6
needs: [EnvVar, Build]
uses: phoenixcontact/tools/.github/workflows/integrationtest-tool.yml@main
with:
MORYX_OPTIMIZE_CODE: "false"
MORYX_BUILD_CONFIG: "Release"
MORYX_BUILDNUMBER: ${{github.run_number}}
dotnet_sdk_version: '7.x'
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
REPOSITORY_NAME: ${{ github.event.repository.name }}
dotnet_sdk_version: ${{ needs.EnvVar.outputs.dotnet_sdk_version }}
REPOSITORY_NAME: ${{ needs.EnvVar.outputs.REPOSITORY_NAME }}

ReportGenerator:
needs: [UnitTests, IntegrationTests]
uses: PHOENIXCONTACT/tools/.github/workflows/reportgenerator-tool.yml@release-6
needs: [EnvVar, UnitTests, IntegrationTests]
uses: phoenixcontact/tools/.github/workflows/reportgenerator-tool.yml@main
with:
MORYX_OPTIMIZE_CODE: "false"
MORYX_BUILD_CONFIG: "Release"
MORYX_BUILDNUMBER: ${{github.run_number}}
dotnet_sdk_version: '7.x'
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
REPOSITORY_NAME: ${{ github.event.repository.name }}
REPOSITORY_NAME: ${{ needs.EnvVar.outputs.REPOSITORY_NAME }}

Publish-Test-Coverage:
needs: [ReportGenerator]
uses: PHOENIXCONTACT/tools/.github/workflows/publish-test-coverage-tool.yml@release-6
needs: [EnvVar, ReportGenerator]
uses: phoenixcontact/tools/.github/workflows/publish-test-coverage-tool.yml@main
with:
MORYX_OPTIMIZE_CODE: "false"
MORYX_BUILD_CONFIG: "Release"
MORYX_BUILDNUMBER: ${{github.run_number}}
dotnet_sdk_version: '7.x'
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
REPOSITORY_NAME: ${{ github.event.repository.name }}
REPOSITORY_NAME: ${{ needs.EnvVar.outputs.REPOSITORY_NAME }}
secrets:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

Documentation:
needs: [UnitTests]
uses: PHOENIXCONTACT/tools/.github/workflows/documentation-tool.yml@release-6
with:
MORYX_OPTIMIZE_CODE: "false"
MORYX_BUILD_CONFIG: "Release"
MORYX_BUILDNUMBER: ${{github.run_number}}
dotnet_sdk_version: '7.x'
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
REPOSITORY_NAME: ${{ github.event.repository.name }}
# currently not working
# Documentation:
# needs: [EnvVar, UnitTests]
# uses: phoenixcontact/tools/.github/workflows/documentation-tool.yml@main
# with:
# REPOSITORY_NAME: ${{ needs.EnvVar.outputs.REPOSITORY_NAME }}

Publish:
needs: [UnitTests]
uses: PHOENIXCONTACT/tools/.github/workflows/publish-tool.yml@release-6
needs: [EnvVar, UnitTests]
uses: phoenixcontact/tools/.github/workflows/publish-tool.yml@main
with:
MORYX_OPTIMIZE_CODE: "false"
MORYX_BUILD_CONFIG: "Release"
MORYX_BUILDNUMBER: ${{github.run_number}}
dotnet_sdk_version: '7.x'
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
REPOSITORY_NAME: ${{ github.event.repository.name }}
dotnet_sdk_version: ${{ needs.EnvVar.outputs.dotnet_sdk_version }}
REPOSITORY_NAME: ${{ needs.EnvVar.outputs.REPOSITORY_NAME }}
MORYX_PACKAGE_TARGET_DEV: ${{ needs.EnvVar.outputs.MORYX_PACKAGE_TARGET_DEV }}
MORYX_PACKAGE_TARGET_V3_DEV: ${{ needs.EnvVar.outputs.MORYX_PACKAGE_TARGET_V3_DEV }}
MORYX_PACKAGE_TARGET_FUTURE: ${{ needs.EnvVar.outputs.MORYX_PACKAGE_TARGET_FUTURE }}
MORYX_PACKAGE_TARGET_V3_FUTURE: ${{ needs.EnvVar.outputs.MORYX_PACKAGE_TARGET_V3_FUTURE }}
MORYX_PACKAGE_TARGET_RELEASE: ${{ needs.EnvVar.outputs.MORYX_PACKAGE_TARGET_RELEASE }}
MORYX_PACKAGE_TARGET_V3_RELEASE: ${{ needs.EnvVar.outputs.MORYX_PACKAGE_TARGET_V3_RELEASE }}
secrets:
MYGET_TOKEN: ${{secrets.MYGET_TOKEN}}
NUGET_TOKEN: ${{secrets.NUGET_TOKEN}}
63 changes: 0 additions & 63 deletions Build.ps1

This file was deleted.

2 changes: 1 addition & 1 deletion Directory.build.props → Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<LangVersion>10.0</LangVersion>
<LangVersion>latest</LangVersion>
</PropertyGroup>

<PropertyGroup>
Expand Down
27 changes: 13 additions & 14 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>

<Import Project=".build\Common.props" Condition="'$(CreatePackage)' == 'true'" />
<Import Project=".build\Common.props" Condition="'$(IsPackable)' == 'true'" />

<PropertyGroup>
<dotnetVersion>6.0.0</dotnetVersion>
<efCoreVersion>6.0.0</efCoreVersion>
<dotnetVersion>8.0.0</dotnetVersion>
<efCoreVersion>8.0.0</efCoreVersion>

<LangVersion>latest</LangVersion>
</PropertyGroup>

<!-- Package refereces for all projects if CreatePackage=true -->
<ItemGroup Condition="'$(CreatePackage)' == 'true'">
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
<!-- Package refereces for all projects if IsPackable=true -->
<ItemGroup Condition="'$(IsPackable)' == 'true'">
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
</ItemGroup>

<!-- Package versions for package references across all projects -->
<ItemGroup>
<!--3rd party dependencies-->
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.6.3" />
<PackageReference Update="Moq" Version="4.17.2" />
<PackageReference Update="NUnit" Version="3.13.3" />
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Update="Moq" Version="4.20.69" />
<PackageReference Update="NUnit" Version="3.14.0" />
<PackageReference Update="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Update="coverlet.collector" Version="3.2.0" >
<PackageReference Update="coverlet.collector" Version="6.0.0" >
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand All @@ -43,12 +44,10 @@
<PackageReference Update="Microsoft.EntityFrameworkCore.Sqlite" Version="$(efCoreVersion)" />
<PackageReference Update="Npgsql.EntityFrameworkCore.PostgreSQL" Version="$(efCoreVersion)" />

<PackageReference Update="System.IO.Ports" Version="6.0.0" />
<PackageReference Update="System.IO.Ports" Version="$(dotnetVersion)" />
<PackageReference Update="System.ComponentModel.Annotations" Version="5.0.0" />

<PackageReference Update="Castle.Windsor" Version="5.1.1" />
<PackageReference Update="Castle.WcfIntegrationFacility" Version="5.1.1" />
<PackageReference Update="Castle.Windsor.Extensions.DependencyInjection" Version="5.1.1" />
<PackageReference Update="Castle.Windsor" Version="6.0.0" />

</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
http://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.3.1
8.2.0
29 changes: 29 additions & 0 deletions docs/migrations/v6_to_v8.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Migration from MORYX Framework v6 to v8


## Local Container Refactoring
The DI container within modules based on Castle Windsor was refactored and simplified. The most changes are caused by removing the historic split between local and global container, which was obsolete after switching the global container to ServiceCollection. We also removed the concept of installers and registrators and replaced everything with API on `IContainer` and extensions inspired by the `IServiceCollection`.

- **Attribute changes:** The base attributes for registration were removed, use `ComponentAttribute`, `PluginAttribute` and `PluginFactory` instead.
- **Installers removed** The concept of installes was removed and with it their implementations `AutoInstaller` and `DependencyInstaller`. They were replaced by the extensions `LoadFromAssembly` with different signature options for `DependencyRegistrationAttribute` and `Predicate<Type>`
- **LoadComponents** was removed as a dedicate feature and is now an extension on `IContainer`. It has also been restricted to public/exported types.
- **IContainerHost** was removed. The seperate interface for accessing a modules container just caused unnecessary casts and the risk of invalid type. The property `Container` was added to `IServerModule` instead.
- **Extend** The flexible method for passing facilities to Castle was removed as it was only added and used by WCF.
- **MoryxFacility** All MORYX specific behavior like strategies and `Named` import overrides were refactored to follow Castle best practises and are now isolated in the `MoryxFacility`. This enables everyone to achieve the MORYX DI behavior with a Castle Container without the MORYX wrapper.
- **Installers** As previously mentioned installers were removed, but since the API on `IContainer` now supports everything previously reserved for installers and registrators, just migrate the registration onto the container like the [DbContextContainerExtension](https://github.com/PHOENIXCONTACT/MORYX-Framework/blob/future/src/Moryx.Model/DbContextContainerExtension.cs) or the [BasicInterceptorInstaller](https://github.com/PHOENIXCONTACT/MORYX-Framework/blob/future/src/Moryx.TestTools.UnitTest/BasicInterceptorInstaller.cs)

## ServerModuleBase

To simplify development and prepare easier integration of the Moryx.Cli we merged the `ServerModuleFacadeControllerBase` into the `ServerModuleBase`. Just replace the base type if your module is affected by this.

## GetObjectData(SerializationInfo info, StreamingContext context)

Removed all overrides of the obsolete method `Exception.GetObjectData(SerializationInfo info, StreamingContext context)` as well as all constructors which were calling the base class constructor `Exception(SerializationInfo info, StreamingContext context)`
The following classes are affected by this change
- MissingFacadeException
- HealthStateException
- InvalidConfigException

## Merged IPublicResource into IResource

`IPublicResource` and `IResource` were merged into `IResource`, since the differentiaten between those was hard to understand for some and barely had any real world advantages. Now literally "Everything is a resource".
4 changes: 2 additions & 2 deletions docs/tutorials/HowToCreateAProduct.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
uid: HowToCreateAProduct
---
# How to create a resource
# How to create a product

This tutorial shows how [Products](../../src/Moryx.AbstractionLayer/Products/ProductType.cs) should be implemented. Look [here](../articles/Products/Concept.md) if you are not firm with the concept of a `Product`.

For products we differentiate between [ProductType](../../src/Moryx.AbstractionLayer/Products/ProductType.cs) and [ProductInstance](../../src/Moryx.AbstractionLayer/Products/ProductInstance.cs). The `ProductType` is what you can order in a catalog, while the `ProductInstance` is what you received after ordering: an instance of the product with its unique serialnumber. So that a `ProductType` can be producted it needs a corresponding `ProductInstance`. If your application isn't used for production, you can skip the `ProductInstances`.
For products we differentiate between [ProductType](../../src/Moryx.AbstractionLayer/Products/ProductType.cs) and [ProductInstance](../../src/Moryx.AbstractionLayer/Products/ProductInstance.cs). The `ProductType` is what you can order in a catalog, while the `ProductInstance` is what you received after ordering: an instance of the product with its unique serialnumber. So that a `ProductType` can be produced it needs a corresponding `ProductInstance`. If your application isn't used for production, you can skip the `ProductInstances`.

## Create a basic ProductType and ProductInstance
All ProductTypes are derived from `ProductType`. The methode `Instantiate()` returns an object of the correspoding `ProductInstance`.
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/HowToTestAModule.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
In order to test a module in its lifecycle with its respective facade we offer the `Moryx.TestTools.IntegrationTest`.
The package brings a `MoryxTestEnvironment<T>`.
With this class you can first create mocks for all module facades your module dependents on using the static `CreateModuleMock<FacadeType>` method.
Afterwards you can create the environment using an implementation of the `ServerModuleFacadeControllerBase`, an instance of the `ConfigBase` and the set of dependency mocks.
Afterwards you can create the environment using an implementation of the `ServerModuleBase<T>` class, an instance of the `ConfigBase` and the set of dependency mocks.
The first two parameters are usually your `ModuleController` and your `ModuleConfig`.
The following example shows a setup for the `IShiftManagement` facade interface. The module depends on the `IResourceManagement` and `IOperatorManagement` facades.

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

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Description>Endpoints for the Product Facade</Description>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<CreatePackage>true</CreatePackage>
<PackageTags>MORYX;IIoT;IoT;</PackageTags>
</PropertyGroup>

Expand Down
Loading

0 comments on commit 9050ecb

Please sign in to comment.