From b9cbcd389acb81871b3e5858ecee1bb23f17faf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Alberto=20Leiva=20Obando?= Date: Fri, 5 Apr 2024 16:54:06 -0600 Subject: [PATCH 01/16] [DI-1337] Data Import 2.3 .NET 8 Update Upgrade projects to NET 8 Update packages to latest version. Update code to match packages version changes --- .../DataImport.Common.Tests.csproj | 28 ++++---- DataImport.Common.Tests/LogLevelTests.cs | 6 +- .../PowerShellPreprocessorServiceTests.cs | 4 +- DataImport.Common/AzureFileService.cs | 6 +- DataImport.Common/DataImport.Common.csproj | 29 +++++--- .../ExtensionMethods/FileExtensions.cs | 4 +- DataImport.Common/Helpers/EnumHelper.cs | 2 +- DataImport.Common/HttpContextHelper.cs | 4 +- DataImport.Common/LocalFileService.cs | 6 +- .../ExternalPreprocessorException.cs | 4 ++ .../PowerShellProcessException.cs | 5 +- .../PowerShellValidateException.cs | 4 ++ .../DataImport.EdFi.UnitTests.csproj | 12 ++-- DataImport.EdFi/DataImport.EdFi.csproj | 4 +- .../DataImport.Models.Tests.csproj | 16 ++--- DataImport.Models/DataImport.Models.csproj | 25 +++---- ...taImport.Server.TransformLoad.Tests.csproj | 14 ++-- .../DataImport.Server.TransformLoad.csproj | 40 +++++------ .../Features/FileTransport/FileServer.cs | 35 ++++++---- .../DataImport.TestHelpers.csproj | 2 +- .../DataImport.Web.Tests.csproj | 27 +++----- .../Features/Agent/AddEditAgentTests.cs | 17 +++-- .../ApiServers/ApiServerIndexTests.cs | 4 +- .../AddEditBootstrapDataTests.cs | 2 +- .../Features/DataMaps/DeleteDataMapTests.cs | 3 +- .../Preprocessor/PreprocessorIndexTests.cs | 2 +- .../Helpers/ExtensionMethodsTests.cs | 2 +- DataImport.Web/DataImport.Web.csproj | 68 ++++++++----------- DataImport.Web/Features/Agent/AgentFiles.cs | 9 +-- .../Shared/ApiServerSpecificRequestHandler.cs | 2 +- .../ApiVersionSpecificRequestHandler.cs | 2 +- .../Infrastructure/MvcTransactionFilter.cs | 3 +- DataImport.Web/Startup.cs | 6 +- readme.md | 2 +- 34 files changed, 206 insertions(+), 193 deletions(-) diff --git a/DataImport.Common.Tests/DataImport.Common.Tests.csproj b/DataImport.Common.Tests/DataImport.Common.Tests.csproj index 225eb0ff..4f3229f8 100644 --- a/DataImport.Common.Tests/DataImport.Common.Tests.csproj +++ b/DataImport.Common.Tests/DataImport.Common.Tests.csproj @@ -1,8 +1,10 @@ - + - net6.0 + net8.0 Library false + True + $(NoWarn),1573,1591,1712 @@ -10,19 +12,19 @@ - - - + + + runtime; build; native; contentfiles; analyzers; buildtransitive all - - - - - - - + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive all @@ -44,4 +46,4 @@ Always - + \ No newline at end of file diff --git a/DataImport.Common.Tests/LogLevelTests.cs b/DataImport.Common.Tests/LogLevelTests.cs index 837eda70..8f2ef8bc 100644 --- a/DataImport.Common.Tests/LogLevelTests.cs +++ b/DataImport.Common.Tests/LogLevelTests.cs @@ -21,7 +21,7 @@ public void ShouldReturnLogLevelsFiltered() List actual = LogLevelConstants.GetValidList(LogLevelConstants.Error); Console.WriteLine($"Expected: {string.Join(",", expected)}"); Console.WriteLine($"Actual: {string.Join(",", actual)}"); - Assert.IsTrue(actual.SequenceEqual(expected)); + Assert.That(actual.SequenceEqual(expected), Is.True); } [Test] @@ -29,7 +29,7 @@ public void ShouldReturnLogLevelsIfFilterIsEmpty() { List expected = LogLevelConstants.All.ToList(); List actual = LogLevelConstants.GetValidList(""); - Assert.IsTrue(actual.SequenceEqual(expected)); + Assert.That(actual.SequenceEqual(expected), Is.True); } [Test] @@ -37,7 +37,7 @@ public void ShouldReturnLogLevelsIfFilterIsNotFound() { List expected = LogLevelConstants.All.ToList(); List actual = LogLevelConstants.GetValidList("Test"); - Assert.IsTrue(actual.SequenceEqual(expected)); + Assert.That(actual.SequenceEqual(expected), Is.True); } } } diff --git a/DataImport.Common.Tests/PowerShellPreprocessorServiceTests.cs b/DataImport.Common.Tests/PowerShellPreprocessorServiceTests.cs index 66f6ade2..e5dc908f 100644 --- a/DataImport.Common.Tests/PowerShellPreprocessorServiceTests.cs +++ b/DataImport.Common.Tests/PowerShellPreprocessorServiceTests.cs @@ -68,7 +68,7 @@ public void ShouldReturnInputStreamWhenScriptIsNullOrEmpty(string scriptContent) output.ShouldBe(input); - Assert.AreSame(input, output); + Assert.That(input, Is.SameAs(output)); } [Test] @@ -391,7 +391,7 @@ public void ShouldProvideConvertFromFixedWidthCmdlet() var output = _service.ProcessStreamWithScript(scriptContent, input); var actual = new StreamReader(output).ReadToEnd(); - Assert.AreEqual(expected, actual, message); + Assert.That(expected, Is.EqualTo(actual), message); }; test("Write-Output (ConvertFrom-FixedWidth -FixedWidthString \"012 45 789\" -FieldMap @(0, 4, 7) -NoTrim)", diff --git a/DataImport.Common/AzureFileService.cs b/DataImport.Common/AzureFileService.cs index 92dff825..28649e9f 100644 --- a/DataImport.Common/AzureFileService.cs +++ b/DataImport.Common/AzureFileService.cs @@ -50,7 +50,7 @@ public async Task Upload(string fileName, Stream fileStream, Agent agent) var recordCount = fileStream.TotalLines(fileName.IsCsvFile()); _fileHelper.LogFile(fileName, agent.Id, cloudFile.StorageUri.PrimaryUri.ToString(), FileStatus.Uploaded, recordCount); - _logger.LogInformation("File '{file}' was uploaded to '{uri}' for Agent '{name}' (Id: {id}).", fileName, cloudFile.StorageUri.PrimaryUri, agent.Name, agent.Id); + _logger.LogInformation("File '{File}' was uploaded to '{Uri}' for Agent '{Name}' (Id: {Id}).", fileName, cloudFile.StorageUri.PrimaryUri, agent.Name, agent.Id); } else { @@ -84,11 +84,11 @@ public async Task Transfer(Stream stream, string file, Agent agent) var recordCount = stream.TotalLines(file.IsCsvFile()); await _fileHelper.LogFileAsync(shortFileName, agent.Id, cloudFile.StorageUri.PrimaryUri.ToString(), FileStatus.Uploaded, recordCount); - _logger.LogInformation("Successfully transferred file {file} to {uri} by agent ID: {agent}", shortFileName, cloudFile.StorageUri.PrimaryUri, agent.Id); + _logger.LogInformation("Successfully transferred file {File} to {Uri} by agent ID: {Agent}", shortFileName, cloudFile.StorageUri.PrimaryUri, agent.Id); } catch (Exception ex) { - _logger.LogError(ex, "Unexpected error in TransferFile for file: {file} on site: ", agent.Url); + _logger.LogError(ex, "Unexpected error in TransferFile for file: {File} on site: ", agent.Url); await _fileHelper.LogFileAsync(shortFileName, agent.Id, "", FileStatus.ErrorUploaded, 0); } } diff --git a/DataImport.Common/DataImport.Common.csproj b/DataImport.Common/DataImport.Common.csproj index cb250cd5..ac587659 100644 --- a/DataImport.Common/DataImport.Common.csproj +++ b/DataImport.Common/DataImport.Common.csproj @@ -3,33 +3,44 @@ Library - net6.0 + net8.0 + + + True + $(NoWarn),1573,1591,1712 + - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + - + - + runtime; build; native; contentfiles; analyzers; buildtransitive all - + - - + + diff --git a/DataImport.Common/ExtensionMethods/FileExtensions.cs b/DataImport.Common/ExtensionMethods/FileExtensions.cs index 8d4b2a5a..f15b71d0 100644 --- a/DataImport.Common/ExtensionMethods/FileExtensions.cs +++ b/DataImport.Common/ExtensionMethods/FileExtensions.cs @@ -7,13 +7,11 @@ using Microsoft.Extensions.Options; using System; using System.IO; -using System.Linq; namespace DataImport.Common.ExtensionMethods { public static class FileExtensions { - private static IOptions ConnectionStringsOptions => _connectionStringsOptions; private static IOptions _connectionStringsOptions; public static void SetConnectionStringsOptions(IOptions options) @@ -53,7 +51,7 @@ private static bool IsEmptyRecord(string s) { if (string.IsNullOrWhiteSpace(s)) return true; var array = s.Split(','); - return array.All(x => String.IsNullOrWhiteSpace(x)); + return Array.TrueForAll(array, x => String.IsNullOrWhiteSpace(x)); } public static bool IsCsvFile(this string fileName) => diff --git a/DataImport.Common/Helpers/EnumHelper.cs b/DataImport.Common/Helpers/EnumHelper.cs index 534eb268..3f1b0c51 100644 --- a/DataImport.Common/Helpers/EnumHelper.cs +++ b/DataImport.Common/Helpers/EnumHelper.cs @@ -20,7 +20,7 @@ public static string GetEnumDescription(Enum value) if (attributes != null && attributes.Any()) { - return attributes.First().Description; + return attributes[0].Description; } return value.ToString(); diff --git a/DataImport.Common/HttpContextHelper.cs b/DataImport.Common/HttpContextHelper.cs index abfaa6c1..90c35208 100644 --- a/DataImport.Common/HttpContextHelper.cs +++ b/DataImport.Common/HttpContextHelper.cs @@ -21,9 +21,9 @@ internal static class HttpContextHelper /// /// Gets the current . Returns null if there is no current . /// -#if NET5_0_OR_GREATER +#pragma warning disable S1133 // Deprecated code should be removed [Obsolete("Prefer accessing HttpContext via injection", error: false, DiagnosticId = "HttpContextCurrent", UrlFormat = "https://docs.microsoft.com/en-us/aspnet/core/fundamentals/http-context")] -#endif +#pragma warning restore S1133 // Deprecated code should be removed public static HttpContext Current => _httpContextAccessor.HttpContext; } } diff --git a/DataImport.Common/LocalFileService.cs b/DataImport.Common/LocalFileService.cs index a79d99f4..35149600 100644 --- a/DataImport.Common/LocalFileService.cs +++ b/DataImport.Common/LocalFileService.cs @@ -47,7 +47,7 @@ public async Task Upload(string fileName, Stream fileStream, Agent agent) _fileHelper.LogFile(fileName, agent.Id, UrlUtility.ConvertLocalPathToUri(fullFilePath), FileStatus.Uploaded, recordCount); - _logger.LogInformation("File '{file}' was uploaded to '{path}' for Agent '{name}' (Id: {id}).", fileName, uploadPath, agent.Name, agent.Id); + _logger.LogInformation("File '{File}' was uploaded to '{Path}' for Agent '{Name}' (Id: {Id}).", fileName, uploadPath, agent.Name, agent.Id); } public virtual async Task Transfer(Stream stream, string file, Agent agent) @@ -73,11 +73,11 @@ public virtual async Task Transfer(Stream stream, string file, Agent agent) var recordCount = stream.TotalLines(file.IsCsvFile()); await _fileHelper.LogFileAsync(shortFileName, agent.Id, localFileUri.AbsoluteUri, FileStatus.Uploaded, recordCount); - _logger.LogInformation("Successfully transferred file {file} to {path} by agent ID: {id}", shortFileName, localFileUri.AbsoluteUri, agent.Id); + _logger.LogInformation("Successfully transferred file {File} to {Path} by agent ID: {Id}", shortFileName, localFileUri.AbsoluteUri, agent.Id); } catch (Exception ex) { - _logger.LogError(ex, "Unexpected error in TransferFile for file: {file} on site: {path}", file, agent.Url); + _logger.LogError(ex, "Unexpected error in TransferFile for file: {File} on site: {Path}", file, agent.Url); await _fileHelper.LogFileAsync(shortFileName, agent.Id, "", FileStatus.ErrorUploaded, 0); } } diff --git a/DataImport.Common/Preprocessors/ExternalPreprocessorException.cs b/DataImport.Common/Preprocessors/ExternalPreprocessorException.cs index 9044e840..40d5aa67 100644 --- a/DataImport.Common/Preprocessors/ExternalPreprocessorException.cs +++ b/DataImport.Common/Preprocessors/ExternalPreprocessorException.cs @@ -62,14 +62,18 @@ public ExternalPreprocessorException(string message) public ExternalPreprocessorException(string message, params Exception[] innerExceptions) : base(message, innerExceptions) { } +#pragma warning disable S1133 // Deprecated code should be removed + [Obsolete("Obsolete for NET 8", DiagnosticId = "SYSLIB0051")] protected ExternalPreprocessorException(SerializationInfo info, StreamingContext context) : base(info, context) { } + [Obsolete("Obsolete for NET 8", DiagnosticId = "SYSLIB0051")] public override void GetObjectData(SerializationInfo info, StreamingContext context) { base.GetObjectData(info, context); info.AddValue(nameof(ProcessName), ProcessName); info.AddValue(nameof(Errors), Errors); } +#pragma warning disable S1133 // Deprecated code should be removed } } diff --git a/DataImport.Common/Preprocessors/PowerShellProcessException.cs b/DataImport.Common/Preprocessors/PowerShellProcessException.cs index 05d8c305..55b8b7a7 100644 --- a/DataImport.Common/Preprocessors/PowerShellProcessException.cs +++ b/DataImport.Common/Preprocessors/PowerShellProcessException.cs @@ -44,14 +44,17 @@ public PowerShellProcessException(string message) public PowerShellProcessException(string message, params Exception[] innerExceptions) : base(message, innerExceptions) { } - +#pragma warning disable S1133 // Deprecated code should be removed + [Obsolete("Obsolete for NET 8", DiagnosticId = "SYSLIB0051")] protected PowerShellProcessException(SerializationInfo info, StreamingContext context) : base(info, context) { } + [Obsolete("Obsolete for NET 8", DiagnosticId = "SYSLIB0051")] public override void GetObjectData(SerializationInfo info, StreamingContext context) { base.GetObjectData(info, context); info.AddValue(nameof(Errors), Errors); } +#pragma warning disable S1133 // Deprecated code should be removed } } diff --git a/DataImport.Common/Preprocessors/PowerShellValidateException.cs b/DataImport.Common/Preprocessors/PowerShellValidateException.cs index f45e4dd8..886f5c1a 100644 --- a/DataImport.Common/Preprocessors/PowerShellValidateException.cs +++ b/DataImport.Common/Preprocessors/PowerShellValidateException.cs @@ -24,13 +24,17 @@ public PowerShellValidateException(ParseError[] parseErrors) public PowerShellValidateException(string message) : base(message) { } +#pragma warning disable S1133 // Deprecated code should be removed + [Obsolete("Obsolete for NET 8", DiagnosticId = "SYSLIB0051")] protected PowerShellValidateException(SerializationInfo info, StreamingContext context) : base(info, context) { } + [Obsolete("Obsolete for NET 8", DiagnosticId = "SYSLIB0051")] public override void GetObjectData(SerializationInfo info, StreamingContext context) { base.GetObjectData(info, context); info.AddValue(nameof(ParseErrors), ParseErrors); } +#pragma warning disable S1133 // Deprecated code should be removed } } diff --git a/DataImport.EdFi.UnitTests/DataImport.EdFi.UnitTests.csproj b/DataImport.EdFi.UnitTests/DataImport.EdFi.UnitTests.csproj index 6d264c51..34128604 100644 --- a/DataImport.EdFi.UnitTests/DataImport.EdFi.UnitTests.csproj +++ b/DataImport.EdFi.UnitTests/DataImport.EdFi.UnitTests.csproj @@ -1,6 +1,6 @@  - net6.0 + net8.0 Library false @@ -8,10 +8,10 @@ - - - - - + + + + + \ No newline at end of file diff --git a/DataImport.EdFi/DataImport.EdFi.csproj b/DataImport.EdFi/DataImport.EdFi.csproj index efd32699..64662aa6 100644 --- a/DataImport.EdFi/DataImport.EdFi.csproj +++ b/DataImport.EdFi/DataImport.EdFi.csproj @@ -3,12 +3,12 @@ Library - net6.0 + net8.0 - + \ No newline at end of file diff --git a/DataImport.Models.Tests/DataImport.Models.Tests.csproj b/DataImport.Models.Tests/DataImport.Models.Tests.csproj index 5b1cf8dc..0c13d3f2 100644 --- a/DataImport.Models.Tests/DataImport.Models.Tests.csproj +++ b/DataImport.Models.Tests/DataImport.Models.Tests.csproj @@ -1,6 +1,6 @@  - net6.0 + net8.0 Library false @@ -9,13 +9,13 @@ - - - - - - - + + + + + + + diff --git a/DataImport.Models/DataImport.Models.csproj b/DataImport.Models/DataImport.Models.csproj index 97b66a72..780f7eea 100644 --- a/DataImport.Models/DataImport.Models.csproj +++ b/DataImport.Models/DataImport.Models.csproj @@ -1,6 +1,6 @@  - net6.0 + net8.0 Library @@ -114,19 +114,16 @@ - - + + + - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - + + + + + + + \ No newline at end of file diff --git a/DataImport.Server.TransformLoad.Tests/DataImport.Server.TransformLoad.Tests.csproj b/DataImport.Server.TransformLoad.Tests/DataImport.Server.TransformLoad.Tests.csproj index 9dc616e8..7b8fef8d 100644 --- a/DataImport.Server.TransformLoad.Tests/DataImport.Server.TransformLoad.Tests.csproj +++ b/DataImport.Server.TransformLoad.Tests/DataImport.Server.TransformLoad.Tests.csproj @@ -1,6 +1,6 @@  - net6.0 + net8.0 Library false @@ -37,11 +37,11 @@ - - - - - - + + + + + + \ No newline at end of file diff --git a/DataImport.Server.TransformLoad/DataImport.Server.TransformLoad.csproj b/DataImport.Server.TransformLoad/DataImport.Server.TransformLoad.csproj index decd80b7..2773b27b 100644 --- a/DataImport.Server.TransformLoad/DataImport.Server.TransformLoad.csproj +++ b/DataImport.Server.TransformLoad/DataImport.Server.TransformLoad.csproj @@ -1,6 +1,6 @@  - net6.0 + net8.0 Exe false publish\ @@ -25,14 +25,14 @@ logging.json Always - - logging_Sql.json - Always - - - logging_PgSql.json - Always - + + logging_Sql.json + Always + + + logging_PgSql.json + Always + Always @@ -49,18 +49,18 @@ - - - - - - - - + + + + + + + + - - - + + + diff --git a/DataImport.Server.TransformLoad/Features/FileTransport/FileServer.cs b/DataImport.Server.TransformLoad/Features/FileTransport/FileServer.cs index ec45c7a7..cd7499d5 100644 --- a/DataImport.Server.TransformLoad/Features/FileTransport/FileServer.cs +++ b/DataImport.Server.TransformLoad/Features/FileTransport/FileServer.cs @@ -8,6 +8,7 @@ using DataImport.Common.ExtensionMethods; using DataImport.Models; using FluentFTP; +using FluentFTP.Client.BaseClient; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Renci.SshNet; @@ -45,13 +46,14 @@ public async Task> GetFileList(Agent ftpsAgent) try { _logger.LogInformation("Connecting to host: {url}", ftpsAgent.Url); - using (var client = CreateClient(ftpsAgent)) + using (var client = CreateAsyncClient(ftpsAgent)) { + //TODO: CHECK client.ValidateCertificate += OnValidateFtpsCertificate; - await client.ConnectAsync(); + await client.Connect(); - list.AddRange(from file in await client.GetListingAsync(ftpsAgent.Directory) - where file.Type == FtpFileSystemObjectType.File && file.Name.IsLike(ftpsAgent.FilePattern) + list.AddRange(from file in await client.GetListing(ftpsAgent.Directory) + where file.Type == FtpObjectType.File && file.Name.IsLike(ftpsAgent.FilePattern) select file.FullName); } } @@ -63,7 +65,7 @@ public async Task> GetFileList(Agent ftpsAgent) return list; } - private void OnValidateFtpsCertificate(FtpClient control, FtpSslValidationEventArgs e) + private void OnValidateFtpsCertificate(BaseFtpClient control, FtpSslValidationEventArgs e) { if (_appSettings.AllowTestCertificates) e.Accept = true; @@ -72,22 +74,29 @@ private void OnValidateFtpsCertificate(FtpClient control, FtpSslValidationEventA public async Task TransferFileToStorage(Agent agent, string fileName) { using (var stream = new MemoryStream()) - using (var client = CreateClient(agent)) + using (var client = CreateAsyncClient(agent)) { client.ValidateCertificate += OnValidateFtpsCertificate; - await client.ConnectAsync(); - await client.DownloadAsync(stream, fileName); + await client.Connect(); + await client.DownloadStream(stream, fileName); await _fileService.Transfer(stream, fileName, agent); } } private FtpClient CreateClient(Agent agent) { - return new FtpClient(agent.Url, Port(agent), agent.Username, - Encryption.Decrypt(agent.Password, _appSettings.EncryptionKey)) - { - EncryptionMode = FtpEncryptionMode.Implicit - }; + FtpConfig ftpConfig = new FtpConfig(); + ftpConfig.EncryptionMode = FtpEncryptionMode.Implicit; + return new FtpClient(agent.Url, agent.Username, + Encryption.Decrypt(agent.Password, _appSettings.EncryptionKey), Port(agent), ftpConfig); + } + + private AsyncFtpClient CreateAsyncClient(Agent agent) + { + FtpConfig ftpConfig = new FtpConfig(); + ftpConfig.EncryptionMode = FtpEncryptionMode.Implicit; + return new AsyncFtpClient(agent.Url, agent.Username, + Encryption.Decrypt(agent.Password, _appSettings.EncryptionKey), Port(agent), ftpConfig); } private int Port(Agent agent) diff --git a/DataImport.TestHelpers/DataImport.TestHelpers.csproj b/DataImport.TestHelpers/DataImport.TestHelpers.csproj index 62e5fab9..2b6e15a8 100644 --- a/DataImport.TestHelpers/DataImport.TestHelpers.csproj +++ b/DataImport.TestHelpers/DataImport.TestHelpers.csproj @@ -1,6 +1,6 @@  - net6.0 + net8.0 Library false diff --git a/DataImport.Web.Tests/DataImport.Web.Tests.csproj b/DataImport.Web.Tests/DataImport.Web.Tests.csproj index 04c7f168..6102000b 100644 --- a/DataImport.Web.Tests/DataImport.Web.Tests.csproj +++ b/DataImport.Web.Tests/DataImport.Web.Tests.csproj @@ -1,10 +1,8 @@  - - net6.0 + net8.0 false - @@ -12,23 +10,21 @@ - - - - - - - - - + + + + + + + + + - - Always @@ -36,5 +32,4 @@ Always - - + \ No newline at end of file diff --git a/DataImport.Web.Tests/Features/Agent/AddEditAgentTests.cs b/DataImport.Web.Tests/Features/Agent/AddEditAgentTests.cs index 5b662467..6a527f75 100644 --- a/DataImport.Web.Tests/Features/Agent/AddEditAgentTests.cs +++ b/DataImport.Web.Tests/Features/Agent/AddEditAgentTests.cs @@ -17,7 +17,6 @@ using System.Globalization; using System.Linq; using System.Threading.Tasks; -using static DataImport.TestHelpers.TestHelpers; using static DataImport.Web.Tests.Testing; namespace DataImport.Web.Tests.Features.Agent @@ -599,8 +598,8 @@ public async Task ShouldSuccessfullyAssociateBootstrapDataWithAgent() ApiServerId = apiServer.Id, DdlBootstrapDatas = new List { - Json(new AgentBootstrapData { BootstrapDataId = bootstrapData1.Id, ProcessingOrder = 1 }), - Json(new AgentBootstrapData { BootstrapDataId = bootstrapData2.Id, ProcessingOrder = 2 }) + TestHelpers.TestHelpers.Json(new AgentBootstrapData { BootstrapDataId = bootstrapData1.Id, ProcessingOrder = 1 }), + TestHelpers.TestHelpers.Json(new AgentBootstrapData { BootstrapDataId = bootstrapData2.Id, ProcessingOrder = 2 }) } }; @@ -614,7 +613,7 @@ public async Task ShouldSuccessfullyAssociateBootstrapDataWithAgent() addEditViewModel.DdlBootstrapDatas = new List { - Json(new AgentBootstrapData { BootstrapDataId = bootstrapData1.Id, ProcessingOrder = 5}) + TestHelpers.TestHelpers.Json(new AgentBootstrapData { BootstrapDataId = bootstrapData1.Id, ProcessingOrder = 5}) }; await Send(new EditAgent.Command { ViewModel = addEditViewModel }); @@ -652,8 +651,8 @@ public async Task ShouldRemoveDuplicatesFromAssociatedBootstrapDatas() ApiServerId = apiServer.Id, DdlBootstrapDatas = new List { - Json(new AgentBootstrapData { BootstrapDataId = bootstrapData.Id, ProcessingOrder = 1 }), - Json(new AgentBootstrapData { BootstrapDataId = bootstrapData.Id, ProcessingOrder = 2 }) + TestHelpers.TestHelpers.Json(new AgentBootstrapData { BootstrapDataId = bootstrapData.Id, ProcessingOrder = 1 }), + TestHelpers.TestHelpers.Json(new AgentBootstrapData { BootstrapDataId = bootstrapData.Id, ProcessingOrder = 2 }) } }; @@ -666,8 +665,8 @@ public async Task ShouldRemoveDuplicatesFromAssociatedBootstrapDatas() addEditViewModel.DdlBootstrapDatas = new List { - Json(new AgentBootstrapData { BootstrapDataId = bootstrapData.Id, ProcessingOrder = 2 }), - Json(new AgentBootstrapData { BootstrapDataId = bootstrapData.Id, ProcessingOrder = 1 }), + TestHelpers.TestHelpers.Json(new AgentBootstrapData { BootstrapDataId = bootstrapData.Id, ProcessingOrder = 2 }), + TestHelpers.TestHelpers.Json(new AgentBootstrapData { BootstrapDataId = bootstrapData.Id, ProcessingOrder = 1 }), }; await Send(new EditAgent.Command { ViewModel = addEditViewModel }); addEditViewModel = await Send(new EditAgent.Query { Id = response.AgentId }); @@ -691,7 +690,7 @@ public async Task ShouldRemoveBootstrapDataAgentsWhenAgentIsArchived() ApiServerId = apiServer.Id, DdlBootstrapDatas = new List { - Json(new AgentBootstrapData { BootstrapDataId = bootstrapData.Id }), + TestHelpers.TestHelpers.Json(new AgentBootstrapData { BootstrapDataId = bootstrapData.Id }), } }; diff --git a/DataImport.Web.Tests/Features/ApiServers/ApiServerIndexTests.cs b/DataImport.Web.Tests/Features/ApiServers/ApiServerIndexTests.cs index 79c13ce9..0c75f83c 100644 --- a/DataImport.Web.Tests/Features/ApiServers/ApiServerIndexTests.cs +++ b/DataImport.Web.Tests/Features/ApiServers/ApiServerIndexTests.cs @@ -21,8 +21,8 @@ public async Task ShouldDisplayAllApiServers() var apiVersion = Testing.Query(newApiServer.ApiVersionId); var allApiServers = await Testing.Send(new ApiServerIndex.Query()); - CollectionAssert.IsNotEmpty(allApiServers.ApiServers); - Assert.IsTrue(allApiServers.ApiServers.Count >= 2); + Assert.That(allApiServers.ApiServers, Is.Not.Empty); + Assert.That(allApiServers.ApiServers.Count >= 2, Is.True); allApiServers.ApiServers.Single(x => x.Id == newApiServer.Id) .ShouldMatch(new ApiServerIndex.ApiServerModel diff --git a/DataImport.Web.Tests/Features/BootstrapData/AddEditBootstrapDataTests.cs b/DataImport.Web.Tests/Features/BootstrapData/AddEditBootstrapDataTests.cs index fbb75108..34013e4b 100644 --- a/DataImport.Web.Tests/Features/BootstrapData/AddEditBootstrapDataTests.cs +++ b/DataImport.Web.Tests/Features/BootstrapData/AddEditBootstrapDataTests.cs @@ -384,7 +384,7 @@ public async Task ShouldNotAllowDeletingBootstrapDataUsedByAgent() ApiServerId = apiServer.Id, DdlBootstrapDatas = new List { - Json(new AgentBootstrapData { BootstrapDataId = bootstrapData.Id }) + TestHelpers.TestHelpers.Json(new AgentBootstrapData { BootstrapDataId = bootstrapData.Id }) } }; diff --git a/DataImport.Web.Tests/Features/DataMaps/DeleteDataMapTests.cs b/DataImport.Web.Tests/Features/DataMaps/DeleteDataMapTests.cs index 33454925..b3a75835 100644 --- a/DataImport.Web.Tests/Features/DataMaps/DeleteDataMapTests.cs +++ b/DataImport.Web.Tests/Features/DataMaps/DeleteDataMapTests.cs @@ -13,7 +13,6 @@ using DataImport.Web.Features.Agent; using Shouldly; using static DataImport.Web.Tests.Testing; -using static DataImport.TestHelpers.TestHelpers; namespace DataImport.Web.Tests.Features.DataMaps { @@ -68,7 +67,7 @@ private static async Task AssociateAgentToDataMap(int dataMapId) Name = SampleString(), DdlDataMaps = new List { - Json(new MappedAgent { DataMapId = dataMapId }) + TestHelpers.TestHelpers.Json(new MappedAgent { DataMapId = dataMapId }) }, ApiServerId = apiServer.Id } diff --git a/DataImport.Web.Tests/Features/Preprocessor/PreprocessorIndexTests.cs b/DataImport.Web.Tests/Features/Preprocessor/PreprocessorIndexTests.cs index 782440b0..4f3d3c5f 100644 --- a/DataImport.Web.Tests/Features/Preprocessor/PreprocessorIndexTests.cs +++ b/DataImport.Web.Tests/Features/Preprocessor/PreprocessorIndexTests.cs @@ -26,7 +26,7 @@ public async Task ShouldDisplayAllPreprocessors() var preprocessors = await Send(new PreprocessorIndex.Query()); - CollectionAssert.IsNotEmpty(preprocessors.Preprocessors); + Assert.That(preprocessors.Preprocessors, Is.Not.Empty); preprocessors.Preprocessors.Single(x => x.Id == preprocessor.Id) .ShouldMatch(new PreprocessorIndex.PreprocessorIndexModel diff --git a/DataImport.Web.Tests/Helpers/ExtensionMethodsTests.cs b/DataImport.Web.Tests/Helpers/ExtensionMethodsTests.cs index f6c9d66b..d2260fa2 100644 --- a/DataImport.Web.Tests/Helpers/ExtensionMethodsTests.cs +++ b/DataImport.Web.Tests/Helpers/ExtensionMethodsTests.cs @@ -100,7 +100,7 @@ public void ToDescriptorNameShouldReturnEmptyStringIfDescriptorIsNull() { string descriptor = null; // ReSharper disable once ExpressionIsAlwaysNull - Assert.AreEqual(string.Empty, descriptor.ToDescriptorName()); + Assert.That(string.Empty, Is.EqualTo(descriptor.ToDescriptorName())); } } } diff --git a/DataImport.Web/DataImport.Web.csproj b/DataImport.Web/DataImport.Web.csproj index 13c6675c..4382f1cf 100644 --- a/DataImport.Web/DataImport.Web.csproj +++ b/DataImport.Web/DataImport.Web.csproj @@ -1,66 +1,56 @@ - - + - net6.0 + net8.0 false true $(DefaultItemExcludes);Publish/**/* NU5100, NU5110, NU5111, NU5124 - en + en - - Always + Always - Always + Always - Always + Always - - - - - - + + + - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - + + + + + + - + - - - - - - - + + + + + + + + + + + + - - + \ No newline at end of file diff --git a/DataImport.Web/Features/Agent/AgentFiles.cs b/DataImport.Web/Features/Agent/AgentFiles.cs index af27b074..ddbc6fec 100644 --- a/DataImport.Web/Features/Agent/AgentFiles.cs +++ b/DataImport.Web/Features/Agent/AgentFiles.cs @@ -6,6 +6,7 @@ using DataImport.Common.Enums; using DataImport.Common.ExtensionMethods; using FluentFTP; +using FluentFTP.Client.BaseClient; using MediatR; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; @@ -71,7 +72,7 @@ protected override QueryResult Handle(Query request) } } - private static void OnValidateFtpsCertificate(FtpClient control, FtpSslValidationEventArgs e) + private static void OnValidateFtpsCertificate(BaseFtpClient control, FtpSslValidationEventArgs e) { if (_allowTestCertificates) e.Accept = true; @@ -84,14 +85,14 @@ private static IEnumerable GetAgentFiles(string url, int? port, string u if (port == null) port = AgentTypeCodeEnum.DefaultPort(AgentTypeCodeEnum.Ftps); - using (var ftpsClient = new FtpClient(url, port.Value, username, password)) + using (var ftpsClient = new FtpClient(url, username, password, port.Value)) { - ftpsClient.EncryptionMode = FtpEncryptionMode.Implicit; + ftpsClient.Config.EncryptionMode = FtpEncryptionMode.Implicit; ftpsClient.ValidateCertificate += OnValidateFtpsCertificate; ftpsClient.Connect(); if (!ftpsClient.IsConnected) throw new Exception("Ftps Client Cannot Connect"); return ftpsClient.GetListing(directory).Where(x => - x.Type == FtpFileSystemObjectType.File && x.Name.IsLike(filePattern.Trim())).Select(x => x.Name).ToList(); + x.Type == FtpObjectType.File && x.Name.IsLike(filePattern.Trim())).Select(x => x.Name).ToList(); } } else diff --git a/DataImport.Web/Features/Shared/ApiServerSpecificRequestHandler.cs b/DataImport.Web/Features/Shared/ApiServerSpecificRequestHandler.cs index 526032c6..486e6d6b 100644 --- a/DataImport.Web/Features/Shared/ApiServerSpecificRequestHandler.cs +++ b/DataImport.Web/Features/Shared/ApiServerSpecificRequestHandler.cs @@ -30,7 +30,7 @@ public ApiServerSpecificRequestHandler(ApiServerSelectListProvider serverSelectL _database = database; } - public async Task Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate next) + public async Task Handle(TRequest request, RequestHandlerDelegate next, CancellationToken cancellationToken) { var apiServerSelectItems = await _serverSelectListProvider.GetApiServers(cancellationToken); var hasConfiguredApiServer = apiServerSelectItems.Any(x => !string.IsNullOrWhiteSpace(x.Value)); diff --git a/DataImport.Web/Features/Shared/ApiVersionSpecificRequestHandler.cs b/DataImport.Web/Features/Shared/ApiVersionSpecificRequestHandler.cs index 250270c4..0b3a6aa0 100644 --- a/DataImport.Web/Features/Shared/ApiVersionSpecificRequestHandler.cs +++ b/DataImport.Web/Features/Shared/ApiVersionSpecificRequestHandler.cs @@ -22,7 +22,7 @@ public ApiVersionSpecificRequestHandler(ApiVersionSelectListProvider apiVersionS _apiVersionSelectListProvider = apiVersionSelectListProvider; } - public async Task Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate next) + public async Task Handle(TRequest request, RequestHandlerDelegate next, CancellationToken cancellationToken) { var apiVersionSelectList = await _apiVersionSelectListProvider.GetApiVersions(cancellationToken); diff --git a/DataImport.Web/Infrastructure/MvcTransactionFilter.cs b/DataImport.Web/Infrastructure/MvcTransactionFilter.cs index 76dfa119..009a395f 100644 --- a/DataImport.Web/Infrastructure/MvcTransactionFilter.cs +++ b/DataImport.Web/Infrastructure/MvcTransactionFilter.cs @@ -6,6 +6,7 @@ using DataImport.Models; using DataImport.Web.Features.ApiServers; using DataImport.Web.Services; +using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.AspNetCore.Routing; @@ -97,7 +98,7 @@ private static void AjaxRedirect(ActionExecutedContext filterContext, RedirectTo if (filterContext.HttpContext.Request.Method == "GET") { // REDIRECT_LOCATION must be handled on the client side. - filterContext.HttpContext.Response.Headers.Add("REDIRECT_LOCATION", redirectUrl); + filterContext.HttpContext.Response.Headers.Append("REDIRECT_LOCATION", redirectUrl); } else { diff --git a/DataImport.Web/Startup.cs b/DataImport.Web/Startup.cs index d17772f5..e57a0172 100644 --- a/DataImport.Web/Startup.cs +++ b/DataImport.Web/Startup.cs @@ -102,7 +102,7 @@ public void ConfigureServices(IServiceCollection services) services.AddTransient(); - //Configure MVC Razor Views under "FeatureFolder" and with compilation + //Configure MVC Razor Views under "FeatureFolder" and with compilation services.Configure(options => options.ViewLocationExpanders.Add(new FeatureViewLocationExpander())) .AddControllersWithViews(options => { @@ -176,8 +176,8 @@ public void ConfigureServices(IServiceCollection services) }); services.AddMvc() - .AddSessionStateTempDataProvider() - .AddFluentValidation(fv => fv.RegisterValidatorsFromAssemblyContaining()); + .AddSessionStateTempDataProvider(); + services.AddFluentValidationAutoValidation().AddFluentValidationClientsideAdapters(); services.AddSession(); diff --git a/readme.md b/readme.md index 51058705..fe22b9e4 100644 --- a/readme.md +++ b/readme.md @@ -29,7 +29,7 @@ Data Import is a multi-project C# .NET solution with a web administration panel ### Prerequisites -Data Import 1.3+ requires **.NET 6** +Data Import 1.3+ requires **.NET 8** Additionally, familiarity with the following technologies are required for installing and configuring Data Import: From ddc513adb0a344afee52e58057f67b8e33251f60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Alberto=20Leiva=20Obando?= Date: Mon, 8 Apr 2024 05:39:46 -0600 Subject: [PATCH 02/16] Update Docker files to use .NET 8 images --- .github/workflows/on-prerelease.yml | 2 +- .github/workflows/on-pullrequest-or-push.yml | 8 ++++---- Dockerfile | 6 +++--- dev.Dockerfile | 12 ++++++------ 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/on-prerelease.yml b/.github/workflows/on-prerelease.yml index 47cc17c4..bbb02344 100644 --- a/.github/workflows/on-prerelease.yml +++ b/.github/workflows/on-prerelease.yml @@ -51,7 +51,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a # v3.0.3 with: - dotnet-version: 6.0.x + dotnet-version: 8.0.x - name: Publish .NET Assemblies run: | diff --git a/.github/workflows/on-pullrequest-or-push.yml b/.github/workflows/on-pullrequest-or-push.yml index 6df9f3f6..1ee07d84 100644 --- a/.github/workflows/on-pullrequest-or-push.yml +++ b/.github/workflows/on-pullrequest-or-push.yml @@ -23,7 +23,7 @@ on: - ".github/**/*.yml" workflow_dispatch: -env: +env: DB_PASS: ${{ secrets.DB_PASS }} jobs: @@ -49,7 +49,7 @@ jobs: ACCEPT_EULA: 'Y' ports: - 1433:1433 - + defaults: run: shell: pwsh @@ -60,7 +60,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a # v3.0.3 with: - dotnet-version: 6.0.x + dotnet-version: 8.0.x - name: Build run: ./build.ps1 -Command Build -Configuration Release @@ -68,7 +68,7 @@ jobs: - name: Run Unit Tests if: success() run: ./build.ps1 -Command UnitTest -Configuration Release -Report True - + - name: Integration Tests run: ./build.ps1 -Command IntegrationTest -Configuration Release -Report True shell: pwsh diff --git a/Dockerfile b/Dockerfile index a33d96e1..933c5f9d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,8 +3,8 @@ # The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0. # See the LICENSE and NOTICES files in the project root for more information. -#tag 6.0-alpine -FROM mcr.microsoft.com/dotnet/aspnet@sha256:201cedd60cb295b2ebea7184561a45c5c0ee337e37300ea0f25cff5a2c762538 +#tag 8.0-alpine +FROM mcr.microsoft.com/dotnet/aspnet@sha256:646b1c5ff36375f35f6149b0ce19ca095f97b4b882b90652801e9fbe82bcfa8a LABEL maintainer="Ed-Fi Alliance, LLC and Contributors " ENV VERSION="2.2.0" ENV TZ=${TIME_ZONE} @@ -15,7 +15,7 @@ ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false WORKDIR /app -RUN apk --no-cache add unzip=~6 dos2unix=~7 bash=~5 gettext=~0 postgresql13-client=~13 jq=~1 icu=~72 gcompat tzdata && \ +RUN apk --no-cache add unzip=~6 dos2unix=~7 bash=~5 gettext=~0 postgresql13-client=~13 jq=~1 icu=~74 gcompat tzdata && \ wget -O /app/DataImport.zip https://pkgs.dev.azure.com/ed-fi-alliance/Ed-Fi-Alliance-OSS/_apis/packaging/feeds/EdFi/nuget/packages/DataImport.Web/versions/${VERSION}/content && \ unzip /app/DataImport.zip -d /app/DataImport && \ cp -r /app/DataImport/DataImport.Web/. /app/DataImport.Web && \ diff --git a/dev.Dockerfile b/dev.Dockerfile index feb338f1..e9d98202 100644 --- a/dev.Dockerfile +++ b/dev.Dockerfile @@ -3,8 +3,8 @@ # The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0. # See the LICENSE and NOTICES files in the project root for more information. -#tag sdk:6.0-alpine -FROM mcr.microsoft.com/dotnet/sdk@sha256:c1a73b72c02e7b837e9a93030d545bc4181193e1bab1033364ed2d00986d78ff AS build +# tag sdk:8.0 alpine +FROM mcr.microsoft.com/dotnet/sdk@sha256:e646d8a0fa589bcd970e0ebde394780398e8ae08fffeb36781753c51fc9e87b0 AS build WORKDIR /source COPY DataImport.Web/*.csproj DataImport.Web/ @@ -13,8 +13,8 @@ COPY DataImport.Models/*.csproj DataImport.Models/ COPY DataImport.Common/*.csproj DataImport.Common/ COPY DataImport.EdFi/*.csproj DataImport.EdFi/ COPY logging.json logging.json -COPY logging_PgSql.json logging_PgSql.json -COPY logging_Sql.json logging_Sql.json +COPY logging_PgSql.json logging_PgSql.json +COPY logging_Sql.json logging_Sql.json RUN dotnet restore DataImport.Server.TransformLoad/DataImport.Server.TransformLoad.csproj RUN dotnet restore DataImport.Web/DataImport.Web.csproj @@ -33,8 +33,8 @@ WORKDIR /source/DataImport.Server.TransformLoad RUN dotnet build -c Release --no-restore RUN dotnet publish -c Release --no-build -o /app/DataImport.Server.TransformLoad -#tag aspnet:6.0-alpine -FROM mcr.microsoft.com/dotnet/aspnet@sha256:5d7911e8485a58ac50eefa09e2cea8f3d59268fd7f1501f72324e37e29d9d6ee +#tag 8.0-alpine +FROM mcr.microsoft.com/dotnet/aspnet@sha256:646b1c5ff36375f35f6149b0ce19ca095f97b4b882b90652801e9fbe82bcfa8a LABEL maintainer="Ed-Fi Alliance, LLC and Contributors " # Alpine image does not contain Globalization Cultures library so we need to install ICU library to get for LINQ expression to work # Disable the globaliztion invariant mode (set in base image) From 95f4a42fe9772900126958039581b99f7bc02aff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Alberto=20Leiva=20Obando?= Date: Mon, 8 Apr 2024 06:08:15 -0600 Subject: [PATCH 03/16] Update HttpContextHelper.cs --- DataImport.Common/HttpContextHelper.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/DataImport.Common/HttpContextHelper.cs b/DataImport.Common/HttpContextHelper.cs index 90c35208..cfb5fc72 100644 --- a/DataImport.Common/HttpContextHelper.cs +++ b/DataImport.Common/HttpContextHelper.cs @@ -17,7 +17,6 @@ namespace Microsoft.AspNetCore.Http internal static class HttpContextHelper { private static readonly HttpContextAccessor _httpContextAccessor = new HttpContextAccessor(); - /// /// Gets the current . Returns null if there is no current . /// From eb3f78c124098727c59b6a3b085277b12712086a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Alberto=20Leiva=20Obando?= Date: Mon, 8 Apr 2024 09:42:00 -0600 Subject: [PATCH 04/16] Fix styles --- DataImport.Common/HttpContextHelper.cs | 2 ++ .../PostgreSql/20231128143229_AddIsDeleteOperationField.cs | 2 +- .../PostgreSql/20231208155432_AddIsDeleteByNaturalKeyField.cs | 2 +- .../SqlServer/20231127222509_AddIsDeleteOperationField.cs | 2 +- .../SqlServer/20231208155339_AddIsDeleteByNaturalKeyField.cs | 2 +- DataImport.Web/Helpers/JsonValidator.cs | 1 - 6 files changed, 6 insertions(+), 5 deletions(-) diff --git a/DataImport.Common/HttpContextHelper.cs b/DataImport.Common/HttpContextHelper.cs index cfb5fc72..5e5579f0 100644 --- a/DataImport.Common/HttpContextHelper.cs +++ b/DataImport.Common/HttpContextHelper.cs @@ -16,7 +16,9 @@ namespace Microsoft.AspNetCore.Http /// internal static class HttpContextHelper { +#pragma warning disable IDE0055 private static readonly HttpContextAccessor _httpContextAccessor = new HttpContextAccessor(); +#pragma warning restore IDE0055 /// /// Gets the current . Returns null if there is no current . /// diff --git a/DataImport.Models/Migrations/PostgreSql/20231128143229_AddIsDeleteOperationField.cs b/DataImport.Models/Migrations/PostgreSql/20231128143229_AddIsDeleteOperationField.cs index c412a627..e012b8ee 100644 --- a/DataImport.Models/Migrations/PostgreSql/20231128143229_AddIsDeleteOperationField.cs +++ b/DataImport.Models/Migrations/PostgreSql/20231128143229_AddIsDeleteOperationField.cs @@ -1,4 +1,4 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; #nullable disable diff --git a/DataImport.Models/Migrations/PostgreSql/20231208155432_AddIsDeleteByNaturalKeyField.cs b/DataImport.Models/Migrations/PostgreSql/20231208155432_AddIsDeleteByNaturalKeyField.cs index 1159e2c8..146de152 100644 --- a/DataImport.Models/Migrations/PostgreSql/20231208155432_AddIsDeleteByNaturalKeyField.cs +++ b/DataImport.Models/Migrations/PostgreSql/20231208155432_AddIsDeleteByNaturalKeyField.cs @@ -1,4 +1,4 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; #nullable disable diff --git a/DataImport.Models/Migrations/SqlServer/20231127222509_AddIsDeleteOperationField.cs b/DataImport.Models/Migrations/SqlServer/20231127222509_AddIsDeleteOperationField.cs index 350c84a0..468972da 100644 --- a/DataImport.Models/Migrations/SqlServer/20231127222509_AddIsDeleteOperationField.cs +++ b/DataImport.Models/Migrations/SqlServer/20231127222509_AddIsDeleteOperationField.cs @@ -1,4 +1,4 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; #nullable disable diff --git a/DataImport.Models/Migrations/SqlServer/20231208155339_AddIsDeleteByNaturalKeyField.cs b/DataImport.Models/Migrations/SqlServer/20231208155339_AddIsDeleteByNaturalKeyField.cs index 95508f91..cea82bde 100644 --- a/DataImport.Models/Migrations/SqlServer/20231208155339_AddIsDeleteByNaturalKeyField.cs +++ b/DataImport.Models/Migrations/SqlServer/20231208155339_AddIsDeleteByNaturalKeyField.cs @@ -1,4 +1,4 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; #nullable disable diff --git a/DataImport.Web/Helpers/JsonValidator.cs b/DataImport.Web/Helpers/JsonValidator.cs index 1de26cb4..b97966e7 100644 --- a/DataImport.Web/Helpers/JsonValidator.cs +++ b/DataImport.Web/Helpers/JsonValidator.cs @@ -49,4 +49,3 @@ public bool IsValidJson(string data) } } } - From 543bd714cb245a92d5afd59638b821ff98647469 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Alberto=20Leiva=20Obando?= Date: Mon, 8 Apr 2024 11:08:39 -0600 Subject: [PATCH 05/16] Add TrustServerCertificate=True for test projects --- DataImport.Models.Tests/appsettings.json | 8 ++++---- DataImport.Server.TransformLoad.Tests/appsettings.json | 2 +- DataImport.Web.Tests/appsettings.json | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/DataImport.Models.Tests/appsettings.json b/DataImport.Models.Tests/appsettings.json index 7d8dbd13..cb72d9cf 100644 --- a/DataImport.Models.Tests/appsettings.json +++ b/DataImport.Models.Tests/appsettings.json @@ -1,5 +1,5 @@ { - "ConnectionStrings": { - "defaultConnection": "Data Source=(local);Initial Catalog=EdFi_DataImport_Test;Trusted_Connection=True" - } -} \ No newline at end of file + "ConnectionStrings": { + "defaultConnection": "Data Source=(local);Initial Catalog=EdFi_DataImport_Test;Trusted_Connection=True;TrustServerCertificate=True" + } +} diff --git a/DataImport.Server.TransformLoad.Tests/appsettings.json b/DataImport.Server.TransformLoad.Tests/appsettings.json index 0b57eb93..42dbbe11 100644 --- a/DataImport.Server.TransformLoad.Tests/appsettings.json +++ b/DataImport.Server.TransformLoad.Tests/appsettings.json @@ -17,7 +17,7 @@ "TimeOutInMilliseconds": 5000 }, "ConnectionStrings": { - "defaultConnection": "Data Source=(local);Initial Catalog=EdFi_DataImport_Test;Trusted_Connection=True", + "defaultConnection": "Data Source=(local);Initial Catalog=EdFi_DataImport_Test;Trusted_Connection=True;TrustServerCertificate=True", "storageConnection": "UseDevelopmentStorage=true" } } diff --git a/DataImport.Web.Tests/appsettings.json b/DataImport.Web.Tests/appsettings.json index 8c1895c0..5623db63 100644 --- a/DataImport.Web.Tests/appsettings.json +++ b/DataImport.Web.Tests/appsettings.json @@ -8,10 +8,10 @@ "ShareName": "C:\\Temp", "UsePowerShellWithNoRestrictions": false }, - "ConnectionStrings": { - "defaultConnection": "Data Source=(local);Initial Catalog=EdFi_DataImport_Test;Trusted_Connection=True", - "storageConnection": "UseDevelopmentStorage=true" - }, + "ConnectionStrings": { + "defaultConnection": "Data Source=(local);Initial Catalog=EdFi_DataImport_Test;Trusted_Connection=True;TrustServerCertificate=True", + "storageConnection": "UseDevelopmentStorage=true" + }, "ExternalPreprocessors": { "Enabled": true, "TimeOutInMilliseconds": 5000 From 804459838a1a4095eaeaa9b38eb009f4f91b40f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Alberto=20Leiva=20Obando?= Date: Mon, 8 Apr 2024 13:30:23 -0600 Subject: [PATCH 06/16] Update connection settings --- DataImport.Models.Tests/appsettings.json | 2 +- DataImport.Server.TransformLoad.Tests/appsettings.json | 2 +- DataImport.Web.Tests/appsettings.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DataImport.Models.Tests/appsettings.json b/DataImport.Models.Tests/appsettings.json index cb72d9cf..f6631364 100644 --- a/DataImport.Models.Tests/appsettings.json +++ b/DataImport.Models.Tests/appsettings.json @@ -1,5 +1,5 @@ { "ConnectionStrings": { - "defaultConnection": "Data Source=(local);Initial Catalog=EdFi_DataImport_Test;Trusted_Connection=True;TrustServerCertificate=True" + "defaultConnection": "Data Source=(local);Initial Catalog=EdFi_DataImport_Test;Trusted_Connection=True;Integrated Security=True;TrustServerCertificate=True;" } } diff --git a/DataImport.Server.TransformLoad.Tests/appsettings.json b/DataImport.Server.TransformLoad.Tests/appsettings.json index 42dbbe11..5b160f9e 100644 --- a/DataImport.Server.TransformLoad.Tests/appsettings.json +++ b/DataImport.Server.TransformLoad.Tests/appsettings.json @@ -17,7 +17,7 @@ "TimeOutInMilliseconds": 5000 }, "ConnectionStrings": { - "defaultConnection": "Data Source=(local);Initial Catalog=EdFi_DataImport_Test;Trusted_Connection=True;TrustServerCertificate=True", + "defaultConnection": "Data Source=(local);Initial Catalog=EdFi_DataImport_Test;Trusted_Connection=True;Integrated Security=True;TrustServerCertificate=True;", "storageConnection": "UseDevelopmentStorage=true" } } diff --git a/DataImport.Web.Tests/appsettings.json b/DataImport.Web.Tests/appsettings.json index 5623db63..518320d9 100644 --- a/DataImport.Web.Tests/appsettings.json +++ b/DataImport.Web.Tests/appsettings.json @@ -9,7 +9,7 @@ "UsePowerShellWithNoRestrictions": false }, "ConnectionStrings": { - "defaultConnection": "Data Source=(local);Initial Catalog=EdFi_DataImport_Test;Trusted_Connection=True;TrustServerCertificate=True", + "defaultConnection": "Data Source=(local);Initial Catalog=EdFi_DataImport_Test;Trusted_Connection=True;Integrated Security=True;TrustServerCertificate=True", "storageConnection": "UseDevelopmentStorage=true" }, "ExternalPreprocessors": { From 40b348d13a90e3b2b0c2f2e41338ce9b2d361a60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Alberto=20Leiva=20Obando?= Date: Mon, 8 Apr 2024 13:45:05 -0600 Subject: [PATCH 07/16] Test with Encrypt false --- DataImport.Models.Tests/appsettings.json | 2 +- DataImport.Server.TransformLoad.Tests/appsettings.json | 2 +- DataImport.Web.Tests/appsettings.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DataImport.Models.Tests/appsettings.json b/DataImport.Models.Tests/appsettings.json index f6631364..3ccf16f1 100644 --- a/DataImport.Models.Tests/appsettings.json +++ b/DataImport.Models.Tests/appsettings.json @@ -1,5 +1,5 @@ { "ConnectionStrings": { - "defaultConnection": "Data Source=(local);Initial Catalog=EdFi_DataImport_Test;Trusted_Connection=True;Integrated Security=True;TrustServerCertificate=True;" + "defaultConnection": "Data Source=(local);Initial Catalog=EdFi_DataImport_Test;Trusted_Connection=True;Integrated Security=True;TrustServerCertificate=True;Encrypt=False" } } diff --git a/DataImport.Server.TransformLoad.Tests/appsettings.json b/DataImport.Server.TransformLoad.Tests/appsettings.json index 5b160f9e..e7224cba 100644 --- a/DataImport.Server.TransformLoad.Tests/appsettings.json +++ b/DataImport.Server.TransformLoad.Tests/appsettings.json @@ -17,7 +17,7 @@ "TimeOutInMilliseconds": 5000 }, "ConnectionStrings": { - "defaultConnection": "Data Source=(local);Initial Catalog=EdFi_DataImport_Test;Trusted_Connection=True;Integrated Security=True;TrustServerCertificate=True;", + "defaultConnection": "Data Source=(local);Initial Catalog=EdFi_DataImport_Test;Trusted_Connection=True;Integrated Security=True;TrustServerCertificate=True;Encrypt=False", "storageConnection": "UseDevelopmentStorage=true" } } diff --git a/DataImport.Web.Tests/appsettings.json b/DataImport.Web.Tests/appsettings.json index 518320d9..cd7796d1 100644 --- a/DataImport.Web.Tests/appsettings.json +++ b/DataImport.Web.Tests/appsettings.json @@ -9,7 +9,7 @@ "UsePowerShellWithNoRestrictions": false }, "ConnectionStrings": { - "defaultConnection": "Data Source=(local);Initial Catalog=EdFi_DataImport_Test;Trusted_Connection=True;Integrated Security=True;TrustServerCertificate=True", + "defaultConnection": "Data Source=(local);Initial Catalog=EdFi_DataImport_Test;Trusted_Connection=True;Integrated Security=True;TrustServerCertificate=True;Encrypt=False", "storageConnection": "UseDevelopmentStorage=true" }, "ExternalPreprocessors": { From c6094b408326cf70a0adcf28bfeb5f63c81c5202 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Alberto=20Leiva=20Obando?= Date: Mon, 8 Apr 2024 14:40:33 -0600 Subject: [PATCH 08/16] Update on-pullrequest-or-push.yml Add TrustServerCertificate --- .github/workflows/on-pullrequest-or-push.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/on-pullrequest-or-push.yml b/.github/workflows/on-pullrequest-or-push.yml index 1ee07d84..bdde919d 100644 --- a/.github/workflows/on-pullrequest-or-push.yml +++ b/.github/workflows/on-pullrequest-or-push.yml @@ -73,7 +73,7 @@ jobs: run: ./build.ps1 -Command IntegrationTest -Configuration Release -Report True shell: pwsh env: - ConnectionStrings__defaultConnection: "Server=localhost,1433;Initial Catalog=EdFi_DataImport_Test;User Id=sa;Password=${{ env.DB_PASS }};Trusted_Connection=False;" + ConnectionStrings__defaultConnection: "Server=localhost,1433;Initial Catalog=EdFi_DataImport_Test;User Id=sa;Password=${{ env.DB_PASS }};Trusted_Connection=False;TrustServerCertificate=True;" PythonExecutableLocation: "/usr/bin/python" - name: Upload Results as Workflow Artifact From cf8b450e1e2e50b0b1b7aa222e3cdfb58f626747 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Alberto=20Leiva=20Obando?= Date: Mon, 8 Apr 2024 15:50:37 -0600 Subject: [PATCH 09/16] Update on-pullrequest-or-push.yml Upgrade Codeql --- .github/workflows/on-pullrequest-or-push.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/on-pullrequest-or-push.yml b/.github/workflows/on-pullrequest-or-push.yml index bdde919d..42937fd8 100644 --- a/.github/workflows/on-pullrequest-or-push.yml +++ b/.github/workflows/on-pullrequest-or-push.yml @@ -89,7 +89,7 @@ jobs: - name: Initialize CodeQL if: success() - uses: github/codeql-action/init@896079047b4bb059ba6f150a5d87d47dde99e6e5 # codeql-bundle-20221211 + uses: github/codeql-action/init@cf7e9f23492505046de9a37830c3711dd0f25bb3 # v2.16.2 with: languages: csharp @@ -98,4 +98,4 @@ jobs: - name: Perform CodeQL Analysis if: success() - uses: github/codeql-action/analyze@896079047b4bb059ba6f150a5d87d47dde99e6e5 # codeql-bundle-20221211 + uses: github/codeql-action/analyze@cf7e9f23492505046de9a37830c3711dd0f25bb3 # v2.16.2 From 424d1528f407910ac0f955b293f33fc0666294f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Alberto=20Leiva=20Obando?= Date: Tue, 9 Apr 2024 09:33:05 -0600 Subject: [PATCH 10/16] Update actions version - Update actions version - Update on-pullrequest-or-push workflow. --- .github/workflows/on-merge-or-tag.yml | 4 ++-- .github/workflows/on-prerelease.yml | 4 ++-- .github/workflows/on-pullrequest-or-push.yml | 16 +++++++++------- .github/workflows/on-release.yml | 4 ++-- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/.github/workflows/on-merge-or-tag.yml b/.github/workflows/on-merge-or-tag.yml index ec043286..70711592 100644 --- a/.github/workflows/on-merge-or-tag.yml +++ b/.github/workflows/on-merge-or-tag.yml @@ -26,7 +26,7 @@ jobs: shell: pwsh steps: - name: Checkout the Repo - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: # MinVer needs to have more than just the current commit, so tell # GitHub to get many more. Setting to 0 forces retrieval of _all_ @@ -47,7 +47,7 @@ jobs: - name: Create Data Import Web Pre-Release run: | $version = "${{ steps.versions.outputs.data-import }}" - $tag = $version -replace "v","Pre-Release-v" + $tag = $version -replace "v","Pre-Release-v" $body = @{ tag_name = "$tag" diff --git a/.github/workflows/on-prerelease.yml b/.github/workflows/on-prerelease.yml index bbb02344..04bdbecd 100644 --- a/.github/workflows/on-prerelease.yml +++ b/.github/workflows/on-prerelease.yml @@ -59,7 +59,7 @@ jobs: ./build.ps1 -Command BuildAndPublish ` -Configuration Release ` - -Version $appVersion + -Version $appVersion - name: Setup Nuget.exe uses: nuget/setup-nuget@fd9fffd6ca4541cf4152a9565835ca1a88a6eb37 #v1.1.1 @@ -100,7 +100,7 @@ jobs: outputs: sbom-hash-code: ${{ steps.sbom-hash-code.outputs.sbom-hash-code }} steps: - - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Get Artifacts uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a #v3.0.2 diff --git a/.github/workflows/on-pullrequest-or-push.yml b/.github/workflows/on-pullrequest-or-push.yml index 42937fd8..0718425a 100644 --- a/.github/workflows/on-pullrequest-or-push.yml +++ b/.github/workflows/on-pullrequest-or-push.yml @@ -55,12 +55,7 @@ jobs: shell: pwsh steps: - name: Checkout the Repo - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 - - - name: Setup .NET - uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a # v3.0.3 - with: - dotnet-version: 8.0.x + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Build run: ./build.ps1 -Command Build -Configuration Release @@ -85,8 +80,15 @@ jobs: - name: Dependency Review ("Dependabot on PR") if: github.event_name == 'pull_request' - uses: actions/dependency-review-action@c090f4e553673e6e505ea70d6a95362ee12adb94 # v3.0.3 + uses: actions/dependency-review-action@4901385134134e04cec5fbe5ddfe3b2c5bd5d976 # v4.0.0 + code-analysis: + name: Code Analysis + runs-on: ubuntu-latest + defaults: + run: + shell: pwsh + steps: - name: Initialize CodeQL if: success() uses: github/codeql-action/init@cf7e9f23492505046de9a37830c3711dd0f25bb3 # v2.16.2 diff --git a/.github/workflows/on-release.yml b/.github/workflows/on-release.yml index 569ff820..9a527248 100644 --- a/.github/workflows/on-release.yml +++ b/.github/workflows/on-release.yml @@ -21,7 +21,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout the repo - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Delete other pre-releases and their tags shell: pwsh @@ -31,7 +31,7 @@ jobs: $token = "${{ secrets.GITHUB_TOKEN }}" $page = 1 - $release_list = @() + $release_list = @() Do { From f54571804b04c426b5d16df4e066d6fce5094739 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Alberto=20Leiva=20Obando?= Date: Tue, 9 Apr 2024 09:41:03 -0600 Subject: [PATCH 11/16] Update on-pullrequest-or-push.yml --- .github/workflows/on-pullrequest-or-push.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/on-pullrequest-or-push.yml b/.github/workflows/on-pullrequest-or-push.yml index 0718425a..c6d91ee4 100644 --- a/.github/workflows/on-pullrequest-or-push.yml +++ b/.github/workflows/on-pullrequest-or-push.yml @@ -89,6 +89,9 @@ jobs: run: shell: pwsh steps: + - name: Checkout the Repo + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - name: Initialize CodeQL if: success() uses: github/codeql-action/init@cf7e9f23492505046de9a37830c3711dd0f25bb3 # v2.16.2 From e0b79a945efd52c26e30412d29e306de8e3b2464 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Alberto=20Leiva=20Obando?= Date: Tue, 9 Apr 2024 10:06:17 -0600 Subject: [PATCH 12/16] Downgrade SonarAnalyzer --- DataImport.Common.Tests/DataImport.Common.Tests.csproj | 2 +- DataImport.Common/DataImport.Common.csproj | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DataImport.Common.Tests/DataImport.Common.Tests.csproj b/DataImport.Common.Tests/DataImport.Common.Tests.csproj index 4f3229f8..28b81012 100644 --- a/DataImport.Common.Tests/DataImport.Common.Tests.csproj +++ b/DataImport.Common.Tests/DataImport.Common.Tests.csproj @@ -24,7 +24,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/DataImport.Common/DataImport.Common.csproj b/DataImport.Common/DataImport.Common.csproj index ac587659..6a086a3b 100644 --- a/DataImport.Common/DataImport.Common.csproj +++ b/DataImport.Common/DataImport.Common.csproj @@ -1,4 +1,4 @@ - + Library @@ -30,7 +30,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all From fb380d933d09920f7b990234246c3d44e8b7f240 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Alberto=20Leiva=20Obando?= Date: Tue, 9 Apr 2024 10:38:19 -0600 Subject: [PATCH 13/16] Update github actions --- .github/workflows/after-pullrequest.yml | 2 +- .github/workflows/on-prerelease.yml | 2 +- .github/workflows/on-pullrequest-or-push.yml | 7 +++---- .github/workflows/on-release.yml | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/after-pullrequest.yml b/.github/workflows/after-pullrequest.yml index c8457fdd..0411261d 100644 --- a/.github/workflows/after-pullrequest.yml +++ b/.github/workflows/after-pullrequest.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Upload Test Results - uses: dorny/test-reporter@c9b3d0e2bd2a4e96aaf424dbaa31c46b42318226 # v1.6.0 + uses: dorny/test-reporter@eaa763f6ffc21c7a37837f56cd5f9737f27fc6c8 # v1.8.0 with: artifact: csharp-tests name: C# Unit Test Results diff --git a/.github/workflows/on-prerelease.yml b/.github/workflows/on-prerelease.yml index 04bdbecd..cac3fd42 100644 --- a/.github/workflows/on-prerelease.yml +++ b/.github/workflows/on-prerelease.yml @@ -216,7 +216,7 @@ jobs: run: shell: pwsh steps: - - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Get Artifact uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a #v3.0.2 diff --git a/.github/workflows/on-pullrequest-or-push.yml b/.github/workflows/on-pullrequest-or-push.yml index c6d91ee4..b1e59704 100644 --- a/.github/workflows/on-pullrequest-or-push.yml +++ b/.github/workflows/on-pullrequest-or-push.yml @@ -27,10 +27,9 @@ env: DB_PASS: ${{ secrets.DB_PASS }} jobs: - # TODO: restore this with AA-1601 - # run-ps-lint: - # name: PowerShell Linter - # uses: Ed-Fi-Alliance-OSS/Ed-Fi-Actions/.github/workflows/powershell-analyzer.yml@main + run-ps-lint: + name: PowerShell Linter + uses: Ed-Fi-Alliance-OSS/Ed-Fi-Actions/.github/workflows/powershell-analyzer.yml@main scan-actions-bidi: name: Scan Actions, scan all files for BIDI Trojan Attacks uses: ed-fi-alliance-oss/ed-fi-actions/.github/workflows/repository-scanner.yml@main diff --git a/.github/workflows/on-release.yml b/.github/workflows/on-release.yml index 9a527248..096f48ef 100644 --- a/.github/workflows/on-release.yml +++ b/.github/workflows/on-release.yml @@ -60,7 +60,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout the repo - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Promote Package shell: pwsh From 2f476edaca5ee08ce7fa49a8134f1ed54e2e141c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Alberto=20Leiva=20Obando?= Date: Tue, 9 Apr 2024 10:43:38 -0600 Subject: [PATCH 14/16] Update after-pullrequest.yml Add missing whitespace --- .github/workflows/after-pullrequest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/after-pullrequest.yml b/.github/workflows/after-pullrequest.yml index 0411261d..2cef264a 100644 --- a/.github/workflows/after-pullrequest.yml +++ b/.github/workflows/after-pullrequest.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Upload Test Results - uses: dorny/test-reporter@eaa763f6ffc21c7a37837f56cd5f9737f27fc6c8 # v1.8.0 + uses: dorny/test-reporter@eaa763f6ffc21c7a37837f56cd5f9737f27fc6c8 # v1.8.0 with: artifact: csharp-tests name: C# Unit Test Results From 296c2a9046ca1dca573d17c7e933294d026db08c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Alberto=20Leiva=20Obando?= Date: Tue, 9 Apr 2024 10:49:01 -0600 Subject: [PATCH 15/16] Update uses: actions/upload-artifact to use a valida version --- .github/workflows/on-prerelease.yml | 6 +++--- .github/workflows/on-pullrequest-or-push.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/on-prerelease.yml b/.github/workflows/on-prerelease.yml index cac3fd42..cd2481ea 100644 --- a/.github/workflows/on-prerelease.yml +++ b/.github/workflows/on-prerelease.yml @@ -28,7 +28,7 @@ jobs: data-import-version: ${{ steps.versions.outputs.data-import }} steps: - - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: fetch-depth: 0 @@ -83,7 +83,7 @@ jobs: - name: Upload Packages as Artifacts if: success() - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 + uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0 with: name: "${{ env.PACKAGE_NAME }}-NuGet" path: ./*.nupkg @@ -134,7 +134,7 @@ jobs: - name: Upload SBOM if: success() - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 + uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0 with: name: ${{ env.PACKAGE_NAME }}-SBOM path: ./manifest diff --git a/.github/workflows/on-pullrequest-or-push.yml b/.github/workflows/on-pullrequest-or-push.yml index b1e59704..aed40f3d 100644 --- a/.github/workflows/on-pullrequest-or-push.yml +++ b/.github/workflows/on-pullrequest-or-push.yml @@ -71,7 +71,7 @@ jobs: PythonExecutableLocation: "/usr/bin/python" - name: Upload Results as Workflow Artifact - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 + uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0 with: name: csharp-tests path: "**/*.trx" From d549b0fc3c632e0ff5f3bed29f0e69fcea08b9a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Alberto=20Leiva=20Obando?= Date: Tue, 9 Apr 2024 11:05:17 -0600 Subject: [PATCH 16/16] Update on-pullrequest-or-push.yml --- .github/workflows/on-pullrequest-or-push.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/on-pullrequest-or-push.yml b/.github/workflows/on-pullrequest-or-push.yml index aed40f3d..4520d9fe 100644 --- a/.github/workflows/on-pullrequest-or-push.yml +++ b/.github/workflows/on-pullrequest-or-push.yml @@ -91,6 +91,10 @@ jobs: - name: Checkout the Repo uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - name: Dependency Review ("Dependabot on PR") + if: ${{ !github.event.repository.fork }} + uses: actions/dependency-review-action@9129d7d40b8c12c1ed0f60400d00c92d437adcce # v4.1.3 + - name: Initialize CodeQL if: success() uses: github/codeql-action/init@cf7e9f23492505046de9a37830c3711dd0f25bb3 # v2.16.2