diff --git a/CHANGELOG.md b/CHANGELOG.md index d5a9a735eb..1990fbf1c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,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 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/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/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/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 = diff --git a/build/scripts/scripts.fsproj b/build/scripts/scripts.fsproj index b1a17f28d9..5f5ae95d86 100644 --- a/build/scripts/scripts.fsproj +++ b/build/scripts/scripts.fsproj @@ -46,6 +46,6 @@ - + diff --git a/tests/Tests.Core/Tests.Core.csproj b/tests/Tests.Core/Tests.Core.csproj index 87ac0ee9e2..fbd04d69f2 100644 --- a/tests/Tests.Core/Tests.Core.csproj +++ b/tests/Tests.Core/Tests.Core.csproj @@ -23,6 +23,6 @@ - +