From 681acc7964eb9bf203f60f8f0e9f9349adfca333 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Jan 2024 21:37:56 +0000 Subject: [PATCH 1/4] Bump Proc from 0.6.2 to 0.8.0 Bumps [Proc](https://github.com/nullean/proc) from 0.6.2 to 0.8.0. - [Release notes](https://github.com/nullean/proc/releases) - [Commits](https://github.com/nullean/proc/compare/0.6.2...0.8.0) --- updated-dependencies: - dependency-name: Proc dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .../OpenSearch.OpenSearch.Managed.csproj | 2 +- build/scripts/scripts.fsproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/abstractions/src/OpenSearch.OpenSearch.Managed/OpenSearch.OpenSearch.Managed.csproj b/abstractions/src/OpenSearch.OpenSearch.Managed/OpenSearch.OpenSearch.Managed.csproj index 1024dfc8f4..7b25d45037 100644 --- a/abstractions/src/OpenSearch.OpenSearch.Managed/OpenSearch.OpenSearch.Managed.csproj +++ b/abstractions/src/OpenSearch.OpenSearch.Managed/OpenSearch.OpenSearch.Managed.csproj @@ -13,7 +13,7 @@ - + diff --git a/build/scripts/scripts.fsproj b/build/scripts/scripts.fsproj index b38276bda8..e2be286bfe 100644 --- a/build/scripts/scripts.fsproj +++ b/build/scripts/scripts.fsproj @@ -44,6 +44,6 @@ - + From 32635dc9bdce2509cbb19eee7c4f2458991c067e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 15 Jan 2024 21:38:19 +0000 Subject: [PATCH 2/4] Update changelog Signed-off-by: dependabot[bot] --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c741862f74..6d3c738c8e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Bumps `Bogus` from 34.0.2 to 35.3.0 - Bumps `Octokit` from 9.0.0 to 9.1.0 - Bumps `FSharp.Core` from 8.0.100 to 8.0.101 +- Bumps `Proc` from 0.6.2 to 0.8.0 ## [1.6.0] ### Added From 7e70a0aa2f357d12b37386fca2d6211b3c72ef56 Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Tue, 16 Jan 2024 12:53:49 +1300 Subject: [PATCH 3/4] Fix building Signed-off-by: Thomas Farr --- .../Tasks/IClusterComposeTask.cs | 12 +++--------- tests/Tests.Core/Tests.Core.csproj | 2 +- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/abstractions/src/OpenSearch.OpenSearch.Ephemeral/Tasks/IClusterComposeTask.cs b/abstractions/src/OpenSearch.OpenSearch.Ephemeral/Tasks/IClusterComposeTask.cs index 199e363e34..40b200f28a 100644 --- a/abstractions/src/OpenSearch.OpenSearch.Ephemeral/Tasks/IClusterComposeTask.cs +++ b/abstractions/src/OpenSearch.OpenSearch.Ephemeral/Tasks/IClusterComposeTask.cs @@ -172,14 +172,10 @@ protected static void WriteFileIfNotExist(string fileLocation, string contents) protected static void ExecuteBinary(EphemeralClusterConfiguration config, IConsoleLineHandler writer, string binary, string description, params string[] arguments) => - ExecuteBinaryInternal(config, writer, binary, description, null, arguments); - - protected static void ExecuteBinary(EphemeralClusterConfiguration config, IConsoleLineHandler writer, - string binary, string description, StartedHandler startedHandler, params string[] arguments) => - ExecuteBinaryInternal(config, writer, binary, description, startedHandler, arguments); + ExecuteBinaryInternal(config, writer, binary, description, arguments); private static void ExecuteBinaryInternal(EphemeralClusterConfiguration config, IConsoleLineHandler writer, - string binary, string description, StartedHandler startedHandler, params string[] arguments) + string binary, string description, params string[] arguments) { var command = $"{{{binary}}} {{{string.Join(" ", arguments)}}}"; writer?.WriteDiagnostic($"{{{nameof(ExecuteBinary)}}} starting process [{description}] {command}"); @@ -194,9 +190,7 @@ private static void ExecuteBinaryInternal(EphemeralClusterConfiguration config, } }; - var result = startedHandler != null - ? Proc.Start(processStartArguments, timeout, new ConsoleOutColorWriter(), startedHandler) - : Proc.Start(processStartArguments, timeout, new ConsoleOutColorWriter()); + var result = Proc.Start(processStartArguments, timeout, new ConsoleOutColorWriter()); if (!result.Completed) throw new Exception($"Timeout while executing {description} exceeded {timeout}"); diff --git a/tests/Tests.Core/Tests.Core.csproj b/tests/Tests.Core/Tests.Core.csproj index 28e285a2dd..b0d0c23f9d 100644 --- a/tests/Tests.Core/Tests.Core.csproj +++ b/tests/Tests.Core/Tests.Core.csproj @@ -23,6 +23,6 @@ - + From 3f4c16d1e029ba1ab7a0ccb6035d5d48063082a5 Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Tue, 16 Jan 2024 12:59:45 +1300 Subject: [PATCH 4/4] Fix integration tests Signed-off-by: Thomas Farr --- .../Tasks/InstallationTasks/InstallPlugins.cs | 2 +- .../Configuration/NodeSettings.cs | 9 +++----- build/scripts/Building.fs | 23 ++++++++++--------- build/scripts/ReposTooling.fs | 13 +++++------ 4 files changed, 22 insertions(+), 25 deletions(-) diff --git a/abstractions/src/OpenSearch.OpenSearch.Ephemeral/Tasks/InstallationTasks/InstallPlugins.cs b/abstractions/src/OpenSearch.OpenSearch.Ephemeral/Tasks/InstallationTasks/InstallPlugins.cs index c64501038e..c9509b7d03 100644 --- a/abstractions/src/OpenSearch.OpenSearch.Ephemeral/Tasks/InstallationTasks/InstallPlugins.cs +++ b/abstractions/src/OpenSearch.OpenSearch.Ephemeral/Tasks/InstallationTasks/InstallPlugins.cs @@ -99,7 +99,7 @@ public override void Run(IEphemeralCluster cluste cluster.Writer, fs.PluginBinary, $"install opensearch plugin: {plugin.SubProductName}", - "install --batch", GetPluginLocation(plugin, v)); + "install", "--batch", GetPluginLocation(plugin, v)); CopyConfigDirectoryToHomeCacheConfigDirectory(cluster, plugin); } diff --git a/abstractions/src/OpenSearch.OpenSearch.Managed/Configuration/NodeSettings.cs b/abstractions/src/OpenSearch.OpenSearch.Managed/Configuration/NodeSettings.cs index 0ce531141c..ea34663ca7 100644 --- a/abstractions/src/OpenSearch.OpenSearch.Managed/Configuration/NodeSettings.cs +++ b/abstractions/src/OpenSearch.OpenSearch.Managed/Configuration/NodeSettings.cs @@ -56,18 +56,15 @@ public void Add(string setting) public void Add(string key, string value, string versionRange) => Add(new NodeSetting(key, value, versionRange)); - public string[] ToCommandLineArguments(OpenSearchVersion version) - { - var settingArgument = "-E "; - return this + public string[] ToCommandLineArguments(OpenSearchVersion version) => + this //if a node setting is only applicable for a certain version make sure its filtered out .Where(s => string.IsNullOrEmpty(s.VersionRange) || version.InRange(s.VersionRange)) //allow additional settings to take precedence over already DefaultNodeSettings //without relying on opensearch to dedup .GroupBy(setting => setting.Key) .Select(g => g.Last()) - .Select(s => s.Key.StartsWith(settingArgument) ? s.ToString() : $"{settingArgument}{s}") + .SelectMany(s => new[] { "-E", s.ToString() }) .ToArray(); - } } } diff --git a/build/scripts/Building.fs b/build/scripts/Building.fs index 19da39c0ee..93fbdebb65 100644 --- a/build/scripts/Building.fs +++ b/build/scripts/Building.fs @@ -124,29 +124,30 @@ module Build = Shell.rm nuspec deps - - - let rewriteLibFolder libFolder project nugetId dependencies = + + + let rewriteLibFolder libFolder project nugetId dependencies = let info = DirectoryInfo libFolder let tfm = info.Name let fullPath = Path.GetFullPath libFolder - - let mainDll = sprintf "%s.dll" (Path.Combine(fullPath, project)) + + let mainDll = sprintf "%s.dll" (Path.Combine(fullPath, project)) let renamedDll dll = dll |> String.replace ".dll" (sprintf "%i.dll" version.Full.Major) - + printfn "dll: %s Nuget id: %s dependencies: %A" mainDll nugetId dependencies let depAssemblies = dependencies |> Seq.map (fun d -> sprintf "%s.dll" (Path.Combine(Paths.InplaceBuildOutput project tfm, d))) - let dlls = + let args = [mainDll] |> Seq.append depAssemblies |> Seq.map (fun dll -> - sprintf @"-i ""%s"" -o ""%s"" -k ""%s""" dll (renamedDll dll) keyFile + ["-i"; dll; "-o"; renamedDll dll; "-k"; keyFile] ) - - ReposTooling.Rewriter dlls - + |> Seq.concat + + ReposTooling.Rewriter args + Shell.rm mainDll let mainPdb = sprintf "%s.pdb" (Path.Combine(fullPath, project)) if File.exists mainPdb then Shell.rm mainPdb diff --git a/build/scripts/ReposTooling.fs b/build/scripts/ReposTooling.fs index cdd01f8cfe..2005a5a0ad 100644 --- a/build/scripts/ReposTooling.fs +++ b/build/scripts/ReposTooling.fs @@ -64,17 +64,16 @@ module ReposTooling = let folder = Path.getDirectory (Paths.TestProjFile "Tests.YamlRunner") let timeout = TimeSpan.FromMinutes(120.) Tooling.DotNet.ExecInWithTimeout folder (["run"; "--" ] @ args) timeout |> ignore - - + + let restoreOnce = lazy(Tooling.DotNet.Exec ["tool"; "restore"]) - + let private differ = "assembly-differ" let Differ args = restoreOnce.Force() - - let args = args |> String.concat " " - let command = sprintf @"%s %s -o ../../%s" differ args Paths.BuildOutput - Tooling.DotNet.ExecIn Paths.TargetsFolder [command] |> ignore + + let args = [differ] @ args @ ["-o"; $"../../{Paths.BuildOutput}"] + Tooling.DotNet.ExecIn Paths.TargetsFolder args let private assemblyRewriter = "assembly-rewriter" let Rewriter args =