diff --git a/.vsts.ci.yml b/.vsts.ci.yml index 9917e704df..739583ae9b 100644 --- a/.vsts.ci.yml +++ b/.vsts.ci.yml @@ -29,7 +29,7 @@ parameters: default: true - name: macOS_arm64 type: boolean - displayName: macOS (arm64) + displayName: macOS (arm64)m default: true - name: skipRhelRelease type: boolean diff --git a/src/Agent.Sdk/Util/ExceptionsUtil.cs b/src/Agent.Sdk/Util/ExceptionsUtil.cs index 29da4be311..8412c64f47 100644 --- a/src/Agent.Sdk/Util/ExceptionsUtil.cs +++ b/src/Agent.Sdk/Util/ExceptionsUtil.cs @@ -2,10 +2,7 @@ // Licensed under the MIT License. using System; -using System.Collections.Generic; using System.Net.Sockets; -using System.Text; -using Microsoft.VisualStudio.Services.Agent; using Microsoft.VisualStudio.Services.Agent.Util; namespace Agent.Sdk.Util diff --git a/src/Agent.Sdk/Util/ILoggedSecretMasker.cs b/src/Agent.Sdk/Util/ILoggedSecretMasker.cs index 5cb01c379c..acd832ae77 100644 --- a/src/Agent.Sdk/Util/ILoggedSecretMasker.cs +++ b/src/Agent.Sdk/Util/ILoggedSecretMasker.cs @@ -1,8 +1,5 @@ using Microsoft.TeamFoundation.DistributedTask.Logging; using System; -using System.Collections.Generic; -using System.Text; -using System.Text.RegularExpressions; namespace Agent.Sdk.Util { diff --git a/src/Agent.Sdk/Util/LoggedSecretMasker.cs b/src/Agent.Sdk/Util/LoggedSecretMasker.cs index 0ac9571c08..2eede77beb 100644 --- a/src/Agent.Sdk/Util/LoggedSecretMasker.cs +++ b/src/Agent.Sdk/Util/LoggedSecretMasker.cs @@ -1,8 +1,5 @@ using Microsoft.TeamFoundation.DistributedTask.Logging; using System; -using System.Collections.Generic; -using System.Text; -using System.Text.RegularExpressions; namespace Agent.Sdk.Util { diff --git a/src/Agent.Sdk/Util/MaskingUtil.cs b/src/Agent.Sdk/Util/MaskingUtil.cs index 15317d2d19..6ad41ffcee 100644 --- a/src/Agent.Sdk/Util/MaskingUtil.cs +++ b/src/Agent.Sdk/Util/MaskingUtil.cs @@ -1,7 +1,5 @@ using Microsoft.VisualStudio.Services.ServiceEndpoints.WebApi; using System; -using System.Collections.Generic; -using System.Text; namespace Microsoft.VisualStudio.Services.Agent.Util { diff --git a/src/Agent.Sdk/Util/PlatformUtil.cs b/src/Agent.Sdk/Util/PlatformUtil.cs index 53d5bfd108..29a5375e1b 100644 --- a/src/Agent.Sdk/Util/PlatformUtil.cs +++ b/src/Agent.Sdk/Util/PlatformUtil.cs @@ -2,12 +2,9 @@ // Licensed under the MIT License. using System; -using System.Collections.Generic; -using System.Diagnostics; using System.IO; using System.Linq; using System.Net.Http; -using System.Net.Sockets; using System.Reflection; using System.Runtime.InteropServices; using System.Text; @@ -15,10 +12,6 @@ using System.Threading.Tasks; using System.Xml.Linq; using Agent.Sdk.Knob; -using Agent.Sdk.Util; -using BuildXL.Cache.MemoizationStore.Interfaces.Caches; -using BuildXL.Utilities; -using Microsoft.TeamFoundation.Build.WebApi; using Microsoft.VisualStudio.Services.Agent.Util; using Microsoft.Win32; using Newtonsoft.Json; diff --git a/src/Agent.Worker/ContainerOperationProvider.cs b/src/Agent.Worker/ContainerOperationProvider.cs index 64c8b40f1c..73c0f5c7dd 100644 --- a/src/Agent.Worker/ContainerOperationProvider.cs +++ b/src/Agent.Worker/ContainerOperationProvider.cs @@ -789,7 +789,7 @@ private async Task CreateContainerNetworkAsync(IExecutionContext executionContex { Trace.Entering(); ArgUtil.NotNull(executionContext, nameof(executionContext)); - + if (network != "host") { int networkExitCode = await _dockerManger.DockerNetworkCreate(executionContext, network); diff --git a/src/Agent.Worker/Handlers/StepHost.cs b/src/Agent.Worker/Handlers/StepHost.cs index dbc97674de..aa0c2a07c7 100644 --- a/src/Agent.Worker/Handlers/StepHost.cs +++ b/src/Agent.Worker/Handlers/StepHost.cs @@ -210,24 +210,22 @@ public async Task ExecuteAsync(string workingDirectory, // It appears that node.exe outputs UTF8 when not in TTY mode. outputEncoding = Encoding.UTF8; } - using (var redirectStandardIn = new InputQueue()) - { - var payloadJson = JsonUtility.ToString(payload); - redirectStandardIn.Enqueue(payloadJson); - HostContext.GetTrace(nameof(ContainerStepHost)).Info($"Payload: {payloadJson}"); - return await processInvoker.ExecuteAsync(workingDirectory: HostContext.GetDirectory(WellKnownDirectory.Work), - fileName: containerEnginePath, - arguments: containerExecutionArgs, - environment: null, - requireExitCodeZero: requireExitCodeZero, - outputEncoding: outputEncoding, - killProcessOnCancel: killProcessOnCancel, - redirectStandardIn: redirectStandardIn, - inheritConsoleHandler: inheritConsoleHandler, - continueAfterCancelProcessTreeKillAttempt: continueAfterCancelProcessTreeKillAttempt, - cancellationToken: cancellationToken); - } - + + using var redirectStandardIn = new InputQueue(); + var payloadJson = JsonUtility.ToString(payload); + redirectStandardIn.Enqueue(payloadJson); + HostContext.GetTrace(nameof(ContainerStepHost)).Info($"Payload: {payloadJson}"); + return await processInvoker.ExecuteAsync(workingDirectory: HostContext.GetDirectory(WellKnownDirectory.Work), + fileName: containerEnginePath, + arguments: containerExecutionArgs, + environment: null, + requireExitCodeZero: requireExitCodeZero, + outputEncoding: outputEncoding, + killProcessOnCancel: killProcessOnCancel, + redirectStandardIn: redirectStandardIn, + inheritConsoleHandler: inheritConsoleHandler, + continueAfterCancelProcessTreeKillAttempt: continueAfterCancelProcessTreeKillAttempt, + cancellationToken: cancellationToken); } } diff --git a/src/Agent.Worker/WorkerCommandManager.cs b/src/Agent.Worker/WorkerCommandManager.cs index f2e1c072b5..e88061a0ae 100644 --- a/src/Agent.Worker/WorkerCommandManager.cs +++ b/src/Agent.Worker/WorkerCommandManager.cs @@ -111,11 +111,10 @@ public bool TryProcessCommand(IExecutionContext context, string input) } catch (SocketException ex) { - using (var vssConnection = WorkerUtilities.GetVssConnection(context)) - { - ExceptionsUtil.HandleSocketException(ex, vssConnection.Uri.ToString(), context.Error); - context.CommandResult = TaskResult.Failed; - } + using var vssConnection = WorkerUtilities.GetVssConnection(context); + + ExceptionsUtil.HandleSocketException(ex, vssConnection.Uri.ToString(), context.Error); + context.CommandResult = TaskResult.Failed; } catch (Exception ex) { diff --git a/src/Misc/externals.sh b/src/Misc/externals.sh index 23b4e9ddaf..beb2df95ec 100644 --- a/src/Misc/externals.sh +++ b/src/Misc/externals.sh @@ -11,7 +11,7 @@ NODE_URL=https://nodejs.org/dist NODE_VERSION="6.17.1" NODE10_VERSION="10.24.1" NODE16_VERSION="16.17.1" -MINGIT_VERSION="2.38.1" +MINGIT_VERSION="2.39.1" LFS_VERSION="2.13.3" get_abs_path() { diff --git a/src/Test/L0/SecretMaskerTests/LoggedSecretMaskerL0.cs b/src/Test/L0/SecretMaskerTests/LoggedSecretMaskerL0.cs index 67373ddac6..982c93bba2 100644 --- a/src/Test/L0/SecretMaskerTests/LoggedSecretMaskerL0.cs +++ b/src/Test/L0/SecretMaskerTests/LoggedSecretMaskerL0.cs @@ -134,7 +134,7 @@ protected virtual void Dispose(bool disposing) } _secretMasker.Dispose(); - _secretMasker= null; + _secretMasker = null; disposedValue = true; }