From 2a78fb7fb3c50580b3ace9fb53f81ed1fc2ccf3d Mon Sep 17 00:00:00 2001 From: James Friel Date: Wed, 18 Dec 2024 12:02:42 +0000 Subject: [PATCH 1/2] fix mef attacher issue --- CHANGELOG.md | 4 +++ .../Modules/Attachers/AttacherMEFTest.cs | 32 +++++++++++++++++++ .../DataLoad/Engine/Attachers/Attacher.cs | 5 +++ .../Modules/Attachers/RemoteAttacher.cs | 3 +- .../Modules/Attachers/RemoteTableAttacher.cs | 3 ++ 5 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 Rdmp.Core.Tests/DataLoad/Modules/Attachers/AttacherMEFTest.cs diff --git a/CHANGELOG.md b/CHANGELOG.md index 859f5d9afc..cef7f7a06a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +- Fix issue with MEF constructing Remote Table Attachers + ## [8.4.1] - 2024-12-10 - Improve Overview Model Generation Speed diff --git a/Rdmp.Core.Tests/DataLoad/Modules/Attachers/AttacherMEFTest.cs b/Rdmp.Core.Tests/DataLoad/Modules/Attachers/AttacherMEFTest.cs new file mode 100644 index 0000000000..c85967c52c --- /dev/null +++ b/Rdmp.Core.Tests/DataLoad/Modules/Attachers/AttacherMEFTest.cs @@ -0,0 +1,32 @@ +using NPOI.SS.Formula.Functions; +using NUnit.Framework; +using Rdmp.Core.DataLoad.Engine.Attachers; +using Rdmp.Core.DataLoad.Modules.Attachers; +using Rdmp.Core.Repositories; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tests.Common; + +namespace Rdmp.Core.Tests.DataLoad.Modules.Attachers +{ + public class AttacherMEFTest: UnitTests + { + + [Test] + public void AttacherMEFCreationTest() + { + var types = MEF.GetTypes().Where(t => !typeof(RemoteAttacher).IsAssignableTo(t)).ToArray(); + List AttacherPaths = types.Select(t => t.FullName).ToList(); + foreach (var path in AttacherPaths) + { + Assert.DoesNotThrow(() => + { + MEF.CreateA(path); + }); + } + } + } +} diff --git a/Rdmp.Core/DataLoad/Engine/Attachers/Attacher.cs b/Rdmp.Core/DataLoad/Engine/Attachers/Attacher.cs index 1c30e2ea46..60d97abf64 100644 --- a/Rdmp.Core/DataLoad/Engine/Attachers/Attacher.cs +++ b/Rdmp.Core/DataLoad/Engine/Attachers/Attacher.cs @@ -64,6 +64,11 @@ protected Attacher(bool requestsExternalDatabaseCreation) RequestsExternalDatabaseCreation = requestsExternalDatabaseCreation; } + protected Attacher() + { + RequestsExternalDatabaseCreation = true; + } + public abstract void Check(ICheckNotifier notifier); diff --git a/Rdmp.Core/DataLoad/Modules/Attachers/RemoteAttacher.cs b/Rdmp.Core/DataLoad/Modules/Attachers/RemoteAttacher.cs index 99e5853c54..316479816a 100644 --- a/Rdmp.Core/DataLoad/Modules/Attachers/RemoteAttacher.cs +++ b/Rdmp.Core/DataLoad/Modules/Attachers/RemoteAttacher.cs @@ -24,7 +24,8 @@ namespace Rdmp.Core.DataLoad.Modules.Attachers; public class RemoteAttacher : Attacher, IPluginAttacher { - public RemoteAttacher(bool requestsExternalDatabaseCreation=true) : base(requestsExternalDatabaseCreation) { } + public RemoteAttacher(bool requestsExternalDatabaseCreation = true) : base(requestsExternalDatabaseCreation) { } + public RemoteAttacher() : base(true) { } [DemandsInitialization("How far back to pull data from")] public AttacherHistoricalDurations HistoricalFetchDuration { get; set; } diff --git a/Rdmp.Core/DataLoad/Modules/Attachers/RemoteTableAttacher.cs b/Rdmp.Core/DataLoad/Modules/Attachers/RemoteTableAttacher.cs index fa7ff3cd9c..7d8122586e 100644 --- a/Rdmp.Core/DataLoad/Modules/Attachers/RemoteTableAttacher.cs +++ b/Rdmp.Core/DataLoad/Modules/Attachers/RemoteTableAttacher.cs @@ -40,6 +40,9 @@ public class RemoteTableAttacher : RemoteAttacher public RemoteTableAttacher(bool requestsExternalDatabaseCreation=true) : base(requestsExternalDatabaseCreation) { } + public RemoteTableAttacher() : base(true) + { + } [DemandsInitialization( "The server to connect to (this replaces all other settings e.g. RemoteServer, RemoteDatabaseName etc")] From f6a14eb889ca88d447a8845180171643ee030667 Mon Sep 17 00:00:00 2001 From: James Friel Date: Wed, 18 Dec 2024 12:06:15 +0000 Subject: [PATCH 2/2] update version --- CHANGELOG.md | 2 +- SharedAssemblyInfo.cs | 6 +++--- rdmp-client.xml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cef7f7a06a..c51b9cb50f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased] +## [8.4.2] - 2024-12-19 - Fix issue with MEF constructing Remote Table Attachers diff --git a/SharedAssemblyInfo.cs b/SharedAssemblyInfo.cs index ec5884a345..55f72e959f 100644 --- a/SharedAssemblyInfo.cs +++ b/SharedAssemblyInfo.cs @@ -10,6 +10,6 @@ [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -[assembly: AssemblyVersion("8.4.1")] -[assembly: AssemblyFileVersion("8.4.1")] -[assembly: AssemblyInformationalVersion("8.4.1")] +[assembly: AssemblyVersion("8.4.2")] +[assembly: AssemblyFileVersion("8.4.2")] +[assembly: AssemblyInformationalVersion("8.4.2")] diff --git a/rdmp-client.xml b/rdmp-client.xml index 9157566cec..096919a04c 100644 --- a/rdmp-client.xml +++ b/rdmp-client.xml @@ -1,7 +1,7 @@ - 8.4.1.0 - https://github.com/HicServices/RDMP/releases/download/v8.4.1/rdmp-8.4.1-client.zip + 8.4.2.0 + https://github.com/HicServices/RDMP/releases/download/v8.4.2/rdmp-8.4.2-client.zip https://github.com/HicServices/RDMP/blob/main/CHANGELOG.md#7 true