From aa294be57f8d5df0a1acb66a40a14889b494b321 Mon Sep 17 00:00:00 2001 From: Claudiu Guiman Date: Wed, 15 May 2024 13:02:42 -0400 Subject: [PATCH 001/107] [ParameterCapturingService] Remove ILogger and IServiceProvider. (#6625) --- .../HostingStartup.cs | 1 - .../FunctionProbes/FunctionProbesManager.cs | 13 +- .../ParameterCapturingLogger.cs | 168 ------------------ .../ParameterCapturingService.cs | 37 +--- .../ParameterCapturingLoggerTests.cs | 102 ----------- .../FunctionProbes/FunctionProbesScenario.cs | 8 +- 6 files changed, 10 insertions(+), 319 deletions(-) delete mode 100644 src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ParameterCapturingLogger.cs delete mode 100644 src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/ParameterCapturingLoggerTests.cs diff --git a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/HostingStartup.cs b/src/Microsoft.Diagnostics.Monitoring.HostingStartup/HostingStartup.cs index 613cff749d3..13fa379d089 100644 --- a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/HostingStartup.cs +++ b/src/Microsoft.Diagnostics.Monitoring.HostingStartup/HostingStartup.cs @@ -26,7 +26,6 @@ public void Configure(IWebHostBuilder builder) if (ToolIdentifiers.IsEnvVarEnabled(InProcessFeaturesIdentifiers.EnvironmentVariables.ParameterCapturing.Enable)) { - services.AddSingleton(); services.AddHostedService(); } }); diff --git a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/FunctionProbes/FunctionProbesManager.cs b/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/FunctionProbes/FunctionProbesManager.cs index a30600f7d90..2515e186653 100644 --- a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/FunctionProbes/FunctionProbesManager.cs +++ b/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/FunctionProbes/FunctionProbesManager.cs @@ -5,7 +5,6 @@ using Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.ObjectFormatting; using Microsoft.Diagnostics.Monitoring.StartupHook; using Microsoft.Diagnostics.Tools.Monitor.Profiler; -using Microsoft.Extensions.Logging; using System; using System.Collections.Generic; using System.Collections.ObjectModel; @@ -71,14 +70,11 @@ private static extern void RegisterFunctionProbeCallbacks( public event EventHandler? OnProbeFault; - private readonly ILogger _logger; - - public FunctionProbesManager(ILogger logger) + public FunctionProbesManager() { ProfilerResolver.InitializeResolver(); _disposalToken = _disposalTokenSource.Token; - _logger = logger; // // CONSIDER: @@ -103,8 +99,6 @@ public FunctionProbesManager(ILogger logger) private void OnRegistration(int hresult) { - _logger.LogDebug(ParameterCapturingStrings.ProbeManagementCallback, nameof(OnRegistration), hresult); - TransitionStateFromHr(_probeRegistrationTaskSource, hresult, expectedState: ProbeStateUninitialized, succeededState: ProbeStateUninstalled, @@ -113,8 +107,6 @@ private void OnRegistration(int hresult) private void OnInstallation(int hresult) { - _logger.LogDebug(ParameterCapturingStrings.ProbeManagementCallback, nameof(OnInstallation), hresult); - TransitionStateFromHr(_installationTaskSource, hresult, expectedState: ProbeStateInstalling, succeededState: ProbeStateInstalled, @@ -123,8 +115,6 @@ private void OnInstallation(int hresult) private void OnUninstallation(int hresult) { - _logger.LogDebug(ParameterCapturingStrings.ProbeManagementCallback, nameof(OnUninstallation), hresult); - TransitionStateFromHr(_uninstallationTaskSource, hresult, expectedState: ProbeStateUninstalling, succeededState: ProbeStateUninstalled, @@ -304,7 +294,6 @@ public async Task StartCapturingAsync(IList methods, IFunctionProbes { using IDisposable _ = linkedCancellationToken.Register(() => { - _logger.LogDebug(ParameterCapturingStrings.CancellationRequestedDuringProbeInstallation, token.IsCancellationRequested, _disposalToken.IsCancellationRequested); _installationTaskSource?.TrySetCanceled(linkedCancellationToken); // diff --git a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ParameterCapturingLogger.cs b/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ParameterCapturingLogger.cs deleted file mode 100644 index fa47674e379..00000000000 --- a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ParameterCapturingLogger.cs +++ /dev/null @@ -1,168 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.FunctionProbes; -using Microsoft.Diagnostics.Monitoring.StartupHook; -using Microsoft.Extensions.Logging; -using System; -using System.Collections.Concurrent; -using System.Diagnostics; -using System.Globalization; -using System.Linq; -using System.Threading; - -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing -{ - internal sealed class ParameterCapturingLogger : IDisposable - { - private record QueuedLogStatement(string Format, string[] Args, KeyValueLogScope Scope); - - internal static class Scopes - { - private const string Prefix = "DotnetMonitor_"; - - public const string TimeStamp = Prefix + "Timestamp"; - - public const string ThreadId = Prefix + "ThreadId"; - - public const string ActivityId = Prefix + "ActivityId"; - public const string ActivityIdFormat = Prefix + "ActivityIdFormat"; - - public static class CaptureSite - { - private const string Prefix = Scopes.Prefix + "CaptureSite_"; - - public const string MethodName = Prefix + "MethodName"; - public const string ModuleName = Prefix + "ModuleName"; - public const string TypeName = Prefix + "TypeName"; - } - } - - private readonly ILogger _userLogger; - private readonly ILogger _systemLogger; - private readonly Thread _thread; - private BlockingCollection _messages; - private uint _droppedMessageCounter; - private const int BackgroundLoggingCapacity = 1024; - private const string BackgroundLoggingThreadName = "[dotnet-monitor] Probe Logging Thread"; - private long _disposedState; - - private static readonly string[] ExcludedThreads = new[] - { - "Console logger queue processing thread", - }; - - public ParameterCapturingLogger(ILogger userLogger, ILogger systemLogger) - { - _userLogger = userLogger; - _systemLogger = systemLogger; - _thread = new Thread(ThreadProc); - - _thread.Priority = ThreadPriority.BelowNormal; - _thread.IsBackground = true; - _thread.Name = BackgroundLoggingThreadName; - _messages = new BlockingCollection(BackgroundLoggingCapacity); - _thread.Start(); - } - - public bool ShouldLog() - { - // Probes should not attempt to log on the console logging thread - // or on the background thread that is used to log system messages. - - if (Environment.CurrentManagedThreadId == _thread.ManagedThreadId) - { - return false; - } - if (ExcludedThreads.Contains(Thread.CurrentThread.Name)) - { - return false; - } - - return true; - } - - public void Log(ParameterCaptureMode mode, MethodTemplateString methodTemplateString, string[] args) - { - DisposableHelper.ThrowIfDisposed(ref _disposedState); - - KeyValueLogScope scope = GenerateScope(methodTemplateString); - - if (mode == ParameterCaptureMode.Inline) - { - Log(_userLogger, methodTemplateString.Template, args, scope); - } - else if (mode == ParameterCaptureMode.Background) - { - if (!_messages.TryAdd(new QueuedLogStatement(methodTemplateString.Template, args, scope))) - { - Interlocked.Increment(ref _droppedMessageCounter); - } - } - } - - private static KeyValueLogScope GenerateScope(MethodTemplateString methodTemplateString) - { - KeyValueLogScope scope = new(); - - // Store timestamp as ISO 8601 compliant - scope.Values.Add(Scopes.TimeStamp, DateTime.UtcNow.ToString("o", CultureInfo.InvariantCulture)); - scope.Values.Add(Scopes.ThreadId, Environment.CurrentManagedThreadId); - - scope.Values.Add(Scopes.CaptureSite.MethodName, methodTemplateString.MethodName); - scope.Values.Add(Scopes.CaptureSite.ModuleName, methodTemplateString.ModuleName); - scope.Values.Add(Scopes.CaptureSite.TypeName, methodTemplateString.TypeName); - - Activity? currentActivity = Activity.Current; - if (currentActivity?.Id != null) - { - scope.Values.Add(Scopes.ActivityId, currentActivity.Id); - scope.Values.Add(Scopes.ActivityIdFormat, currentActivity.IdFormat); - } - - return scope; - } - - private void ThreadProc() - { - using IDisposable _ = MonitorExecutionContextTracker.MonitorScope(); - - try - { - while (_messages.TryTake(out QueuedLogStatement? entry, Timeout.InfiniteTimeSpan)) - { - Log(_systemLogger, entry.Format, entry.Args, entry.Scope); - } - } - catch (ObjectDisposedException) - { - } - catch - { - } - } - - public void Complete() - { - // NOTE We currently do not wait for the background thread in production code - _messages.CompleteAdding(); - _thread.Join(); - } - - private static void Log(ILogger logger, string format, string[] args, KeyValueLogScope scope) - { - using var _ = logger.BeginScope(scope); - logger.Log(LogLevel.Information, format, args); - } - - public void Dispose() - { - if (!DisposableHelper.CanDispose(ref _disposedState)) - { - return; - } - _messages.CompleteAdding(); - _messages.Dispose(); - } - } -} diff --git a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ParameterCapturingService.cs b/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ParameterCapturingService.cs index 0599943c75c..76b72dc9008 100644 --- a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ParameterCapturingService.cs +++ b/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ParameterCapturingService.cs @@ -9,9 +9,7 @@ using Microsoft.Diagnostics.Tools.Monitor.ParameterCapturing; using Microsoft.Diagnostics.Tools.Monitor.Profiler; using Microsoft.Diagnostics.Tools.Monitor.StartupHook; -using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; using System; using System.Collections.Generic; using System.Reflection; @@ -30,11 +28,8 @@ internal sealed class ParameterCapturingService : BackgroundService, IParameterC private readonly ParameterCapturingEventSource _eventSource = new(); private readonly AsyncParameterCapturingEventSource? _asyncEventSource; private readonly ParameterCapturingPipeline? _pipeline; - private readonly ParameterCapturingLogger? _parameterCapturingLogger; - private readonly ILogger? _logger; - - public ParameterCapturingService(IServiceProvider services) + public ParameterCapturingService() { using IDisposable _ = MonitorExecutionContextTracker.MonitorScope(); @@ -52,19 +47,9 @@ public ParameterCapturingService(IServiceProvider services) StartupHookCommand.StopCapturingParameters, OnStopMessage); - IMethodDescriptionValidator _methodDescriptionValidator = services.GetRequiredService(); - - _logger = services.GetService>() - ?? throw new NotSupportedException(ParameterCapturingStrings.FeatureUnsupported_NoLogger); - - ILogger userLogger = services.GetService>() - ?? throw new NotSupportedException(ParameterCapturingStrings.FeatureUnsupported_NoLogger); - - ILogger systemLogger = services.GetService>() - ?? throw new NotSupportedException(ParameterCapturingStrings.FeatureUnsupported_NoLogger); + IMethodDescriptionValidator _methodDescriptionValidator = new MethodDescriptionValidator(); - _parameterCapturingLogger = new(userLogger, systemLogger); - FunctionProbesManager probeManager = new(_logger); + FunctionProbesManager probeManager = new(); _pipeline = new ParameterCapturingPipeline(probeManager, this, _methodDescriptionValidator); @@ -84,32 +69,21 @@ public ParameterCapturingService(IServiceProvider services) public void CapturingStart(StartCapturingParametersPayload request, IList methods) { _eventSource.CapturingStart(request.RequestId); - _logger?.LogInformation( - ParameterCapturingStrings.StartParameterCapturingFormatString, - request.Duration, - methods.Count); } public void CapturingStop(Guid requestId) { _eventSource.CapturingStop(requestId); - _logger?.LogInformation(ParameterCapturingStrings.StopParameterCapturing); } public void FailedToCapture(Guid requestId, ParameterCapturingEvents.CapturingFailedReason reason, string details) { _eventSource.FailedToCapture(requestId, reason, details); - if (reason == ParameterCapturingEvents.CapturingFailedReason.UnresolvedMethods) - { - _logger?.LogWarning(details); - } } public void ProbeFault(Guid requestId, InstrumentedMethod faultingMethod) { - // TODO: Report back this fault on ParameterCapturingEventSource. - _logger?.LogWarning(ParameterCapturingStrings.StoppingParameterCapturingDueToProbeFault, faultingMethod.MethodTemplateString.Template); - + // TODO: Report back this fault on ParameterCapturingEventSource. try { _pipeline?.RequestStop(requestId); @@ -128,7 +102,7 @@ private bool IsAvailable() private void OnStartMessage(StartCapturingParametersPayload payload) { - if (!IsAvailable() || _pipeline == null || _parameterCapturingLogger == null || _asyncEventSource == null) + if (!IsAvailable() || _pipeline == null || _asyncEventSource == null) { BroadcastServiceState(); return; @@ -233,7 +207,6 @@ public override void Dispose() SharedInternals.MessageDispatcher?.UnregisterCallback(StartupHookCommand.StopCapturingParameters); _pipeline?.Dispose(); - _parameterCapturingLogger?.Dispose(); _asyncEventSource?.Dispose(); diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/ParameterCapturingLoggerTests.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/ParameterCapturingLoggerTests.cs deleted file mode 100644 index 1d897e48cc8..00000000000 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/ParameterCapturingLoggerTests.cs +++ /dev/null @@ -1,102 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing; -using Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.FunctionProbes; -using Microsoft.Diagnostics.Monitoring.TestCommon; -using Microsoft.Extensions.Logging; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Reflection; -using Xunit; - -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests.ParameterCapturing -{ - [TargetFrameworkMonikerTrait(TargetFrameworkMonikerExtensions.CurrentTargetFrameworkMoniker)] - public class ParameterCapturingLoggerTests - { - private readonly MethodInfo _testMethod = typeof(ParameterCapturingLoggerTests).GetMethod(nameof(TestMethod), BindingFlags.Static | BindingFlags.NonPublic); - private static void TestMethod() { } - - [Theory] - [InlineData(ParameterCaptureMode.Inline, typeof(DotnetMonitor.ParameterCapture.UserCode))] - [InlineData(ParameterCaptureMode.Background, typeof(DotnetMonitor.ParameterCapture.SystemCode))] - internal void LoggingCategories(ParameterCaptureMode mode, Type categoryType) - { - // Arrange & Act - IList entries = TestCore(mode); - - // Assert - LogRecordEntry entry = Assert.Single(entries); - Assert.Equal(categoryType.FullName, entry.Category); - - return; - } - - [Theory] - [InlineData(ParameterCaptureMode.Inline)] - [InlineData(ParameterCaptureMode.Background)] - internal void ScopeData(ParameterCaptureMode mode) - { - // Arrange - using Activity loggingActivity = new("ScopeDataTest"); - Activity.Current = loggingActivity; - loggingActivity.Start(); - - Dictionary expectedScope = new() - { - { ParameterCapturingLogger.Scopes.ActivityId, loggingActivity.Id }, - { ParameterCapturingLogger.Scopes.ActivityIdFormat, loggingActivity.IdFormat }, - { ParameterCapturingLogger.Scopes.ThreadId, Environment.CurrentManagedThreadId }, - { ParameterCapturingLogger.Scopes.CaptureSite.MethodName, _testMethod.Name }, - { ParameterCapturingLogger.Scopes.CaptureSite.TypeName, _testMethod.DeclaringType.FullName }, - { ParameterCapturingLogger.Scopes.CaptureSite.ModuleName, _testMethod.Module.Name } - }; - - // Act - IList entries = TestCore(mode); - - // Assert - LogRecordEntry entry = Assert.Single(entries); - IReadOnlyList> rawScope = Assert.Single(entry.Scopes); - - Dictionary scopeData = new(rawScope); - - // Validate variant data first. - - // Timestamp - Assert.True(scopeData.Remove(ParameterCapturingLogger.Scopes.TimeStamp, out object rawTimeStamp)); - string timeStampStr = Assert.IsType(rawTimeStamp); - Assert.True(DateTime.TryParse(timeStampStr, out _)); - - // Static data - Assert.Equal(expectedScope, scopeData); - - return; - } - - private IList TestCore(ParameterCaptureMode mode) - { - Assert.NotNull(_testMethod); - - // Arrange - LogRecord logRecord = new(); - ILoggerFactory factory = LoggerFactory.Create(builder => builder.AddProvider(new TestLoggerProvider(logRecord))); - - MethodTemplateString message = new(_testMethod); - - // Act - using (ParameterCapturingLogger logger = new(factory.CreateLogger(), factory.CreateLogger())) - { - logger.Log(mode, message, Array.Empty()); - - // Force the logger to drain the background queue before we dispose it. - logger.Complete(); - } - - // Assert - return logRecord.Events; - } - } -} diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/Scenarios/FunctionProbes/FunctionProbesScenario.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/Scenarios/FunctionProbes/FunctionProbesScenario.cs index 65de7d25c9b..a4889756faf 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/Scenarios/FunctionProbes/FunctionProbesScenario.cs +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/Scenarios/FunctionProbes/FunctionProbesScenario.cs @@ -70,10 +70,10 @@ public static CliCommand Command() CliCommand testCaseCommand = new(subCommand); testCaseCommand.SetAction((result, token) => { - return ScenarioHelpers.RunScenarioAsync(async logger => + return ScenarioHelpers.RunScenarioAsync(async _ => { PerFunctionProbeProxy probeProxy = new PerFunctionProbeProxy(); - using FunctionProbesManager probeManager = new(logger); + using FunctionProbesManager probeManager = new(); await testCase(probeManager, probeProxy, token); @@ -389,9 +389,9 @@ private static async Task Test_DontProbeInMonitorContextAsync(FunctionProbesMana public static Task ValidateNoMutatingProfilerAsync(ParseResult result, CancellationToken token) { - return ScenarioHelpers.RunScenarioAsync(logger => + return ScenarioHelpers.RunScenarioAsync(_ => { - Assert.Throws(() => new FunctionProbesManager(logger)); + Assert.Throws(() => new FunctionProbesManager()); return Task.FromResult(0); }, token); From 60a6925b14d467445112e1607c1b44bba26cd284 Mon Sep 17 00:00:00 2001 From: Claudiu Guiman Date: Wed, 15 May 2024 14:55:18 -0400 Subject: [PATCH 002/107] Remove MethodTemplateString (#6645) --- .../FunctionProbes/InstrumentedMethod.cs | 8 - .../MethodTemplateString.cs | 198 ------------------ .../MethodTemplateStringTests.cs | 43 ---- 3 files changed, 249 deletions(-) delete mode 100644 src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/MethodTemplateString.cs delete mode 100644 src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/MethodTemplateStringTests.cs diff --git a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/FunctionProbes/InstrumentedMethod.cs b/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/FunctionProbes/InstrumentedMethod.cs index 52843a8bf03..e1b65a2f497 100644 --- a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/FunctionProbes/InstrumentedMethod.cs +++ b/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/FunctionProbes/InstrumentedMethod.cs @@ -21,7 +21,6 @@ public InstrumentedMethod(MethodInfo method, ParameterBoxingInstructions[] boxin { FunctionId = method.GetFunctionId(); SupportedParameters = BoxingInstructions.AreParametersSupported(boxingInstructions); - MethodTemplateString = new MethodTemplateString(method); //TODO: remove! MethodSignature = new MethodSignature(method); foreach (bool isParameterSupported in SupportedParameters) { @@ -68,13 +67,6 @@ private static ParameterCaptureMode ComputeCaptureMode(MethodInfo method) /// public bool[] SupportedParameters { get; } - /// - /// A template string that contains the full method name with parameter names and - /// format items for each supported parameter. - /// - /// TODO: remove! - public MethodTemplateString MethodTemplateString { get; } - /// /// Information about the method (name, parameter types, parameter names). /// diff --git a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/MethodTemplateString.cs b/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/MethodTemplateString.cs deleted file mode 100644 index 76e5a0134c3..00000000000 --- a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/MethodTemplateString.cs +++ /dev/null @@ -1,198 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Reflection; -using System.Text; - -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing -{ - internal sealed class MethodTemplateString - { - private static class Tokens - { - private static class Internal - { - public const string Prefix = "<"; - public const string Postfix = ">"; - } - - public static class Types - { - public const char ArityDelimiter = '`'; - public const char Separator = '.'; - public const string Unknown = Internal.Prefix + "unknown" + Internal.Postfix; - } - - public static class Parameters - { - public const char Start = '('; - public const string Separator = ", "; - public const string NameValueSeparator = ": "; - public const char End = ')'; - - public static class Modifiers - { - public const char Separator = ' '; - public const string RefOrRefLike = "ref"; - public const string In = "in"; - public const string Out = "out"; - } - - public static class Names - { - public const string ImplicitThis = "this"; - public const string Unknown = Internal.Prefix + "unknown" + Internal.Postfix; - } - } - - public static class Generics - { - public const char Start = '<'; - public const string Separator = ", "; - public const char End = '>'; - } - } - - - public string ModuleName { get; } - public string TypeName { get; } - public string MethodName { get; } - - public string Template { get; } - - public MethodTemplateString(MethodInfo method) - { - ModuleName = GetModuleName(method); - TypeName = GetDeclaringTypeName(method); - MethodName = GetMethodName(method); - - Template = string.Concat( - TypeName, - Tokens.Types.Separator, - MethodName, - Tokens.Parameters.Start, - GetTemplatedParameters(method), - Tokens.Parameters.End); - } - - private static string GetModuleName(MethodInfo method) => method.Module.Name; - - private static string GetDeclaringTypeName(MethodInfo method) - { - StringBuilder builder = new(); - - // For a generic declaring type, trim the arity information and replace it with the known generic argument names. - string declaringTypeName = method.DeclaringType?.FullName?.Split(Tokens.Types.ArityDelimiter)?[0] ?? Tokens.Types.Unknown; - builder.Append(declaringTypeName); - EmitGenericArguments(builder, method.DeclaringType?.GetGenericArguments()); - - return builder.ToString(); - } - - private static string GetMethodName(MethodInfo method) - { - StringBuilder builder = new(); - - builder.Append(method.Name); - EmitGenericArguments(builder, method.GetGenericArguments()); - - return builder.ToString(); - } - - private static string GetTemplatedParameters(MethodInfo method) - { - StringBuilder builder = new(); - - int parameterIndex = 0; - ParameterInfo[] explicitParameters = method.GetParameters(); - - // Implicit this - if (method.HasImplicitThis()) - { - EmitParameter( - builder, - method.DeclaringType, - Tokens.Parameters.Names.ImplicitThis); - parameterIndex++; - } - - foreach (ParameterInfo paramInfo in explicitParameters) - { - if (parameterIndex != 0) - { - builder.Append(Tokens.Parameters.Separator); - } - - string name = paramInfo.Name ?? Tokens.Parameters.Names.Unknown; - EmitParameter( - builder, - paramInfo.ParameterType, - name, - paramInfo); - - parameterIndex++; - } - - return builder.ToString(); - } - - private static void EmitParameter(StringBuilder stringBuilder, Type? type, string name, ParameterInfo? paramInfo = null) - { - stringBuilder.AppendLine(); - stringBuilder.Append('\t'); - - // Modifiers - if (paramInfo?.IsIn == true) - { - stringBuilder.Append(Tokens.Parameters.Modifiers.In); - stringBuilder.Append(Tokens.Parameters.Modifiers.Separator); - } - else if (paramInfo?.IsOut == true) - { - stringBuilder.Append(Tokens.Parameters.Modifiers.Out); - stringBuilder.Append(Tokens.Parameters.Modifiers.Separator); - } - else if (type?.IsByRef == true || - type?.IsByRefLike == true) - { - stringBuilder.Append(Tokens.Parameters.Modifiers.RefOrRefLike); - stringBuilder.Append(Tokens.Parameters.Modifiers.Separator); - } - - // Name - stringBuilder.Append(name); - stringBuilder.Append(Tokens.Parameters.NameValueSeparator); - - // Value - EmitFormatItem(stringBuilder, name); - } - - private static void EmitGenericArguments(StringBuilder stringBuilder, Type[]? genericArgs) - { - if (genericArgs == null || genericArgs.Length == 0) - { - return; - } - - stringBuilder.Append(Tokens.Generics.Start); - for (int i = 0; i < genericArgs.Length; i++) - { - if (i != 0) - { - stringBuilder.Append(Tokens.Generics.Separator); - } - - stringBuilder.Append(genericArgs[i].Name); - } - stringBuilder.Append(Tokens.Generics.End); - } - - private static void EmitFormatItem(StringBuilder stringBuilder, string name) - { - stringBuilder.Append('{'); - stringBuilder.Append(name); - stringBuilder.Append('}'); - } - } -} diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/MethodTemplateStringTests.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/MethodTemplateStringTests.cs deleted file mode 100644 index ef38ab3c30c..00000000000 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/MethodTemplateStringTests.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing; -using Microsoft.Diagnostics.Monitoring.TestCommon; -using SampleMethods; -using System; -using System.Reflection; -using Xunit; - -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests.ParameterCapturing -{ - [TargetFrameworkMonikerTrait(TargetFrameworkMonikerExtensions.CurrentTargetFrameworkMoniker)] - public class MethodTemplateStringTests - { - [Theory] - [InlineData(typeof(TestMethodSignatures), nameof(TestMethodSignatures.ImplicitThis), "SampleMethods.TestMethodSignatures.ImplicitThis(this: {this})")] - [InlineData(typeof(StaticTestMethodSignatures), nameof(StaticTestMethodSignatures.Arrays), "SampleMethods.StaticTestMethodSignatures.Arrays(intArray: {intArray}, multidimensionalArray: {multidimensionalArray})")] - [InlineData(typeof(StaticTestMethodSignatures), nameof(StaticTestMethodSignatures.Delegate), "SampleMethods.StaticTestMethodSignatures.Delegate(func: {func})")] - [InlineData(typeof(StaticTestMethodSignatures), nameof(StaticTestMethodSignatures.InParam), "SampleMethods.StaticTestMethodSignatures.InParam(in i: {i})")] - [InlineData(typeof(StaticTestMethodSignatures), nameof(StaticTestMethodSignatures.OutParam), "SampleMethods.StaticTestMethodSignatures.OutParam(out i: {i})")] - [InlineData(typeof(StaticTestMethodSignatures), nameof(StaticTestMethodSignatures.RefParam), "SampleMethods.StaticTestMethodSignatures.RefParam(ref i: {i})")] - [InlineData(typeof(StaticTestMethodSignatures), nameof(StaticTestMethodSignatures.RefStruct), "SampleMethods.StaticTestMethodSignatures.RefStruct(ref myRefStruct: {myRefStruct})")] - [InlineData(typeof(StaticTestMethodSignatures), nameof(StaticTestMethodSignatures.GenericParameters), "SampleMethods.StaticTestMethodSignatures.GenericParameters(t: {t}, k: {k})")] - [InlineData(typeof(StaticTestMethodSignatures), nameof(StaticTestMethodSignatures.VarArgs), "SampleMethods.StaticTestMethodSignatures.VarArgs(b: {b}, myInts: {myInts})")] - [InlineData(typeof(StaticTestMethodSignatures), nameof(StaticTestMethodSignatures.Unicode_ΦΨ), "SampleMethods.StaticTestMethodSignatures.Unicode_ΦΨ(δ: {δ})")] - [InlineData(typeof(StaticTestMethodSignatures.SampleNestedStruct), nameof(StaticTestMethodSignatures.SampleNestedStruct.DoWork), "SampleMethods.StaticTestMethodSignatures+SampleNestedStruct.DoWork(this: {this}, i: {i})")] - public void MethodTemplateString(Type declaringType, string methodName, string templateString) - { - // Arrange - MethodInfo method = declaringType.GetMethod(methodName); - Assert.NotNull(method); - - // Act - string actualTemplateString = new MethodTemplateString(method).Template; - - // Assert - Assert.NotNull(actualTemplateString); - actualTemplateString = actualTemplateString.ReplaceLineEndings("").Replace("\t", ""); - Assert.Equal(templateString, actualTemplateString); - } - } -} From 8ec4643edaac1b7b733bce33777dfff90b5fd881 Mon Sep 17 00:00:00 2001 From: Claudiu Guiman Date: Wed, 15 May 2024 16:30:44 -0400 Subject: [PATCH 003/107] Trace probe faults through event source (#6644) * Trace probe faults through event source * ProbeFaulted should throw InvalidOperationException --- .../ParameterCapturingService.cs | 12 ++++- .../ParameterCapturingStrings.Designer.cs | 47 +------------------ .../ParameterCapturingStrings.resx | 20 ++------ .../ParameterCapturingEvents.cs | 3 +- 4 files changed, 17 insertions(+), 65 deletions(-) diff --git a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ParameterCapturingService.cs b/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ParameterCapturingService.cs index 76b72dc9008..c2ac32665fa 100644 --- a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ParameterCapturingService.cs +++ b/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ParameterCapturingService.cs @@ -12,6 +12,7 @@ using Microsoft.Extensions.Hosting; using System; using System.Collections.Generic; +using System.Globalization; using System.Reflection; using System.Threading; using System.Threading.Tasks; @@ -83,7 +84,16 @@ public void FailedToCapture(Guid requestId, ParameterCapturingEvents.CapturingFa public void ProbeFault(Guid requestId, InstrumentedMethod faultingMethod) { - // TODO: Report back this fault on ParameterCapturingEventSource. + _eventSource.FailedToCapture( + requestId, + ParameterCapturingEvents.CapturingFailedReason.ProbeFaulted, + string.Format( + CultureInfo.InvariantCulture, + ParameterCapturingStrings.StoppingParameterCapturingDueToProbeFault, + faultingMethod.MethodSignature.ModuleName, + faultingMethod.MethodSignature.TypeName, + faultingMethod.MethodSignature.MethodName + )); try { _pipeline?.RequestStop(requestId); diff --git a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ParameterCapturingStrings.Designer.cs b/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ParameterCapturingStrings.Designer.cs index b92a947219a..f7a0b898498 100644 --- a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ParameterCapturingStrings.Designer.cs +++ b/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ParameterCapturingStrings.Designer.cs @@ -61,15 +61,6 @@ internal ParameterCapturingStrings() { } } - /// - /// Looks up a localized string similar to Cancellation has been requested during probe installation. Cancellation tokens request state (Provided:{isProvidedTokenCancelled}, Disposal:{isDisposalTokenCancelled}).. - /// - internal static string CancellationRequestedDuringProbeInstallation { - get { - return ResourceManager.GetString("CancellationRequestedDuringProbeInstallation", resourceCulture); - } - } - /// /// Looks up a localized string similar to The following method descriptions are not allowed: {0}. /// @@ -107,43 +98,7 @@ internal static string ErrorMessage_SignatureIsNotForAMethod { } /// - /// Looks up a localized string similar to Unable to create an ILogger instance in the target process.. - /// - internal static string FeatureUnsupported_NoLogger { - get { - return ResourceManager.GetString("FeatureUnsupported_NoLogger", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to {callbackName}, hr={hr}. - /// - internal static string ProbeManagementCallback { - get { - return ResourceManager.GetString("ProbeManagementCallback", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Started parameter capturing for {duration} on {numberOfMethods} method(s).. - /// - internal static string StartParameterCapturingFormatString { - get { - return ResourceManager.GetString("StartParameterCapturingFormatString", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Stopped parameter capturing.. - /// - internal static string StopParameterCapturing { - get { - return ResourceManager.GetString("StopParameterCapturing", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Parameter capturing encountered an internal error when processing '{method}', stopping.. + /// Looks up a localized string similar to Parameter capturing encountered an internal error when processing '{0}!{1}.{2}', stopping.. /// internal static string StoppingParameterCapturingDueToProbeFault { get { diff --git a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ParameterCapturingStrings.resx b/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ParameterCapturingStrings.resx index a40f1ee7666..be3c284e2a3 100644 --- a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ParameterCapturingStrings.resx +++ b/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ParameterCapturingStrings.resx @@ -117,9 +117,6 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Cancellation has been requested during probe installation. Cancellation tokens request state (Provided:{isProvidedTokenCancelled}, Disposal:{isDisposalTokenCancelled}). - The following method descriptions are not allowed: {0} @@ -132,20 +129,9 @@ The provided signature blob must be for a method. - - Unable to create an ILogger instance in the target process. - - - {callbackName}, hr={hr} - - - Started parameter capturing for {duration} on {numberOfMethods} method(s). - - - Stopped parameter capturing. - - Parameter capturing encountered an internal error when processing '{method}', stopping. + Parameter capturing encountered an internal error when processing '{0}!{1}.{2}', stopping. + 0 is the module name, 1 is the method type and 2 is the method name. Too many requests @@ -153,4 +139,4 @@ Unable to resolve one or more method descriptions: {0} - \ No newline at end of file + diff --git a/src/Tools/dotnet-monitor/ParameterCapturing/ParameterCapturingEvents.cs b/src/Tools/dotnet-monitor/ParameterCapturing/ParameterCapturingEvents.cs index f5deb7c7000..1975a8d085e 100644 --- a/src/Tools/dotnet-monitor/ParameterCapturing/ParameterCapturingEvents.cs +++ b/src/Tools/dotnet-monitor/ParameterCapturing/ParameterCapturingEvents.cs @@ -52,7 +52,8 @@ public enum CapturingFailedReason : uint UnresolvedMethods = 0, InvalidRequest, TooManyRequests, - InternalError + InternalError, + ProbeFaulted } public static class CapturingFailedPayloads From c215dc81eb9e879bbe68ecdff51013fec7b2ecb2 Mon Sep 17 00:00:00 2001 From: Claudiu Guiman Date: Thu, 16 May 2024 12:43:57 -0400 Subject: [PATCH 004/107] Remove leftover unused classes and file references (#6657) --- .../FunctionProbeCategories.cs | 25 ------------------- ...agnostics.Monitoring.HostingStartup.csproj | 2 -- 2 files changed, 27 deletions(-) delete mode 100644 src/Microsoft.Diagnostics.Monitoring.HostingStartup/FunctionProbeCategories.cs diff --git a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/FunctionProbeCategories.cs b/src/Microsoft.Diagnostics.Monitoring.HostingStartup/FunctionProbeCategories.cs deleted file mode 100644 index c742134347d..00000000000 --- a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/FunctionProbeCategories.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace DotnetMonitor.ParameterCapture -{ - /// - /// Special namespace and class used for Parameter Capture logging. - /// This is to prevent log filtering that normally occurs for Microsoft categories. - /// We can also use this to classify different types of logs, such as user vs. library code. - /// - internal sealed class UserCode - { - } - - internal sealed class SystemCode - { - } - - internal sealed class Service - { - } -} - - - diff --git a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/Microsoft.Diagnostics.Monitoring.HostingStartup.csproj b/src/Microsoft.Diagnostics.Monitoring.HostingStartup/Microsoft.Diagnostics.Monitoring.HostingStartup.csproj index 9c34122f9e8..904e8f90395 100644 --- a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/Microsoft.Diagnostics.Monitoring.HostingStartup.csproj +++ b/src/Microsoft.Diagnostics.Monitoring.HostingStartup/Microsoft.Diagnostics.Monitoring.HostingStartup.csproj @@ -16,8 +16,6 @@ - - From edd8931a01b36fbd58c4fe264b2f571062659097 Mon Sep 17 00:00:00 2001 From: Claudiu Guiman Date: Mon, 20 May 2024 17:06:03 -0400 Subject: [PATCH 005/107] Enable nullable types in HostingStartup.UnitTests (#6682) --- ...Monitoring.HostingStartup.UnitTests.csproj | 1 + .../Boxing/BoxingInstructionsTests.cs | 20 ++++++++----- .../Boxing/MethodDefinitionExtensionsTests.cs | 6 ++-- .../ParameterCapturing/MethodResolverTests.cs | 2 +- .../MethodSignatureTests.cs | 14 ++++----- .../DebuggerDisplayFormatterTests.cs | 6 ++-- .../DebuggerDisplay/ExpressionBinderTests.cs | 2 +- .../Pipeline/CaptureLimitPolicyProbesTests.cs | 6 ++-- .../ParameterCapturingPipelineTests.cs | 30 +++++++++---------- .../Pipeline/TestFunctionProbes.cs | 6 ++-- .../ParameterCapturing/SampleMethods.cs | 2 +- 11 files changed, 51 insertions(+), 44 deletions(-) diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests.csproj b/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests.csproj index b8488616b15..a20295d2c7d 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests.csproj +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests.csproj @@ -3,6 +3,7 @@ $(TestTargetFrameworks) True + enable diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/Boxing/BoxingInstructionsTests.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/Boxing/BoxingInstructionsTests.cs index 9526804f721..db2dcad85d4 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/Boxing/BoxingInstructionsTests.cs +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/Boxing/BoxingInstructionsTests.cs @@ -49,7 +49,8 @@ public BoxingInstructionsTests(ITestOutputHelper outputHelper) public void GetBoxingInstructions_Detects_UnsupportedParameters(Type declaringType, string methodName, params bool[] supported) { // Arrange - MethodInfo method = declaringType.GetMethod(methodName); + MethodInfo? method = declaringType.GetMethod(methodName); + Assert.NotNull(method); // Act bool[] supportedParameters = BoxingInstructions.AreParametersSupported(BoxingInstructions.GetBoxingInstructions(method)); @@ -62,7 +63,8 @@ public void GetBoxingInstructions_Detects_UnsupportedParameters(Type declaringTy public void GetBoxingInstructions_Handles_GenericParameters() { // Arrange - MethodInfo method = Type.GetType($"{nameof(SampleMethods)}.GenericTestMethodSignatures`2").GetMethod("GenericParameters"); + MethodInfo? method = Type.GetType($"{nameof(SampleMethods)}.GenericTestMethodSignatures`2")?.GetMethod("GenericParameters"); + Assert.NotNull(method); bool[] supported = new bool[] { true, true, true, true }; // Act @@ -90,7 +92,8 @@ public void GetBoxingInstructions_Handles_Primitives() SpecialCaseBoxingTypes.Single, SpecialCaseBoxingTypes.Double, ]; - MethodInfo method = typeof(StaticTestMethodSignatures).GetMethod(nameof(StaticTestMethodSignatures.Primitives)); + MethodInfo? method = typeof(StaticTestMethodSignatures).GetMethod(nameof(StaticTestMethodSignatures.Primitives)); + Assert.NotNull(method); // Act ParameterBoxingInstructions[] actualInstructions = BoxingInstructions.GetBoxingInstructions(method); @@ -108,7 +111,8 @@ public void GetBoxingInstructions_Handles_BuiltInReferenceTypes() SpecialCaseBoxingTypes.Object, SpecialCaseBoxingTypes.Object, ]; - MethodInfo method = typeof(StaticTestMethodSignatures).GetMethod(nameof(StaticTestMethodSignatures.BuiltInReferenceTypes)); + MethodInfo? method = typeof(StaticTestMethodSignatures).GetMethod(nameof(StaticTestMethodSignatures.BuiltInReferenceTypes)); + Assert.NotNull(method); // Act ParameterBoxingInstructions[] actualInstructions = BoxingInstructions.GetBoxingInstructions(method); @@ -140,14 +144,14 @@ public void GetBoxingInstructions_Handles_BuiltInReferenceTypes() [InlineData(typeof(StaticTestMethodSignatures), nameof(StaticTestMethodSignatures.VarArgs))] public void ReflectionAndSignatureDecoder_Contract_InSync(Type declaringType, string methodName) { - MethodInfo method = declaringType.GetMethod(methodName); + MethodInfo? method = declaringType.GetMethod(methodName); ReflectionAndSignatureDecoder_Contract_InSyncCore(method); } [Fact] public void ReflectionAndSignatureDecoder_Contract_Generics_InSync() { - MethodInfo method = Type.GetType($"{nameof(SampleMethods)}.GenericTestMethodSignatures`2").GetMethod("GenericParameters"); + MethodInfo? method = Type.GetType($"{nameof(SampleMethods)}.GenericTestMethodSignatures`2")?.GetMethod("GenericParameters"); ReflectionAndSignatureDecoder_Contract_InSyncCore(method); } @@ -155,13 +159,13 @@ public void ReflectionAndSignatureDecoder_Contract_Generics_InSync() /// Tests if GetBoxingInstructionsFromReflection is in sync with the signature decoder support for a given method's parameters. /// /// The method whose parameters to test. - private static void ReflectionAndSignatureDecoder_Contract_InSyncCore(MethodInfo method) + private static void ReflectionAndSignatureDecoder_Contract_InSyncCore(MethodInfo? method) { Assert.NotNull(method); ParameterInfo[] parameters = method.GetParameters(); - ParameterBoxingInstructions[] signatureDecoderInstructions = BoxingInstructions.GetAncillaryBoxingInstructionsFromMethodSignature(method); ; + ParameterBoxingInstructions[]? signatureDecoderInstructions = BoxingInstructions.GetAncillaryBoxingInstructionsFromMethodSignature(method); Assert.NotNull(signatureDecoderInstructions); Assert.Equal(parameters.Length, signatureDecoderInstructions.Length); diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/Boxing/MethodDefinitionExtensionsTests.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/Boxing/MethodDefinitionExtensionsTests.cs index 459405fb657..783b779e5a0 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/Boxing/MethodDefinitionExtensionsTests.cs +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/Boxing/MethodDefinitionExtensionsTests.cs @@ -21,14 +21,16 @@ public class MethodDefinitionExtensionsTests [InlineData(typeof(StaticTestMethodSignatures), nameof(StaticTestMethodSignatures.ValueType_TypeSpec), 6, 17)] public void GetParameterBoxingInstructions_Captures_MemoryRegion_ForTypeSpecs(Type declaringType, string methodName, params int[] parameterSignatureLengths) { - MethodInfo method = declaringType.GetMethod(methodName); + MethodInfo? method = declaringType.GetMethod(methodName); + Assert.NotNull(method); TestCore(method, parameterSignatureLengths); } [Fact] public void GetParameterBoxingInstructions_Captures_MemoryRegion_ForTypeGenerics() { - MethodInfo method = Type.GetType($"{nameof(SampleMethods)}.GenericTestMethodSignatures`2").GetMethod("GenericParameters"); + MethodInfo? method = Type.GetType($"{nameof(SampleMethods)}.GenericTestMethodSignatures`2")?.GetMethod("GenericParameters"); + Assert.NotNull(method); int[] parameterSignatureLengths = [2, 2, 2]; TestCore(method, parameterSignatureLengths); } diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/MethodResolverTests.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/MethodResolverTests.cs index a70ffdd0f75..ae642b93c10 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/MethodResolverTests.cs +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/MethodResolverTests.cs @@ -162,7 +162,7 @@ private static MethodDescription GetMethodDescription(Type declaringType, string return new MethodDescription { ModuleName = declaringType.Module.Name, - TypeName = declaringType.FullName, + TypeName = declaringType.FullName ?? string.Empty, MethodName = methodName }; } diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/MethodSignatureTests.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/MethodSignatureTests.cs index 7d5ce63f149..b8fa7693cb2 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/MethodSignatureTests.cs +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/MethodSignatureTests.cs @@ -219,11 +219,11 @@ public void NestedStructs() => ]); private static void TestCore( - MethodInfo methodInfo, - string expectedMethodName, - string expectedDeclaringType, - string expectedDeclaringTypeModuleName, - ExpectedParameterSignature[] expectedParameters) + MethodInfo? methodInfo, + string expectedMethodName, + string expectedDeclaringType, + string expectedDeclaringTypeModuleName, + ExpectedParameterSignature[] expectedParameters) { // Arrange Assert.NotNull(methodInfo); @@ -249,9 +249,9 @@ private static void TestCore( private sealed record ExpectedParameterSignature(Type paramType) { - public string Name; + public string? Name; - public string Type; + public string? Type; public string TypeModuleName = paramType.Module.Name; diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/DebuggerDisplayFormatterTests.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/DebuggerDisplayFormatterTests.cs index 3976c944bbc..554cb756442 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/DebuggerDisplayFormatterTests.cs +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/DebuggerDisplayFormatterTests.cs @@ -28,7 +28,7 @@ private sealed class DebuggerDisplayClassWithNullField { public int Count { get; set; } - public static string NullField => null; + public static string? NullField => null; } [Theory] @@ -80,7 +80,7 @@ public void GetDebuggerDisplayFormatter_ReturnsWorkingFormatter() Count = 10 }; - FormatterFactoryResult factoryResult = DebuggerDisplayFormatter.GetDebuggerDisplayFormatter(testObj.GetType()); + FormatterFactoryResult? factoryResult = DebuggerDisplayFormatter.GetDebuggerDisplayFormatter(testObj.GetType()); Assert.NotNull(factoryResult); // Act @@ -100,7 +100,7 @@ public void GetDebuggerDisplayFormatter_FormatsNull() Count = 10 }; - FormatterFactoryResult factoryResult = DebuggerDisplayFormatter.GetDebuggerDisplayFormatter(testObj.GetType()); + FormatterFactoryResult? factoryResult = DebuggerDisplayFormatter.GetDebuggerDisplayFormatter(testObj.GetType()); Assert.NotNull(factoryResult); // Act diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/ExpressionBinderTests.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/ExpressionBinderTests.cs index cdeb5ba459e..3713ade95e3 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/ExpressionBinderTests.cs +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/ExpressionBinderTests.cs @@ -66,7 +66,7 @@ public void BindExpression(string expression, bool doesBind, object expected) } Assert.NotNull(evaluator); - object result = evaluator.Value.Evaluate(obj); + object? result = evaluator.Value.Evaluate(obj); // Assert Assert.Equal(expected, result); diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/Pipeline/CaptureLimitPolicyProbesTests.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/Pipeline/CaptureLimitPolicyProbesTests.cs index 1e196a890f3..c6943a01480 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/Pipeline/CaptureLimitPolicyProbesTests.cs +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/Pipeline/CaptureLimitPolicyProbesTests.cs @@ -88,8 +88,8 @@ public void EnterProbe_ShortCircuits_WhenLimitReached() public void CacheMethods_PassesThrough() { // Arrange - List expectedMethods = [(MethodInfo)MethodBase.GetCurrentMethod()]; - IList actualMethods = null; + List expectedMethods = [(MethodInfo)MethodBase.GetCurrentMethod()!]; + IList actualMethods = []; TaskCompletionSource requestStop = new(); CaptureLimitPolicyProbes probes = new(new TestFunctionProbes( @@ -113,7 +113,7 @@ public void EnterProbe_PassesThrough() object[] expectedArgs = [new Uri("https://www.example.com"), 10]; ulong? actualUniquifier = null; - object[] actualArgs = null; + object[] actualArgs = []; TaskCompletionSource requestStop = new(); CaptureLimitPolicyProbes probes = new(new TestFunctionProbes( diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/Pipeline/ParameterCapturingPipelineTests.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/Pipeline/ParameterCapturingPipelineTests.cs index b703a9b8641..24817351bfd 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/Pipeline/ParameterCapturingPipelineTests.cs +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/Pipeline/ParameterCapturingPipelineTests.cs @@ -21,12 +21,12 @@ namespace Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests.ParameterCap { internal sealed class TestFunctionProbesManager : IFunctionProbesManager { - private readonly Action, IFunctionProbes> _onStart; - private readonly Action _onStop; + private readonly Action, IFunctionProbes>? _onStart; + private readonly Action? _onStop; - public event EventHandler OnProbeFault; + public event EventHandler? OnProbeFault; - public TestFunctionProbesManager(Action, IFunctionProbes> onStart = null, Action onStop = null) + public TestFunctionProbesManager(Action, IFunctionProbes>? onStart = null, Action? onStop = null) { _onStart = onStart; _onStop = onStop; @@ -57,16 +57,16 @@ public void Dispose() internal sealed class TestParameterCapturingCallbacks : IParameterCapturingPipelineCallbacks { - private readonly Action> _onCapturingStart; - private readonly Action _onCapturingStop; - private readonly Action _onCapturingFailed; - private readonly Action _onProbeFault; + private readonly Action>? _onCapturingStart; + private readonly Action? _onCapturingStop; + private readonly Action? _onCapturingFailed; + private readonly Action? _onProbeFault; public TestParameterCapturingCallbacks( - Action> onCapturingStart = null, - Action onCapturingStop = null, - Action onCapturingFailed = null, - Action onProbeFault = null) + Action>? onCapturingStart = null, + Action? onCapturingStop = null, + Action? onCapturingFailed = null, + Action? onProbeFault = null) { _onCapturingStart = onCapturingStart; _onCapturingStop = onCapturingStop; @@ -97,8 +97,8 @@ public void ProbeFault(Guid requestId, InstrumentedMethod faultingMethod) internal sealed class TestMethodDescriptionValidator : IMethodDescriptionValidator { - private readonly Func _onValidateMethods; - public TestMethodDescriptionValidator(Func onValidateMethods = null) + private readonly Func? _onValidateMethods; + public TestMethodDescriptionValidator(Func? onValidateMethods = null) { _onValidateMethods = onValidateMethods; } @@ -476,7 +476,7 @@ private StartCapturingParametersPayload CreateStartCapturingPayload(TimeSpan dur string moduleName = typeof(ParameterCapturingPipelineTests).Module.Name; Assert.NotNull(moduleName); - string typeName = typeof(ParameterCapturingPipelineTests).FullName; + string? typeName = typeof(ParameterCapturingPipelineTests).FullName; Assert.NotNull(typeName); return new StartCapturingParametersPayload() diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/Pipeline/TestFunctionProbes.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/Pipeline/TestFunctionProbes.cs index 664e6a84473..012b5b7f6dc 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/Pipeline/TestFunctionProbes.cs +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/Pipeline/TestFunctionProbes.cs @@ -10,10 +10,10 @@ namespace Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests.ParameterCap { internal sealed class TestFunctionProbes : IFunctionProbes { - private readonly Func _onEnterProbe; - private readonly Action> _onCacheMethods; + private readonly Func? _onEnterProbe; + private readonly Action>? _onCacheMethods; - public TestFunctionProbes(Func onEnterProbe = null, Action> onCacheMethods = null) + public TestFunctionProbes(Func? onEnterProbe = null, Action>? onCacheMethods = null) { _onEnterProbe = onEnterProbe; _onCacheMethods = onCacheMethods; diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/SampleMethods.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/SampleMethods.cs index e12eef7f172..f262658d303 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/SampleMethods.cs +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/SampleMethods.cs @@ -79,7 +79,7 @@ public static string ExceptionRegionAtBeginningOfMethod(object myObject) { try { - return myObject.ToString(); + return myObject.ToString() ?? string.Empty; } catch { From 4e7f72655aea8f2829ec9e11d8ecbc62cd6a6a34 Mon Sep 17 00:00:00 2001 From: Claudiu Guiman Date: Wed, 22 May 2024 12:03:42 -0400 Subject: [PATCH 006/107] Introduce BackgroundService utility class in StartupHook (#6655) * Introduce BackgroundService utility class in StartupHook * Add ConfigureAwait(false) * Refactor BackgroundService to expose the executing task * Add SafeCancel * PR feedback * Rename tests --- .../ParameterCapturingService.cs | 2 +- .../BackgroundService.cs | 62 +++++++++ .../BackgroundServiceTests.cs | 129 ++++++++++++++++++ .../MockBackgroundService.cs | 38 ++++++ 4 files changed, 230 insertions(+), 1 deletion(-) create mode 100644 src/Microsoft.Diagnostics.Monitoring.StartupHook/BackgroundService.cs create mode 100644 src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/BackgroundService/BackgroundServiceTests.cs create mode 100644 src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/BackgroundService/MockBackgroundService.cs diff --git a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ParameterCapturingService.cs b/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ParameterCapturingService.cs index c2ac32665fa..d8b1aadcb68 100644 --- a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ParameterCapturingService.cs +++ b/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ParameterCapturingService.cs @@ -9,13 +9,13 @@ using Microsoft.Diagnostics.Tools.Monitor.ParameterCapturing; using Microsoft.Diagnostics.Tools.Monitor.Profiler; using Microsoft.Diagnostics.Tools.Monitor.StartupHook; -using Microsoft.Extensions.Hosting; using System; using System.Collections.Generic; using System.Globalization; using System.Reflection; using System.Threading; using System.Threading.Tasks; +using BackgroundService = Microsoft.Extensions.Hosting.BackgroundService; namespace Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing { diff --git a/src/Microsoft.Diagnostics.Monitoring.StartupHook/BackgroundService.cs b/src/Microsoft.Diagnostics.Monitoring.StartupHook/BackgroundService.cs new file mode 100644 index 00000000000..9a2d43b8210 --- /dev/null +++ b/src/Microsoft.Diagnostics.Monitoring.StartupHook/BackgroundService.cs @@ -0,0 +1,62 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Threading; +using System.Threading.Tasks; + +namespace Microsoft.Diagnostics.Monitoring.StartupHook +{ + internal abstract class BackgroundService : IDisposable + { + private readonly CancellationTokenSource _cts = new(); + private long _disposedState; + + public Task? ExecutingTask { get; private set; } + + public void Start() + { + ExecutingTask = Task.Run(async () => + { + await ExecuteAsync(_cts.Token).ConfigureAwait(false); + }, _cts.Token); + } + + public void Stop() + { + SafeCancel(); + + try + { + ExecutingTask?.Wait(TimeSpan.FromSeconds(1)); + } + catch + { + // ignore + } + } + + public virtual void Dispose() + { + if (!DisposableHelper.CanDispose(ref _disposedState)) + return; + + SafeCancel(); + _cts.Dispose(); + } + + private void SafeCancel() + { + try + { + _cts.Cancel(); + } + catch (AggregateException) + { + // Ignore all exceptions thrown by registered callbacks on the associated CancellationToken. + } + } + + protected abstract Task ExecuteAsync(CancellationToken stoppingToken); + } +} diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/BackgroundService/BackgroundServiceTests.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/BackgroundService/BackgroundServiceTests.cs new file mode 100644 index 00000000000..bd4be15f272 --- /dev/null +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/BackgroundService/BackgroundServiceTests.cs @@ -0,0 +1,129 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using Microsoft.Diagnostics.Monitoring.TestCommon; +using System; +using System.Threading; +using System.Threading.Tasks; +using Xunit; + +namespace Microsoft.Diagnostics.Monitoring.StartupHook +{ + [TargetFrameworkMonikerTrait(TargetFrameworkMonikerExtensions.CurrentTargetFrameworkMoniker)] + public sealed class BackgroundServiceTests + { + [Fact] + public void ConstructionWorks() + { + using BackgroundService _ = new MockBackgroundService(); + } + + [Fact] + public async Task Start_RunsBackgroundTask() + { + // Arrange + using CancellationTokenSource cts = new(CommonTestTimeouts.GeneralTimeout); + using MockBackgroundService service = new MockBackgroundService(); + + // Act + service.Start(); + + // Assert + await service.BackgroundTaskStarted.Task.WaitAsync(cts.Token); + } + + [Fact] + public async Task Stop_TriggersCancellation() + { + // Arrange + using CancellationTokenSource cts = new(CommonTestTimeouts.GeneralTimeout); + using MockBackgroundService service = new MockBackgroundService(async (CancellationToken stoppingToken) => + { + await Task.Delay(Timeout.Infinite, stoppingToken); + }); + + // Act + service.Start(); + await service.BackgroundTaskStarted.Task.WaitAsync(cts.Token); + service.Stop(); + + // Assert + Assert.NotNull(service.ExecutingTask); + await Assert.ThrowsAnyAsync(() => service.ExecutingTask); + } + + [Fact] + public async Task Stop_WaitsForTheBackgroundTask() + { + // Arrange + using CancellationTokenSource cts = new(CommonTestTimeouts.GeneralTimeout); + object lockObj = new(); + bool stopCompleted = false; + bool taskCompleted = false; + TaskCompletionSource backgroundTaskCompletion = new(TaskCreationOptions.RunContinuationsAsynchronously); + TaskCompletionSource beforeStopCompletion = new(TaskCreationOptions.RunContinuationsAsynchronously); + + MockBackgroundService service = new MockBackgroundService(async _ => + { + await backgroundTaskCompletion.Task.WaitAsync(cts.Token); + lock (lockObj) + { + Assert.False(stopCompleted, "Stop completed before the background task."); + taskCompleted = true; + } + }); + + // Act + service.Start(); + await service.BackgroundTaskStarted.Task.WaitAsync(cts.Token); + + Task stopTask = Task.Run(async () => + { + await Task.Yield(); + beforeStopCompletion.SetResult(); + service.Stop(); + + lock (lockObj) + { + Assert.True(taskCompleted, "Stop completed before the background task."); + stopCompleted = true; + } + }); + + await beforeStopCompletion.Task.WaitAsync(cts.Token); + // Wait a bit to ensure Stop() is waiting for the background task to complete + await Task.Delay(TimeSpan.FromMilliseconds(100)); + + backgroundTaskCompletion.SetResult(); + + await stopTask.WaitAsync(cts.Token); + + // Assert + Assert.NotNull(service.ExecutingTask); + Assert.False(service.ExecutingTask.IsFaulted); + } + + [Fact] + public async Task WorkerThrows_TaskExceptionIsCaptured() + { + // Arrange + using CancellationTokenSource cts = new(CommonTestTimeouts.GeneralTimeout); + MockBackgroundService service = new MockBackgroundService(async _ => + { + await Task.Yield(); + throw new NotImplementedException(); + }); + + // Act + service.Start(); + await service.BackgroundTaskStarted.Task.WaitAsync(cts.Token); + + service.Stop(); + service.Dispose(); + + // Assert + Assert.NotNull(service.ExecutingTask); + await Assert.ThrowsAsync(() => service.ExecutingTask); + } + } +} diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/BackgroundService/MockBackgroundService.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/BackgroundService/MockBackgroundService.cs new file mode 100644 index 00000000000..b750d6a4247 --- /dev/null +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/BackgroundService/MockBackgroundService.cs @@ -0,0 +1,38 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Threading; +using System.Threading.Tasks; + +namespace Microsoft.Diagnostics.Monitoring.StartupHook +{ + internal sealed class MockBackgroundService : BackgroundService, IDisposable + { + private readonly Func _backgroundFunc; + + public MockBackgroundService() + { + _backgroundFunc = _ => Task.CompletedTask; + } + + public MockBackgroundService(Func backgroundFunc) + { + _backgroundFunc = backgroundFunc; + } + + protected override async Task ExecuteAsync(CancellationToken stoppingToken) + { + BackgroundTaskStarted.SetResult(); + + await _backgroundFunc(stoppingToken); + } + + public override void Dispose() + { + base.Dispose(); + } + + public TaskCompletionSource BackgroundTaskStarted { get; } = new(TaskCreationOptions.RunContinuationsAsynchronously); + } +} From e880a5faa368572fed54f3f31d080e1cbd345c39 Mon Sep 17 00:00:00 2001 From: Claudiu Guiman Date: Wed, 29 May 2024 17:49:41 -0400 Subject: [PATCH 007/107] Refactor FunctionProbesTests to use the AppRunner instead of ScenarioRunner in net7 or higher tests (#6744) --- .../FunctionProbesTests.cs | 50 ++++++++++++++++--- 1 file changed, 44 insertions(+), 6 deletions(-) diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests/FunctionProbesTests.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests/FunctionProbesTests.cs index b087474d61a..df567693153 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests/FunctionProbesTests.cs +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests/FunctionProbesTests.cs @@ -2,20 +2,26 @@ // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.Diagnostics.Monitoring.TestCommon; -using Microsoft.Diagnostics.Monitoring.TestCommon.Options; +using Microsoft.Diagnostics.Monitoring.TestCommon.Runners; using Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests.Fixtures; -using Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests.Runners; -using Microsoft.Diagnostics.Monitoring.WebApi; +using Microsoft.Diagnostics.Tools.Monitor.HostingStartup; using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; using System.Collections.Generic; using System.Linq; using System.Net.Http; +using System.Reflection; using System.Runtime.InteropServices; using System.Threading.Tasks; using Xunit; using Xunit.Abstractions; +#if !NET7_0_OR_GREATER +using Microsoft.Diagnostics.Monitoring.TestCommon.Options; +using Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests.Runners; +using Microsoft.Diagnostics.Monitoring.WebApi; +using Microsoft.Extensions.Logging; +#endif + namespace Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests { [TargetFrameworkMonikerTrait(TargetFrameworkMonikerExtensions.CurrentTargetFrameworkMoniker)] @@ -38,7 +44,6 @@ public FunctionProbesTests(ITestOutputHelper outputHelper, ServiceProviderFixtur public static IEnumerable GetAllTestScenarios() { List arguments = new(); - IEnumerable testArchitectures = ProfilerHelper.GetArchitecture(); List commands = typeof(TestAppScenarios.FunctionProbes.SubScenarios).GetFields(System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static) .Select(p => p.Name) @@ -57,9 +62,41 @@ public static IEnumerable GetAllTestScenarios() return arguments; } +#if !NET7_0_OR_GREATER + [Theory(Skip ="This test installs the mutating profiler which is not enabled on net6 or lower.")] +#else [Theory] +#endif [MemberData(nameof(FunctionProbesTests.GetAllTestScenarios), MemberType = typeof(FunctionProbesTests))] public async Task RunTestScenario(Architecture targetArchitecture, string subScenario) + { + await using AppRunner appRunner = new(_outputHelper, Assembly.GetExecutingAssembly()) + { + Architecture = targetArchitecture, + ScenarioName = TestAppScenarios.FunctionProbes.Name, + SubScenarioName = subScenario + }; + + // Enable the mutating profiler + string profilerPath = NativeLibraryHelper.GetSharedLibraryPath(targetArchitecture, ProfilerIdentifiers.MutatingProfiler.LibraryRootFileName); + appRunner.Environment.Add(ProfilerHelper.ClrEnvVarEnableNotificationProfilers, ProfilerHelper.ClrEnvVarEnabledValue); + appRunner.Environment.Add(ProfilerHelper.ClrEnvVarEnableProfiling, ProfilerHelper.ClrEnvVarEnabledValue); + appRunner.Environment.Add(ProfilerHelper.ClrEnvVarProfiler, ProfilerIdentifiers.MutatingProfiler.Clsid.StringWithBraces); + appRunner.Environment.Add(ProfilerHelper.ClrEnvVarProfilerPath, profilerPath); + appRunner.Environment.Add(ProfilerIdentifiers.MutatingProfiler.EnvironmentVariables.ModulePath, profilerPath); + + // The profiler checks this env variable to enable parameter capturing features. + appRunner.Environment.Add(InProcessFeaturesIdentifiers.EnvironmentVariables.ParameterCapturing.Enable, "1"); + + await appRunner.ExecuteAsync(() => Task.CompletedTask); + + Assert.Equal(0, appRunner.ExitCode); + } + +#if !NET7_0_OR_GREATER + [Theory] + [MemberData(nameof(ProfilerHelper.GetArchitecture), MemberType = typeof(ProfilerHelper))] + public async Task ValidateProfilerIsNotInstalledOnNet6(Architecture targetArchitecture) { await ScenarioRunner.SingleTarget( _outputHelper, @@ -80,7 +117,8 @@ await ScenarioRunner.SingleTarget( }; }, profilerLogLevel: LogLevel.Trace, - subScenarioName: subScenario); + subScenarioName: TestAppScenarios.FunctionProbes.SubScenarios.ValidateNoMutatingProfiler); } +#endif // NET7_0_OR_GREATER } } From 2f5379b3774e8f9332553e06b986bb2d5e25fe00 Mon Sep 17 00:00:00 2001 From: Claudiu Guiman Date: Thu, 30 May 2024 12:37:57 -0400 Subject: [PATCH 008/107] Move the ParameterCapturing code in StartupHook (#6707) * Move the ParameterCapturing code in StartupHook * fix string resource --- .../HostingStartup.cs | 7 +----- .../DiagnosticsBootstrapper.cs | 10 ++++++++ ....Diagnostics.Monitoring.StartupHook.csproj | 16 +++++++++++++ .../Boxing/BoxingInstructions.cs | 4 ++-- .../Boxing/BoxingTokensSignatureProvider.cs | 4 ++-- .../Boxing/MethodDefinitionExtensions.cs | 4 ++-- .../DeniedMethodsException.cs | 2 +- .../AsyncParameterCapturingEventSource.cs | 3 +-- .../Eventing/ParameterCapturingEventSource.cs | 2 +- .../EventSourceEmittingProbes.cs | 6 ++--- .../FunctionProbes/FunctionProbesManager.cs | 9 ++++--- .../FunctionProbes/FunctionProbesState.cs | 2 +- .../FunctionProbes/FunctionProbesStub.cs | 3 +-- .../FunctionProbes/IFunctionProbes.cs | 2 +- .../FunctionProbes/IFunctionProbesManager.cs | 2 +- .../FunctionProbes/InstrumentedMethod.cs | 4 ++-- .../FunctionProbes/ProfilerAbi.cs | 2 +- .../IMethodDescriptionValidator.cs | 2 +- .../MethodDescriptionValidator.cs | 2 +- .../MethodInfoExtensions.cs | 2 +- .../ParameterCapturing/MethodResolver.cs | 2 +- .../ParameterCapturing/MethodSignature.cs | 2 +- .../DebuggerDisplayFormatter.cs | 4 ++-- .../DebuggerDisplay/DebuggerDisplayParser.cs | 2 +- .../DebuggerDisplay/ExpressionBinder.cs | 4 ++-- .../Formatters/RuntimeFormatters.cs | 2 +- .../ObjectFormatting/ObjectFormatter.cs | 2 +- .../ObjectFormatting/ObjectFormatterCache.cs | 2 +- .../ObjectFormatterFactory.cs | 4 ++-- .../ParameterCapturingService.cs | 10 ++++---- .../ParameterCapturingStrings.Designer.cs | 6 ++--- .../ParameterCapturingStrings.resx | 0 .../ParameterCapturing/ParameterSignature.cs | 2 +- .../Pipeline/CaptureLimitPolicyProbes.cs | 4 ++-- .../IParameterCapturingPipelineCallbacks.cs | 2 +- .../Pipeline/ParameterCapturingPipeline.cs | 4 ++-- .../Pipeline/TooManyRequestsException.cs | 2 +- .../ResolvedParameterInfo.cs | 4 ++-- .../ParameterCapturing/TypeUtils.cs | 2 +- .../UnresolvedMethodsException.cs | 2 +- .../Boxing/BoxingInstructionsTests.cs | 8 +++---- .../Boxing/MethodDefinitionExtensionsTests.cs | 6 ++--- .../FunctionProbes/ProfilerAbiTests.cs | 4 ++-- .../ParameterCapturing/MethodResolverTests.cs | 6 ++--- .../MethodSignatureTests.cs | 4 ++-- .../DebuggerDisplayFormatterTests.cs | 12 ++++++---- .../DebuggerDisplayParserTests.cs | 8 +++---- .../DebuggerDisplay/ExpressionBinderTests.cs | 6 ++--- .../Formatters/RuntimeFormattersTests.cs | 4 ++-- .../ObjectFormatterFactoryTests.cs | 4 ++-- .../ObjectFormatting/ObjectFormatterTests.cs | 4 ++-- .../Pipeline/CaptureLimitPolicyProbesTests.cs | 4 ++-- .../ParameterCapturingPipelineTests.cs | 10 ++++---- .../Pipeline/TestFunctionProbes.cs | 4 ++-- .../ParameterCapturing/SampleMethods.cs | 0 .../ParameterCapturing/TypeUtilsTests.cs | 4 ++-- .../ParameterCapturingTests.cs | 24 +++++-------------- ....Diagnostics.Monitoring.UnitTestApp.csproj | 3 ++- .../FunctionProbes/FunctionProbesScenario.cs | 4 ++-- .../FunctionProbes/PerFunctionProbeProxy.cs | 2 +- .../Scenarios/ParameterCapturingScenario.cs | 3 +++ .../CaptureParametersOperation.cs | 6 ++--- src/Tools/dotnet-monitor/Strings.Designer.cs | 18 +++++++------- src/Tools/dotnet-monitor/Strings.resx | 6 ++--- 64 files changed, 157 insertions(+), 147 deletions(-) rename src/{Microsoft.Diagnostics.Monitoring.HostingStartup => Microsoft.Diagnostics.Monitoring.StartupHook}/ParameterCapturing/Boxing/BoxingInstructions.cs (98%) rename src/{Microsoft.Diagnostics.Monitoring.HostingStartup => Microsoft.Diagnostics.Monitoring.StartupHook}/ParameterCapturing/Boxing/BoxingTokensSignatureProvider.cs (94%) rename src/{Microsoft.Diagnostics.Monitoring.HostingStartup => Microsoft.Diagnostics.Monitoring.StartupHook}/ParameterCapturing/Boxing/MethodDefinitionExtensions.cs (97%) rename src/{Microsoft.Diagnostics.Monitoring.HostingStartup => Microsoft.Diagnostics.Monitoring.StartupHook}/ParameterCapturing/DeniedMethodsException.cs (93%) rename src/{Microsoft.Diagnostics.Monitoring.HostingStartup => Microsoft.Diagnostics.Monitoring.StartupHook}/ParameterCapturing/Eventing/AsyncParameterCapturingEventSource.cs (96%) rename src/{Microsoft.Diagnostics.Monitoring.HostingStartup => Microsoft.Diagnostics.Monitoring.StartupHook}/ParameterCapturing/Eventing/ParameterCapturingEventSource.cs (98%) rename src/{Microsoft.Diagnostics.Monitoring.HostingStartup => Microsoft.Diagnostics.Monitoring.StartupHook}/ParameterCapturing/FunctionProbes/EventSourceEmittingProbes.cs (93%) rename src/{Microsoft.Diagnostics.Monitoring.HostingStartup => Microsoft.Diagnostics.Monitoring.StartupHook}/ParameterCapturing/FunctionProbes/FunctionProbesManager.cs (97%) rename src/{Microsoft.Diagnostics.Monitoring.HostingStartup => Microsoft.Diagnostics.Monitoring.StartupHook}/ParameterCapturing/FunctionProbes/FunctionProbesState.cs (86%) rename src/{Microsoft.Diagnostics.Monitoring.HostingStartup => Microsoft.Diagnostics.Monitoring.StartupHook}/ParameterCapturing/FunctionProbes/FunctionProbesStub.cs (89%) rename src/{Microsoft.Diagnostics.Monitoring.HostingStartup => Microsoft.Diagnostics.Monitoring.StartupHook}/ParameterCapturing/FunctionProbes/IFunctionProbes.cs (88%) rename src/{Microsoft.Diagnostics.Monitoring.HostingStartup => Microsoft.Diagnostics.Monitoring.StartupHook}/ParameterCapturing/FunctionProbes/IFunctionProbesManager.cs (86%) rename src/{Microsoft.Diagnostics.Monitoring.HostingStartup => Microsoft.Diagnostics.Monitoring.StartupHook}/ParameterCapturing/FunctionProbes/InstrumentedMethod.cs (93%) rename src/{Microsoft.Diagnostics.Monitoring.HostingStartup => Microsoft.Diagnostics.Monitoring.StartupHook}/ParameterCapturing/FunctionProbes/ProfilerAbi.cs (95%) rename src/{Microsoft.Diagnostics.Monitoring.HostingStartup => Microsoft.Diagnostics.Monitoring.StartupHook}/ParameterCapturing/IMethodDescriptionValidator.cs (83%) rename src/{Microsoft.Diagnostics.Monitoring.HostingStartup => Microsoft.Diagnostics.Monitoring.StartupHook}/ParameterCapturing/MethodDescriptionValidator.cs (93%) rename src/{Microsoft.Diagnostics.Monitoring.HostingStartup => Microsoft.Diagnostics.Monitoring.StartupHook}/ParameterCapturing/MethodInfoExtensions.cs (91%) rename src/{Microsoft.Diagnostics.Monitoring.HostingStartup => Microsoft.Diagnostics.Monitoring.StartupHook}/ParameterCapturing/MethodResolver.cs (98%) rename src/{Microsoft.Diagnostics.Monitoring.HostingStartup => Microsoft.Diagnostics.Monitoring.StartupHook}/ParameterCapturing/MethodSignature.cs (98%) rename src/{Microsoft.Diagnostics.Monitoring.HostingStartup => Microsoft.Diagnostics.Monitoring.StartupHook}/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/DebuggerDisplayFormatter.cs (92%) rename src/{Microsoft.Diagnostics.Monitoring.HostingStartup => Microsoft.Diagnostics.Monitoring.StartupHook}/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/DebuggerDisplayParser.cs (98%) rename src/{Microsoft.Diagnostics.Monitoring.HostingStartup => Microsoft.Diagnostics.Monitoring.StartupHook}/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/ExpressionBinder.cs (97%) rename src/{Microsoft.Diagnostics.Monitoring.HostingStartup => Microsoft.Diagnostics.Monitoring.StartupHook}/ParameterCapturing/ObjectFormatting/Formatters/RuntimeFormatters.cs (93%) rename src/{Microsoft.Diagnostics.Monitoring.HostingStartup => Microsoft.Diagnostics.Monitoring.StartupHook}/ParameterCapturing/ObjectFormatting/ObjectFormatter.cs (97%) rename src/{Microsoft.Diagnostics.Monitoring.HostingStartup => Microsoft.Diagnostics.Monitoring.StartupHook}/ParameterCapturing/ObjectFormatting/ObjectFormatterCache.cs (95%) rename src/{Microsoft.Diagnostics.Monitoring.HostingStartup => Microsoft.Diagnostics.Monitoring.StartupHook}/ParameterCapturing/ObjectFormatting/ObjectFormatterFactory.cs (88%) rename src/{Microsoft.Diagnostics.Monitoring.HostingStartup => Microsoft.Diagnostics.Monitoring.StartupHook}/ParameterCapturing/ParameterCapturingService.cs (94%) rename src/{Microsoft.Diagnostics.Monitoring.HostingStartup => Microsoft.Diagnostics.Monitoring.StartupHook}/ParameterCapturing/ParameterCapturingStrings.Designer.cs (95%) rename src/{Microsoft.Diagnostics.Monitoring.HostingStartup => Microsoft.Diagnostics.Monitoring.StartupHook}/ParameterCapturing/ParameterCapturingStrings.resx (100%) rename src/{Microsoft.Diagnostics.Monitoring.HostingStartup => Microsoft.Diagnostics.Monitoring.StartupHook}/ParameterCapturing/ParameterSignature.cs (80%) rename src/{Microsoft.Diagnostics.Monitoring.HostingStartup => Microsoft.Diagnostics.Monitoring.StartupHook}/ParameterCapturing/Pipeline/CaptureLimitPolicyProbes.cs (90%) rename src/{Microsoft.Diagnostics.Monitoring.HostingStartup => Microsoft.Diagnostics.Monitoring.StartupHook}/ParameterCapturing/Pipeline/IParameterCapturingPipelineCallbacks.cs (89%) rename src/{Microsoft.Diagnostics.Monitoring.HostingStartup => Microsoft.Diagnostics.Monitoring.StartupHook}/ParameterCapturing/Pipeline/ParameterCapturingPipeline.cs (98%) rename src/{Microsoft.Diagnostics.Monitoring.HostingStartup => Microsoft.Diagnostics.Monitoring.StartupHook}/ParameterCapturing/Pipeline/TooManyRequestsException.cs (78%) rename src/{Microsoft.Diagnostics.Monitoring.HostingStartup => Microsoft.Diagnostics.Monitoring.StartupHook}/ParameterCapturing/ResolvedParameterInfo.cs (68%) rename src/{Microsoft.Diagnostics.Monitoring.HostingStartup => Microsoft.Diagnostics.Monitoring.StartupHook}/ParameterCapturing/TypeUtils.cs (93%) rename src/{Microsoft.Diagnostics.Monitoring.HostingStartup => Microsoft.Diagnostics.Monitoring.StartupHook}/ParameterCapturing/UnresolvedMethodsException.cs (93%) rename src/Tests/{Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests => Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests}/ParameterCapturing/Boxing/BoxingInstructionsTests.cs (97%) rename src/Tests/{Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests => Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests}/ParameterCapturing/Boxing/MethodDefinitionExtensionsTests.cs (91%) rename src/Tests/{Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests => Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests}/ParameterCapturing/FunctionProbes/ProfilerAbiTests.cs (87%) rename src/Tests/{Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests => Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests}/ParameterCapturing/MethodResolverTests.cs (96%) rename src/Tests/{Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests => Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests}/ParameterCapturing/MethodSignatureTests.cs (98%) rename src/Tests/{Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests => Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests}/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/DebuggerDisplayFormatterTests.cs (85%) rename src/Tests/{Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests => Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests}/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/DebuggerDisplayParserTests.cs (89%) rename src/Tests/{Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests => Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests}/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/ExpressionBinderTests.cs (86%) rename src/Tests/{Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests => Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests}/ParameterCapturing/ObjectFormatting/Formatters/RuntimeFormattersTests.cs (93%) rename src/Tests/{Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests => Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests}/ParameterCapturing/ObjectFormatting/ObjectFormatterFactoryTests.cs (86%) rename src/Tests/{Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests => Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests}/ParameterCapturing/ObjectFormatting/ObjectFormatterTests.cs (92%) rename src/Tests/{Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests => Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests}/ParameterCapturing/Pipeline/CaptureLimitPolicyProbesTests.cs (95%) rename src/Tests/{Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests => Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests}/ParameterCapturing/Pipeline/ParameterCapturingPipelineTests.cs (97%) rename src/Tests/{Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests => Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests}/ParameterCapturing/Pipeline/TestFunctionProbes.cs (84%) rename src/Tests/{Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests => Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests}/ParameterCapturing/SampleMethods.cs (100%) rename src/Tests/{Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests => Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests}/ParameterCapturing/TypeUtilsTests.cs (86%) diff --git a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/HostingStartup.cs b/src/Microsoft.Diagnostics.Monitoring.HostingStartup/HostingStartup.cs index 13fa379d089..91ea0e08644 100644 --- a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/HostingStartup.cs +++ b/src/Microsoft.Diagnostics.Monitoring.HostingStartup/HostingStartup.cs @@ -3,10 +3,8 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.Diagnostics.Monitoring.HostingStartup; -using Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing; using Microsoft.Diagnostics.Tools.Monitor; using Microsoft.Diagnostics.Tools.Monitor.HostingStartup; -using Microsoft.Extensions.DependencyInjection; using System.Threading; [assembly: HostingStartup(typeof(HostingStartup))] @@ -24,10 +22,7 @@ public void Configure(IWebHostBuilder builder) // validation in tests. Interlocked.Increment(ref InvocationCount); - if (ToolIdentifiers.IsEnvVarEnabled(InProcessFeaturesIdentifiers.EnvironmentVariables.ParameterCapturing.Enable)) - { - services.AddHostedService(); - } + // TODO: remove the HostingStartup project. }); ToolIdentifiers.EnableEnvVar(InProcessFeaturesIdentifiers.EnvironmentVariables.AvailableInfrastructure.HostingStartup); diff --git a/src/Microsoft.Diagnostics.Monitoring.StartupHook/DiagnosticsBootstrapper.cs b/src/Microsoft.Diagnostics.Monitoring.StartupHook/DiagnosticsBootstrapper.cs index 414c677e5b3..66d06861518 100644 --- a/src/Microsoft.Diagnostics.Monitoring.StartupHook/DiagnosticsBootstrapper.cs +++ b/src/Microsoft.Diagnostics.Monitoring.StartupHook/DiagnosticsBootstrapper.cs @@ -3,6 +3,7 @@ using Microsoft.Diagnostics.Monitoring.StartupHook.Exceptions; using Microsoft.Diagnostics.Monitoring.StartupHook.Monitoring; +using Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing; using Microsoft.Diagnostics.Tools.Monitor; using Microsoft.Diagnostics.Tools.Monitor.HostingStartup; using Microsoft.Diagnostics.Tools.Monitor.Profiler; @@ -18,6 +19,7 @@ internal sealed class DiagnosticsBootstrapper : { private readonly CurrentAppDomainExceptionProcessor _exceptionProcessor; private readonly AspNetHostingStartupLoader? _hostingStartupLoader; + private readonly ParameterCapturingService? _parameterCapturingService; private long _disposedState; @@ -44,6 +46,12 @@ public DiagnosticsBootstrapper() new MessageDispatcher.ProfilerMessageSource(CommandSet.StartupHook)); ToolIdentifiers.EnableEnvVar(InProcessFeaturesIdentifiers.EnvironmentVariables.AvailableInfrastructure.ManagedMessaging); } + + if (ToolIdentifiers.IsEnvVarEnabled(InProcessFeaturesIdentifiers.EnvironmentVariables.ParameterCapturing.Enable)) + { + _parameterCapturingService = new(); + _parameterCapturingService.Start(); + } } catch { @@ -58,6 +66,8 @@ public void Dispose() return; _exceptionProcessor.Dispose(); + _parameterCapturingService?.Stop(); + _parameterCapturingService?.Dispose(); _hostingStartupLoader?.Dispose(); SharedInternals.MessageDispatcher?.Dispose(); } diff --git a/src/Microsoft.Diagnostics.Monitoring.StartupHook/Microsoft.Diagnostics.Monitoring.StartupHook.csproj b/src/Microsoft.Diagnostics.Monitoring.StartupHook/Microsoft.Diagnostics.Monitoring.StartupHook.csproj index 0311295165c..8459975bcf3 100644 --- a/src/Microsoft.Diagnostics.Monitoring.StartupHook/Microsoft.Diagnostics.Monitoring.StartupHook.csproj +++ b/src/Microsoft.Diagnostics.Monitoring.StartupHook/Microsoft.Diagnostics.Monitoring.StartupHook.csproj @@ -17,6 +17,7 @@ + @@ -32,4 +33,19 @@ + + + True + True + ParameterCapturingStrings.resx + + + + + + ResXFileCodeGenerator + ParameterCapturingStrings.Designer.cs + + + diff --git a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/Boxing/BoxingInstructions.cs b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/Boxing/BoxingInstructions.cs similarity index 98% rename from src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/Boxing/BoxingInstructions.cs rename to src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/Boxing/BoxingInstructions.cs index 6f4dfa23120..10c049d724b 100644 --- a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/Boxing/BoxingInstructions.cs +++ b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/Boxing/BoxingInstructions.cs @@ -1,14 +1,14 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.FunctionProbes; +using Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.FunctionProbes; using System; using System.Diagnostics; using System.Reflection; using System.Reflection.Metadata; using System.Reflection.Metadata.Ecma335; -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.Boxing +namespace Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.Boxing { internal static class BoxingInstructions { diff --git a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/Boxing/BoxingTokensSignatureProvider.cs b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/Boxing/BoxingTokensSignatureProvider.cs similarity index 94% rename from src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/Boxing/BoxingTokensSignatureProvider.cs rename to src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/Boxing/BoxingTokensSignatureProvider.cs index 010129a8756..11b8d0c4366 100644 --- a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/Boxing/BoxingTokensSignatureProvider.cs +++ b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/Boxing/BoxingTokensSignatureProvider.cs @@ -1,12 +1,12 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.FunctionProbes; +using Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.FunctionProbes; using System.Collections.Immutable; using System.Reflection.Metadata; using System.Reflection.Metadata.Ecma335; -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.Boxing +namespace Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.Boxing { /// /// This decoder is made specifically for parameters of the following types: diff --git a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/Boxing/MethodDefinitionExtensions.cs b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/Boxing/MethodDefinitionExtensions.cs similarity index 97% rename from src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/Boxing/MethodDefinitionExtensions.cs rename to src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/Boxing/MethodDefinitionExtensions.cs index 307bdac6629..9758230fdfd 100644 --- a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/Boxing/MethodDefinitionExtensions.cs +++ b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/Boxing/MethodDefinitionExtensions.cs @@ -1,14 +1,14 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.FunctionProbes; +using Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.FunctionProbes; using System; using System.Collections.Immutable; using System.Diagnostics; using System.Reflection.Metadata; using System.Reflection.Metadata.Ecma335; -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.Boxing +namespace Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.Boxing { internal static class MethodDefinitionExtensions { diff --git a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/DeniedMethodsException.cs b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/DeniedMethodsException.cs similarity index 93% rename from src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/DeniedMethodsException.cs rename to src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/DeniedMethodsException.cs index b8b3675945a..bb433ca9f7b 100644 --- a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/DeniedMethodsException.cs +++ b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/DeniedMethodsException.cs @@ -7,7 +7,7 @@ using System.Globalization; using System.Text; -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing +namespace Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing { internal sealed class DeniedMethodsException : ArgumentException { diff --git a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/Eventing/AsyncParameterCapturingEventSource.cs b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/Eventing/AsyncParameterCapturingEventSource.cs similarity index 96% rename from src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/Eventing/AsyncParameterCapturingEventSource.cs rename to src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/Eventing/AsyncParameterCapturingEventSource.cs index c034a77fa48..4dbcfdf9e86 100644 --- a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/Eventing/AsyncParameterCapturingEventSource.cs +++ b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/Eventing/AsyncParameterCapturingEventSource.cs @@ -1,13 +1,12 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using Microsoft.Diagnostics.Monitoring.StartupHook; using System; using System.Collections.Concurrent; using System.Diagnostics; using System.Threading; -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.Eventing +namespace Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.Eventing { internal sealed class AsyncParameterCapturingEventSource : IDisposable { diff --git a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/Eventing/ParameterCapturingEventSource.cs b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/Eventing/ParameterCapturingEventSource.cs similarity index 98% rename from src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/Eventing/ParameterCapturingEventSource.cs rename to src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/Eventing/ParameterCapturingEventSource.cs index 49460e11446..c1e81fbccd8 100644 --- a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/Eventing/ParameterCapturingEventSource.cs +++ b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/Eventing/ParameterCapturingEventSource.cs @@ -9,7 +9,7 @@ using System.Reflection; using static Microsoft.Diagnostics.Tools.Monitor.ParameterCapturing.ParameterCapturingEvents; -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.Eventing +namespace Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.Eventing { [EventSource(Name = ParameterCapturingEvents.SourceName)] internal sealed class ParameterCapturingEventSource : AbstractMonitorEventSource diff --git a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/FunctionProbes/EventSourceEmittingProbes.cs b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/FunctionProbes/EventSourceEmittingProbes.cs similarity index 93% rename from src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/FunctionProbes/EventSourceEmittingProbes.cs rename to src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/FunctionProbes/EventSourceEmittingProbes.cs index 08cbf44b053..b44a572d380 100644 --- a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/FunctionProbes/EventSourceEmittingProbes.cs +++ b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/FunctionProbes/EventSourceEmittingProbes.cs @@ -1,13 +1,13 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.Eventing; -using Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.ObjectFormatting; +using Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.Eventing; +using Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.ObjectFormatting; using System; using System.Collections.Generic; using System.Reflection; -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.FunctionProbes +namespace Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.FunctionProbes { internal sealed class EventSourceEmittingProbes : IFunctionProbes { diff --git a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/FunctionProbes/FunctionProbesManager.cs b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/FunctionProbes/FunctionProbesManager.cs similarity index 97% rename from src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/FunctionProbes/FunctionProbesManager.cs rename to src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/FunctionProbes/FunctionProbesManager.cs index 2515e186653..ce1416e360f 100644 --- a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/FunctionProbes/FunctionProbesManager.cs +++ b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/FunctionProbes/FunctionProbesManager.cs @@ -1,9 +1,8 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.Boxing; -using Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.ObjectFormatting; -using Microsoft.Diagnostics.Monitoring.StartupHook; +using Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.Boxing; +using Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.ObjectFormatting; using Microsoft.Diagnostics.Tools.Monitor.Profiler; using System; using System.Collections.Generic; @@ -14,7 +13,7 @@ using System.Threading; using System.Threading.Tasks; -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.FunctionProbes +namespace Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.FunctionProbes { internal sealed class FunctionProbesManager : IFunctionProbesManager { @@ -137,7 +136,7 @@ private void OnFault(ulong uniquifier) OnProbeFault?.Invoke(this, instrumentedMethod); } - + private void TransitionStateFromHr(TaskCompletionSource? taskCompletionSource, int hresult, long expectedState, long succeededState, long failedState) { Exception? ex = Marshal.GetExceptionForHR(hresult); diff --git a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/FunctionProbes/FunctionProbesState.cs b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/FunctionProbes/FunctionProbesState.cs similarity index 86% rename from src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/FunctionProbes/FunctionProbesState.cs rename to src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/FunctionProbes/FunctionProbesState.cs index 21bc960f331..6b05187affd 100644 --- a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/FunctionProbes/FunctionProbesState.cs +++ b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/FunctionProbes/FunctionProbesState.cs @@ -3,7 +3,7 @@ using System.Collections.ObjectModel; -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.FunctionProbes +namespace Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.FunctionProbes { internal sealed class FunctionProbesState { diff --git a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/FunctionProbes/FunctionProbesStub.cs b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/FunctionProbes/FunctionProbesStub.cs similarity index 89% rename from src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/FunctionProbes/FunctionProbesStub.cs rename to src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/FunctionProbes/FunctionProbesStub.cs index bd84b097f67..f0b4cdc51db 100644 --- a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/FunctionProbes/FunctionProbesStub.cs +++ b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/FunctionProbes/FunctionProbesStub.cs @@ -1,10 +1,9 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using Microsoft.Diagnostics.Monitoring.StartupHook; using System; -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.FunctionProbes +namespace Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.FunctionProbes { public static class FunctionProbesStub { diff --git a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/FunctionProbes/IFunctionProbes.cs b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/FunctionProbes/IFunctionProbes.cs similarity index 88% rename from src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/FunctionProbes/IFunctionProbes.cs rename to src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/FunctionProbes/IFunctionProbes.cs index b33985f23e9..87b78bd2e44 100644 --- a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/FunctionProbes/IFunctionProbes.cs +++ b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/FunctionProbes/IFunctionProbes.cs @@ -5,7 +5,7 @@ using System.Collections.Generic; using System.Reflection; -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.FunctionProbes +namespace Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.FunctionProbes { internal interface IFunctionProbes { diff --git a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/FunctionProbes/IFunctionProbesManager.cs b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/FunctionProbes/IFunctionProbesManager.cs similarity index 86% rename from src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/FunctionProbes/IFunctionProbesManager.cs rename to src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/FunctionProbes/IFunctionProbesManager.cs index 59edc813f34..e6918c7e0c6 100644 --- a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/FunctionProbes/IFunctionProbesManager.cs +++ b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/FunctionProbes/IFunctionProbesManager.cs @@ -7,7 +7,7 @@ using System.Threading; using System.Threading.Tasks; -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.FunctionProbes +namespace Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.FunctionProbes { internal interface IFunctionProbesManager : IDisposable { diff --git a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/FunctionProbes/InstrumentedMethod.cs b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/FunctionProbes/InstrumentedMethod.cs similarity index 93% rename from src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/FunctionProbes/InstrumentedMethod.cs rename to src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/FunctionProbes/InstrumentedMethod.cs index e1b65a2f497..38c0fd63a3d 100644 --- a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/FunctionProbes/InstrumentedMethod.cs +++ b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/FunctionProbes/InstrumentedMethod.cs @@ -1,10 +1,10 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.Boxing; +using Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.Boxing; using System.Reflection; -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.FunctionProbes +namespace Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.FunctionProbes { internal enum ParameterCaptureMode { diff --git a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/FunctionProbes/ProfilerAbi.cs b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/FunctionProbes/ProfilerAbi.cs similarity index 95% rename from src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/FunctionProbes/ProfilerAbi.cs rename to src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/FunctionProbes/ProfilerAbi.cs index fdc1a491d59..dd85a7690dc 100644 --- a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/FunctionProbes/ProfilerAbi.cs +++ b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/FunctionProbes/ProfilerAbi.cs @@ -9,7 +9,7 @@ using System.Runtime.InteropServices; -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.FunctionProbes +namespace Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.FunctionProbes { internal enum SpecialCaseBoxingTypes : uint { diff --git a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/IMethodDescriptionValidator.cs b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/IMethodDescriptionValidator.cs similarity index 83% rename from src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/IMethodDescriptionValidator.cs rename to src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/IMethodDescriptionValidator.cs index 5c2f367ff75..41668d3ddd0 100644 --- a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/IMethodDescriptionValidator.cs +++ b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/IMethodDescriptionValidator.cs @@ -3,7 +3,7 @@ using Microsoft.Diagnostics.Monitoring.StartupHook.MonitorMessageDispatcher.Models; -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing +namespace Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing { internal interface IMethodDescriptionValidator { diff --git a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/MethodDescriptionValidator.cs b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/MethodDescriptionValidator.cs similarity index 93% rename from src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/MethodDescriptionValidator.cs rename to src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/MethodDescriptionValidator.cs index bb624a4cdc2..7d09f5e072f 100644 --- a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/MethodDescriptionValidator.cs +++ b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/MethodDescriptionValidator.cs @@ -3,7 +3,7 @@ using Microsoft.Diagnostics.Monitoring.StartupHook.MonitorMessageDispatcher.Models; -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing +namespace Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing { internal class MethodDescriptionValidator : IMethodDescriptionValidator { diff --git a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/MethodInfoExtensions.cs b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/MethodInfoExtensions.cs similarity index 91% rename from src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/MethodInfoExtensions.cs rename to src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/MethodInfoExtensions.cs index 8f94594ca69..b580295aa72 100644 --- a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/MethodInfoExtensions.cs +++ b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/MethodInfoExtensions.cs @@ -3,7 +3,7 @@ using System.Reflection; -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing +namespace Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing { internal static class MethodInfoExtensions { diff --git a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/MethodResolver.cs b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/MethodResolver.cs similarity index 98% rename from src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/MethodResolver.cs rename to src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/MethodResolver.cs index 3399fab720f..4d0016e3dea 100644 --- a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/MethodResolver.cs +++ b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/MethodResolver.cs @@ -7,7 +7,7 @@ using System.Linq; using System.Reflection; -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing +namespace Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing { internal sealed class MethodResolver { diff --git a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/MethodSignature.cs b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/MethodSignature.cs similarity index 98% rename from src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/MethodSignature.cs rename to src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/MethodSignature.cs index 2cfc29b3de5..3bebdb796fe 100644 --- a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/MethodSignature.cs +++ b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/MethodSignature.cs @@ -6,7 +6,7 @@ using System.Reflection; using System.Text; -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing +namespace Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing { internal sealed class MethodSignature(MethodInfo method) { diff --git a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/DebuggerDisplayFormatter.cs b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/DebuggerDisplayFormatter.cs similarity index 92% rename from src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/DebuggerDisplayFormatter.cs rename to src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/DebuggerDisplayFormatter.cs index 3b7b4078814..ca7a4cc105a 100644 --- a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/DebuggerDisplayFormatter.cs +++ b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/DebuggerDisplayFormatter.cs @@ -6,9 +6,9 @@ using System.Diagnostics; using System.Linq; using System.Reflection; -using static Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.ObjectFormatting.Formatters.DebuggerDisplay.DebuggerDisplayParser; +using static Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.ObjectFormatting.Formatters.DebuggerDisplay.DebuggerDisplayParser; -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.ObjectFormatting.Formatters.DebuggerDisplay +namespace Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.ObjectFormatting.Formatters.DebuggerDisplay { internal static class DebuggerDisplayFormatter { diff --git a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/DebuggerDisplayParser.cs b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/DebuggerDisplayParser.cs similarity index 98% rename from src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/DebuggerDisplayParser.cs rename to src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/DebuggerDisplayParser.cs index fd693269093..3ea670813d9 100644 --- a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/DebuggerDisplayParser.cs +++ b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/DebuggerDisplayParser.cs @@ -5,7 +5,7 @@ using System.Collections.Generic; using System.Text; -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.ObjectFormatting.Formatters.DebuggerDisplay +namespace Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.ObjectFormatting.Formatters.DebuggerDisplay { internal static class DebuggerDisplayParser { diff --git a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/ExpressionBinder.cs b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/ExpressionBinder.cs similarity index 97% rename from src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/ExpressionBinder.cs rename to src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/ExpressionBinder.cs index 478c74fd68b..ca51028df86 100644 --- a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/ExpressionBinder.cs +++ b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/ExpressionBinder.cs @@ -4,9 +4,9 @@ using System; using System.Collections.Generic; using System.Reflection; -using static Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.ObjectFormatting.Formatters.DebuggerDisplay.DebuggerDisplayParser; +using static Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.ObjectFormatting.Formatters.DebuggerDisplay.DebuggerDisplayParser; -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.ObjectFormatting.Formatters.DebuggerDisplay +namespace Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.ObjectFormatting.Formatters.DebuggerDisplay { internal static class ExpressionBinder { diff --git a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ObjectFormatting/Formatters/RuntimeFormatters.cs b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/ObjectFormatting/Formatters/RuntimeFormatters.cs similarity index 93% rename from src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ObjectFormatting/Formatters/RuntimeFormatters.cs rename to src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/ObjectFormatting/Formatters/RuntimeFormatters.cs index 41cead7910f..645654e3ea8 100644 --- a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ObjectFormatting/Formatters/RuntimeFormatters.cs +++ b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/ObjectFormatting/Formatters/RuntimeFormatters.cs @@ -4,7 +4,7 @@ using System; using System.Globalization; -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.ObjectFormatting +namespace Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.ObjectFormatting { internal static class RuntimeFormatters { diff --git a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ObjectFormatting/ObjectFormatter.cs b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/ObjectFormatting/ObjectFormatter.cs similarity index 97% rename from src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ObjectFormatting/ObjectFormatter.cs rename to src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/ObjectFormatting/ObjectFormatter.cs index d556b7a6822..0c8970d00c5 100644 --- a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ObjectFormatting/ObjectFormatter.cs +++ b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/ObjectFormatting/ObjectFormatter.cs @@ -4,7 +4,7 @@ using System; using static Microsoft.Diagnostics.Tools.Monitor.ParameterCapturing.ParameterCapturingEvents; -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.ObjectFormatting +namespace Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.ObjectFormatting { internal delegate ObjectFormatterResult ObjectFormatterFunc(object obj, FormatSpecifier formatSpecifier = FormatSpecifier.None); diff --git a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ObjectFormatting/ObjectFormatterCache.cs b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/ObjectFormatting/ObjectFormatterCache.cs similarity index 95% rename from src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ObjectFormatting/ObjectFormatterCache.cs rename to src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/ObjectFormatting/ObjectFormatterCache.cs index f68cb2fbb3b..546b5d1a39b 100644 --- a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ObjectFormatting/ObjectFormatterCache.cs +++ b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/ObjectFormatting/ObjectFormatterCache.cs @@ -6,7 +6,7 @@ using System.Diagnostics; using System.Reflection; -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.ObjectFormatting +namespace Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.ObjectFormatting { [DebuggerDisplay("Count = {_cache.Count}, UseDebuggerDisplayAttribute={_useDebuggerDisplayAttribute}")] internal sealed class ObjectFormatterCache diff --git a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ObjectFormatting/ObjectFormatterFactory.cs b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/ObjectFormatting/ObjectFormatterFactory.cs similarity index 88% rename from src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ObjectFormatting/ObjectFormatterFactory.cs rename to src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/ObjectFormatting/ObjectFormatterFactory.cs index 57cdb3a8c28..11cce22223a 100644 --- a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ObjectFormatting/ObjectFormatterFactory.cs +++ b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/ObjectFormatting/ObjectFormatterFactory.cs @@ -1,11 +1,11 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.ObjectFormatting.Formatters.DebuggerDisplay; +using Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.ObjectFormatting.Formatters.DebuggerDisplay; using System; using System.Collections.Generic; -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.ObjectFormatting +namespace Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.ObjectFormatting { /// /// The results from GetFormatter. diff --git a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ParameterCapturingService.cs b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/ParameterCapturingService.cs similarity index 94% rename from src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ParameterCapturingService.cs rename to src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/ParameterCapturingService.cs index d8b1aadcb68..74371cc2603 100644 --- a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ParameterCapturingService.cs +++ b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/ParameterCapturingService.cs @@ -1,11 +1,10 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.Eventing; -using Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.FunctionProbes; -using Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.Pipeline; -using Microsoft.Diagnostics.Monitoring.StartupHook; using Microsoft.Diagnostics.Monitoring.StartupHook.Monitoring; +using Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.Eventing; +using Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.FunctionProbes; +using Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.Pipeline; using Microsoft.Diagnostics.Tools.Monitor.ParameterCapturing; using Microsoft.Diagnostics.Tools.Monitor.Profiler; using Microsoft.Diagnostics.Tools.Monitor.StartupHook; @@ -15,9 +14,8 @@ using System.Reflection; using System.Threading; using System.Threading.Tasks; -using BackgroundService = Microsoft.Extensions.Hosting.BackgroundService; -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing +namespace Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing { internal sealed class ParameterCapturingService : BackgroundService, IParameterCapturingPipelineCallbacks, IDisposable { diff --git a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ParameterCapturingStrings.Designer.cs b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/ParameterCapturingStrings.Designer.cs similarity index 95% rename from src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ParameterCapturingStrings.Designer.cs rename to src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/ParameterCapturingStrings.Designer.cs index f7a0b898498..49469887ad2 100644 --- a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ParameterCapturingStrings.Designer.cs +++ b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/ParameterCapturingStrings.Designer.cs @@ -8,7 +8,7 @@ // //------------------------------------------------------------------------------ -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing { +namespace Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing { using System; @@ -39,8 +39,8 @@ internal ParameterCapturingStrings() { internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.ParameterCaptu" + - "ringStrings", typeof(ParameterCapturingStrings).Assembly); + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.ParameterCapturin" + + "gStrings", typeof(ParameterCapturingStrings).Assembly); resourceMan = temp; } return resourceMan; diff --git a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ParameterCapturingStrings.resx b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/ParameterCapturingStrings.resx similarity index 100% rename from src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ParameterCapturingStrings.resx rename to src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/ParameterCapturingStrings.resx diff --git a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ParameterSignature.cs b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/ParameterSignature.cs similarity index 80% rename from src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ParameterSignature.cs rename to src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/ParameterSignature.cs index abe151ac1ef..ffdc64d4d1e 100644 --- a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ParameterSignature.cs +++ b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/ParameterSignature.cs @@ -3,7 +3,7 @@ using System.Reflection; -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing +namespace Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing { internal sealed record ParameterSignature(string? Name, string? Type, string? TypeModuleName, ParameterAttributes Attributes, bool IsByRef) { diff --git a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/Pipeline/CaptureLimitPolicyProbes.cs b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/Pipeline/CaptureLimitPolicyProbes.cs similarity index 90% rename from src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/Pipeline/CaptureLimitPolicyProbes.cs rename to src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/Pipeline/CaptureLimitPolicyProbes.cs index ea9815e121f..5b1f3b63461 100644 --- a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/Pipeline/CaptureLimitPolicyProbes.cs +++ b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/Pipeline/CaptureLimitPolicyProbes.cs @@ -1,13 +1,13 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.FunctionProbes; +using Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.FunctionProbes; using System.Collections.Generic; using System.Reflection; using System.Threading; using System.Threading.Tasks; -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.Pipeline +namespace Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.Pipeline { internal sealed class CaptureLimitPolicyProbes : IFunctionProbes { diff --git a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/Pipeline/IParameterCapturingPipelineCallbacks.cs b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/Pipeline/IParameterCapturingPipelineCallbacks.cs similarity index 89% rename from src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/Pipeline/IParameterCapturingPipelineCallbacks.cs rename to src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/Pipeline/IParameterCapturingPipelineCallbacks.cs index 5c90d6bd3a6..f2d47c4a813 100644 --- a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/Pipeline/IParameterCapturingPipelineCallbacks.cs +++ b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/Pipeline/IParameterCapturingPipelineCallbacks.cs @@ -7,7 +7,7 @@ using System.Collections.Generic; using System.Reflection; -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.FunctionProbes +namespace Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.FunctionProbes { internal interface IParameterCapturingPipelineCallbacks { diff --git a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/Pipeline/ParameterCapturingPipeline.cs b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/Pipeline/ParameterCapturingPipeline.cs similarity index 98% rename from src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/Pipeline/ParameterCapturingPipeline.cs rename to src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/Pipeline/ParameterCapturingPipeline.cs index d2df9465d73..1cd6eb69067 100644 --- a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/Pipeline/ParameterCapturingPipeline.cs +++ b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/Pipeline/ParameterCapturingPipeline.cs @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.FunctionProbes; +using Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.FunctionProbes; using Microsoft.Diagnostics.Monitoring.StartupHook.MonitorMessageDispatcher.Models; using Microsoft.Diagnostics.Tools.Monitor.ParameterCapturing; using Microsoft.Diagnostics.Tools.Monitor.Profiler; @@ -13,7 +13,7 @@ using System.Threading.Channels; using System.Threading.Tasks; -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.Pipeline +namespace Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.Pipeline { internal sealed class ParameterCapturingPipeline : IDisposable { diff --git a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/Pipeline/TooManyRequestsException.cs b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/Pipeline/TooManyRequestsException.cs similarity index 78% rename from src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/Pipeline/TooManyRequestsException.cs rename to src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/Pipeline/TooManyRequestsException.cs index 68c861ad746..ef629e047dd 100644 --- a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/Pipeline/TooManyRequestsException.cs +++ b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/Pipeline/TooManyRequestsException.cs @@ -3,7 +3,7 @@ using System; -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.Pipeline +namespace Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.Pipeline { internal sealed class TooManyRequestsException : Exception { diff --git a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ResolvedParameterInfo.cs b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/ResolvedParameterInfo.cs similarity index 68% rename from src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ResolvedParameterInfo.cs rename to src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/ResolvedParameterInfo.cs index 7ac627f9ab1..d59a46400aa 100644 --- a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/ResolvedParameterInfo.cs +++ b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/ResolvedParameterInfo.cs @@ -1,10 +1,10 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.ObjectFormatting; +using Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.ObjectFormatting; using System.Reflection; -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing +namespace Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing { internal sealed record ResolvedParameterInfo(string? Name, string? Type, string? TypeModuleName, ObjectFormatterResult Value, ParameterAttributes Attributes, bool IsByRef) { diff --git a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/TypeUtils.cs b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/TypeUtils.cs similarity index 93% rename from src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/TypeUtils.cs rename to src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/TypeUtils.cs index 547cd7a4ac4..d119bfa7b39 100644 --- a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/TypeUtils.cs +++ b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/TypeUtils.cs @@ -3,7 +3,7 @@ using System; -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing +namespace Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing { internal static class TypeUtils { diff --git a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/UnresolvedMethodsException.cs b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/UnresolvedMethodsException.cs similarity index 93% rename from src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/UnresolvedMethodsException.cs rename to src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/UnresolvedMethodsException.cs index ce23592b18e..31054a38e3a 100644 --- a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ParameterCapturing/UnresolvedMethodsException.cs +++ b/src/Microsoft.Diagnostics.Monitoring.StartupHook/ParameterCapturing/UnresolvedMethodsException.cs @@ -7,7 +7,7 @@ using System.Globalization; using System.Text; -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing +namespace Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing { internal sealed class UnresolvedMethodsExceptions : Exception { diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/Boxing/BoxingInstructionsTests.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/Boxing/BoxingInstructionsTests.cs similarity index 97% rename from src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/Boxing/BoxingInstructionsTests.cs rename to src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/Boxing/BoxingInstructionsTests.cs index db2dcad85d4..122337297a1 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/Boxing/BoxingInstructionsTests.cs +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/Boxing/BoxingInstructionsTests.cs @@ -1,8 +1,8 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.Boxing; -using Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.FunctionProbes; +using Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.Boxing; +using Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.FunctionProbes; using Microsoft.Diagnostics.Monitoring.TestCommon; using SampleMethods; using System; @@ -10,7 +10,7 @@ using Xunit; using Xunit.Abstractions; -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests.ParameterCapturing.Boxing +namespace Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests.ParameterCapturing.Boxing { [TargetFrameworkMonikerTrait(TargetFrameworkMonikerExtensions.CurrentTargetFrameworkMoniker)] public class BoxingInstructionsTests @@ -178,7 +178,7 @@ private static void ReflectionAndSignatureDecoder_Contract_InSyncCore(MethodInfo // // // NOTE: The signature decoder may produce a superset of boxing instructions compared to what GetBoxingInstructionsFromReflection needs. - // This is okay as GetBoxingInstructionsFromReflection determines when to leverage the signature decoder. + // This is okay as GetBoxingInstructionsFromReflection determines when to leverage the signature decoder. // ParameterBoxingInstructions reflectionInstructions = BoxingInstructions.GetBoxingInstructionsFromReflection(method, parameters[i].ParameterType, out bool canUseSignatureDecoder); if (canUseSignatureDecoder) diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/Boxing/MethodDefinitionExtensionsTests.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/Boxing/MethodDefinitionExtensionsTests.cs similarity index 91% rename from src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/Boxing/MethodDefinitionExtensionsTests.cs rename to src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/Boxing/MethodDefinitionExtensionsTests.cs index 783b779e5a0..101c54c9f23 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/Boxing/MethodDefinitionExtensionsTests.cs +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/Boxing/MethodDefinitionExtensionsTests.cs @@ -1,8 +1,8 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.Boxing; -using Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.FunctionProbes; +using Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.Boxing; +using Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.FunctionProbes; using Microsoft.Diagnostics.Monitoring.TestCommon; using SampleMethods; using System; @@ -11,7 +11,7 @@ using System.Reflection.Metadata; using Xunit; -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests.ParameterCapturing.Boxing +namespace Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests.ParameterCapturing.Boxing { [TargetFrameworkMonikerTrait(TargetFrameworkMonikerExtensions.CurrentTargetFrameworkMoniker)] public class MethodDefinitionExtensionsTests diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/FunctionProbes/ProfilerAbiTests.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/FunctionProbes/ProfilerAbiTests.cs similarity index 87% rename from src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/FunctionProbes/ProfilerAbiTests.cs rename to src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/FunctionProbes/ProfilerAbiTests.cs index d9d2beb694e..8e9971ec35e 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/FunctionProbes/ProfilerAbiTests.cs +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/FunctionProbes/ProfilerAbiTests.cs @@ -1,12 +1,12 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.FunctionProbes; +using Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.FunctionProbes; using Microsoft.Diagnostics.Monitoring.TestCommon; using System.Reflection; using Xunit; -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests.ParameterCapturing.FunctionProbes +namespace Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests.ParameterCapturing.FunctionProbes { [TargetFrameworkMonikerTrait(TargetFrameworkMonikerExtensions.CurrentTargetFrameworkMoniker)] public class ProfilerAbiTests diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/MethodResolverTests.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/MethodResolverTests.cs similarity index 96% rename from src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/MethodResolverTests.cs rename to src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/MethodResolverTests.cs index ae642b93c10..8dfc044d78e 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/MethodResolverTests.cs +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/MethodResolverTests.cs @@ -1,8 +1,8 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing; -using Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.Boxing; +using Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing; +using Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.Boxing; using Microsoft.Diagnostics.Monitoring.StartupHook.MonitorMessageDispatcher.Models; using Microsoft.Diagnostics.Monitoring.TestCommon; using SampleMethods; @@ -13,7 +13,7 @@ using Xunit; using Xunit.Abstractions; -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests.ParameterCapturing +namespace Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests.ParameterCapturing { [TargetFrameworkMonikerTrait(TargetFrameworkMonikerExtensions.CurrentTargetFrameworkMoniker)] public class MethodResolverTests diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/MethodSignatureTests.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/MethodSignatureTests.cs similarity index 98% rename from src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/MethodSignatureTests.cs rename to src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/MethodSignatureTests.cs index b8fa7693cb2..6f650262492 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/MethodSignatureTests.cs +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/MethodSignatureTests.cs @@ -1,14 +1,14 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing; +using Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing; using Microsoft.Diagnostics.Monitoring.TestCommon; using SampleMethods; using System; using System.Reflection; using Xunit; -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests.ParameterCapturing +namespace Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests.ParameterCapturing { [TargetFrameworkMonikerTrait(TargetFrameworkMonikerExtensions.CurrentTargetFrameworkMoniker)] public class MethodSignatureTests diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/DebuggerDisplayFormatterTests.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/DebuggerDisplayFormatterTests.cs similarity index 85% rename from src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/DebuggerDisplayFormatterTests.cs rename to src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/DebuggerDisplayFormatterTests.cs index 554cb756442..203c87e1f13 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/DebuggerDisplayFormatterTests.cs +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/DebuggerDisplayFormatterTests.cs @@ -1,16 +1,16 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.ObjectFormatting; -using Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.ObjectFormatting.Formatters.DebuggerDisplay; +using Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.ObjectFormatting; +using Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.ObjectFormatting.Formatters.DebuggerDisplay; using Microsoft.Diagnostics.Monitoring.TestCommon; using System; using System.Diagnostics; using Xunit; -using static Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.ObjectFormatting.Formatters.DebuggerDisplay.DebuggerDisplayFormatter; +using static Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.ObjectFormatting.Formatters.DebuggerDisplay.DebuggerDisplayFormatter; using static Microsoft.Diagnostics.Tools.Monitor.ParameterCapturing.ParameterCapturingEvents; -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests.ParameterCapturing.ObjectFormatting.Formatters.DebuggerDisplay +namespace Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests.ParameterCapturing.ObjectFormatting.Formatters.DebuggerDisplay { [TargetFrameworkMonikerTrait(TargetFrameworkMonikerExtensions.CurrentTargetFrameworkMoniker)] public class DebuggerDisplayFormatterTests @@ -28,7 +28,9 @@ private sealed class DebuggerDisplayClassWithNullField { public int Count { get; set; } - public static string? NullField => null; +#pragma warning disable CS8603 // Possible null reference return. + public static string NullField => null; +#pragma warning restore CS8603 // Possible null reference return. } [Theory] diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/DebuggerDisplayParserTests.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/DebuggerDisplayParserTests.cs similarity index 89% rename from src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/DebuggerDisplayParserTests.cs rename to src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/DebuggerDisplayParserTests.cs index e8a27df110d..718f5386011 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/DebuggerDisplayParserTests.cs +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/DebuggerDisplayParserTests.cs @@ -1,15 +1,15 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.ObjectFormatting; -using Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.ObjectFormatting.Formatters.DebuggerDisplay; +using Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.ObjectFormatting; +using Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.ObjectFormatting.Formatters.DebuggerDisplay; using Microsoft.Diagnostics.Monitoring.TestCommon; using System; using System.Linq; using Xunit; -using static Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.ObjectFormatting.Formatters.DebuggerDisplay.DebuggerDisplayParser; +using static Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.ObjectFormatting.Formatters.DebuggerDisplay.DebuggerDisplayParser; -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests.ParameterCapturing.ObjectFormatting.Formatters.DebuggerDisplay +namespace Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests.ParameterCapturing.ObjectFormatting.Formatters.DebuggerDisplay { [TargetFrameworkMonikerTrait(TargetFrameworkMonikerExtensions.CurrentTargetFrameworkMoniker)] public class DebuggerDisplayParserTests diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/ExpressionBinderTests.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/ExpressionBinderTests.cs similarity index 86% rename from src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/ExpressionBinderTests.cs rename to src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/ExpressionBinderTests.cs index 3713ade95e3..08175177585 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/ExpressionBinderTests.cs +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/ExpressionBinderTests.cs @@ -1,13 +1,13 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.ObjectFormatting.Formatters.DebuggerDisplay; +using Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.ObjectFormatting.Formatters.DebuggerDisplay; using Microsoft.Diagnostics.Monitoring.TestCommon; using System; using Xunit; -using static Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.ObjectFormatting.Formatters.DebuggerDisplay.ExpressionBinder; +using static Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.ObjectFormatting.Formatters.DebuggerDisplay.ExpressionBinder; -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests.ParameterCapturing.ObjectFormatting.Formatters.DebuggerDisplay +namespace Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests.ParameterCapturing.ObjectFormatting.Formatters.DebuggerDisplay { [TargetFrameworkMonikerTrait(TargetFrameworkMonikerExtensions.CurrentTargetFrameworkMoniker)] public class ExpressionBinderTests diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/ObjectFormatting/Formatters/RuntimeFormattersTests.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/ObjectFormatting/Formatters/RuntimeFormattersTests.cs similarity index 93% rename from src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/ObjectFormatting/Formatters/RuntimeFormattersTests.cs rename to src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/ObjectFormatting/Formatters/RuntimeFormattersTests.cs index 6644d5d7991..3a8be64ba5b 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/ObjectFormatting/Formatters/RuntimeFormattersTests.cs +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/ObjectFormatting/Formatters/RuntimeFormattersTests.cs @@ -1,14 +1,14 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.ObjectFormatting; +using Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.ObjectFormatting; using Microsoft.Diagnostics.Monitoring.TestCommon; using SampleMethods; using System; using Xunit; using static Microsoft.Diagnostics.Tools.Monitor.ParameterCapturing.ParameterCapturingEvents; -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests.ParameterCapturing.ObjectFormatting.Formatters +namespace Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests.ParameterCapturing.ObjectFormatting.Formatters { [TargetFrameworkMonikerTrait(TargetFrameworkMonikerExtensions.CurrentTargetFrameworkMoniker)] public class RuntimeFormattersTests diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/ObjectFormatting/ObjectFormatterFactoryTests.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/ObjectFormatting/ObjectFormatterFactoryTests.cs similarity index 86% rename from src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/ObjectFormatting/ObjectFormatterFactoryTests.cs rename to src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/ObjectFormatting/ObjectFormatterFactoryTests.cs index 11aa53b0e02..eac1a1e6592 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/ObjectFormatting/ObjectFormatterFactoryTests.cs +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/ObjectFormatting/ObjectFormatterFactoryTests.cs @@ -1,14 +1,14 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.ObjectFormatting; +using Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.ObjectFormatting; using Microsoft.Diagnostics.Monitoring.TestCommon; using SampleMethods; using System; using System.Reflection; using Xunit; -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests.ParameterCapturing +namespace Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests.ParameterCapturing { [TargetFrameworkMonikerTrait(TargetFrameworkMonikerExtensions.CurrentTargetFrameworkMoniker)] public class ObjectFormatterFactoryTests diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/ObjectFormatting/ObjectFormatterTests.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/ObjectFormatting/ObjectFormatterTests.cs similarity index 92% rename from src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/ObjectFormatting/ObjectFormatterTests.cs rename to src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/ObjectFormatting/ObjectFormatterTests.cs index dc1a447414e..607088b7541 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/ObjectFormatting/ObjectFormatterTests.cs +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/ObjectFormatting/ObjectFormatterTests.cs @@ -1,13 +1,13 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.ObjectFormatting; +using Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.ObjectFormatting; using Microsoft.Diagnostics.Monitoring.TestCommon; using System; using Xunit; using static Microsoft.Diagnostics.Tools.Monitor.ParameterCapturing.ParameterCapturingEvents; -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests.ParameterCapturing +namespace Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests.ParameterCapturing { [TargetFrameworkMonikerTrait(TargetFrameworkMonikerExtensions.CurrentTargetFrameworkMoniker)] public class ObjectFormatterTests diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/Pipeline/CaptureLimitPolicyProbesTests.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/Pipeline/CaptureLimitPolicyProbesTests.cs similarity index 95% rename from src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/Pipeline/CaptureLimitPolicyProbesTests.cs rename to src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/Pipeline/CaptureLimitPolicyProbesTests.cs index c6943a01480..5852757efac 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/Pipeline/CaptureLimitPolicyProbesTests.cs +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/Pipeline/CaptureLimitPolicyProbesTests.cs @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.Pipeline; +using Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.Pipeline; using Microsoft.Diagnostics.Monitoring.TestCommon; using System; using System.Collections.Generic; @@ -10,7 +10,7 @@ using System.Threading.Tasks; using Xunit; -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests.ParameterCapturing.Pipeline +namespace Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests.ParameterCapturing.Pipeline { [TargetFrameworkMonikerTrait(TargetFrameworkMonikerExtensions.CurrentTargetFrameworkMoniker)] public class CaptureLimitPolicyProbesTests diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/Pipeline/ParameterCapturingPipelineTests.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/Pipeline/ParameterCapturingPipelineTests.cs similarity index 97% rename from src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/Pipeline/ParameterCapturingPipelineTests.cs rename to src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/Pipeline/ParameterCapturingPipelineTests.cs index 24817351bfd..9fcc5192107 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/Pipeline/ParameterCapturingPipelineTests.cs +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/Pipeline/ParameterCapturingPipelineTests.cs @@ -1,10 +1,10 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing; -using Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.Boxing; -using Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.FunctionProbes; -using Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.Pipeline; +using Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing; +using Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.Boxing; +using Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.FunctionProbes; +using Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.Pipeline; using Microsoft.Diagnostics.Monitoring.StartupHook.MonitorMessageDispatcher.Models; using Microsoft.Diagnostics.Monitoring.TestCommon; using Microsoft.Diagnostics.Tools.Monitor.ParameterCapturing; @@ -17,7 +17,7 @@ using Xunit; using Xunit.Abstractions; -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests.ParameterCapturing.Pipeline +namespace Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests.ParameterCapturing.Pipeline { internal sealed class TestFunctionProbesManager : IFunctionProbesManager { diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/Pipeline/TestFunctionProbes.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/Pipeline/TestFunctionProbes.cs similarity index 84% rename from src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/Pipeline/TestFunctionProbes.cs rename to src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/Pipeline/TestFunctionProbes.cs index 012b5b7f6dc..af79d704560 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/Pipeline/TestFunctionProbes.cs +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/Pipeline/TestFunctionProbes.cs @@ -1,12 +1,12 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.FunctionProbes; +using Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.FunctionProbes; using System; using System.Collections.Generic; using System.Reflection; -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests.ParameterCapturing.Pipeline +namespace Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests.ParameterCapturing.Pipeline { internal sealed class TestFunctionProbes : IFunctionProbes { diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/SampleMethods.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/SampleMethods.cs similarity index 100% rename from src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/SampleMethods.cs rename to src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/SampleMethods.cs diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/TypeUtilsTests.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/TypeUtilsTests.cs similarity index 86% rename from src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/TypeUtilsTests.cs rename to src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/TypeUtilsTests.cs index 8f9ea43b4d8..bde6433d900 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/ParameterCapturing/TypeUtilsTests.cs +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/TypeUtilsTests.cs @@ -1,11 +1,11 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing; +using Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing; using Microsoft.Diagnostics.Monitoring.TestCommon; using Xunit; -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests.ParameterCapturing +namespace Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests.ParameterCapturing { [TargetFrameworkMonikerTrait(TargetFrameworkMonikerExtensions.CurrentTargetFrameworkMoniker)] public class TypeUtilsTests diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests/ParameterCapturingTests.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests/ParameterCapturingTests.cs index 0d91d93bc7c..3705fc373cb 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests/ParameterCapturingTests.cs +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests/ParameterCapturingTests.cs @@ -78,30 +78,18 @@ await RunTestCaseCore(TestAppScenarios.ParameterCapturing.SubScenarios.AspNetApp [Theory] [MemberData(nameof(ProfilerHelper.GetArchitecture), MemberType = typeof(ProfilerHelper))] - public async Task NonAspNetAppFailsOperation(Architecture targetArchitecture) - { - await RunTestCaseCore(TestAppScenarios.ParameterCapturing.SubScenarios.NonAspNetApp, targetArchitecture, async (appRunner, apiClient) => - { - int processId = await appRunner.ProcessIdTask; - - CaptureParametersConfiguration config = GetValidConfiguration(); - - ValidationProblemDetailsException validationException = await Assert.ThrowsAsync(() => apiClient.CaptureParametersAsync(processId, Timeout.InfiniteTimeSpan, config)); - Assert.Equal(HttpStatusCode.BadRequest, validationException.StatusCode); - - await appRunner.SendCommandAsync(TestAppScenarios.ParameterCapturing.Commands.Continue); - }); - } + public Task CapturesParametersInNonAspNetApps(Architecture targetArchitecture) => + CapturesParametersCore(TestAppScenarios.ParameterCapturing.SubScenarios.NonAspNetApp, targetArchitecture, CapturedParameterFormat.JsonSequence); [Theory] [MemberData(nameof(ProfilerHelper.GetArchitecture), MemberType = typeof(ProfilerHelper))] public Task CapturesParametersAndOutputJsonSequence(Architecture targetArchitecture) => - CapturesParametersCore(targetArchitecture, CapturedParameterFormat.JsonSequence); + CapturesParametersCore(TestAppScenarios.ParameterCapturing.SubScenarios.AspNetApp, targetArchitecture, CapturedParameterFormat.JsonSequence); [Theory] [MemberData(nameof(ProfilerHelper.GetArchitecture), MemberType = typeof(ProfilerHelper))] public Task CapturesParametersAndOutputNewlineDelimitedJson(Architecture targetArchitecture) => - CapturesParametersCore(targetArchitecture, CapturedParameterFormat.NewlineDelimitedJson); + CapturesParametersCore(TestAppScenarios.ParameterCapturing.SubScenarios.AspNetApp, targetArchitecture, CapturedParameterFormat.NewlineDelimitedJson); #else // NET7_0_OR_GREATER [Theory] @@ -122,9 +110,9 @@ await RunTestCaseCore(TestAppScenarios.ParameterCapturing.SubScenarios.AspNetApp } #endif // NET7_0_OR_GREATER - private async Task CapturesParametersCore(Architecture targetArchitecture, CapturedParameterFormat format) + private async Task CapturesParametersCore(string subScenarioName,Architecture targetArchitecture, CapturedParameterFormat format) { - await RunTestCaseCore(TestAppScenarios.ParameterCapturing.SubScenarios.AspNetApp, targetArchitecture, async (appRunner, apiClient) => + await RunTestCaseCore(subScenarioName, targetArchitecture, async (appRunner, apiClient) => { int processId = await appRunner.ProcessIdTask; diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/Microsoft.Diagnostics.Monitoring.UnitTestApp.csproj b/src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/Microsoft.Diagnostics.Monitoring.UnitTestApp.csproj index 417ff0bf4b0..dee00113162 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/Microsoft.Diagnostics.Monitoring.UnitTestApp.csproj +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/Microsoft.Diagnostics.Monitoring.UnitTestApp.csproj @@ -13,11 +13,12 @@ + - + diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/Scenarios/FunctionProbes/FunctionProbesScenario.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/Scenarios/FunctionProbes/FunctionProbesScenario.cs index a4889756faf..f4962615ad5 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/Scenarios/FunctionProbes/FunctionProbesScenario.cs +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/Scenarios/FunctionProbes/FunctionProbesScenario.cs @@ -1,8 +1,8 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing; -using Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.FunctionProbes; +using Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing; +using Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.FunctionProbes; using Microsoft.Diagnostics.Monitoring.StartupHook; using Microsoft.Diagnostics.Monitoring.TestCommon; using SampleMethods; diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/Scenarios/FunctionProbes/PerFunctionProbeProxy.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/Scenarios/FunctionProbes/PerFunctionProbeProxy.cs index 64fd7b69f5e..275d7c4491a 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/Scenarios/FunctionProbes/PerFunctionProbeProxy.cs +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/Scenarios/FunctionProbes/PerFunctionProbeProxy.cs @@ -8,7 +8,7 @@ using System.Threading; using Xunit.Sdk; -namespace Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.FunctionProbes +namespace Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing.FunctionProbes { internal sealed class PerFunctionProbeWrapper { diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/Scenarios/ParameterCapturingScenario.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/Scenarios/ParameterCapturingScenario.cs index c4030d4f1f6..ae9a0973382 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/Scenarios/ParameterCapturingScenario.cs +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/Scenarios/ParameterCapturingScenario.cs @@ -48,6 +48,9 @@ public static Task NonAspNetAppAsync(ParseResult result, CancellationToken func: async logger => { await ScenarioHelpers.WaitForCommandAsync(TestAppScenarios.ParameterCapturing.Commands.Continue, logger); + + SampleMethods.StaticTestMethodSignatures.NoArgs(); + return 0; }, token); } diff --git a/src/Tools/dotnet-monitor/ParameterCapturing/CaptureParametersOperation.cs b/src/Tools/dotnet-monitor/ParameterCapturing/CaptureParametersOperation.cs index e1d4c74388a..f8c9dcc1214 100644 --- a/src/Tools/dotnet-monitor/ParameterCapturing/CaptureParametersOperation.cs +++ b/src/Tools/dotnet-monitor/ParameterCapturing/CaptureParametersOperation.cs @@ -107,10 +107,10 @@ static Exception getNotAvailableException(string reason) throw getNotAvailableException(Strings.ParameterCapturingNotAvailable_Reason_ManagedMessagingDidNotLoad); } - if (!env.TryGetValue(InProcessFeaturesIdentifiers.EnvironmentVariables.AvailableInfrastructure.HostingStartup, out string isHostingStartupAvailable) || - !ToolIdentifiers.IsEnvVarValueEnabled(isHostingStartupAvailable)) + if (!env.TryGetValue(InProcessFeaturesIdentifiers.EnvironmentVariables.AvailableInfrastructure.StartupHook, out string isStartupHookAvailable) || + !ToolIdentifiers.IsEnvVarValueEnabled(isStartupHookAvailable)) { - throw getNotAvailableException(Strings.ParameterCapturingNotAvailable_Reason_HostingStartupDidNotLoad); + throw getNotAvailableException(Strings.ParameterCapturingNotAvailable_Reason_StartupHookDidNotLoad); } const string EditAndContinueEnvName = "COMPLUS_ForceEnc"; diff --git a/src/Tools/dotnet-monitor/Strings.Designer.cs b/src/Tools/dotnet-monitor/Strings.Designer.cs index e6468279b8f..af49d4f19b9 100644 --- a/src/Tools/dotnet-monitor/Strings.Designer.cs +++ b/src/Tools/dotnet-monitor/Strings.Designer.cs @@ -1654,15 +1654,6 @@ internal static string Message_ShowSources { } } - /// - /// Looks up a localized string similar to This feature is only available on processes using ASP.NET Core. If the process is using ASP.NET Core and has successfully started, ensure that it has not been configured to prevent hosting startup assemblies from loading.. - /// - internal static string ParameterCapturingNotAvailable_Reason_HostingStartupDidNotLoad { - get { - return ResourceManager.GetString("ParameterCapturingNotAvailable_Reason_HostingStartupDidNotLoad", resourceCulture); - } - } - /// /// Looks up a localized string similar to The process has Hot Reload enabled.. /// @@ -1690,6 +1681,15 @@ internal static string ParameterCapturingNotAvailable_Reason_PreventedHostingSta } } + /// + /// Looks up a localized string similar to This feature requires the startup hook to be loaded in the target process.. + /// + internal static string ParameterCapturingNotAvailable_Reason_StartupHookDidNotLoad { + get { + return ResourceManager.GetString("ParameterCapturingNotAvailable_Reason_StartupHookDidNotLoad", resourceCulture); + } + } + /// /// Looks up a localized string similar to The process needs to be using .NET 7 or newer.. /// diff --git a/src/Tools/dotnet-monitor/Strings.resx b/src/Tools/dotnet-monitor/Strings.resx index 8616e168143..a63ac31d441 100644 --- a/src/Tools/dotnet-monitor/Strings.resx +++ b/src/Tools/dotnet-monitor/Strings.resx @@ -930,8 +930,8 @@ The process has prevented hosting startup assemblies from loading using the ASPNETCORE_PREVENTHOSTINGSTARTUP environment variable. - - This feature is only available on processes using ASP.NET Core. If the process is using ASP.NET Core and has successfully started, ensure that it has not been configured to prevent hosting startup assemblies from loading. + + This feature requires the startup hook to be loaded in the target process. An internal error occurred that has prevented communication with the process. @@ -949,4 +949,4 @@ The expiration time on or after the generated key will no longer be accepted. This is a time span offset (e.g. "7.00:00:00" for 7 days) that will be added to the current date time to create the expiration date time. Gets the string to display in help that explains what the '--expiration' option does. - \ No newline at end of file + From 3bd2c0f9d17060eff09eb36861f25a7b5fcfe768 Mon Sep 17 00:00:00 2001 From: Claudiu Guiman Date: Fri, 31 May 2024 13:47:41 -0400 Subject: [PATCH 009/107] Remove HostingStartup (#6751) --- documentation/api/parameters.md | 2 - dotnet-monitor.sln | 14 --- eng/AfterSolutionBuild.targets | 1 - .../HostingStartup.cs | 31 ------- ...agnostics.Monitoring.HostingStartup.csproj | 45 --------- .../ProjectsToPublish.props | 15 --- .../IMethodDescription.cs | 2 +- .../AspNetHostingStartupLoader.cs | 69 -------------- .../DiagnosticsBootstrapper.cs | 11 --- ....Diagnostics.Monitoring.StartupHook.csproj | 3 - .../IInProcessFeatures.cs | 2 - .../KeyValueLogScope.cs | 4 - .../KeyValueLogScopeExtensions.cs | 8 +- .../Models/CaptureParametersConfiguration.cs | 2 +- .../Models/MethodDescription.cs | 2 +- .../ProfilerMessage.cs | 5 +- ...Monitoring.HostingStartup.UnitTests.csproj | 13 --- ...t.Diagnostics.Monitoring.TestCommon.csproj | 1 - .../TestAppScenarios.cs | 12 --- .../FunctionProbesTests.cs | 2 +- .../HostingStartupTests.cs | 62 ------------- ...ics.Monitoring.Tool.FunctionalTests.csproj | 1 - .../StartupHookTests.cs | 2 +- ....Diagnostics.Monitoring.UnitTestApp.csproj | 1 - .../Program.cs | 1 - .../Scenarios/HostingStartupScenario.cs | 81 ----------------- .../Commands/CollectCommandHandler.cs | 1 - .../HostingStartup/HostingStartupService.cs | 91 ------------------- .../InProcessFeatures/InProcessFeatures.cs | 6 +- ...cessFeaturesEndpointInfoSourceCallbacks.cs | 2 +- .../InProcessFeaturesIdentifiers.cs | 3 +- .../InProcessFeaturesService.cs | 2 +- src/Tools/dotnet-monitor/LoggingExtensions.cs | 11 --- .../CaptureParametersOperation.cs | 9 +- .../Profiler/ProfilerMessagePayloads.cs | 2 +- .../ServiceCollectionExtensions.cs | 8 -- .../StartupHook/StartupHookIdentifiers.cs | 16 ---- src/Tools/dotnet-monitor/Strings.Designer.cs | 27 ------ src/Tools/dotnet-monitor/Strings.resx | 63 ++++++------- .../dotnet-monitor/dotnet-monitor.csproj | 8 -- .../dotnet-monitor-base/Package.props | 1 - 41 files changed, 41 insertions(+), 601 deletions(-) delete mode 100644 src/Microsoft.Diagnostics.Monitoring.HostingStartup/HostingStartup.cs delete mode 100644 src/Microsoft.Diagnostics.Monitoring.HostingStartup/Microsoft.Diagnostics.Monitoring.HostingStartup.csproj delete mode 100644 src/Microsoft.Diagnostics.Monitoring.HostingStartup/ProjectsToPublish.props delete mode 100644 src/Microsoft.Diagnostics.Monitoring.StartupHook/AspNetHostingStartupLoader.cs delete mode 100644 src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests.csproj delete mode 100644 src/Tests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests/HostingStartupTests.cs delete mode 100644 src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/Scenarios/HostingStartupScenario.cs delete mode 100644 src/Tools/dotnet-monitor/HostingStartup/HostingStartupService.cs delete mode 100644 src/Tools/dotnet-monitor/StartupHook/StartupHookIdentifiers.cs diff --git a/documentation/api/parameters.md b/documentation/api/parameters.md index 2bf5c886da3..d20f5431334 100644 --- a/documentation/api/parameters.md +++ b/documentation/api/parameters.md @@ -131,8 +131,6 @@ Content-Type: application/x-ndjson - The target application must use ASP.NET Core. - The target application cannot have [Hot Reload](https://learn.microsoft.com/visualstudio/debugger/hot-reload) enabled. - `dotnet-monitor` must be set to `Listen` mode, and the target application must start suspended. See [diagnostic port configuration](../configuration/diagnostic-port-configuration.md) for information on how to do this. -- The target application must have [`ILogger`](https://learn.microsoft.com/dotnet/api/microsoft.extensions.logging.ilogger) available via [ASP.NET Core's dependency injection](https://learn.microsoft.com/aspnet/core/fundamentals/dependency-injection). -- This feature relies on a hosting startup assembly. If the target application [disabled automatic loading](https://learn.microsoft.com/aspnet/core/fundamentals/host/platform-specific-configuration#disable-automatic-loading-of-hosting-startup-assemblies) of these, this feature will not be available. - This feature relies on a [ICorProfilerCallback](https://docs.microsoft.com/dotnet/framework/unmanaged-api/profiling/icorprofilercallback-interface) implementation. If the target application is already using an `ICorProfiler` that isn't notify-only, this feature will not be available. - If a target application is using .NET 7 then the `dotnet-monitor` startup hook must be configured. This is automatically done in .NET 8+. diff --git a/dotnet-monitor.sln b/dotnet-monitor.sln index a44a392a57e..338f5bdc028 100644 --- a/dotnet-monitor.sln +++ b/dotnet-monitor.sln @@ -70,10 +70,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Diagnostics.Monit EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Extensions", "Extensions", "{D3FEE1C0-E1E7-4796-A217-B46E3B6CCCCD}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Diagnostics.Monitoring.HostingStartup", "src\Microsoft.Diagnostics.Monitoring.HostingStartup\Microsoft.Diagnostics.Monitoring.HostingStartup.csproj", "{86BDA5CD-6A18-4EC2-9F13-F1A2723DD864}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests", "src\Tests\Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests\Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests.csproj", "{B9216DD7-F216-490A-A388-BBE0EC946EF2}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -188,14 +184,6 @@ Global {E7EA323B-0CFE-4D42-9844-4C322A3BC54A}.Debug|Any CPU.Build.0 = Debug|Any CPU {E7EA323B-0CFE-4D42-9844-4C322A3BC54A}.Release|Any CPU.ActiveCfg = Release|Any CPU {E7EA323B-0CFE-4D42-9844-4C322A3BC54A}.Release|Any CPU.Build.0 = Release|Any CPU - {86BDA5CD-6A18-4EC2-9F13-F1A2723DD864}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {86BDA5CD-6A18-4EC2-9F13-F1A2723DD864}.Debug|Any CPU.Build.0 = Debug|Any CPU - {86BDA5CD-6A18-4EC2-9F13-F1A2723DD864}.Release|Any CPU.ActiveCfg = Release|Any CPU - {86BDA5CD-6A18-4EC2-9F13-F1A2723DD864}.Release|Any CPU.Build.0 = Release|Any CPU - {B9216DD7-F216-490A-A388-BBE0EC946EF2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B9216DD7-F216-490A-A388-BBE0EC946EF2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B9216DD7-F216-490A-A388-BBE0EC946EF2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B9216DD7-F216-490A-A388-BBE0EC946EF2}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -231,8 +219,6 @@ Global {72EC615C-E1BE-4D27-A0FC-C0FEE483D3D2} = {19FAB78C-3351-4911-8F0C-8C6056401740} {E7EA323B-0CFE-4D42-9844-4C322A3BC54A} = {C7568468-1C79-4944-8136-18812A7F9EA7} {D3FEE1C0-E1E7-4796-A217-B46E3B6CCCCD} = {19FAB78C-3351-4911-8F0C-8C6056401740} - {86BDA5CD-6A18-4EC2-9F13-F1A2723DD864} = {19FAB78C-3351-4911-8F0C-8C6056401740} - {B9216DD7-F216-490A-A388-BBE0EC946EF2} = {C7568468-1C79-4944-8136-18812A7F9EA7} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {46465737-C938-44FC-BE1A-4CE139EBB5E0} diff --git a/eng/AfterSolutionBuild.targets b/eng/AfterSolutionBuild.targets index af7ca5f7f55..809cbd183bc 100644 --- a/eng/AfterSolutionBuild.targets +++ b/eng/AfterSolutionBuild.targets @@ -3,7 +3,6 @@ - diff --git a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/HostingStartup.cs b/src/Microsoft.Diagnostics.Monitoring.HostingStartup/HostingStartup.cs deleted file mode 100644 index 91ea0e08644..00000000000 --- a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/HostingStartup.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using Microsoft.AspNetCore.Hosting; -using Microsoft.Diagnostics.Monitoring.HostingStartup; -using Microsoft.Diagnostics.Tools.Monitor; -using Microsoft.Diagnostics.Tools.Monitor.HostingStartup; -using System.Threading; - -[assembly: HostingStartup(typeof(HostingStartup))] -namespace Microsoft.Diagnostics.Monitoring.HostingStartup -{ - internal sealed class HostingStartup : IHostingStartup - { - public static int InvocationCount; - - public void Configure(IWebHostBuilder builder) - { - builder.ConfigureServices(services => - { - // Keep track of how many times this hosting startup has been invoked for easy - // validation in tests. - Interlocked.Increment(ref InvocationCount); - - // TODO: remove the HostingStartup project. - }); - - ToolIdentifiers.EnableEnvVar(InProcessFeaturesIdentifiers.EnvironmentVariables.AvailableInfrastructure.HostingStartup); - } - } -} diff --git a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/Microsoft.Diagnostics.Monitoring.HostingStartup.csproj b/src/Microsoft.Diagnostics.Monitoring.HostingStartup/Microsoft.Diagnostics.Monitoring.HostingStartup.csproj deleted file mode 100644 index 904e8f90395..00000000000 --- a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/Microsoft.Diagnostics.Monitoring.HostingStartup.csproj +++ /dev/null @@ -1,45 +0,0 @@ - - - - - net6.0 - true - Library - $(DefineConstants);HOSTINGSTARTUP - enable - True - - - - - - - - - - - - - - - - - - - - - - True - True - ParameterCapturingStrings.resx - - - - - - ResXFileCodeGenerator - ParameterCapturingStrings.Designer.cs - - - - diff --git a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ProjectsToPublish.props b/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ProjectsToPublish.props deleted file mode 100644 index 958e293fe26..00000000000 --- a/src/Microsoft.Diagnostics.Monitoring.HostingStartup/ProjectsToPublish.props +++ /dev/null @@ -1,15 +0,0 @@ - - - net6.0 - Microsoft.Diagnostics.Monitoring.HostingStartup - $(ArtifactsDir)pub\$(HostingStartupLibraryName)\$(Configuration)\$(HostingStartupTargetFramework)\ - $(HostingStartupPublishPath)$(HostingStartupLibraryName).dll - $(HostingStartupPublishPath)$(HostingStartupLibraryName).pdb - - - - - TargetFramework=$(HostingStartupTargetFramework);RuntimeIdentifier=;PublishDir=$(HostingStartupPublishPath) - - - diff --git a/src/Microsoft.Diagnostics.Monitoring.Options/IMethodDescription.cs b/src/Microsoft.Diagnostics.Monitoring.Options/IMethodDescription.cs index a2c5c1b1173..7191e1f9931 100644 --- a/src/Microsoft.Diagnostics.Monitoring.Options/IMethodDescription.cs +++ b/src/Microsoft.Diagnostics.Monitoring.Options/IMethodDescription.cs @@ -3,7 +3,7 @@ using System.Text.Json.Serialization; -#if STARTUPHOOK || HOSTINGSTARTUP +#if STARTUPHOOK namespace Microsoft.Diagnostics.Monitoring.StartupHook.MonitorMessageDispatcher.Models #else namespace Microsoft.Diagnostics.Monitoring.Options diff --git a/src/Microsoft.Diagnostics.Monitoring.StartupHook/AspNetHostingStartupLoader.cs b/src/Microsoft.Diagnostics.Monitoring.StartupHook/AspNetHostingStartupLoader.cs deleted file mode 100644 index 158a17fe3ee..00000000000 --- a/src/Microsoft.Diagnostics.Monitoring.StartupHook/AspNetHostingStartupLoader.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.IO; -using System.Reflection; -using System.Runtime.Loader; - -namespace Microsoft.Diagnostics.Monitoring.StartupHook -{ - internal sealed class AspNetHostingStartupLoader : IDisposable - { - private readonly string _filePath; - private readonly string _simpleAssemblyName; - - private long _disposedState; - - public AspNetHostingStartupLoader(string filePath) - { - _filePath = filePath; - _simpleAssemblyName = CalculateSimpleAssemblyName(filePath); - - RegisterHostingStartupAssembly(_simpleAssemblyName); - AssemblyLoadContext.Default.Resolving += AssemblyResolver; - } - - private Assembly? AssemblyResolver(AssemblyLoadContext context, AssemblyName assemblyName) - { - if (_simpleAssemblyName.Equals(assemblyName.Name, StringComparison.OrdinalIgnoreCase)) - { - return AssemblyLoadContext.Default.LoadFromAssemblyPath(_filePath); - } - - return null; - } - - private static string CalculateSimpleAssemblyName(string filePath) - { - string fileName = Path.GetFileName(filePath); - const string dllExtension = ".dll"; - if (dllExtension.Equals(Path.GetExtension(fileName), StringComparison.OrdinalIgnoreCase)) - { - return fileName[..^dllExtension.Length]; - } - - return fileName; - } - - private static void RegisterHostingStartupAssembly(string simpleAssemblyName) - { - const string HostingStartupEnvVariable = "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES"; - // aspnetcore explicitly uses ; as the delimiter for the above environment variable. - // ref: https://github.com/dotnet/aspnetcore/blob/898c164a1f537a8210a26eaf388bdc92531f6b09/src/Hosting/Hosting/src/Internal/WebHostOptions.cs#L79 - const char Delimiter = ';'; - - string? curValue = Environment.GetEnvironmentVariable(HostingStartupEnvVariable); - string newValue = string.IsNullOrWhiteSpace(curValue) ? simpleAssemblyName : string.Concat(curValue, Delimiter, simpleAssemblyName); - Environment.SetEnvironmentVariable(HostingStartupEnvVariable, newValue); - } - - public void Dispose() - { - if (!DisposableHelper.CanDispose(ref _disposedState)) - return; - - AssemblyLoadContext.Default.Resolving -= AssemblyResolver; - } - } -} diff --git a/src/Microsoft.Diagnostics.Monitoring.StartupHook/DiagnosticsBootstrapper.cs b/src/Microsoft.Diagnostics.Monitoring.StartupHook/DiagnosticsBootstrapper.cs index 66d06861518..080201c31e5 100644 --- a/src/Microsoft.Diagnostics.Monitoring.StartupHook/DiagnosticsBootstrapper.cs +++ b/src/Microsoft.Diagnostics.Monitoring.StartupHook/DiagnosticsBootstrapper.cs @@ -5,11 +5,9 @@ using Microsoft.Diagnostics.Monitoring.StartupHook.Monitoring; using Microsoft.Diagnostics.Monitoring.StartupHook.ParameterCapturing; using Microsoft.Diagnostics.Tools.Monitor; -using Microsoft.Diagnostics.Tools.Monitor.HostingStartup; using Microsoft.Diagnostics.Tools.Monitor.Profiler; using Microsoft.Diagnostics.Tools.Monitor.StartupHook; using System; -using System.IO; using MessageDispatcher = Microsoft.Diagnostics.Monitoring.StartupHook.MonitorMessageDispatcher; namespace Microsoft.Diagnostics.Monitoring.StartupHook @@ -18,7 +16,6 @@ internal sealed class DiagnosticsBootstrapper : IDisposable { private readonly CurrentAppDomainExceptionProcessor _exceptionProcessor; - private readonly AspNetHostingStartupLoader? _hostingStartupLoader; private readonly ParameterCapturingService? _parameterCapturingService; private long _disposedState; @@ -30,13 +27,6 @@ public DiagnosticsBootstrapper() using IDisposable _ = MonitorExecutionContextTracker.MonitorScope(); - string? hostingStartupPath = Environment.GetEnvironmentVariable(StartupHookIdentifiers.EnvironmentVariables.HostingStartupPath); - // TODO: Log if specified hosting startup assembly doesn't exist - if (File.Exists(hostingStartupPath)) - { - _hostingStartupLoader = new AspNetHostingStartupLoader(hostingStartupPath); - } - try { // Check that the profiler is loaded before establishing the dispatcher, which has a dependency on the existence of the profiler @@ -68,7 +58,6 @@ public void Dispose() _exceptionProcessor.Dispose(); _parameterCapturingService?.Stop(); _parameterCapturingService?.Dispose(); - _hostingStartupLoader?.Dispose(); SharedInternals.MessageDispatcher?.Dispose(); } } diff --git a/src/Microsoft.Diagnostics.Monitoring.StartupHook/Microsoft.Diagnostics.Monitoring.StartupHook.csproj b/src/Microsoft.Diagnostics.Monitoring.StartupHook/Microsoft.Diagnostics.Monitoring.StartupHook.csproj index 8459975bcf3..353f6c571e0 100644 --- a/src/Microsoft.Diagnostics.Monitoring.StartupHook/Microsoft.Diagnostics.Monitoring.StartupHook.csproj +++ b/src/Microsoft.Diagnostics.Monitoring.StartupHook/Microsoft.Diagnostics.Monitoring.StartupHook.csproj @@ -14,7 +14,6 @@ - @@ -27,9 +26,7 @@ - - diff --git a/src/Microsoft.Diagnostics.Monitoring.WebApi/IInProcessFeatures.cs b/src/Microsoft.Diagnostics.Monitoring.WebApi/IInProcessFeatures.cs index e0c7b2123d5..3ce243d9c73 100644 --- a/src/Microsoft.Diagnostics.Monitoring.WebApi/IInProcessFeatures.cs +++ b/src/Microsoft.Diagnostics.Monitoring.WebApi/IInProcessFeatures.cs @@ -10,8 +10,6 @@ public interface IInProcessFeatures bool IsStartupHookRequired { get; } - bool IsHostingStartupRequired { get; } - bool IsLibrarySharingRequired { get; } } } diff --git a/src/Microsoft.Diagnostics.Monitoring.WebApi/KeyValueLogScope.cs b/src/Microsoft.Diagnostics.Monitoring.WebApi/KeyValueLogScope.cs index 76f62de6635..8039539695f 100644 --- a/src/Microsoft.Diagnostics.Monitoring.WebApi/KeyValueLogScope.cs +++ b/src/Microsoft.Diagnostics.Monitoring.WebApi/KeyValueLogScope.cs @@ -5,11 +5,7 @@ using System.Collections.Generic; using System.Text; -#if HOSTINGSTARTUP -namespace Microsoft.Diagnostics.Monitoring.HostingStartup -#else namespace Microsoft.Diagnostics.Monitoring.WebApi -#endif { // Logger implementations have different ways of serializing log scopes. This class helps those loggers // serialize the scope information in the best way possible for each of the implementations. diff --git a/src/Microsoft.Diagnostics.Monitoring.WebApi/KeyValueLogScopeExtensions.cs b/src/Microsoft.Diagnostics.Monitoring.WebApi/KeyValueLogScopeExtensions.cs index b94b3e0972a..43f0f238c17 100644 --- a/src/Microsoft.Diagnostics.Monitoring.WebApi/KeyValueLogScopeExtensions.cs +++ b/src/Microsoft.Diagnostics.Monitoring.WebApi/KeyValueLogScopeExtensions.cs @@ -2,14 +2,9 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Collections.Generic; - -#if HOSTINGSTARTUP -namespace Microsoft.Diagnostics.Monitoring.HostingStartup -#else using System.Globalization; namespace Microsoft.Diagnostics.Monitoring.WebApi -#endif { internal static class KeyValueLogScopeExtensions { @@ -17,7 +12,7 @@ public static void Add(this List> values, string ke { values.Add(new KeyValuePair(key, value)); } -#if !HOSTINGSTARTUP + public static void AddArtifactType(this KeyValueLogScope scope, string artifactType) { scope.Values.Add("ArtifactType", artifactType); @@ -32,6 +27,5 @@ public static void AddArtifactEndpointInfo(this KeyValueLogScope scope, IEndpoin ArtifactMetadataNames.ArtifactSource.RuntimeInstanceCookie, endpointInfo.RuntimeInstanceCookie.ToString("N")); } -#endif } } diff --git a/src/Microsoft.Diagnostics.Monitoring.WebApi/Models/CaptureParametersConfiguration.cs b/src/Microsoft.Diagnostics.Monitoring.WebApi/Models/CaptureParametersConfiguration.cs index e967a080b30..e0c4a7181b2 100644 --- a/src/Microsoft.Diagnostics.Monitoring.WebApi/Models/CaptureParametersConfiguration.cs +++ b/src/Microsoft.Diagnostics.Monitoring.WebApi/Models/CaptureParametersConfiguration.cs @@ -5,7 +5,7 @@ using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; -#if STARTUPHOOK || HOSTINGSTARTUP +#if STARTUPHOOK namespace Microsoft.Diagnostics.Monitoring.StartupHook.MonitorMessageDispatcher.Models #else namespace Microsoft.Diagnostics.Monitoring.WebApi.Models diff --git a/src/Microsoft.Diagnostics.Monitoring.WebApi/Models/MethodDescription.cs b/src/Microsoft.Diagnostics.Monitoring.WebApi/Models/MethodDescription.cs index 62aea680ec6..8a7b18afca0 100644 --- a/src/Microsoft.Diagnostics.Monitoring.WebApi/Models/MethodDescription.cs +++ b/src/Microsoft.Diagnostics.Monitoring.WebApi/Models/MethodDescription.cs @@ -4,7 +4,7 @@ using System; using System.ComponentModel.DataAnnotations; -#if STARTUPHOOK || HOSTINGSTARTUP +#if STARTUPHOOK namespace Microsoft.Diagnostics.Monitoring.StartupHook.MonitorMessageDispatcher.Models #else using Microsoft.Diagnostics.Monitoring.Options; diff --git a/src/Microsoft.Diagnostics.Monitoring.WebApi/ProfilerMessage.cs b/src/Microsoft.Diagnostics.Monitoring.WebApi/ProfilerMessage.cs index 6255ace92af..f40475a9489 100644 --- a/src/Microsoft.Diagnostics.Monitoring.WebApi/ProfilerMessage.cs +++ b/src/Microsoft.Diagnostics.Monitoring.WebApi/ProfilerMessage.cs @@ -6,7 +6,7 @@ using System.Text.Json; -#if STARTUPHOOK || HOSTINGSTARTUP +#if STARTUPHOOK namespace Microsoft.Diagnostics.Monitoring.StartupHook.Monitoring #else namespace Microsoft.Diagnostics.Monitoring @@ -29,9 +29,6 @@ public enum ProfilerCommand : ushort Callstack }; - /// - /// Shared between the StartupHook and HostingStartup assembly. - /// public enum StartupHookCommand : ushort { StartCapturingParameters, diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests.csproj b/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests.csproj deleted file mode 100644 index a20295d2c7d..00000000000 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests/Microsoft.Diagnostics.Monitoring.HostingStartup.UnitTests.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - $(TestTargetFrameworks) - True - enable - - - - - - - diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.TestCommon/Microsoft.Diagnostics.Monitoring.TestCommon.csproj b/src/Tests/Microsoft.Diagnostics.Monitoring.TestCommon/Microsoft.Diagnostics.Monitoring.TestCommon.csproj index a8410dac814..3544d5bfdd2 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.TestCommon/Microsoft.Diagnostics.Monitoring.TestCommon.csproj +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.TestCommon/Microsoft.Diagnostics.Monitoring.TestCommon.csproj @@ -33,7 +33,6 @@ - diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.TestCommon/TestAppScenarios.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.TestCommon/TestAppScenarios.cs index f73606f941e..fe4766ef238 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.TestCommon/TestAppScenarios.cs +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.TestCommon/TestAppScenarios.cs @@ -120,18 +120,6 @@ public static class SubScenarios } } - public static class HostingStartup - { - public const string Name = nameof(HostingStartup); - - public static class SubScenarios - { - public const string VerifyAspNetAppWithoutHostingStartup = nameof(VerifyAspNetAppWithoutHostingStartup); - public const string VerifyAspNetApp = nameof(VerifyAspNetApp); - public const string VerifyNonAspNetAppNotImpacted = nameof(VerifyNonAspNetAppNotImpacted); - } - } - public static class Stacks { public const string Name = nameof(Stacks); diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests/FunctionProbesTests.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests/FunctionProbesTests.cs index df567693153..cea57664c78 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests/FunctionProbesTests.cs +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests/FunctionProbesTests.cs @@ -4,7 +4,7 @@ using Microsoft.Diagnostics.Monitoring.TestCommon; using Microsoft.Diagnostics.Monitoring.TestCommon.Runners; using Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests.Fixtures; -using Microsoft.Diagnostics.Tools.Monitor.HostingStartup; +using Microsoft.Diagnostics.Tools.Monitor.StartupHook; using Microsoft.Extensions.DependencyInjection; using System.Collections.Generic; using System.Linq; diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests/HostingStartupTests.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests/HostingStartupTests.cs deleted file mode 100644 index fee42ee1bfd..00000000000 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests/HostingStartupTests.cs +++ /dev/null @@ -1,62 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using Microsoft.Diagnostics.Monitoring.TestCommon; -using Microsoft.Diagnostics.Monitoring.TestCommon.Options; -using Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests.Fixtures; -using Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests.Runners; -using Microsoft.Diagnostics.Monitoring.WebApi; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; -using System.Net.Http; -using System.Threading.Tasks; -using Xunit; -using Xunit.Abstractions; - -namespace Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests -{ - [TargetFrameworkMonikerTrait(TargetFrameworkMonikerExtensions.CurrentTargetFrameworkMoniker)] - [Collection(DefaultCollectionFixture.Name)] - public class HostingStartupTests - { - private readonly IHttpClientFactory _httpClientFactory; - private readonly ITestOutputHelper _outputHelper; - - public HostingStartupTests(ITestOutputHelper outputHelper, ServiceProviderFixture serviceProviderFixture) - { - _httpClientFactory = serviceProviderFixture.ServiceProvider.GetService(); - _outputHelper = outputHelper; - } - - - [Theory] - [InlineData(TestAppScenarios.HostingStartup.SubScenarios.VerifyAspNetApp, true)] - [InlineData(TestAppScenarios.HostingStartup.SubScenarios.VerifyAspNetAppWithoutHostingStartup, false)] - [InlineData(TestAppScenarios.HostingStartup.SubScenarios.VerifyNonAspNetAppNotImpacted, true)] - - public async Task HostingStartupLoadTests(string subScenario, bool tryLoadHostingStartup) - { - await ScenarioRunner.SingleTarget( - _outputHelper, - _httpClientFactory, - DiagnosticPortConnectionMode.Listen, - TestAppScenarios.HostingStartup.Name, - appValidate: (runner, client) => { return Task.CompletedTask; }, - configureApp: runner => - { - runner.EnableMonitorStartupHook = true; - }, - configureTool: runner => - { - runner.ConfigurationFromEnvironment.EnableInProcessFeatures(); - // Enable a feature that requires the hosting startup assembly. - runner.ConfigurationFromEnvironment.InProcessFeatures.ParameterCapturing = new() - { - Enabled = tryLoadHostingStartup - }; - }, - profilerLogLevel: LogLevel.Trace, - subScenarioName: subScenario); - } - } -} diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests.csproj b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests.csproj index 3b632639638..c2373b90b27 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests.csproj +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests.csproj @@ -85,7 +85,6 @@ - diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/StartupHookTests.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/StartupHookTests.cs index 25358ee9d2e..d9cf19c2681 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/StartupHookTests.cs +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/StartupHookTests.cs @@ -4,7 +4,7 @@ using Microsoft.Diagnostics.Monitoring.TestCommon; using Microsoft.Diagnostics.Monitoring.TestCommon.Runners; using Microsoft.Diagnostics.NETCore.Client; -using Microsoft.Diagnostics.Tools.Monitor.HostingStartup; +using Microsoft.Diagnostics.Tools.Monitor.StartupHook; using Microsoft.Extensions.Logging; using System; using System.Collections.Generic; diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/Microsoft.Diagnostics.Monitoring.UnitTestApp.csproj b/src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/Microsoft.Diagnostics.Monitoring.UnitTestApp.csproj index dee00113162..cd3ab6d95da 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/Microsoft.Diagnostics.Monitoring.UnitTestApp.csproj +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/Microsoft.Diagnostics.Monitoring.UnitTestApp.csproj @@ -12,7 +12,6 @@ - diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/Program.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/Program.cs index 256bdd5cf47..f5cfd0d8d36 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/Program.cs +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/Program.cs @@ -22,7 +22,6 @@ public static Task Main(string[] args) FunctionProbesScenario.Command(), LoggerScenario.Command(), ParameterCapturingScenario.Command(), - HostingStartupScenario.Command(), SpinWaitScenario.Command(), EnvironmentVariablesScenario.Command(), StacksScenario.Command(), diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/Scenarios/HostingStartupScenario.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/Scenarios/HostingStartupScenario.cs deleted file mode 100644 index 582aeab617d..00000000000 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/Scenarios/HostingStartupScenario.cs +++ /dev/null @@ -1,81 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Http; -using Microsoft.Diagnostics.Monitoring.TestCommon; -using Microsoft.Extensions.DependencyInjection; -using System.CommandLine; -using System.Threading; -using System.Threading.Tasks; -using Xunit; - -namespace Microsoft.Diagnostics.Monitoring.UnitTestApp.Scenarios -{ - internal sealed class HostingStartupScenario - { - public static CliCommand Command() - { - CliCommand aspnetAppNoHostingStartupCommand = new(TestAppScenarios.HostingStartup.SubScenarios.VerifyAspNetAppWithoutHostingStartup); - aspnetAppNoHostingStartupCommand.SetAction(VerifyAspNetAppWithoutHostingStartupAsync); - - CliCommand aspnetAppCommand = new(TestAppScenarios.HostingStartup.SubScenarios.VerifyAspNetApp); - aspnetAppCommand.SetAction(VerifyAspNetAppAsync); - - CliCommand nonAspNetAppCommand = new(TestAppScenarios.HostingStartup.SubScenarios.VerifyNonAspNetAppNotImpacted); - nonAspNetAppCommand.SetAction(VerifyNonAspNetAppNotImpactedAsync); - - CliCommand scenarioCommand = new(TestAppScenarios.HostingStartup.Name); - scenarioCommand.Subcommands.Add(aspnetAppNoHostingStartupCommand); - scenarioCommand.Subcommands.Add(aspnetAppCommand); - scenarioCommand.Subcommands.Add(nonAspNetAppCommand); - return scenarioCommand; - } - - public static Task VerifyNonAspNetAppNotImpactedAsync(ParseResult result, CancellationToken token) - { - return ScenarioHelpers.RunScenarioAsync(logger => - { - Assert.Equal(0, HostingStartup.HostingStartup.InvocationCount); - return Task.FromResult(0); - }, token); - } - - public static Task VerifyAspNetAppWithoutHostingStartupAsync(ParseResult result, CancellationToken token) - { - return ScenarioHelpers.RunWebScenarioAsync(logger => - { - Assert.Equal(0, HostingStartup.HostingStartup.InvocationCount); - return Task.FromResult(0); - }, token); - } - - public static Task VerifyAspNetAppAsync(ParseResult result, CancellationToken token) - { - return ScenarioHelpers.RunWebScenarioAsync(logger => - { - Assert.Equal(1, HostingStartup.HostingStartup.InvocationCount); - return Task.FromResult(0); - }, token); - } - - private sealed class Startup - { - public static void ConfigureServices(IServiceCollection services) - { - services.AddControllers(); - } - - public static void Configure(IApplicationBuilder app, IWebHostEnvironment env) - { - app.UseRouting(); - - app.UseEndpoints(endpoints => - { - endpoints.MapGet("/", () => Results.Ok()); - }); - } - } - } -} diff --git a/src/Tools/dotnet-monitor/Commands/CollectCommandHandler.cs b/src/Tools/dotnet-monitor/Commands/CollectCommandHandler.cs index 799ff74c852..32b2f930c9e 100644 --- a/src/Tools/dotnet-monitor/Commands/CollectCommandHandler.cs +++ b/src/Tools/dotnet-monitor/Commands/CollectCommandHandler.cs @@ -133,7 +133,6 @@ private static IHostBuilder Configure(this IHostBuilder builder, StartupAuthenti services.ConfigureLibrarySharing(); services.ConfigureProfiler(); services.ConfigureStartupHook(); - services.ConfigureHostingStartup(); services.ConfigureExceptions(); services.ConfigureStartupLoggers(authConfigurator); services.ConfigureInProcessFeatures(context.Configuration); diff --git a/src/Tools/dotnet-monitor/HostingStartup/HostingStartupService.cs b/src/Tools/dotnet-monitor/HostingStartup/HostingStartupService.cs deleted file mode 100644 index 9836d4b2fba..00000000000 --- a/src/Tools/dotnet-monitor/HostingStartup/HostingStartupService.cs +++ /dev/null @@ -1,91 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using Microsoft.Diagnostics.Monitoring.WebApi; -using Microsoft.Diagnostics.NETCore.Client; -using Microsoft.Diagnostics.Tools.Monitor.LibrarySharing; -using Microsoft.Diagnostics.Tools.Monitor.StartupHook; -using Microsoft.Extensions.FileProviders; -using Microsoft.Extensions.Logging; -using System; -using System.IO; -using System.Threading; -using System.Threading.Tasks; - -namespace Microsoft.Diagnostics.Tools.Monitor.HostingStartup -{ - internal sealed class HostingStartupService - : IDiagnosticLifetimeService - { - // Intent is to ship a single TFM of the hosting startup, which should be the lowest supported version. - private const string HostingStartupFileName = "Microsoft.Diagnostics.Monitoring.HostingStartup.dll"; - private const string HostingStartupTargetFramework = "net6.0"; - - private readonly IEndpointInfo _endpointInfo; - private readonly StartupHookService _startupHookService; - private readonly IInProcessFeatures _inProcessFeatures; - private readonly ISharedLibraryService _sharedLibraryService; - private readonly ILogger _logger; - - public HostingStartupService( - IEndpointInfo endpointInfo, - StartupHookService startupHookService, - ISharedLibraryService sharedLibraryService, - IInProcessFeatures inProcessFeatures, - ILogger logger) - { - _endpointInfo = endpointInfo; - _startupHookService = startupHookService; - _inProcessFeatures = inProcessFeatures; - _sharedLibraryService = sharedLibraryService; - _logger = logger; - } - - public async ValueTask StartAsync(CancellationToken cancellationToken) - { - if (!_inProcessFeatures.IsHostingStartupRequired) - { - return; - } - - // Hosting startup is only supported on .NET 6+ - if (_endpointInfo.RuntimeVersion == null || _endpointInfo.RuntimeVersion.Major < 6) - { - return; - } - - try - { - // Hosting startup requires the startup hook - if (!await _startupHookService.Applied.WaitAsync(cancellationToken)) - { - return; - } - - IFileProviderFactory fileProviderFactory = await _sharedLibraryService.GetFactoryAsync(cancellationToken); - IFileProvider managedFileProvider = fileProviderFactory.CreateManaged(HostingStartupTargetFramework); - - IFileInfo hostingStartupLibraryFileInfo = managedFileProvider.GetFileInfo(HostingStartupFileName); - if (!hostingStartupLibraryFileInfo.Exists) - { - throw new FileNotFoundException(Strings.ErrorMessage_UnableToFindHostingStartupAssembly, hostingStartupLibraryFileInfo.Name); - } - - DiagnosticsClient client = new DiagnosticsClient(_endpointInfo.Endpoint); - await client.SetEnvironmentVariableAsync( - StartupHookIdentifiers.EnvironmentVariables.HostingStartupPath, - hostingStartupLibraryFileInfo.PhysicalPath, - cancellationToken); - } - catch (Exception ex) - { - _logger.UnableToApplyHostingStartup(ex); - } - } - - public ValueTask StopAsync(CancellationToken cancellationToken) - { - return ValueTask.CompletedTask; - } - } -} diff --git a/src/Tools/dotnet-monitor/InProcessFeatures/InProcessFeatures.cs b/src/Tools/dotnet-monitor/InProcessFeatures/InProcessFeatures.cs index 55f99c6d780..8d48f0313a2 100644 --- a/src/Tools/dotnet-monitor/InProcessFeatures/InProcessFeatures.cs +++ b/src/Tools/dotnet-monitor/InProcessFeatures/InProcessFeatures.cs @@ -32,10 +32,8 @@ public InProcessFeatures( public bool IsMutatingProfilerRequired => IsParameterCapturingEnabled; - public bool IsStartupHookRequired => IsHostingStartupRequired || IsExceptionsEnabled; + public bool IsStartupHookRequired => IsParameterCapturingEnabled || IsExceptionsEnabled; - public bool IsHostingStartupRequired => IsParameterCapturingEnabled; - - public bool IsLibrarySharingRequired => IsProfilerRequired || IsStartupHookRequired || IsHostingStartupRequired; + public bool IsLibrarySharingRequired => IsProfilerRequired || IsStartupHookRequired; } } diff --git a/src/Tools/dotnet-monitor/InProcessFeatures/InProcessFeaturesEndpointInfoSourceCallbacks.cs b/src/Tools/dotnet-monitor/InProcessFeatures/InProcessFeaturesEndpointInfoSourceCallbacks.cs index f194c6bf7fe..0c3aa44491c 100644 --- a/src/Tools/dotnet-monitor/InProcessFeatures/InProcessFeaturesEndpointInfoSourceCallbacks.cs +++ b/src/Tools/dotnet-monitor/InProcessFeatures/InProcessFeaturesEndpointInfoSourceCallbacks.cs @@ -5,7 +5,7 @@ using System.Threading; using System.Threading.Tasks; -namespace Microsoft.Diagnostics.Tools.Monitor.HostingStartup +namespace Microsoft.Diagnostics.Tools.Monitor.StartupHook { internal sealed class InProcessFeaturesEndpointInfoSourceCallbacks : IEndpointInfoSourceCallbacks { diff --git a/src/Tools/dotnet-monitor/InProcessFeatures/InProcessFeaturesIdentifiers.cs b/src/Tools/dotnet-monitor/InProcessFeatures/InProcessFeaturesIdentifiers.cs index 3e2606a040a..c4e2118d210 100644 --- a/src/Tools/dotnet-monitor/InProcessFeatures/InProcessFeaturesIdentifiers.cs +++ b/src/Tools/dotnet-monitor/InProcessFeatures/InProcessFeaturesIdentifiers.cs @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -namespace Microsoft.Diagnostics.Tools.Monitor.HostingStartup +namespace Microsoft.Diagnostics.Tools.Monitor.StartupHook { public static class InProcessFeaturesIdentifiers { @@ -26,7 +26,6 @@ public static class AvailableInfrastructure private const string AvailableInfrastructurePrefix = InProcessFeaturesPrefix + "AvailableInfrastructure_"; public const string ManagedMessaging = AvailableInfrastructurePrefix + nameof(ManagedMessaging); public const string StartupHook = AvailableInfrastructurePrefix + nameof(StartupHook); - public const string HostingStartup = AvailableInfrastructurePrefix + nameof(HostingStartup); } } } diff --git a/src/Tools/dotnet-monitor/InProcessFeatures/InProcessFeaturesService.cs b/src/Tools/dotnet-monitor/InProcessFeatures/InProcessFeaturesService.cs index bd5d37b83e5..4311f8a5b7f 100644 --- a/src/Tools/dotnet-monitor/InProcessFeatures/InProcessFeaturesService.cs +++ b/src/Tools/dotnet-monitor/InProcessFeatures/InProcessFeaturesService.cs @@ -11,7 +11,7 @@ using System.Threading; using System.Threading.Tasks; -namespace Microsoft.Diagnostics.Tools.Monitor.HostingStartup +namespace Microsoft.Diagnostics.Tools.Monitor.StartupHook { internal sealed class InProcessFeaturesService { diff --git a/src/Tools/dotnet-monitor/LoggingExtensions.cs b/src/Tools/dotnet-monitor/LoggingExtensions.cs index 0a44b655669..5578be3cee7 100644 --- a/src/Tools/dotnet-monitor/LoggingExtensions.cs +++ b/src/Tools/dotnet-monitor/LoggingExtensions.cs @@ -512,12 +512,6 @@ internal static class LoggingExtensions logLevel: LogLevel.Debug, formatString: Strings.LogFormatString_EndpointRemovalFailed); - private static readonly Action _unableToApplyHostingStartup = - LoggerMessage.Define( - eventId: LoggingEventIds.UnableToApplyHostingStartup.EventId(), - logLevel: LogLevel.Error, - formatString: Strings.LogFormatString_UnableToApplyHostingStartup); - private static readonly Action _unableToApplyInProcessFeatureFlags = LoggerMessage.Define( eventId: LoggingEventIds.UnableToApplyInProcessFeatureFlags.EventId(), @@ -954,11 +948,6 @@ public static void EndpointRemovalFailed(this ILogger logger, int processId, Exc _endpointRemovalFailed(logger, processId, ex); } - public static void UnableToApplyHostingStartup(this ILogger logger, Exception ex) - { - _unableToApplyHostingStartup(logger, ex); - } - public static void UnableToApplyInProcessFeatureFlags(this ILogger logger, Exception ex) { _unableToApplyInProcessFeatureFlags(logger, ex); diff --git a/src/Tools/dotnet-monitor/ParameterCapturing/CaptureParametersOperation.cs b/src/Tools/dotnet-monitor/ParameterCapturing/CaptureParametersOperation.cs index f8c9dcc1214..12c32830bf8 100644 --- a/src/Tools/dotnet-monitor/ParameterCapturing/CaptureParametersOperation.cs +++ b/src/Tools/dotnet-monitor/ParameterCapturing/CaptureParametersOperation.cs @@ -6,8 +6,8 @@ using Microsoft.Diagnostics.Monitoring.WebApi; using Microsoft.Diagnostics.Monitoring.WebApi.Models; using Microsoft.Diagnostics.NETCore.Client; -using Microsoft.Diagnostics.Tools.Monitor.HostingStartup; using Microsoft.Diagnostics.Tools.Monitor.Profiler; +using Microsoft.Diagnostics.Tools.Monitor.StartupHook; using Microsoft.Extensions.Logging; using System; using System.Collections.Generic; @@ -94,13 +94,6 @@ static Exception getNotAvailableException(string reason) IDictionary env = await client.GetProcessEnvironmentAsync(token); - const string PreventHostingStartupEnvName = "ASPNETCORE_PREVENTHOSTINGSTARTUP"; - if (env.TryGetValue(PreventHostingStartupEnvName, out string preventHostingStartupEnvValue) && - ToolIdentifiers.IsEnvVarValueEnabled(preventHostingStartupEnvValue)) - { - throw getNotAvailableException(Strings.ParameterCapturingNotAvailable_Reason_PreventedHostingStartup); - } - if (!env.TryGetValue(InProcessFeaturesIdentifiers.EnvironmentVariables.AvailableInfrastructure.ManagedMessaging, out string isManagedMessagingAvailable) || !ToolIdentifiers.IsEnvVarValueEnabled(isManagedMessagingAvailable)) { diff --git a/src/Tools/dotnet-monitor/Profiler/ProfilerMessagePayloads.cs b/src/Tools/dotnet-monitor/Profiler/ProfilerMessagePayloads.cs index ded6c17f014..ed648f8ad8d 100644 --- a/src/Tools/dotnet-monitor/Profiler/ProfilerMessagePayloads.cs +++ b/src/Tools/dotnet-monitor/Profiler/ProfilerMessagePayloads.cs @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -#if STARTUPHOOK || HOSTINGSTARTUP +#if STARTUPHOOK using Microsoft.Diagnostics.Monitoring.StartupHook.MonitorMessageDispatcher.Models; #else using Microsoft.Diagnostics.Monitoring.WebApi.Models; diff --git a/src/Tools/dotnet-monitor/ServiceCollectionExtensions.cs b/src/Tools/dotnet-monitor/ServiceCollectionExtensions.cs index 159ad6037e8..0844ce7aaea 100644 --- a/src/Tools/dotnet-monitor/ServiceCollectionExtensions.cs +++ b/src/Tools/dotnet-monitor/ServiceCollectionExtensions.cs @@ -26,7 +26,6 @@ using Microsoft.Diagnostics.Tools.Monitor.Egress.FileSystem; using Microsoft.Diagnostics.Tools.Monitor.Exceptions; using Microsoft.Diagnostics.Tools.Monitor.Extensibility; -using Microsoft.Diagnostics.Tools.Monitor.HostingStartup; using Microsoft.Diagnostics.Tools.Monitor.LibrarySharing; using Microsoft.Diagnostics.Tools.Monitor.ParameterCapturing; using Microsoft.Diagnostics.Tools.Monitor.Profiler; @@ -358,13 +357,6 @@ public static IServiceCollection ConfigureExceptions(this IServiceCollection ser return services; } - public static IServiceCollection ConfigureHostingStartup(this IServiceCollection services) - { - services.AddScoped(); - services.AddScopedForwarder(); - return services; - } - public static IServiceCollection ConfigureStartupHook(this IServiceCollection services) { services.AddScoped(); diff --git a/src/Tools/dotnet-monitor/StartupHook/StartupHookIdentifiers.cs b/src/Tools/dotnet-monitor/StartupHook/StartupHookIdentifiers.cs deleted file mode 100644 index 5c581892070..00000000000 --- a/src/Tools/dotnet-monitor/StartupHook/StartupHookIdentifiers.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace Microsoft.Diagnostics.Tools.Monitor.StartupHook -{ - public static class StartupHookIdentifiers - { - public static class EnvironmentVariables - { - private const string StartupHookPrefix = ToolIdentifiers.StandardPrefix + "StartupHook_"; - - // The full path of a HostingStartup assembly to load into a target process. - public const string HostingStartupPath = StartupHookPrefix + nameof(HostingStartupPath); - } - } -} diff --git a/src/Tools/dotnet-monitor/Strings.Designer.cs b/src/Tools/dotnet-monitor/Strings.Designer.cs index af49d4f19b9..bf9c5d8a90a 100644 --- a/src/Tools/dotnet-monitor/Strings.Designer.cs +++ b/src/Tools/dotnet-monitor/Strings.Designer.cs @@ -538,15 +538,6 @@ internal static string ErrorMessage_UnableToDetermineTargetPlatform { } } - /// - /// Looks up a localized string similar to Unable to find hosting startup assembly at determined path.. - /// - internal static string ErrorMessage_UnableToFindHostingStartupAssembly { - get { - return ResourceManager.GetString("ErrorMessage_UnableToFindHostingStartupAssembly", resourceCulture); - } - } - /// /// Looks up a localized string similar to Unable to find profiler assembly at determined path.. /// @@ -1519,15 +1510,6 @@ internal static string LogFormatString_StartupHookInstructions { } } - /// - /// Looks up a localized string similar to Unable to apply hosting startup.. - /// - internal static string LogFormatString_UnableToApplyHostingStartup { - get { - return ResourceManager.GetString("LogFormatString_UnableToApplyHostingStartup", resourceCulture); - } - } - /// /// Looks up a localized string similar to Unable to apply in process feature flags.. /// @@ -1672,15 +1654,6 @@ internal static string ParameterCapturingNotAvailable_Reason_ManagedMessagingDid } } - /// - /// Looks up a localized string similar to The process has prevented hosting startup assemblies from loading using the ASPNETCORE_PREVENTHOSTINGSTARTUP environment variable.. - /// - internal static string ParameterCapturingNotAvailable_Reason_PreventedHostingStartup { - get { - return ResourceManager.GetString("ParameterCapturingNotAvailable_Reason_PreventedHostingStartup", resourceCulture); - } - } - /// /// Looks up a localized string similar to This feature requires the startup hook to be loaded in the target process.. /// diff --git a/src/Tools/dotnet-monitor/Strings.resx b/src/Tools/dotnet-monitor/Strings.resx index a63ac31d441..149fd3abebe 100644 --- a/src/Tools/dotnet-monitor/Strings.resx +++ b/src/Tools/dotnet-monitor/Strings.resx @@ -1,17 +1,17 @@  - @@ -897,12 +897,6 @@ 0. providerName: The name of the provider that failed validation. 1. errorMessage: The validation failure message - - Unable to find hosting startup assembly at determined path. - - - Unable to apply hosting startup. - Unable to apply in process feature flags. @@ -927,9 +921,6 @@ 1 Format Parameters: 0. reason: The reason why the feature is unavailable. - - The process has prevented hosting startup assemblies from loading using the ASPNETCORE_PREVENTHOSTINGSTARTUP environment variable. - This feature requires the startup hook to be loaded in the target process. diff --git a/src/Tools/dotnet-monitor/dotnet-monitor.csproj b/src/Tools/dotnet-monitor/dotnet-monitor.csproj index de82ee8efdc..241ee397586 100644 --- a/src/Tools/dotnet-monitor/dotnet-monitor.csproj +++ b/src/Tools/dotnet-monitor/dotnet-monitor.csproj @@ -73,7 +73,6 @@ - @@ -118,13 +117,6 @@ tools/$(TargetFramework)/any/shared/any/$(StartupHookTargetFramework) - - - tools/$(TargetFramework)/any/shared/any/$(HostingStartupTargetFramework) - - - tools/$(TargetFramework)/any/shared/any/$(HostingStartupTargetFramework) - diff --git a/src/archives/dotnet-monitor-base/Package.props b/src/archives/dotnet-monitor-base/Package.props index 6a317e71722..b82800d81e1 100644 --- a/src/archives/dotnet-monitor-base/Package.props +++ b/src/archives/dotnet-monitor-base/Package.props @@ -1,7 +1,6 @@ - dotnet-monitor From 6a13c8f695673e0e63ccce3266deeb9b4e4e9506 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Jun 2024 11:32:26 -0700 Subject: [PATCH 010/107] [main] Bump Microsoft.NETCore.DotNetHost in /eng/dependabot/net8.0 (#6736) Bumps [Microsoft.NETCore.DotNetHost](https://github.com/dotnet/runtime) from 8.0.5 to 8.0.6. - [Release notes](https://github.com/dotnet/runtime/releases) - [Commits](https://github.com/dotnet/runtime/compare/v8.0.5...v8.0.6) --- updated-dependencies: - dependency-name: Microsoft.NETCore.DotNetHost dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Wiktor Kopec --- eng/dependabot/net8.0/Versions.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/dependabot/net8.0/Versions.props b/eng/dependabot/net8.0/Versions.props index 0dd5910c8a9..81bacd28d4c 100644 --- a/eng/dependabot/net8.0/Versions.props +++ b/eng/dependabot/net8.0/Versions.props @@ -10,6 +10,6 @@ 8.0.0 - 8.0.5 + 8.0.6 From 4fb831d4f433edc90e7945c092ebb9483c38dee5 Mon Sep 17 00:00:00 2001 From: AntonPalyok Date: Tue, 4 Jun 2024 01:09:10 +0200 Subject: [PATCH 011/107] Add documentation note about in-process features are only supported in Listen mode. (#6755) * Add documentation note about in-process features are only supported in Listen mode. * Update 'github-action-markdown-link-check' to latest version to fix markdown link validation issues * Fix wrong links in documentation/api/definitions.md * Ignore 'hub.docker.com' in markdown link checker because it returns Status Code 405 on GET requests. --- .github/linters/check-markdown-links-config.json | 3 +++ .github/workflows/check-markdown-links.yml | 2 +- documentation/api/definitions.md | 4 ++-- documentation/api/stacks.md | 4 ++-- .../configuration/in-process-features-configuration.md | 4 ++++ 5 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/linters/check-markdown-links-config.json b/.github/linters/check-markdown-links-config.json index 49b07a50043..ef2b131a34c 100644 --- a/.github/linters/check-markdown-links-config.json +++ b/.github/linters/check-markdown-links-config.json @@ -11,6 +11,9 @@ }, { "pattern": "^https://www\\.dotnetfoundation.org/.*" + }, + { + "pattern": "^https://hub\\.docker\\.com/.*" } ], "aliveStatusCodes": [ diff --git a/.github/workflows/check-markdown-links.yml b/.github/workflows/check-markdown-links.yml index eecf9969116..cd7e01d655b 100644 --- a/.github/workflows/check-markdown-links.yml +++ b/.github/workflows/check-markdown-links.yml @@ -19,7 +19,7 @@ jobs: persist-credentials: false - name: Check markdown links - uses: gaurav-nelson/github-action-markdown-link-check@5c5dfc0ac2e225883c0e5f03a85311ec2830d368 + uses: gaurav-nelson/github-action-markdown-link-check@7d83e59a57f3c201c76eed3d33dff64ec4452d27 with: config-file: .github/linters/check-markdown-links-config.json use-quiet-mode: 'yes' diff --git a/documentation/api/definitions.md b/documentation/api/definitions.md index b7b55aa2571..dff57e617e4 100644 --- a/documentation/api/definitions.md +++ b/documentation/api/definitions.md @@ -54,7 +54,7 @@ Object describing the basic state of a collection rule for the executing instanc | Name | Type | Description | |---|---|---| -| State | [CollectionRuleState](#collectionrulestate-63) | Indicates what state the collection rule is in for the current process. | +| State | [CollectionRuleState](#collectionrulestate) | Indicates what state the collection rule is in for the current process. | | StateReason | string | Human-readable explanation for the current state of the collection rule. | ## CollectionRuleDetailedDescription @@ -65,7 +65,7 @@ Object describing the detailed state of a collection rule for the executing inst | Name | Type | Description | |---|---|---| -| State | [CollectionRuleState](#collectionrulestate-63) | Indicates what state the collection rule is in for the current process. | +| State | [CollectionRuleState](#collectionrulestate) | Indicates what state the collection rule is in for the current process. | | StateReason | string | Human-readable explanation for the current state of the collection rule. | | LifetimeOccurrences | int | The number of times the trigger has executed for a process in its lifetime. | | SlidingWindowOccurrences | int | The number of times the trigger has executed within the current sliding window. | diff --git a/documentation/api/stacks.md b/documentation/api/stacks.md index 7efd903dd52..4147e7f57a4 100644 --- a/documentation/api/stacks.md +++ b/documentation/api/stacks.md @@ -62,7 +62,7 @@ Allowed schemes: ### Sample Request ```http -GET /stack?pid=21632 HTTP/1.1 +GET /stacks?pid=21632 HTTP/1.1 Host: localhost:52323 Authorization: Bearer fffffffffffffffffffffffffffffffffffffffffff= Accept: application/json @@ -100,7 +100,7 @@ Location: localhost:52323/operations/67f07e40-5cca-4709-9062-26302c484f18 ### Sample Request ```http -GET /stack?pid=21632 HTTP/1.1 +GET /stacks?pid=21632 HTTP/1.1 Host: localhost:52323 Authorization: Bearer fffffffffffffffffffffffffffffffffffffffffff= Accept: text/plain diff --git a/documentation/configuration/in-process-features-configuration.md b/documentation/configuration/in-process-features-configuration.md index 26d7578259d..b8503cc1215 100644 --- a/documentation/configuration/in-process-features-configuration.md +++ b/documentation/configuration/in-process-features-configuration.md @@ -4,6 +4,10 @@ First Available: 8.0 Preview 7 +> [!NOTE] +> In-process features are only supported when running dotnet-monitor in `Listen` mode. +> See [Diagnostic Port](./diagnostic-port-configuration.md) configuration for details. + Some features of `dotnet monitor` require loading libraries into target applications. These libraries ship with `dotnet monitor` and are provisioned to be available to target applications using the `DefaultSharedPath` option in the [storage configuration](./storage-configuration.md) section. The following features require these in-process libraries to be used: - [Call Stacks](#call-stacks) From 70f3537e8459a2de835b4d4a55e713e7ee55b711 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 4 Jun 2024 23:04:08 +0000 Subject: [PATCH 012/107] Update dependencies from https://github.com/dotnet/diagnostics build 20240603.1 (#6763) [main] Update dependencies from dotnet/diagnostics --- eng/Version.Details.xml | 12 ++++++------ eng/Versions.props | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index cfe3dfddb87..f3d6efaf33a 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -4,13 +4,13 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore 8e941eb42f819adb116b881195158b3887a70a1c - + https://github.com/dotnet/diagnostics - 481674f73f11e8096f48820ae133d98c88d64a14 + 05f88f687a02aa865384beda97a8910d4d57b17b - + https://github.com/dotnet/diagnostics - 481674f73f11e8096f48820ae133d98c88d64a14 + 05f88f687a02aa865384beda97a8910d4d57b17b https://github.com/dotnet/command-line-api @@ -46,9 +46,9 @@ https://github.com/dotnet/arcade f2b2071632d5d4c46d0f904f2b0d917b1752551b - + https://github.com/dotnet/diagnostics - 481674f73f11e8096f48820ae133d98c88d64a14 + 05f88f687a02aa865384beda97a8910d4d57b17b https://dev.azure.com/dnceng/internal/_git/dotnet-runtime diff --git a/eng/Versions.props b/eng/Versions.props index 4adea73195f..92465ac9dd9 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -57,8 +57,8 @@ 2.0.0-beta4.24209.3 - 8.0.0-preview.24281.1 - 8.0.0-preview.24281.1 + 8.0.0-preview.24303.1 + 8.0.0-preview.24303.1 8.0.103-servicing.24114.15 @@ -67,7 +67,7 @@ 8.0.1 8.0.1-servicing.23580.1 - 1.0.528101 + 1.0.530301 $(MicrosoftNETCoreApp31Version) From 3bcbcafdbc5462cdc9af6b50afd32ef3d5f0e304 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 4 Jun 2024 16:13:50 -0700 Subject: [PATCH 013/107] Bump dawidd6/action-download-artifact from 3.1.4 to 5 (#6767) Bumps [dawidd6/action-download-artifact](https://github.com/dawidd6/action-download-artifact) from 3.1.4 to 5. - [Release notes](https://github.com/dawidd6/action-download-artifact/releases) - [Commits](https://github.com/dawidd6/action-download-artifact/compare/09f2f74827fd3a8607589e5ad7f9398816f540fe...deb3bb83256a78589fef6a7b942e5f2573ad7c13) --- updated-dependencies: - dependency-name: dawidd6/action-download-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/submit-linter-suggestions.yml | 2 +- .github/workflows/submit-to-do-issue.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/submit-linter-suggestions.yml b/.github/workflows/submit-linter-suggestions.yml index cc98a9b091b..688a9abfe04 100644 --- a/.github/workflows/submit-linter-suggestions.yml +++ b/.github/workflows/submit-linter-suggestions.yml @@ -49,7 +49,7 @@ jobs: # The default artifact download action doesn't support cross-workflow # artifacts, so use a 3rd party one. - name: 'Download linting results' - uses: dawidd6/action-download-artifact@09f2f74827fd3a8607589e5ad7f9398816f540fe + uses: dawidd6/action-download-artifact@deb3bb83256a78589fef6a7b942e5f2573ad7c13 with: workflow: ${{env.workflow_name}} run_id: ${{github.event.workflow_run.id }} diff --git a/.github/workflows/submit-to-do-issue.yml b/.github/workflows/submit-to-do-issue.yml index 518ac4a701e..1a77ad39cf0 100644 --- a/.github/workflows/submit-to-do-issue.yml +++ b/.github/workflows/submit-to-do-issue.yml @@ -35,7 +35,7 @@ jobs: # The default artifact download action doesn't support cross-workflow # artifacts, so use a 3rd party one. - name: 'Download linting results' - uses: dawidd6/action-download-artifact@09f2f74827fd3a8607589e5ad7f9398816f540fe + uses: dawidd6/action-download-artifact@deb3bb83256a78589fef6a7b942e5f2573ad7c13 with: workflow: ${{env.workflow_name}} run_id: ${{github.event.workflow_run.id }} From f653b640dd9ed817812ce6f1bf3927f016d40aed Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Wed, 5 Jun 2024 13:06:18 +0000 Subject: [PATCH 014/107] Update dependencies from https://github.com/dotnet/diagnostics build 20240604.1 (#6773) [main] Update dependencies from dotnet/diagnostics --- eng/Version.Details.xml | 12 ++++++------ eng/Versions.props | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index f3d6efaf33a..8df5c729251 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -4,13 +4,13 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore 8e941eb42f819adb116b881195158b3887a70a1c - + https://github.com/dotnet/diagnostics - 05f88f687a02aa865384beda97a8910d4d57b17b + 1c854868f031c1fb9cb2e175baaab120a42b42fd - + https://github.com/dotnet/diagnostics - 05f88f687a02aa865384beda97a8910d4d57b17b + 1c854868f031c1fb9cb2e175baaab120a42b42fd https://github.com/dotnet/command-line-api @@ -46,9 +46,9 @@ https://github.com/dotnet/arcade f2b2071632d5d4c46d0f904f2b0d917b1752551b - + https://github.com/dotnet/diagnostics - 05f88f687a02aa865384beda97a8910d4d57b17b + 1c854868f031c1fb9cb2e175baaab120a42b42fd https://dev.azure.com/dnceng/internal/_git/dotnet-runtime diff --git a/eng/Versions.props b/eng/Versions.props index 92465ac9dd9..4645d782daa 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -57,8 +57,8 @@ 2.0.0-beta4.24209.3 - 8.0.0-preview.24303.1 - 8.0.0-preview.24303.1 + 8.0.0-preview.24304.1 + 8.0.0-preview.24304.1 8.0.103-servicing.24114.15 @@ -67,7 +67,7 @@ 8.0.1 8.0.1-servicing.23580.1 - 1.0.530301 + 1.0.530401 $(MicrosoftNETCoreApp31Version) From 6cdcb8e89862adf3ca64caa9ba73230057d10e44 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Wed, 5 Jun 2024 14:13:47 +0000 Subject: [PATCH 015/107] Update dependencies from https://github.com/dotnet/diagnostics build 20240604.1 (#6774) [feature/9.x] Update dependencies from dotnet/diagnostics --- eng/Version.Details.xml | 12 ++++++------ eng/Versions.props | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 6f3077b6c4f..196f7d27f1d 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -4,13 +4,13 @@ https://github.com/dotnet/aspnetcore b8566e110b1d3918b5f7319db463aa69dbb0c183 - + https://github.com/dotnet/diagnostics - 05f88f687a02aa865384beda97a8910d4d57b17b + 1c854868f031c1fb9cb2e175baaab120a42b42fd - + https://github.com/dotnet/diagnostics - 05f88f687a02aa865384beda97a8910d4d57b17b + 1c854868f031c1fb9cb2e175baaab120a42b42fd https://github.com/dotnet/command-line-api @@ -42,9 +42,9 @@ https://github.com/dotnet/arcade 2c08708d18855f2e2779ac5d0623a5978751c4f3 - + https://github.com/dotnet/diagnostics - 05f88f687a02aa865384beda97a8910d4d57b17b + 1c854868f031c1fb9cb2e175baaab120a42b42fd https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index 4f552cee075..4822f3999a0 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -57,8 +57,8 @@ 2.0.0-beta4.24209.3 - 8.0.0-preview.24303.1 - 8.0.0-preview.24303.1 + 8.0.0-preview.24304.1 + 8.0.0-preview.24304.1 9.0.0-preview.24303.1 @@ -67,7 +67,7 @@ 9.0.100-preview.6.24304.2 - 1.0.530301 + 1.0.530401 $(MicrosoftNETCoreApp31Version) From 8c9c63c613db74b1f32ecd56f3669c429bdb093b Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Wed, 5 Jun 2024 14:16:17 +0000 Subject: [PATCH 016/107] Update dependencies from https://github.com/dotnet/arcade build 20240605.1 (#6775) [feature/9.x] Update dependencies from dotnet/arcade --- eng/Version.Details.xml | 20 +-- eng/Versions.props | 6 +- .../core-templates/post-build/post-build.yml | 3 +- .../post-build/trigger-subscription.yml | 13 -- .../steps/add-build-to-channel.yml | 13 -- .../post-build/add-build-to-channel.ps1 | 48 ------- .../post-build/check-channel-consistency.ps1 | 10 +- eng/common/post-build/nuget-validation.ps1 | 13 +- eng/common/post-build/nuget-verification.ps1 | 121 ++++++++++++++++++ eng/common/post-build/post-build-utils.ps1 | 91 ------------- eng/common/post-build/publish-using-darc.ps1 | 7 +- eng/common/post-build/redact-logs.ps1 | 10 +- .../post-build/sourcelink-validation.ps1 | 10 +- eng/common/post-build/symbols-validation.ps1 | 2 - .../post-build/trigger-subscriptions.ps1 | 64 --------- eng/common/template-guidance.md | 4 - .../post-build/trigger-subscription.yml | 13 -- .../steps/add-build-to-channel.yml | 7 - .../post-build/trigger-subscription.yml | 13 -- .../templates/steps/add-build-to-channel.yml | 7 - global.json | 4 +- 21 files changed, 172 insertions(+), 307 deletions(-) delete mode 100644 eng/common/core-templates/post-build/trigger-subscription.yml delete mode 100644 eng/common/core-templates/steps/add-build-to-channel.yml delete mode 100644 eng/common/post-build/add-build-to-channel.ps1 create mode 100644 eng/common/post-build/nuget-verification.ps1 delete mode 100644 eng/common/post-build/post-build-utils.ps1 delete mode 100644 eng/common/post-build/trigger-subscriptions.ps1 delete mode 100644 eng/common/templates-official/post-build/trigger-subscription.yml delete mode 100644 eng/common/templates-official/steps/add-build-to-channel.yml delete mode 100644 eng/common/templates/post-build/trigger-subscription.yml delete mode 100644 eng/common/templates/steps/add-build-to-channel.yml diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 196f7d27f1d..af811af1c8c 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -22,25 +22,25 @@ https://github.com/dotnet/roslyn-analyzers 1d1b6bc0be25482a9105912d71649c03866733b0 - + https://github.com/dotnet/arcade - 2c08708d18855f2e2779ac5d0623a5978751c4f3 + 1c6e4ad6eedf59f8bdd9e84e811f6d037b8b8087 - + https://github.com/dotnet/arcade - 2c08708d18855f2e2779ac5d0623a5978751c4f3 + 1c6e4ad6eedf59f8bdd9e84e811f6d037b8b8087 - + https://github.com/dotnet/arcade - 2c08708d18855f2e2779ac5d0623a5978751c4f3 + 1c6e4ad6eedf59f8bdd9e84e811f6d037b8b8087 - + https://github.com/dotnet/arcade - 2c08708d18855f2e2779ac5d0623a5978751c4f3 + 1c6e4ad6eedf59f8bdd9e84e811f6d037b8b8087 - + https://github.com/dotnet/arcade - 2c08708d18855f2e2779ac5d0623a5978751c4f3 + 1c6e4ad6eedf59f8bdd9e84e811f6d037b8b8087 https://github.com/dotnet/diagnostics diff --git a/eng/Versions.props b/eng/Versions.props index 4822f3999a0..8758493c7b3 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -48,9 +48,9 @@ --> - 9.0.0-beta.24303.1 - 9.0.0-beta.24303.1 - 9.0.0-beta.24303.1 + 9.0.0-beta.24305.1 + 9.0.0-beta.24305.1 + 9.0.0-beta.24305.1 9.0.0-preview.6.24303.6 9.0.0-preview.6.24303.6 diff --git a/eng/common/core-templates/post-build/post-build.yml b/eng/common/core-templates/post-build/post-build.yml index 865bc1ecb4f..fb15c40c03d 100644 --- a/eng/common/core-templates/post-build/post-build.yml +++ b/eng/common/core-templates/post-build/post-build.yml @@ -145,8 +145,7 @@ stages: displayName: Validate inputs: filePath: $(Build.SourcesDirectory)/eng/common/post-build/nuget-validation.ps1 - arguments: -PackagesPath $(Build.ArtifactStagingDirectory)/PackageArtifacts/ - -ToolDestinationPath $(Agent.BuildDirectory)/Extract/ + arguments: -PackagesPath $(Build.ArtifactStagingDirectory)/PackageArtifacts/ - job: displayName: Signing Validation diff --git a/eng/common/core-templates/post-build/trigger-subscription.yml b/eng/common/core-templates/post-build/trigger-subscription.yml deleted file mode 100644 index da669030daf..00000000000 --- a/eng/common/core-templates/post-build/trigger-subscription.yml +++ /dev/null @@ -1,13 +0,0 @@ -parameters: - ChannelId: 0 - -steps: -- task: PowerShell@2 - displayName: Triggering subscriptions - inputs: - filePath: $(Build.SourcesDirectory)/eng/common/post-build/trigger-subscriptions.ps1 - arguments: -SourceRepo $(Build.Repository.Uri) - -ChannelId ${{ parameters.ChannelId }} - -MaestroApiAccessToken $(MaestroAccessToken) - -MaestroApiEndPoint $(MaestroApiEndPoint) - -MaestroApiVersion $(MaestroApiVersion) diff --git a/eng/common/core-templates/steps/add-build-to-channel.yml b/eng/common/core-templates/steps/add-build-to-channel.yml deleted file mode 100644 index f67a210d62f..00000000000 --- a/eng/common/core-templates/steps/add-build-to-channel.yml +++ /dev/null @@ -1,13 +0,0 @@ -parameters: - ChannelId: 0 - -steps: -- task: PowerShell@2 - displayName: Add Build to Channel - inputs: - filePath: $(Build.SourcesDirectory)/eng/common/post-build/add-build-to-channel.ps1 - arguments: -BuildId $(BARBuildId) - -ChannelId ${{ parameters.ChannelId }} - -MaestroApiAccessToken $(MaestroApiAccessToken) - -MaestroApiEndPoint $(MaestroApiEndPoint) - -MaestroApiVersion $(MaestroApiVersion) diff --git a/eng/common/post-build/add-build-to-channel.ps1 b/eng/common/post-build/add-build-to-channel.ps1 deleted file mode 100644 index 49938f0c89f..00000000000 --- a/eng/common/post-build/add-build-to-channel.ps1 +++ /dev/null @@ -1,48 +0,0 @@ -param( - [Parameter(Mandatory=$true)][int] $BuildId, - [Parameter(Mandatory=$true)][int] $ChannelId, - [Parameter(Mandatory=$true)][string] $MaestroApiAccessToken, - [Parameter(Mandatory=$false)][string] $MaestroApiEndPoint = 'https://maestro.dot.net', - [Parameter(Mandatory=$false)][string] $MaestroApiVersion = '2019-01-16' -) - -try { - . $PSScriptRoot\post-build-utils.ps1 - - # Check that the channel we are going to promote the build to exist - $channelInfo = Get-MaestroChannel -ChannelId $ChannelId - - if (!$channelInfo) { - Write-PipelineTelemetryCategory -Category 'PromoteBuild' -Message "Channel with BAR ID $ChannelId was not found in BAR!" - ExitWithExitCode 1 - } - - # Get info about which channel(s) the build has already been promoted to - $buildInfo = Get-MaestroBuild -BuildId $BuildId - - if (!$buildInfo) { - Write-PipelineTelemetryError -Category 'PromoteBuild' -Message "Build with BAR ID $BuildId was not found in BAR!" - ExitWithExitCode 1 - } - - # Find whether the build is already assigned to the channel or not - if ($buildInfo.channels) { - foreach ($channel in $buildInfo.channels) { - if ($channel.Id -eq $ChannelId) { - Write-Host "The build with BAR ID $BuildId is already on channel $ChannelId!" - ExitWithExitCode 0 - } - } - } - - Write-Host "Promoting build '$BuildId' to channel '$ChannelId'." - - Assign-BuildToChannel -BuildId $BuildId -ChannelId $ChannelId - - Write-Host 'done.' -} -catch { - Write-Host $_ - Write-PipelineTelemetryError -Category 'PromoteBuild' -Message "There was an error while trying to promote build '$BuildId' to channel '$ChannelId'" - ExitWithExitCode 1 -} diff --git a/eng/common/post-build/check-channel-consistency.ps1 b/eng/common/post-build/check-channel-consistency.ps1 index 1728f035a93..61208d2d135 100644 --- a/eng/common/post-build/check-channel-consistency.ps1 +++ b/eng/common/post-build/check-channel-consistency.ps1 @@ -4,7 +4,15 @@ param( ) try { - . $PSScriptRoot\post-build-utils.ps1 + $ErrorActionPreference = 'Stop' + Set-StrictMode -Version 2.0 + + # `tools.ps1` checks $ci to perform some actions. Since the post-build + # scripts don't necessarily execute in the same agent that run the + # build.ps1/sh script this variable isn't automatically set. + $ci = $true + $disableConfigureToolsetImport = $true + . $PSScriptRoot\..\tools.ps1 if ($PromoteToChannels -eq "") { Write-PipelineTaskError -Type 'warning' -Message "This build won't publish assets as it's not configured to any Maestro channel. If that wasn't intended use Darc to configure a default channel using add-default-channel for this branch or to promote it to a channel using add-build-to-channel. See https://github.com/dotnet/arcade/blob/main/Documentation/Darc.md#assigning-an-individual-build-to-a-channel for more info." diff --git a/eng/common/post-build/nuget-validation.ps1 b/eng/common/post-build/nuget-validation.ps1 index dab3534ab53..9c81aa43917 100644 --- a/eng/common/post-build/nuget-validation.ps1 +++ b/eng/common/post-build/nuget-validation.ps1 @@ -2,20 +2,11 @@ # tool: https://github.com/NuGet/NuGetGallery/tree/jver-verify/src/VerifyMicrosoftPackage param( - [Parameter(Mandatory=$true)][string] $PackagesPath, # Path to where the packages to be validated are - [Parameter(Mandatory=$true)][string] $ToolDestinationPath # Where the validation tool should be downloaded to + [Parameter(Mandatory=$true)][string] $PackagesPath # Path to where the packages to be validated are ) try { - . $PSScriptRoot\post-build-utils.ps1 - - $url = 'https://raw.githubusercontent.com/NuGet/NuGetGallery/3e25ad135146676bcab0050a516939d9958bfa5d/src/VerifyMicrosoftPackage/verify.ps1' - - New-Item -ItemType 'directory' -Path ${ToolDestinationPath} -Force - - Invoke-WebRequest $url -OutFile ${ToolDestinationPath}\verify.ps1 - - & ${ToolDestinationPath}\verify.ps1 ${PackagesPath}\*.nupkg + & $PSScriptRoot\nuget-verification.ps1 ${PackagesPath}\*.nupkg } catch { Write-Host $_.ScriptStackTrace diff --git a/eng/common/post-build/nuget-verification.ps1 b/eng/common/post-build/nuget-verification.ps1 new file mode 100644 index 00000000000..a365194a938 --- /dev/null +++ b/eng/common/post-build/nuget-verification.ps1 @@ -0,0 +1,121 @@ +<# +.SYNOPSIS + Verifies that Microsoft NuGet packages have proper metadata. +.DESCRIPTION + Downloads a verification tool and runs metadata validation on the provided NuGet packages. This script writes an + error if any of the provided packages fail validation. All arguments provided to this PowerShell script that do not + match PowerShell parameters are passed on to the verification tool downloaded during the execution of this script. +.PARAMETER NuGetExePath + The path to the nuget.exe binary to use. If not provided, nuget.exe will be downloaded into the -DownloadPath + directory. +.PARAMETER PackageSource + The package source to use to download the verification tool. If not provided, nuget.org will be used. +.PARAMETER DownloadPath + The directory path to download the verification tool and nuget.exe to. If not provided, + %TEMP%\NuGet.VerifyNuGetPackage will be used. +.PARAMETER args + Arguments that will be passed to the verification tool. +.EXAMPLE + PS> .\verify.ps1 *.nupkg + Verifies the metadata of all .nupkg files in the currect working directory. +.EXAMPLE + PS> .\verify.ps1 --help + Displays the help text of the downloaded verifiction tool. +.LINK + https://github.com/NuGet/NuGetGallery/blob/master/src/VerifyMicrosoftPackage/README.md +#> + +# This script was copied from https://github.com/NuGet/NuGetGallery/blob/3e25ad135146676bcab0050a516939d9958bfa5d/src/VerifyMicrosoftPackage/verify.ps1 + +[CmdletBinding(PositionalBinding = $false)] +param( + [string]$NuGetExePath, + [string]$PackageSource = "https://api.nuget.org/v3/index.json", + [string]$DownloadPath, + [Parameter(ValueFromRemainingArguments = $true)] + [string[]]$args +) + +# The URL to download nuget.exe. +$nugetExeUrl = "https://dist.nuget.org/win-x86-commandline/v4.9.4/nuget.exe" + +# The package ID of the verification tool. +$packageId = "NuGet.VerifyMicrosoftPackage" + +# The location that nuget.exe and the verification tool will be downloaded to. +if (!$DownloadPath) { + $DownloadPath = (Join-Path $env:TEMP "NuGet.VerifyMicrosoftPackage") +} + +$fence = New-Object -TypeName string -ArgumentList '=', 80 + +# Create the download directory, if it doesn't already exist. +if (!(Test-Path $DownloadPath)) { + New-Item -ItemType Directory $DownloadPath | Out-Null +} +Write-Host "Using download path: $DownloadPath" + +if ($NuGetExePath) { + $nuget = $NuGetExePath +} else { + $downloadedNuGetExe = Join-Path $DownloadPath "nuget.exe" + + # Download nuget.exe, if it doesn't already exist. + if (!(Test-Path $downloadedNuGetExe)) { + Write-Host "Downloading nuget.exe from $nugetExeUrl..." + $ProgressPreference = 'SilentlyContinue' + try { + Invoke-WebRequest $nugetExeUrl -OutFile $downloadedNuGetExe + $ProgressPreference = 'Continue' + } catch { + $ProgressPreference = 'Continue' + Write-Error $_ + Write-Error "nuget.exe failed to download." + exit + } + } + + $nuget = $downloadedNuGetExe +} + +Write-Host "Using nuget.exe path: $nuget" +Write-Host " " + +# Download the latest version of the verification tool. +Write-Host "Downloading the latest version of $packageId from $packageSource..." +Write-Host $fence +& $nuget install $packageId ` + -Prerelease ` + -OutputDirectory $DownloadPath ` + -Source $PackageSource +Write-Host $fence +Write-Host " " + +if ($LASTEXITCODE -ne 0) { + Write-Error "nuget.exe failed to fetch the verify tool." + exit +} + +# Find the most recently downloaded tool +Write-Host "Finding the most recently downloaded verification tool." +$verifyProbePath = Join-Path $DownloadPath "$packageId.*" +$verifyPath = Get-ChildItem -Path $verifyProbePath -Directory ` + | Sort-Object -Property LastWriteTime -Descending ` + | Select-Object -First 1 +$verify = Join-Path $verifyPath "tools\NuGet.VerifyMicrosoftPackage.exe" +Write-Host "Using verification tool: $verify" +Write-Host " " + +# Execute the verification tool. +Write-Host "Executing the verify tool..." +Write-Host $fence +& $verify $args +Write-Host $fence +Write-Host " " + +# Respond to the exit code. +if ($LASTEXITCODE -ne 0) { + Write-Error "The verify tool found some problems." +} else { + Write-Output "The verify tool succeeded." +} diff --git a/eng/common/post-build/post-build-utils.ps1 b/eng/common/post-build/post-build-utils.ps1 deleted file mode 100644 index 534f6988d5b..00000000000 --- a/eng/common/post-build/post-build-utils.ps1 +++ /dev/null @@ -1,91 +0,0 @@ -# Most of the functions in this file require the variables `MaestroApiEndPoint`, -# `MaestroApiVersion` and `MaestroApiAccessToken` to be globally available. - -$ErrorActionPreference = 'Stop' -Set-StrictMode -Version 2.0 - -# `tools.ps1` checks $ci to perform some actions. Since the post-build -# scripts don't necessarily execute in the same agent that run the -# build.ps1/sh script this variable isn't automatically set. -$ci = $true -$disableConfigureToolsetImport = $true -. $PSScriptRoot\..\tools.ps1 - -function Create-MaestroApiRequestHeaders([string]$ContentType = 'application/json') { - Validate-MaestroVars - - $headers = New-Object 'System.Collections.Generic.Dictionary[[String],[String]]' - $headers.Add('Accept', $ContentType) - $headers.Add('Authorization',"Bearer $MaestroApiAccessToken") - return $headers -} - -function Get-MaestroChannel([int]$ChannelId) { - Validate-MaestroVars - - $apiHeaders = Create-MaestroApiRequestHeaders - $apiEndpoint = "$MaestroApiEndPoint/api/channels/${ChannelId}?api-version=$MaestroApiVersion" - - $result = try { Invoke-WebRequest -Method Get -Uri $apiEndpoint -Headers $apiHeaders | ConvertFrom-Json } catch { Write-Host "Error: $_" } - return $result -} - -function Get-MaestroBuild([int]$BuildId) { - Validate-MaestroVars - - $apiHeaders = Create-MaestroApiRequestHeaders -AuthToken $MaestroApiAccessToken - $apiEndpoint = "$MaestroApiEndPoint/api/builds/${BuildId}?api-version=$MaestroApiVersion" - - $result = try { return Invoke-WebRequest -Method Get -Uri $apiEndpoint -Headers $apiHeaders | ConvertFrom-Json } catch { Write-Host "Error: $_" } - return $result -} - -function Get-MaestroSubscriptions([string]$SourceRepository, [int]$ChannelId) { - Validate-MaestroVars - - $SourceRepository = [System.Web.HttpUtility]::UrlEncode($SourceRepository) - $apiHeaders = Create-MaestroApiRequestHeaders -AuthToken $MaestroApiAccessToken - $apiEndpoint = "$MaestroApiEndPoint/api/subscriptions?sourceRepository=$SourceRepository&channelId=$ChannelId&api-version=$MaestroApiVersion" - - $result = try { Invoke-WebRequest -Method Get -Uri $apiEndpoint -Headers $apiHeaders | ConvertFrom-Json } catch { Write-Host "Error: $_" } - return $result -} - -function Assign-BuildToChannel([int]$BuildId, [int]$ChannelId) { - Validate-MaestroVars - - $apiHeaders = Create-MaestroApiRequestHeaders -AuthToken $MaestroApiAccessToken - $apiEndpoint = "$MaestroApiEndPoint/api/channels/${ChannelId}/builds/${BuildId}?api-version=$MaestroApiVersion" - Invoke-WebRequest -Method Post -Uri $apiEndpoint -Headers $apiHeaders | Out-Null -} - -function Trigger-Subscription([string]$SubscriptionId) { - Validate-MaestroVars - - $apiHeaders = Create-MaestroApiRequestHeaders -AuthToken $MaestroApiAccessToken - $apiEndpoint = "$MaestroApiEndPoint/api/subscriptions/$SubscriptionId/trigger?api-version=$MaestroApiVersion" - Invoke-WebRequest -Uri $apiEndpoint -Headers $apiHeaders -Method Post | Out-Null -} - -function Validate-MaestroVars { - try { - Get-Variable MaestroApiEndPoint | Out-Null - Get-Variable MaestroApiVersion | Out-Null - Get-Variable MaestroApiAccessToken | Out-Null - - if (!($MaestroApiEndPoint -Match '^http[s]?://maestro-(int|prod).westus2.cloudapp.azure.com$')) { - Write-PipelineTelemetryError -Category 'MaestroVars' -Message "MaestroApiEndPoint is not a valid Maestro URL. '$MaestroApiEndPoint'" - ExitWithExitCode 1 - } - - if (!($MaestroApiVersion -Match '^[0-9]{4}-[0-9]{2}-[0-9]{2}$')) { - Write-PipelineTelemetryError -Category 'MaestroVars' -Message "MaestroApiVersion does not match a version string in the format yyyy-MM-DD. '$MaestroApiVersion'" - ExitWithExitCode 1 - } - } - catch { - Write-PipelineTelemetryError -Category 'MaestroVars' -Message 'Error: Variables `MaestroApiEndPoint`, `MaestroApiVersion` and `MaestroApiAccessToken` are required while using this script.' - Write-Host $_ - ExitWithExitCode 1 - } -} diff --git a/eng/common/post-build/publish-using-darc.ps1 b/eng/common/post-build/publish-using-darc.ps1 index 5a3a32ea8d7..e831d5c1d29 100644 --- a/eng/common/post-build/publish-using-darc.ps1 +++ b/eng/common/post-build/publish-using-darc.ps1 @@ -10,7 +10,12 @@ param( ) try { - . $PSScriptRoot\post-build-utils.ps1 + # `tools.ps1` checks $ci to perform some actions. Since the post-build + # scripts don't necessarily execute in the same agent that run the + # build.ps1/sh script this variable isn't automatically set. + $ci = $true + $disableConfigureToolsetImport = $true + . $PSScriptRoot\..\tools.ps1 $darc = Get-Darc diff --git a/eng/common/post-build/redact-logs.ps1 b/eng/common/post-build/redact-logs.ps1 index 82d91f6fd02..b7fc1959150 100644 --- a/eng/common/post-build/redact-logs.ps1 +++ b/eng/common/post-build/redact-logs.ps1 @@ -11,7 +11,15 @@ param( ) try { - . $PSScriptRoot\post-build-utils.ps1 + $ErrorActionPreference = 'Stop' + Set-StrictMode -Version 2.0 + + # `tools.ps1` checks $ci to perform some actions. Since the post-build + # scripts don't necessarily execute in the same agent that run the + # build.ps1/sh script this variable isn't automatically set. + $ci = $true + $disableConfigureToolsetImport = $true + . $PSScriptRoot\..\tools.ps1 $packageName = 'binlogtool' diff --git a/eng/common/post-build/sourcelink-validation.ps1 b/eng/common/post-build/sourcelink-validation.ps1 index 4011d324e73..1976ef70fb8 100644 --- a/eng/common/post-build/sourcelink-validation.ps1 +++ b/eng/common/post-build/sourcelink-validation.ps1 @@ -6,7 +6,15 @@ param( [Parameter(Mandatory=$true)][string] $SourcelinkCliVersion # Version of SourceLink CLI to use ) -. $PSScriptRoot\post-build-utils.ps1 +$ErrorActionPreference = 'Stop' +Set-StrictMode -Version 2.0 + +# `tools.ps1` checks $ci to perform some actions. Since the post-build +# scripts don't necessarily execute in the same agent that run the +# build.ps1/sh script this variable isn't automatically set. +$ci = $true +$disableConfigureToolsetImport = $true +. $PSScriptRoot\..\tools.ps1 # Cache/HashMap (File -> Exist flag) used to consult whether a file exist # in the repository at a specific commit point. This is populated by inserting diff --git a/eng/common/post-build/symbols-validation.ps1 b/eng/common/post-build/symbols-validation.ps1 index cd2181bafa0..7146e593ffa 100644 --- a/eng/common/post-build/symbols-validation.ps1 +++ b/eng/common/post-build/symbols-validation.ps1 @@ -322,8 +322,6 @@ function InstallDotnetSymbol { } try { - . $PSScriptRoot\post-build-utils.ps1 - InstallDotnetSymbol foreach ($Job in @(Get-Job)) { diff --git a/eng/common/post-build/trigger-subscriptions.ps1 b/eng/common/post-build/trigger-subscriptions.ps1 deleted file mode 100644 index ac9a95778fc..00000000000 --- a/eng/common/post-build/trigger-subscriptions.ps1 +++ /dev/null @@ -1,64 +0,0 @@ -param( - [Parameter(Mandatory=$true)][string] $SourceRepo, - [Parameter(Mandatory=$true)][int] $ChannelId, - [Parameter(Mandatory=$true)][string] $MaestroApiAccessToken, - [Parameter(Mandatory=$false)][string] $MaestroApiEndPoint = 'https://maestro.dot.net', - [Parameter(Mandatory=$false)][string] $MaestroApiVersion = '2019-01-16' -) - -try { - . $PSScriptRoot\post-build-utils.ps1 - - # Get all the $SourceRepo subscriptions - $normalizedSourceRepo = $SourceRepo.Replace('dnceng@', '') - $subscriptions = Get-MaestroSubscriptions -SourceRepository $normalizedSourceRepo -ChannelId $ChannelId - - if (!$subscriptions) { - Write-PipelineTelemetryError -Category 'TriggerSubscriptions' -Message "No subscriptions found for source repo '$normalizedSourceRepo' in channel '$ChannelId'" - ExitWithExitCode 0 - } - - $subscriptionsToTrigger = New-Object System.Collections.Generic.List[string] - $failedTriggeredSubscription = $false - - # Get all enabled subscriptions that need dependency flow on 'everyBuild' - foreach ($subscription in $subscriptions) { - if ($subscription.enabled -and $subscription.policy.updateFrequency -like 'everyBuild' -and $subscription.channel.id -eq $ChannelId) { - Write-Host "Should trigger this subscription: ${$subscription.id}" - [void]$subscriptionsToTrigger.Add($subscription.id) - } - } - - foreach ($subscriptionToTrigger in $subscriptionsToTrigger) { - try { - Write-Host "Triggering subscription '$subscriptionToTrigger'." - - Trigger-Subscription -SubscriptionId $subscriptionToTrigger - - Write-Host 'done.' - } - catch - { - Write-Host "There was an error while triggering subscription '$subscriptionToTrigger'" - Write-Host $_ - Write-Host $_.ScriptStackTrace - $failedTriggeredSubscription = $true - } - } - - if ($subscriptionsToTrigger.Count -eq 0) { - Write-Host "No subscription matched source repo '$normalizedSourceRepo' and channel ID '$ChannelId'." - } - elseif ($failedTriggeredSubscription) { - Write-PipelineTelemetryError -Category 'TriggerSubscriptions' -Message 'At least one subscription failed to be triggered...' - ExitWithExitCode 1 - } - else { - Write-Host 'All subscriptions were triggered successfully!' - } -} -catch { - Write-Host $_.ScriptStackTrace - Write-PipelineTelemetryError -Category 'TriggerSubscriptions' -Message $_ - ExitWithExitCode 1 -} diff --git a/eng/common/template-guidance.md b/eng/common/template-guidance.md index c114bc28dcb..5ef6c30ba92 100644 --- a/eng/common/template-guidance.md +++ b/eng/common/template-guidance.md @@ -76,13 +76,11 @@ eng\common\ source-build.yml (shim) post-build\ post-build.yml (shim) - trigger-subscription.yml (shim) common-variabls.yml (shim) setup-maestro-vars.yml (shim) steps\ publish-build-artifacts.yml (logic) publish-pipeline-artifacts.yml (logic) - add-build-channel.yml (shim) component-governance.yml (shim) generate-sbom.yml (shim) publish-logs.yml (shim) @@ -107,9 +105,7 @@ eng\common\ common-variabls.yml (logic) post-build.yml (logic) setup-maestro-vars.yml (logic) - trigger-subscription.yml (logic) steps\ - add-build-to-channel.yml (logic) component-governance.yml (logic) generate-sbom.yml (logic) publish-build-artifacts.yml (redirect) diff --git a/eng/common/templates-official/post-build/trigger-subscription.yml b/eng/common/templates-official/post-build/trigger-subscription.yml deleted file mode 100644 index da669030daf..00000000000 --- a/eng/common/templates-official/post-build/trigger-subscription.yml +++ /dev/null @@ -1,13 +0,0 @@ -parameters: - ChannelId: 0 - -steps: -- task: PowerShell@2 - displayName: Triggering subscriptions - inputs: - filePath: $(Build.SourcesDirectory)/eng/common/post-build/trigger-subscriptions.ps1 - arguments: -SourceRepo $(Build.Repository.Uri) - -ChannelId ${{ parameters.ChannelId }} - -MaestroApiAccessToken $(MaestroAccessToken) - -MaestroApiEndPoint $(MaestroApiEndPoint) - -MaestroApiVersion $(MaestroApiVersion) diff --git a/eng/common/templates-official/steps/add-build-to-channel.yml b/eng/common/templates-official/steps/add-build-to-channel.yml deleted file mode 100644 index 543dea8c696..00000000000 --- a/eng/common/templates-official/steps/add-build-to-channel.yml +++ /dev/null @@ -1,7 +0,0 @@ -steps: -- template: /eng/common/core-templates/steps/add-build-to-channel.yml - parameters: - is1ESPipeline: true - - ${{ each parameter in parameters }}: - ${{ parameter.key }}: ${{ parameter.value }} diff --git a/eng/common/templates/post-build/trigger-subscription.yml b/eng/common/templates/post-build/trigger-subscription.yml deleted file mode 100644 index da669030daf..00000000000 --- a/eng/common/templates/post-build/trigger-subscription.yml +++ /dev/null @@ -1,13 +0,0 @@ -parameters: - ChannelId: 0 - -steps: -- task: PowerShell@2 - displayName: Triggering subscriptions - inputs: - filePath: $(Build.SourcesDirectory)/eng/common/post-build/trigger-subscriptions.ps1 - arguments: -SourceRepo $(Build.Repository.Uri) - -ChannelId ${{ parameters.ChannelId }} - -MaestroApiAccessToken $(MaestroAccessToken) - -MaestroApiEndPoint $(MaestroApiEndPoint) - -MaestroApiVersion $(MaestroApiVersion) diff --git a/eng/common/templates/steps/add-build-to-channel.yml b/eng/common/templates/steps/add-build-to-channel.yml deleted file mode 100644 index 42bbba161b9..00000000000 --- a/eng/common/templates/steps/add-build-to-channel.yml +++ /dev/null @@ -1,7 +0,0 @@ -steps: -- template: /eng/common/core-templates/steps/add-build-to-channel.yml - parameters: - is1ESPipeline: false - - ${{ each parameter in parameters }}: - ${{ parameter.key }}: ${{ parameter.value }} diff --git a/global.json b/global.json index 860f58ac87b..98b8dc4393c 100644 --- a/global.json +++ b/global.json @@ -31,7 +31,7 @@ }, "msbuild-sdks": { "Microsoft.Build.NoTargets": "3.7.0", - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24303.1", - "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24303.1" + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24305.1", + "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24305.1" } } From a856aec657e9dc1b93d06c7c15a4318e89259c22 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Wed, 5 Jun 2024 14:22:50 +0000 Subject: [PATCH 017/107] Update dependencies from https://github.com/dotnet/sdk build 20240605.1 (#6777) [feature/9.x] Update dependencies from dotnet/sdk - Coherency Updates: - Microsoft.AspNetCore.App.Runtime.win-x64: from 9.0.0-preview.6.24303.6 to 9.0.0-preview.6.24304.8 (parent: VS.Redist.Common.NetCore.SdkPlaceholder.x64.9.0) - VS.Redist.Common.AspNetCore.SharedFramework.x64.9.0: from 9.0.0-preview.6.24303.6 to 9.0.0-preview.6.24304.8 (parent: VS.Redist.Common.NetCore.SdkPlaceholder.x64.9.0) --- eng/Version.Details.xml | 12 ++++++------ eng/Versions.props | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index af811af1c8c..44cfb89b54c 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,8 +1,8 @@ - + https://github.com/dotnet/aspnetcore - b8566e110b1d3918b5f7319db463aa69dbb0c183 + 228900c8b3692f8684f4dc9c7cd5d9d53a276a8e https://github.com/dotnet/diagnostics @@ -50,13 +50,13 @@ https://github.com/dotnet/runtime 3750ac51619efbbc59bf07d3879758a9c18c4b0e - + https://github.com/dotnet/aspnetcore - b8566e110b1d3918b5f7319db463aa69dbb0c183 + 228900c8b3692f8684f4dc9c7cd5d9d53a276a8e - + https://github.com/dotnet/sdk - 36bea1315b44a957c274dc4b4e4b51c2e5c1c651 + 5a8b156bcc5b496d6de43c8cece1bacbb7fee46f https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index 8758493c7b3..20acb150989 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -52,8 +52,8 @@ 9.0.0-beta.24305.1 9.0.0-beta.24305.1 - 9.0.0-preview.6.24303.6 - 9.0.0-preview.6.24303.6 + 9.0.0-preview.6.24304.8 + 9.0.0-preview.6.24304.8 2.0.0-beta4.24209.3 @@ -65,7 +65,7 @@ 9.0.0-preview.6.24281.1 9.0.0-preview.6.24281.1 - 9.0.100-preview.6.24304.2 + 9.0.100-preview.6.24305.1 1.0.530401 From b939d08217b0b46602fabf55ff7750268ff99ea7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 5 Jun 2024 11:00:56 -0700 Subject: [PATCH 018/107] update release information (#6779) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- eng/Versions.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/Versions.props b/eng/Versions.props index 20acb150989..2f3fa6d46aa 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -5,7 +5,7 @@ https://github.com/dotnet/dotnet-monitor 9.0.0 preview - 5 + 6 true - 9.0.0-preview.24303.1 + 9.0.0-preview.24304.1 9.0.0-preview.6.24281.1 9.0.0-preview.6.24281.1 From 9f58454cd65738d4f69a623e83375256cd7aa3a3 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 12:56:09 +0000 Subject: [PATCH 020/107] Update dependencies from https://github.com/dotnet/diagnostics build 20240605.1 (#6785) [main] Update dependencies from dotnet/diagnostics --- eng/Version.Details.xml | 12 ++++++------ eng/Versions.props | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 8df5c729251..84da8e2350c 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -4,13 +4,13 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore 8e941eb42f819adb116b881195158b3887a70a1c - + https://github.com/dotnet/diagnostics - 1c854868f031c1fb9cb2e175baaab120a42b42fd + cc5eca29afa2d9cacf6700ddc8d843082b5955c6 - + https://github.com/dotnet/diagnostics - 1c854868f031c1fb9cb2e175baaab120a42b42fd + cc5eca29afa2d9cacf6700ddc8d843082b5955c6 https://github.com/dotnet/command-line-api @@ -46,9 +46,9 @@ https://github.com/dotnet/arcade f2b2071632d5d4c46d0f904f2b0d917b1752551b - + https://github.com/dotnet/diagnostics - 1c854868f031c1fb9cb2e175baaab120a42b42fd + cc5eca29afa2d9cacf6700ddc8d843082b5955c6 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime diff --git a/eng/Versions.props b/eng/Versions.props index 4645d782daa..275c2c82517 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -57,8 +57,8 @@ 2.0.0-beta4.24209.3 - 8.0.0-preview.24304.1 - 8.0.0-preview.24304.1 + 8.0.0-preview.24305.1 + 8.0.0-preview.24305.1 8.0.103-servicing.24114.15 @@ -67,7 +67,7 @@ 8.0.1 8.0.1-servicing.23580.1 - 1.0.530401 + 1.0.530501 $(MicrosoftNETCoreApp31Version) From 708cda18ad08a084dd945708f3930aff19586f25 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 13:53:10 +0000 Subject: [PATCH 021/107] Update dependencies from https://github.com/dotnet/diagnostics build 20240605.1 (#6786) [feature/9.x] Update dependencies from dotnet/diagnostics --- eng/Version.Details.xml | 12 ++++++------ eng/Versions.props | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 0cb984ca9da..696de538b80 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -4,13 +4,13 @@ https://github.com/dotnet/aspnetcore 228900c8b3692f8684f4dc9c7cd5d9d53a276a8e - + https://github.com/dotnet/diagnostics - 1c854868f031c1fb9cb2e175baaab120a42b42fd + cc5eca29afa2d9cacf6700ddc8d843082b5955c6 - + https://github.com/dotnet/diagnostics - 1c854868f031c1fb9cb2e175baaab120a42b42fd + cc5eca29afa2d9cacf6700ddc8d843082b5955c6 https://github.com/dotnet/command-line-api @@ -42,9 +42,9 @@ https://github.com/dotnet/arcade 1c6e4ad6eedf59f8bdd9e84e811f6d037b8b8087 - + https://github.com/dotnet/diagnostics - 1c854868f031c1fb9cb2e175baaab120a42b42fd + cc5eca29afa2d9cacf6700ddc8d843082b5955c6 https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index 6935bfa14f8..eb12779dd8c 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -57,8 +57,8 @@ 2.0.0-beta4.24209.3 - 8.0.0-preview.24304.1 - 8.0.0-preview.24304.1 + 8.0.0-preview.24305.1 + 8.0.0-preview.24305.1 9.0.0-preview.24304.1 @@ -67,7 +67,7 @@ 9.0.100-preview.6.24305.1 - 1.0.530401 + 1.0.530501 $(MicrosoftNETCoreApp31Version) From cd94a183d2e846298028d7a4bd22ae94783d42e9 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 14:00:42 +0000 Subject: [PATCH 022/107] Update dependencies from https://github.com/dotnet/arcade build 20240605.5 (#6787) [feature/9.x] Update dependencies from dotnet/arcade --- eng/Version.Details.xml | 20 ++++++++++---------- eng/Versions.props | 6 +++--- eng/common/cross/build-android-rootfs.sh | 8 ++++---- global.json | 4 ++-- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 696de538b80..1f61aa10dee 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -22,25 +22,25 @@ https://github.com/dotnet/roslyn-analyzers 333f90a3051f084e7af42b516b6bdd7ae8e004f3 - + https://github.com/dotnet/arcade - 1c6e4ad6eedf59f8bdd9e84e811f6d037b8b8087 + f00e1ca5808b15b206042d50cad7cc1c69d3d938 - + https://github.com/dotnet/arcade - 1c6e4ad6eedf59f8bdd9e84e811f6d037b8b8087 + f00e1ca5808b15b206042d50cad7cc1c69d3d938 - + https://github.com/dotnet/arcade - 1c6e4ad6eedf59f8bdd9e84e811f6d037b8b8087 + f00e1ca5808b15b206042d50cad7cc1c69d3d938 - + https://github.com/dotnet/arcade - 1c6e4ad6eedf59f8bdd9e84e811f6d037b8b8087 + f00e1ca5808b15b206042d50cad7cc1c69d3d938 - + https://github.com/dotnet/arcade - 1c6e4ad6eedf59f8bdd9e84e811f6d037b8b8087 + f00e1ca5808b15b206042d50cad7cc1c69d3d938 https://github.com/dotnet/diagnostics diff --git a/eng/Versions.props b/eng/Versions.props index eb12779dd8c..c18e98ba170 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -48,9 +48,9 @@ --> - 9.0.0-beta.24305.1 - 9.0.0-beta.24305.1 - 9.0.0-beta.24305.1 + 9.0.0-beta.24305.5 + 9.0.0-beta.24305.5 + 9.0.0-beta.24305.5 9.0.0-preview.6.24304.8 9.0.0-preview.6.24304.8 diff --git a/eng/common/cross/build-android-rootfs.sh b/eng/common/cross/build-android-rootfs.sh index f163fb9dae9..7e9ba2b75ed 100644 --- a/eng/common/cross/build-android-rootfs.sh +++ b/eng/common/cross/build-android-rootfs.sh @@ -5,15 +5,15 @@ __NDK_Version=r21 usage() { echo "Creates a toolchain and sysroot used for cross-compiling for Android." - echo. + echo echo "Usage: $0 [BuildArch] [ApiLevel]" - echo. + echo echo "BuildArch is the target architecture of Android. Currently only arm64 is supported." echo "ApiLevel is the target Android API level. API levels usually match to Android releases. See https://source.android.com/source/build-numbers.html" - echo. + echo echo "By default, the toolchain and sysroot will be generated in cross/android-rootfs/toolchain/[BuildArch]. You can change this behavior" echo "by setting the TOOLCHAIN_DIR environment variable" - echo. + echo echo "By default, the NDK will be downloaded into the cross/android-rootfs/android-ndk-$__NDK_Version directory. If you already have an NDK installation," echo "you can set the NDK_DIR environment variable to have this script use that installation of the NDK." echo "By default, this script will generate a file, android_platform, in the root of the ROOTFS_DIR directory that contains the RID for the supported and tested Android build: android.28-arm64. This file is to replace '/etc/os-release', which is not available for Android." diff --git a/global.json b/global.json index 98b8dc4393c..175ad4660b9 100644 --- a/global.json +++ b/global.json @@ -31,7 +31,7 @@ }, "msbuild-sdks": { "Microsoft.Build.NoTargets": "3.7.0", - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24305.1", - "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24305.1" + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24305.5", + "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24305.5" } } From f810fe80ee2d2e339b3dfc0e7fd51a5598aa4942 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 14:06:31 +0000 Subject: [PATCH 023/107] Update dependencies from https://github.com/dotnet/sdk build 20240605.17 (#6788) [feature/9.x] Update dependencies from dotnet/sdk - Coherency Updates: - Microsoft.AspNetCore.App.Runtime.win-x64: from 9.0.0-preview.6.24304.8 to 9.0.0-preview.6.24305.3 (parent: VS.Redist.Common.NetCore.SdkPlaceholder.x64.9.0) - VS.Redist.Common.AspNetCore.SharedFramework.x64.9.0: from 9.0.0-preview.6.24304.8 to 9.0.0-preview.6.24305.3 (parent: VS.Redist.Common.NetCore.SdkPlaceholder.x64.9.0) --- eng/Version.Details.xml | 12 ++++++------ eng/Versions.props | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 1f61aa10dee..6965ffe3f7b 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,8 +1,8 @@ - + https://github.com/dotnet/aspnetcore - 228900c8b3692f8684f4dc9c7cd5d9d53a276a8e + 8adff2c3cf5a5f08ff8cf7715af7b3f540339c12 https://github.com/dotnet/diagnostics @@ -50,13 +50,13 @@ https://github.com/dotnet/runtime 3750ac51619efbbc59bf07d3879758a9c18c4b0e - + https://github.com/dotnet/aspnetcore - 228900c8b3692f8684f4dc9c7cd5d9d53a276a8e + 8adff2c3cf5a5f08ff8cf7715af7b3f540339c12 - + https://github.com/dotnet/sdk - 5a8b156bcc5b496d6de43c8cece1bacbb7fee46f + 6ecc573c92a1237627b37310c6aec65ff3caacc8 https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index c18e98ba170..3aafde38dfd 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -52,8 +52,8 @@ 9.0.0-beta.24305.5 9.0.0-beta.24305.5 - 9.0.0-preview.6.24304.8 - 9.0.0-preview.6.24304.8 + 9.0.0-preview.6.24305.3 + 9.0.0-preview.6.24305.3 2.0.0-beta4.24209.3 @@ -65,7 +65,7 @@ 9.0.0-preview.6.24281.1 9.0.0-preview.6.24281.1 - 9.0.100-preview.6.24305.1 + 9.0.100-preview.6.24305.17 1.0.530501 From 8b00aa63a3b2a1a5434b63b6923dd17bd76c460e Mon Sep 17 00:00:00 2001 From: Joe Schmitt <1146681+schmittjoseph@users.noreply.github.com> Date: Thu, 6 Jun 2024 10:24:21 -0700 Subject: [PATCH 024/107] Add mvid and guid support to profiler (#6769) --- cspell.json | 1 + .../CommonUtilities/ClrData.h | 6 ++-- .../CommonUtilities/NameCache.cpp | 4 +-- .../CommonUtilities/NameCache.h | 2 +- .../CommonUtilities/TypeNameUtilities.cpp | 20 +++++++------ .../EventProvider/EventTypeMapping.h | 11 +++++++ .../EventProvider/ProfilerEvent.h | 30 +++++++++++++++++++ 7 files changed, 60 insertions(+), 14 deletions(-) diff --git a/cspell.json b/cspell.json index c2bf4198c58..ebb62e70107 100644 --- a/cspell.json +++ b/cspell.json @@ -66,6 +66,7 @@ "msbuild", "msdata", "MSRC", + "mvid", "ndjson", "netcoreapp", "newtonsoft", diff --git a/src/Profilers/CommonMonitorProfiler/CommonUtilities/ClrData.h b/src/Profilers/CommonMonitorProfiler/CommonUtilities/ClrData.h index 2945daa412d..c243c31a63c 100644 --- a/src/Profilers/CommonMonitorProfiler/CommonUtilities/ClrData.h +++ b/src/Profilers/CommonMonitorProfiler/CommonUtilities/ClrData.h @@ -11,15 +11,17 @@ class ModuleData { public: - ModuleData(tstring&& name) : - _moduleName(name) + ModuleData(tstring&& name, GUID mvid) : + _moduleName(name), _mvid(mvid) { } const tstring& GetName() const { return _moduleName; } + const GUID GetMvid() const { return _mvid; } private: tstring _moduleName; + GUID _mvid; }; enum class ClassFlags : UINT32 diff --git a/src/Profilers/CommonMonitorProfiler/CommonUtilities/NameCache.cpp b/src/Profilers/CommonMonitorProfiler/CommonUtilities/NameCache.cpp index ee793687b8f..dd0f99ab3e1 100644 --- a/src/Profilers/CommonMonitorProfiler/CommonUtilities/NameCache.cpp +++ b/src/Profilers/CommonMonitorProfiler/CommonUtilities/NameCache.cpp @@ -40,9 +40,9 @@ bool NameCache::TryGetTokenData(ModuleID modId, mdTypeDef token, std::shared_ptr return false; } -void NameCache::AddModuleData(ModuleID moduleId, tstring&& name) +void NameCache::AddModuleData(ModuleID moduleId, tstring&& name, GUID mvid) { - _moduleNames.emplace(moduleId, std::make_shared(std::move(name))); + _moduleNames.emplace(moduleId, std::make_shared(std::move(name), mvid)); } HRESULT NameCache::GetFullyQualifiedName(FunctionID id, tstring& name) diff --git a/src/Profilers/CommonMonitorProfiler/CommonUtilities/NameCache.h b/src/Profilers/CommonMonitorProfiler/CommonUtilities/NameCache.h index a895ed3f6a7..d1549d071bc 100644 --- a/src/Profilers/CommonMonitorProfiler/CommonUtilities/NameCache.h +++ b/src/Profilers/CommonMonitorProfiler/CommonUtilities/NameCache.h @@ -24,7 +24,7 @@ class NameCache bool TryGetModuleData(ModuleID id, std::shared_ptr& data); bool TryGetTokenData(ModuleID modId, mdTypeDef token, std::shared_ptr& data); - void AddModuleData(ModuleID moduleId, tstring&& name); + void AddModuleData(ModuleID moduleId, tstring&& name, GUID mvid); void AddFunctionData(ModuleID moduleId, FunctionID id, tstring&& name, ClassID parent, mdToken methodToken, mdTypeDef parentToken, ClassID* typeArgs, int typeArgsCount); void AddClassData(ModuleID moduleId, ClassID id, mdTypeDef typeDef, ClassFlags flags, ClassID* typeArgs, int typeArgsCount); void AddTokenData(ModuleID moduleId, mdTypeDef typeDef, mdTypeDef outerToken, tstring&& name, tstring&& Namespace); diff --git a/src/Profilers/CommonMonitorProfiler/CommonUtilities/TypeNameUtilities.cpp b/src/Profilers/CommonMonitorProfiler/CommonUtilities/TypeNameUtilities.cpp index 66afb44f502..647cdc10f99 100644 --- a/src/Profilers/CommonMonitorProfiler/CommonUtilities/TypeNameUtilities.cpp +++ b/src/Profilers/CommonMonitorProfiler/CommonUtilities/TypeNameUtilities.cpp @@ -244,18 +244,20 @@ HRESULT TypeNameUtilities::GetModuleInfo(NameCache& nameCache, ModuleID moduleId return S_OK; } + ComPtr pIMDImport; + IfFailRet(_profilerInfo->GetModuleMetaData(moduleId, + ofRead, + IID_IMetaDataImport, + (IUnknown**)&pIMDImport)); + WCHAR moduleFullName[256]; ULONG nameLength = 0; - AssemblyID assemblyID; - - IfFailRet(_profilerInfo->GetModuleInfo(moduleId, - nullptr, + GUID mvid = {0}; + IfFailRet(pIMDImport->GetScopeProps( + moduleFullName, 256, &nameLength, - moduleFullName, - &assemblyID)); - - WCHAR* ptr = nullptr; + &mvid)); int pathSeparatorIndex = nameLength - 1; while (pathSeparatorIndex >= 0) @@ -277,7 +279,7 @@ HRESULT TypeNameUtilities::GetModuleInfo(NameCache& nameCache, ModuleID moduleId moduleName = tstring(moduleFullName, pathSeparatorIndex + 1, nameLength - pathSeparatorIndex - 1); } - nameCache.AddModuleData(moduleId, std::move(moduleName)); + nameCache.AddModuleData(moduleId, std::move(moduleName), mvid); return S_OK; } diff --git a/src/Profilers/CommonMonitorProfiler/EventProvider/EventTypeMapping.h b/src/Profilers/CommonMonitorProfiler/EventProvider/EventTypeMapping.h index 567cdb84cab..922bea98dbe 100644 --- a/src/Profilers/CommonMonitorProfiler/EventProvider/EventTypeMapping.h +++ b/src/Profilers/CommonMonitorProfiler/EventProvider/EventTypeMapping.h @@ -59,6 +59,17 @@ class EventTypeMapping } }; +template<> +class EventTypeMapping +{ +public: + void GetType(COR_PRF_EVENTPIPE_PARAM_DESC& descriptor) + { + descriptor.type = COR_PRF_EVENTPIPE_GUID; + descriptor.elementType = 0; + } +}; + template<> class EventTypeMapping> { diff --git a/src/Profilers/CommonMonitorProfiler/EventProvider/ProfilerEvent.h b/src/Profilers/CommonMonitorProfiler/EventProvider/ProfilerEvent.h index d07f9110e49..037b98a2284 100644 --- a/src/Profilers/CommonMonitorProfiler/EventProvider/ProfilerEvent.h +++ b/src/Profilers/CommonMonitorProfiler/EventProvider/ProfilerEvent.h @@ -43,6 +43,9 @@ class ProfilerEvent template HRESULT WritePayload(COR_PRF_EVENT_DATA* data, const tstring& first, TArgs... rest); + template + HRESULT WritePayload(COR_PRF_EVENT_DATA* data, const GUID& first, TArgs... rest); + template HRESULT WritePayload(COR_PRF_EVENT_DATA* data, const std::vector& first, TArgs... rest); @@ -140,6 +143,33 @@ HRESULT ProfilerEvent::WritePayload(COR_PRF_EVENT_DATA* data, const tst return WritePayload(data, rest...); } +template +template +HRESULT ProfilerEvent::WritePayload(COR_PRF_EVENT_DATA* data, const GUID& first, TArgs... rest) +{ + // Manually copy the GUID into a buffer and pass the buffer address. + // We can't pass the GUID address directly (or use sizeof(GUID)) because the GUID may have padding between its different data segments. + const int GUID_FLAT_SIZE = sizeof(INT32) + sizeof(INT16) + sizeof(INT16) + sizeof(INT64); + static_assert(GUID_FLAT_SIZE == 128 / 8, "Incorrect flat GUID size."); + + BYTE buffer[GUID_FLAT_SIZE] = {0}; + int offset = 0; + + memcpy(&buffer[offset], &first.Data1, sizeof(INT32)); + offset += sizeof(INT32); + memcpy(&buffer[offset], &first.Data2, sizeof(INT16)); + offset += sizeof(INT16); + memcpy(&buffer[offset], &first.Data3, sizeof(INT16)); + offset += sizeof(INT16); + memcpy(&buffer[offset], first.Data4, sizeof(INT64)); + + data[index].ptr = reinterpret_cast(buffer); + data[index].size = static_cast(GUID_FLAT_SIZE); + data[index].reserved = 0; + + return WritePayload(data, rest...); +} + template template std::vector ProfilerEvent::GetEventBuffer(const std::vector& data) From a2c9bfaa2aa0896f220ec039e4770e33c7527106 Mon Sep 17 00:00:00 2001 From: Claudiu Guiman Date: Thu, 6 Jun 2024 17:41:37 -0400 Subject: [PATCH 025/107] Enable parameter capturing in no suspend mode. (#6778) * Enable parameter capturing in no suspend mode. * Change the suspension mode in the configureApp callback * Update ScenarioRunner.SingleTarget to support starting the app before the tool and add a test to verify the feature doesn't work if the startup hook is manually configured. * docs update --- documentation/api/parameters.md | 5 +- .../ParameterCapturingTests.cs | 90 ++++++++++++++----- .../Runners/ScenarioRunner.cs | 76 +++++++++++----- .../Commands/CollectCommandHandler.cs | 6 +- 4 files changed, 129 insertions(+), 48 deletions(-) diff --git a/documentation/api/parameters.md b/documentation/api/parameters.md index d20f5431334..93891024716 100644 --- a/documentation/api/parameters.md +++ b/documentation/api/parameters.md @@ -128,11 +128,10 @@ Content-Type: application/x-ndjson ## Additional Requirements -- The target application must use ASP.NET Core. - The target application cannot have [Hot Reload](https://learn.microsoft.com/visualstudio/debugger/hot-reload) enabled. -- `dotnet-monitor` must be set to `Listen` mode, and the target application must start suspended. See [diagnostic port configuration](../configuration/diagnostic-port-configuration.md) for information on how to do this. +- `dotnet-monitor` must be set to `Listen` mode. See [diagnostic port configuration](../configuration/diagnostic-port-configuration.md) for information on how to do this. +- If the target application is using .NET 7 then the dotnet-monitor startup hook must be manually configured and the target application must start suspended. In .NET 8+ this is not a requirement. - This feature relies on a [ICorProfilerCallback](https://docs.microsoft.com/dotnet/framework/unmanaged-api/profiling/icorprofilercallback-interface) implementation. If the target application is already using an `ICorProfiler` that isn't notify-only, this feature will not be available. -- If a target application is using .NET 7 then the `dotnet-monitor` startup hook must be configured. This is automatically done in .NET 8+. ## Additional Notes diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests/ParameterCapturingTests.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests/ParameterCapturingTests.cs index e155b0788d4..55da1356767 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests/ParameterCapturingTests.cs +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests/ParameterCapturingTests.cs @@ -51,7 +51,12 @@ public ParameterCapturingTests(ITestOutputHelper outputHelper, ServiceProviderFi [MemberData(nameof(ProfilerHelper.GetArchitecture), MemberType = typeof(ProfilerHelper))] public async Task UnresolvableMethodsFailsOperation(Architecture targetArchitecture) { - await RunTestCaseCore(TestAppScenarios.ParameterCapturing.SubScenarios.AspNetApp, targetArchitecture, async (appRunner, apiClient) => + await RunTestCaseCore( + TestAppScenarios.ParameterCapturing.SubScenarios.AspNetApp, + targetArchitecture, + shouldSuspendTargetApp: true, + enableStartupHook: true, + async (appRunner, apiClient) => { int processId = await appRunner.ProcessIdTask; @@ -78,40 +83,52 @@ await RunTestCaseCore(TestAppScenarios.ParameterCapturing.SubScenarios.AspNetApp [Theory] [MemberData(nameof(ProfilerHelper.GetArchitecture), MemberType = typeof(ProfilerHelper))] public Task CapturesParametersInNonAspNetApps(Architecture targetArchitecture) => - CapturesParametersCore(TestAppScenarios.ParameterCapturing.SubScenarios.NonAspNetApp, targetArchitecture, CapturedParameterFormat.JsonSequence); + CapturesParametersCore(TestAppScenarios.ParameterCapturing.SubScenarios.NonAspNetApp, targetArchitecture, CapturedParameterFormat.JsonSequence, shouldSuspendTargetApp: true, enableStartupHook: true); [Theory] [MemberData(nameof(ProfilerHelper.GetArchitecture), MemberType = typeof(ProfilerHelper))] public Task CapturesParametersAndOutputJsonSequence(Architecture targetArchitecture) => - CapturesParametersCore(TestAppScenarios.ParameterCapturing.SubScenarios.AspNetApp, targetArchitecture, CapturedParameterFormat.JsonSequence); + CapturesParametersCore(TestAppScenarios.ParameterCapturing.SubScenarios.AspNetApp, targetArchitecture, CapturedParameterFormat.JsonSequence, shouldSuspendTargetApp: true, enableStartupHook: true); [Theory] [MemberData(nameof(ProfilerHelper.GetArchitecture), MemberType = typeof(ProfilerHelper))] public Task CapturesParametersAndOutputNewlineDelimitedJson(Architecture targetArchitecture) => - CapturesParametersCore(TestAppScenarios.ParameterCapturing.SubScenarios.AspNetApp, targetArchitecture, CapturedParameterFormat.NewlineDelimitedJson); + CapturesParametersCore(TestAppScenarios.ParameterCapturing.SubScenarios.AspNetApp, targetArchitecture, CapturedParameterFormat.NewlineDelimitedJson, shouldSuspendTargetApp: true, enableStartupHook: true); -#else // NET7_0_OR_GREATER +#if NET8_0_OR_GREATER [Theory] [MemberData(nameof(ProfilerHelper.GetArchitecture), MemberType = typeof(ProfilerHelper))] - public async Task Net6AppFailsOperation(Architecture targetArchitecture) - { - await RunTestCaseCore(TestAppScenarios.ParameterCapturing.SubScenarios.AspNetApp, targetArchitecture, async (appRunner, apiClient) => - { - int processId = await appRunner.ProcessIdTask; + public Task CapturesParametersNoSuspend(Architecture targetArchitecture) => + CapturesParametersCore(TestAppScenarios.ParameterCapturing.SubScenarios.AspNetApp, targetArchitecture, CapturedParameterFormat.JsonSequence, shouldSuspendTargetApp: false, enableStartupHook: false); - CaptureParametersConfiguration config = GetValidConfiguration(); +#endif // NET8_0_OR_GREATER - ValidationProblemDetailsException validationException = await Assert.ThrowsAsync(() => apiClient.CaptureParametersAsync(processId, Timeout.InfiniteTimeSpan, config)); - Assert.Equal(HttpStatusCode.BadRequest, validationException.StatusCode); + [Theory] + [MemberData(nameof(ProfilerHelper.GetArchitecture), MemberType = typeof(ProfilerHelper))] + public Task AppWithStartupHookFailsInNoSuspend(Architecture targetArchitecture) => + ValidateBadRequestFailure(TestAppScenarios.ParameterCapturing.SubScenarios.AspNetApp, targetArchitecture, shouldSuspendTargetApp: false, enableStartupHook: true); + +#else // NET7_0_OR_GREATER + [Theory] + [MemberData(nameof(ProfilerHelper.GetArchitecture), MemberType = typeof(ProfilerHelper))] + public Task Net6AppFailsOperation(Architecture targetArchitecture) => + ValidateBadRequestFailure(TestAppScenarios.ParameterCapturing.SubScenarios.AspNetApp, targetArchitecture, shouldSuspendTargetApp: true, enableStartupHook: true); - await appRunner.SendCommandAsync(TestAppScenarios.ParameterCapturing.Commands.Continue); - }); - } #endif // NET7_0_OR_GREATER - private async Task CapturesParametersCore(string subScenarioName,Architecture targetArchitecture, CapturedParameterFormat format) + private async Task CapturesParametersCore( + string subScenarioName, + Architecture targetArchitecture, + CapturedParameterFormat format, + bool shouldSuspendTargetApp, + bool enableStartupHook) { - await RunTestCaseCore(subScenarioName, targetArchitecture, async (appRunner, apiClient) => + await RunTestCaseCore( + subScenarioName, + targetArchitecture, + shouldSuspendTargetApp: shouldSuspendTargetApp, + enableStartupHook: enableStartupHook, + async (appRunner, apiClient) => { int processId = await appRunner.ProcessIdTask; @@ -143,7 +160,36 @@ await RunTestCaseCore(subScenarioName, targetArchitecture, async (appRunner, api }); } - private async Task RunTestCaseCore(string subScenarioName, Architecture targetArchitecture, Func appValidate) + private async Task ValidateBadRequestFailure( + string subScenarioName, + Architecture targetArchitecture, + bool shouldSuspendTargetApp, + bool enableStartupHook) + { + await RunTestCaseCore( + subScenarioName, + targetArchitecture, + shouldSuspendTargetApp: shouldSuspendTargetApp, + enableStartupHook: enableStartupHook, + async (appRunner, apiClient) => + { + int processId = await appRunner.ProcessIdTask; + + CaptureParametersConfiguration config = GetValidConfiguration(); + + ValidationProblemDetailsException validationException = await Assert.ThrowsAsync(() => apiClient.CaptureParametersAsync(processId, Timeout.InfiniteTimeSpan, config)); + Assert.Equal(HttpStatusCode.BadRequest, validationException.StatusCode); + + await appRunner.SendCommandAsync(TestAppScenarios.ParameterCapturing.Commands.Continue); + }); + } + + private async Task RunTestCaseCore( + string subScenarioName, + Architecture targetArchitecture, + bool shouldSuspendTargetApp, + bool enableStartupHook, + Func appValidate) { await ScenarioRunner.SingleTarget( _outputHelper, @@ -153,8 +199,9 @@ await ScenarioRunner.SingleTarget( appValidate: appValidate, configureApp: runner => { - runner.EnableMonitorStartupHook = true; + runner.EnableMonitorStartupHook = enableStartupHook; runner.Architecture = targetArchitecture; + runner.DiagnosticPortSuspend = shouldSuspendTargetApp; }, configureTool: (toolRunner) => { @@ -166,7 +213,8 @@ await ScenarioRunner.SingleTarget( toolRunner.WriteKeyPerValueConfiguration(new RootOptions().AddFileSystemEgress(FileProviderName, _tempDirectory.FullName)); }, profilerLogLevel: LogLevel.Trace, - subScenarioName: subScenarioName); + subScenarioName: subScenarioName, + startAppBeforeTool: !shouldSuspendTargetApp); } private static CaptureParametersConfiguration GetValidConfiguration() diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests/Runners/ScenarioRunner.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests/Runners/ScenarioRunner.cs index 341e3ad526a..ce60896f26b 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests/Runners/ScenarioRunner.cs +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests/Runners/ScenarioRunner.cs @@ -28,7 +28,8 @@ public static async Task SingleTarget( Action configureTool = null, bool disableHttpEgress = false, LogLevel profilerLogLevel = LogLevel.Error, - string subScenarioName = null) + string subScenarioName = null, + bool startAppBeforeTool = false) { DiagnosticPortHelper.Generate( mode, @@ -43,37 +44,66 @@ public static async Task SingleTarget( configureTool?.Invoke(toolRunner); - await toolRunner.StartAsync(); - - using HttpClient httpClient = await toolRunner.CreateHttpClientDefaultAddressAsync(httpClientFactory); - ApiClient apiClient = new(outputHelper, httpClient); - - await using AppRunner appRunner = new(outputHelper, Assembly.GetExecutingAssembly()); - if (profilerLogLevel != LogLevel.None) + if (!startAppBeforeTool) { - appRunner.ProfilerLogLevel = profilerLogLevel.ToString("G"); + await toolRunner.StartAsync(); } - appRunner.ConnectionMode = appConnectionMode; - appRunner.DiagnosticPortPath = diagnosticPortPath; - appRunner.ScenarioName = scenarioName; - appRunner.SubScenarioName = subScenarioName; - configureApp?.Invoke(appRunner); +#nullable enable + HttpClient? httpClient = null; + ApiClient? apiClient = null; - await appRunner.ExecuteAsync(async () => + try { - // Wait for the process to be discovered. - int processId = await appRunner.ProcessIdTask; - _ = await apiClient.GetProcessWithRetryAsync(outputHelper, pid: processId); + if (!startAppBeforeTool) + { + httpClient = await toolRunner.CreateHttpClientDefaultAddressAsync(httpClientFactory); + apiClient = new(outputHelper, httpClient); + } + + await using AppRunner appRunner = new(outputHelper, Assembly.GetExecutingAssembly()); + if (profilerLogLevel != LogLevel.None) + { + appRunner.ProfilerLogLevel = profilerLogLevel.ToString("G"); + } + appRunner.ConnectionMode = appConnectionMode; + appRunner.DiagnosticPortPath = diagnosticPortPath; + appRunner.ScenarioName = scenarioName; + appRunner.SubScenarioName = subScenarioName; + + configureApp?.Invoke(appRunner); + + await appRunner.ExecuteAsync(async () => + { + if (startAppBeforeTool) + { + await toolRunner.StartAsync(); + httpClient = await toolRunner.CreateHttpClientDefaultAddressAsync(httpClientFactory); + apiClient = new(outputHelper, httpClient); + } - await appValidate(appRunner, apiClient); - }); - Assert.Equal(0, appRunner.ExitCode); + // Wait for the process to be discovered. + int processId = await appRunner.ProcessIdTask; + _ = await apiClient.GetProcessWithRetryAsync(outputHelper, pid: processId); - if (null != postAppValidate) + Assert.NotNull(apiClient); + + await appValidate(appRunner, apiClient); + }); + Assert.Equal(0, appRunner.ExitCode); + + Assert.NotNull(apiClient); + + if (null != postAppValidate) + { + await postAppValidate(apiClient, await appRunner.ProcessIdTask); + } + } + finally { - await postAppValidate(apiClient, await appRunner.ProcessIdTask); + httpClient?.Dispose(); } +#nullable disable } } } diff --git a/src/Tools/dotnet-monitor/Commands/CollectCommandHandler.cs b/src/Tools/dotnet-monitor/Commands/CollectCommandHandler.cs index b14fd48fa18..20134f09fab 100644 --- a/src/Tools/dotnet-monitor/Commands/CollectCommandHandler.cs +++ b/src/Tools/dotnet-monitor/Commands/CollectCommandHandler.cs @@ -131,11 +131,15 @@ private static IHostBuilder Configure(this IHostBuilder builder, StartupAuthenti services.AddSingleton(); services.ConfigureCollectionRules(); services.ConfigureLibrarySharing(); + /* + * ConfigureInProcessFeatures needs to be called before ConfigureProfiler + * because the profiler needs to have access to environment variables set by in process features. + */ + services.ConfigureInProcessFeatures(context.Configuration); services.ConfigureProfiler(); services.ConfigureStartupHook(); services.ConfigureExceptions(); services.ConfigureStartupLoggers(authConfigurator); - services.ConfigureInProcessFeatures(context.Configuration); services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); From 07bd424992c9fa7e0218ebc6838b99dbb65353bc Mon Sep 17 00:00:00 2001 From: Wiktor Kopec Date: Thu, 6 Jun 2024 15:40:58 -0700 Subject: [PATCH 026/107] Fixup nuget authentication (#6789) --- eng/pipelines/steps/setup-nuget-sources.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/eng/pipelines/steps/setup-nuget-sources.yml b/eng/pipelines/steps/setup-nuget-sources.yml index 386306d03de..5c12f50f91f 100644 --- a/eng/pipelines/steps/setup-nuget-sources.yml +++ b/eng/pipelines/steps/setup-nuget-sources.yml @@ -8,7 +8,7 @@ steps: displayName: Setup Private Feeds Credentials inputs: filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1 - arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config -Password $Env:Token + arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config env: Token: $(dn-bot-dnceng-artifact-feeds-rw) - ${{ else }}: @@ -19,3 +19,7 @@ steps: arguments: $(Build.SourcesDirectory)/NuGet.config $Token env: Token: $(dn-bot-dnceng-artifact-feeds-rw) +# Run the NuGetAuthenticate task after the internal feeds are added to the nuget.config +# This ensures that creds are set appropriately for all feeds in the config, and that the +# credential provider is installed. +- task: NuGetAuthenticate@1 \ No newline at end of file From 834c5e956273462bd220a087b6ffad26605fd191 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 7 Jun 2024 13:06:14 +0000 Subject: [PATCH 027/107] Update dependencies from https://github.com/dotnet/diagnostics build 20240606.2 (#6792) [main] Update dependencies from dotnet/diagnostics --- eng/Version.Details.xml | 12 ++++++------ eng/Versions.props | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 84da8e2350c..aa2d9f5d025 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -4,13 +4,13 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore 8e941eb42f819adb116b881195158b3887a70a1c - + https://github.com/dotnet/diagnostics - cc5eca29afa2d9cacf6700ddc8d843082b5955c6 + 5bf29f28ab61dec78a4d9a498f6b7ac0f2ded43a - + https://github.com/dotnet/diagnostics - cc5eca29afa2d9cacf6700ddc8d843082b5955c6 + 5bf29f28ab61dec78a4d9a498f6b7ac0f2ded43a https://github.com/dotnet/command-line-api @@ -46,9 +46,9 @@ https://github.com/dotnet/arcade f2b2071632d5d4c46d0f904f2b0d917b1752551b - + https://github.com/dotnet/diagnostics - cc5eca29afa2d9cacf6700ddc8d843082b5955c6 + 5bf29f28ab61dec78a4d9a498f6b7ac0f2ded43a https://dev.azure.com/dnceng/internal/_git/dotnet-runtime diff --git a/eng/Versions.props b/eng/Versions.props index 275c2c82517..8369a97a687 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -57,8 +57,8 @@ 2.0.0-beta4.24209.3 - 8.0.0-preview.24305.1 - 8.0.0-preview.24305.1 + 8.0.0-preview.24306.2 + 8.0.0-preview.24306.2 8.0.103-servicing.24114.15 @@ -67,7 +67,7 @@ 8.0.1 8.0.1-servicing.23580.1 - 1.0.530501 + 1.0.530602 $(MicrosoftNETCoreApp31Version) From 1e733be57a511597371669a2c09fa33b0221e2b3 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 7 Jun 2024 13:56:28 +0000 Subject: [PATCH 028/107] Update dependencies from https://github.com/dotnet/diagnostics build 20240606.2 (#6793) [feature/9.x] Update dependencies from dotnet/diagnostics --- eng/Version.Details.xml | 12 ++++++------ eng/Versions.props | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 6965ffe3f7b..c3df630d0fb 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -4,13 +4,13 @@ https://github.com/dotnet/aspnetcore 8adff2c3cf5a5f08ff8cf7715af7b3f540339c12 - + https://github.com/dotnet/diagnostics - cc5eca29afa2d9cacf6700ddc8d843082b5955c6 + 5bf29f28ab61dec78a4d9a498f6b7ac0f2ded43a - + https://github.com/dotnet/diagnostics - cc5eca29afa2d9cacf6700ddc8d843082b5955c6 + 5bf29f28ab61dec78a4d9a498f6b7ac0f2ded43a https://github.com/dotnet/command-line-api @@ -42,9 +42,9 @@ https://github.com/dotnet/arcade f00e1ca5808b15b206042d50cad7cc1c69d3d938 - + https://github.com/dotnet/diagnostics - cc5eca29afa2d9cacf6700ddc8d843082b5955c6 + 5bf29f28ab61dec78a4d9a498f6b7ac0f2ded43a https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index 3aafde38dfd..c27b2c05d50 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -57,8 +57,8 @@ 2.0.0-beta4.24209.3 - 8.0.0-preview.24305.1 - 8.0.0-preview.24305.1 + 8.0.0-preview.24306.2 + 8.0.0-preview.24306.2 9.0.0-preview.24304.1 @@ -67,7 +67,7 @@ 9.0.100-preview.6.24305.17 - 1.0.530501 + 1.0.530602 $(MicrosoftNETCoreApp31Version) From 7cc2a40cbfb53264e72546bf4f6259d6ad926400 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 7 Jun 2024 13:58:45 +0000 Subject: [PATCH 029/107] Update dependencies from https://github.com/dotnet/arcade build 20240606.4 (#6794) [feature/9.x] Update dependencies from dotnet/arcade --- eng/Version.Details.xml | 20 ++++++++++---------- eng/Versions.props | 6 +++--- eng/common/post-build/publish-using-darc.ps1 | 1 + global.json | 4 ++-- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index c3df630d0fb..d6c312bd7b9 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -22,25 +22,25 @@ https://github.com/dotnet/roslyn-analyzers 333f90a3051f084e7af42b516b6bdd7ae8e004f3 - + https://github.com/dotnet/arcade - f00e1ca5808b15b206042d50cad7cc1c69d3d938 + 7507f80c8db285bbc9939c1dff522a761cf4edc0 - + https://github.com/dotnet/arcade - f00e1ca5808b15b206042d50cad7cc1c69d3d938 + 7507f80c8db285bbc9939c1dff522a761cf4edc0 - + https://github.com/dotnet/arcade - f00e1ca5808b15b206042d50cad7cc1c69d3d938 + 7507f80c8db285bbc9939c1dff522a761cf4edc0 - + https://github.com/dotnet/arcade - f00e1ca5808b15b206042d50cad7cc1c69d3d938 + 7507f80c8db285bbc9939c1dff522a761cf4edc0 - + https://github.com/dotnet/arcade - f00e1ca5808b15b206042d50cad7cc1c69d3d938 + 7507f80c8db285bbc9939c1dff522a761cf4edc0 https://github.com/dotnet/diagnostics diff --git a/eng/Versions.props b/eng/Versions.props index c27b2c05d50..a8dd8bb8b68 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -48,9 +48,9 @@ --> - 9.0.0-beta.24305.5 - 9.0.0-beta.24305.5 - 9.0.0-beta.24305.5 + 9.0.0-beta.24306.4 + 9.0.0-beta.24306.4 + 9.0.0-beta.24306.4 9.0.0-preview.6.24305.3 9.0.0-preview.6.24305.3 diff --git a/eng/common/post-build/publish-using-darc.ps1 b/eng/common/post-build/publish-using-darc.ps1 index e831d5c1d29..d6a39e31cc3 100644 --- a/eng/common/post-build/publish-using-darc.ps1 +++ b/eng/common/post-build/publish-using-darc.ps1 @@ -43,6 +43,7 @@ try { --azdev-pat $AzdoToken ` --bar-uri $MaestroApiEndPoint ` --password $MaestroToken ` + --disable-interactive-auth ` @optionalParams if ($LastExitCode -ne 0) { diff --git a/global.json b/global.json index 175ad4660b9..0180d30149c 100644 --- a/global.json +++ b/global.json @@ -31,7 +31,7 @@ }, "msbuild-sdks": { "Microsoft.Build.NoTargets": "3.7.0", - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24305.5", - "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24305.5" + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24306.4", + "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24306.4" } } From 5214c12a6de3feb3999f303bd49d81f3c936fd58 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 7 Jun 2024 14:00:21 +0000 Subject: [PATCH 030/107] Update dependencies from https://github.com/dotnet/sdk build 20240607.5 (#6796) [feature/9.x] Update dependencies from dotnet/sdk - Coherency Updates: - Microsoft.AspNetCore.App.Runtime.win-x64: from 9.0.0-preview.6.24305.3 to 9.0.0-preview.6.24306.5 (parent: VS.Redist.Common.NetCore.SdkPlaceholder.x64.9.0) - Microsoft.NETCore.App.Runtime.win-x64: from 9.0.0-preview.6.24281.1 to 9.0.0-preview.6.24306.8 (parent: VS.Redist.Common.NetCore.SdkPlaceholder.x64.9.0) - VS.Redist.Common.AspNetCore.SharedFramework.x64.9.0: from 9.0.0-preview.6.24305.3 to 9.0.0-preview.6.24306.5 (parent: VS.Redist.Common.NetCore.SdkPlaceholder.x64.9.0) - VS.Redist.Common.NetCore.SharedFramework.x64.9.0: from 9.0.0-preview.6.24281.1 to 9.0.0-preview.6.24306.8 (parent: VS.Redist.Common.NetCore.SdkPlaceholder.x64.9.0) --- eng/Version.Details.xml | 20 ++++++++++---------- eng/Versions.props | 10 +++++----- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index d6c312bd7b9..5e69861b71f 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,8 +1,8 @@ - + https://github.com/dotnet/aspnetcore - 8adff2c3cf5a5f08ff8cf7715af7b3f540339c12 + 10517269f40d53eb22cce6b4d520ed27ed1e1b9f https://github.com/dotnet/diagnostics @@ -46,21 +46,21 @@ https://github.com/dotnet/diagnostics 5bf29f28ab61dec78a4d9a498f6b7ac0f2ded43a - + https://github.com/dotnet/runtime - 3750ac51619efbbc59bf07d3879758a9c18c4b0e + f6a7ebbb81540401e6b5520afa3ba87c2bd6bcfe - + https://github.com/dotnet/aspnetcore - 8adff2c3cf5a5f08ff8cf7715af7b3f540339c12 + 10517269f40d53eb22cce6b4d520ed27ed1e1b9f - + https://github.com/dotnet/sdk - 6ecc573c92a1237627b37310c6aec65ff3caacc8 + b1d6cfcdb15e9b4fd28e5cead8e452083021f29d - + https://github.com/dotnet/runtime - 3750ac51619efbbc59bf07d3879758a9c18c4b0e + f6a7ebbb81540401e6b5520afa3ba87c2bd6bcfe diff --git a/eng/Versions.props b/eng/Versions.props index a8dd8bb8b68..9d5024b8fab 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -52,8 +52,8 @@ 9.0.0-beta.24306.4 9.0.0-beta.24306.4 - 9.0.0-preview.6.24305.3 - 9.0.0-preview.6.24305.3 + 9.0.0-preview.6.24306.5 + 9.0.0-preview.6.24306.5 2.0.0-beta4.24209.3 @@ -62,10 +62,10 @@ 9.0.0-preview.24304.1 - 9.0.0-preview.6.24281.1 - 9.0.0-preview.6.24281.1 + 9.0.0-preview.6.24306.8 + 9.0.0-preview.6.24306.8 - 9.0.100-preview.6.24305.17 + 9.0.100-preview.6.24307.5 1.0.530602 From 27ae7ee95a0cca39a7206e34930c424cab7a7c8f Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 7 Jun 2024 09:02:53 -0700 Subject: [PATCH 031/107] Update dependencies from https://github.com/dotnet/roslyn-analyzers build 20240606.2 (#6795) Microsoft.CodeAnalysis.NetAnalyzers From Version 9.0.0-preview.24304.1 -> To Version 9.0.0-preview.24306.2 Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 5e69861b71f..013eac9ea1e 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -18,9 +18,9 @@ - + https://github.com/dotnet/roslyn-analyzers - 333f90a3051f084e7af42b516b6bdd7ae8e004f3 + 4d5fd9da36d64d4c3370b8813122e226844fc6ed https://github.com/dotnet/arcade diff --git a/eng/Versions.props b/eng/Versions.props index 9d5024b8fab..5babdfd66a1 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -60,7 +60,7 @@ 8.0.0-preview.24306.2 8.0.0-preview.24306.2 - 9.0.0-preview.24304.1 + 9.0.0-preview.24306.2 9.0.0-preview.6.24306.8 9.0.0-preview.6.24306.8 From 7e3f9d740e0c9b8d2e2bce8544908ad7699e74ff Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 7 Jun 2024 10:27:27 -0700 Subject: [PATCH 032/107] Update Learning Paths (#6754) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .github/learning-path-sha.txt | 2 +- documentation/learningPath/aks.md | 2 +- documentation/learningPath/api.md | 10 ++-- documentation/learningPath/collectionrules.md | 30 +++++----- documentation/learningPath/configuration.md | 16 +++--- documentation/learningPath/egress.md | 22 ++++---- documentation/learningPath/testing.md | 56 +++++++++---------- 7 files changed, 69 insertions(+), 69 deletions(-) diff --git a/.github/learning-path-sha.txt b/.github/learning-path-sha.txt index 73bcecd7c34..9bacc45440c 100644 --- a/.github/learning-path-sha.txt +++ b/.github/learning-path-sha.txt @@ -1 +1 @@ -8e99fe93461686b50ea276b406c5046b252b05e4 \ No newline at end of file +3c31273c42196ec0813b7b5b947ab8e1bd1801ac \ No newline at end of file diff --git a/documentation/learningPath/aks.md b/documentation/learningPath/aks.md index aad93a54a57..92ae857e025 100644 --- a/documentation/learningPath/aks.md +++ b/documentation/learningPath/aks.md @@ -9,7 +9,7 @@ In addition to its availability as a .NET CLI tool, the `dotnet monitor` tool is This workflow takes your local development copy of `dotnet-monitor`, patches it with a local development copy of the [.NET Core Diagnostics Repo](https://github.com/dotnet/diagnostics#net-core-diagnostics-repo), and makes it available as an image for you to consume in an ACR (Azure Container Registry). Note that there are many other ways to do this - this is meant to serve as a basic template that can be adapted to match your needs. -1. Open `pwsh` and run the [generate-dev-sln script](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/generate-dev-sln.ps1), providing a path to your local copy of the diagnostics repo. +1. Open `pwsh` and run the [generate-dev-sln script](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/generate-dev-sln.ps1), providing a path to your local copy of the diagnostics repo. > [!NOTE] > If your changes do not involve the [.NET Core Diagnostics Repo](https://github.com/dotnet/diagnostics#net-core-diagnostics-repo), you don't need to complete this step. diff --git a/documentation/learningPath/api.md b/documentation/learningPath/api.md index c12c0b152f6..21048146453 100644 --- a/documentation/learningPath/api.md +++ b/documentation/learningPath/api.md @@ -7,15 +7,15 @@ dotnet-monitor exposes functionality through both [collection rules](./collectio ## Adding New APIs -The web API surface is defined by a series of controllers [here](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Microsoft.Diagnostics.Monitoring.WebApi/Controllers/). It's common for an API to expose functionality also available via [Actions](./collectionrules.md#actions) and so methods in these controllers are often wrappers around a shared implementation. Each controller may have one or more attributes that configure how and where it is exposed, you can learn more about the notable controller attributes [here](#notable-controller-attributes). +The web API surface is defined by a series of controllers [here](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Microsoft.Diagnostics.Monitoring.WebApi/Controllers/). It's common for an API to expose functionality also available via [Actions](./collectionrules.md#actions) and so methods in these controllers are often wrappers around a shared implementation. Each controller may have one or more attributes that configure how and where it is exposed, you can learn more about the notable controller attributes [here](#notable-controller-attributes). -If the new API needs to either accept or return structured data, a dedicated model should be used. Models are defined [here](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Microsoft.Diagnostics.Monitoring.WebApi/Models/). +If the new API needs to either accept or return structured data, a dedicated model should be used. Models are defined [here](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Microsoft.Diagnostics.Monitoring.WebApi/Models/). When adding a new API, it's important to also update the [`openapi.json`](../openapi.json) spec which describes the API surface. There are CI tests that will ensure this file has been updated to reflect any API changes. Learn more about updating `openapi.json` [here](./testing.md#openapi-generation). ### Adding Tests -Web APIs in dotnet-monitor are typically tested using functional tests that leverage the [ApiClient](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests/HttpApi/ApiClient.cs) to call a specific API. Learn more about how the functional tests are defined and operate [here](./testing.md#functional-tests). +Web APIs in dotnet-monitor are typically tested using functional tests that leverage the [ApiClient](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests/HttpApi/ApiClient.cs) to call a specific API. Learn more about how the functional tests are defined and operate [here](./testing.md#functional-tests). ## Notable Controller Attributes @@ -35,6 +35,6 @@ dotnet-monitor supports multiple different [authentication modes](../authenticat ### Determining Authentication Mode -When dotnet-monitor starts, the command line arguments are first inspected to see if a specific authentication mode was set (such as `--no-auth`), referred to as the `StartupAuthenticationMode`, this is calculated [here](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tools/dotnet-monitor/Commands/CollectCommandHandler.cs#L28). If no modes were explicitly set via a command line argument, dotnet-monitor will select `Deferred` as the `StartupAuthenticationMode`. This indicates that the user configuration should be looked at to determine the authentication mode later on in the startup process. +When dotnet-monitor starts, the command line arguments are first inspected to see if a specific authentication mode was set (such as `--no-auth`), referred to as the `StartupAuthenticationMode`, this is calculated [here](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tools/dotnet-monitor/Commands/CollectCommandHandler.cs#L28). If no modes were explicitly set via a command line argument, dotnet-monitor will select `Deferred` as the `StartupAuthenticationMode`. This indicates that the user configuration should be looked at to determine the authentication mode later on in the startup process. -After determining the `StartupAuthenticationMode` mode, the relevant [IAuthenticationConfigurator](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tools/dotnet-monitor/Auth/IAuthenticationConfigurator.cs) is created by the [AuthConfiguratorFactory](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tools/dotnet-monitor/Auth/AuthConfiguratorFactory.cs). This factory also handles deciding what authentication mode to use when `StartupAuthenticationMode` is `Deferred`. The selected configurator is used to configure various parts of dotnet-monitor that are specific to authentication, such as protecting the web APIs and adding authentication-mode specific logging. +After determining the `StartupAuthenticationMode` mode, the relevant [IAuthenticationConfigurator](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tools/dotnet-monitor/Auth/IAuthenticationConfigurator.cs) is created by the [AuthConfiguratorFactory](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tools/dotnet-monitor/Auth/AuthConfiguratorFactory.cs). This factory also handles deciding what authentication mode to use when `StartupAuthenticationMode` is `Deferred`. The selected configurator is used to configure various parts of dotnet-monitor that are specific to authentication, such as protecting the web APIs and adding authentication-mode specific logging. diff --git a/documentation/learningPath/collectionrules.md b/documentation/learningPath/collectionrules.md index acf678a6e99..a95eb10e546 100644 --- a/documentation/learningPath/collectionrules.md +++ b/documentation/learningPath/collectionrules.md @@ -32,49 +32,49 @@ graph LR ### Key Areas Of The Code -* Collection rules are registered [here](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tools/dotnet-monitor/ServiceCollectionExtensions.cs#L140). When adding a new trigger or action, these types need to be added here to take effect. This section is also responsible for making sure options get configured and validated. -* Options for collection rules can be found [here](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tools/dotnet-monitor/CollectionRules/Options/CollectionRuleOptions.cs). -* Rules are applied, removed, and restarted in response to configuration changes [here](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tools/dotnet-monitor/CollectionRules/CollectionRuleService.cs). This is also responsible for generating a description of each collection rule's state for the `/collectionrules` API Endpoint. -* The pipeline responsible for the lifetime of a single executing collection rule can be found [here](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tools/dotnet-monitor/CollectionRules/CollectionRulePipeline.cs#L54). -* To run collection rules, `dotnet monitor` must be in `Listen` mode - this is set via [DiagnosticPortOptions](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Microsoft.Diagnostics.Monitoring.Options/DiagnosticPortOptions.cs). +* Collection rules are registered [here](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tools/dotnet-monitor/ServiceCollectionExtensions.cs#L141). When adding a new trigger or action, these types need to be added here to take effect. This section is also responsible for making sure options get configured and validated. +* Options for collection rules can be found [here](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tools/dotnet-monitor/CollectionRules/Options/CollectionRuleOptions.cs). +* Rules are applied, removed, and restarted in response to configuration changes [here](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tools/dotnet-monitor/CollectionRules/CollectionRuleService.cs). This is also responsible for generating a description of each collection rule's state for the `/collectionrules` API Endpoint. +* The pipeline responsible for the lifetime of a single executing collection rule can be found [here](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tools/dotnet-monitor/CollectionRules/CollectionRulePipeline.cs#L54). +* To run collection rules, `dotnet monitor` must be in `Listen` mode - this is set via [DiagnosticPortOptions](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Microsoft.Diagnostics.Monitoring.Options/DiagnosticPortOptions.cs). * For each type of trigger, the [dotnet diagnostics repo](https://github.com/dotnet/diagnostics/blob/v6.0.351802/src/Microsoft.Diagnostics.Monitoring.EventPipe/Triggers/ITraceEventTrigger.cs#L29) is responsible for determining whether the triggering conditions have been satisfied. ### Triggers -A trigger will monitor for a specific condition in the target application and raise a notification when that condition has been observed. Options for triggers can be found [here](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tools/dotnet-monitor/CollectionRules/Options/CollectionRuleTriggerOptions.cs); the type of `Settings` is determined by which trigger is being used (possible trigger types can be found [here](https://github.com/dotnet/dotnet-monitor/tree/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tools/dotnet-monitor/CollectionRules/Options/Triggers)). The interface for all triggers can be found [here](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tools/dotnet-monitor/CollectionRules/Triggers/ICollectionRuleTrigger.cs) - this allows `dotnet monitor` to start and stop triggers, regardless of the trigger's properties. The collection rule pipeline creates instances of triggers [here](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tools/dotnet-monitor/CollectionRules/CollectionRulePipeline.cs#L99) before waiting for the trigger to [satisfy its conditions](https://github.com/dotnet/diagnostics/blob/v6.0.351802/src/Microsoft.Diagnostics.Monitoring.EventPipe/Triggers/Pipelines/TraceEventTriggerPipeline.cs#L107) - each trigger has its own set of criteria that determines when a trigger has been satisfied. +A trigger will monitor for a specific condition in the target application and raise a notification when that condition has been observed. Options for triggers can be found [here](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tools/dotnet-monitor/CollectionRules/Options/CollectionRuleTriggerOptions.cs); the type of `Settings` is determined by which trigger is being used (possible trigger types can be found [here](https://github.com/dotnet/dotnet-monitor/tree/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tools/dotnet-monitor/CollectionRules/Options/Triggers)). The interface for all triggers can be found [here](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tools/dotnet-monitor/CollectionRules/Triggers/ICollectionRuleTrigger.cs) - this allows `dotnet monitor` to start and stop triggers, regardless of the trigger's properties. The collection rule pipeline creates instances of triggers [here](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tools/dotnet-monitor/CollectionRules/CollectionRulePipeline.cs#L99) before waiting for the trigger to [satisfy its conditions](https://github.com/dotnet/diagnostics/blob/v6.0.351802/src/Microsoft.Diagnostics.Monitoring.EventPipe/Triggers/Pipelines/TraceEventTriggerPipeline.cs#L107) - each trigger has its own set of criteria that determines when a trigger has been satisfied. ### Actions -Actions allow executing an operation or an external executable in response to a trigger condition being satisfied. Options for actions can be found [here](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tools/dotnet-monitor/CollectionRules/Options/CollectionRuleActionOptions.cs); the type of `Settings` is determined by which action is being used (possible action types can be found [here](https://github.com/dotnet/dotnet-monitor/tree/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tools/dotnet-monitor/CollectionRules/Options/Actions)). The interface for all actions can be found [here](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tools/dotnet-monitor/CollectionRules/Actions/ICollectionRuleAction.cs) - this allows `dotnet monitor` to start an action, wait for it to complete, and get its output values regardless of the action's properties. The action list is [executed](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tools/dotnet-monitor/CollectionRules/CollectionRulePipeline.cs#L149) once the triggering condition has been met (assuming the action list isn't throttled), with each action by default starting without waiting for prior actions to complete. +Actions allow executing an operation or an external executable in response to a trigger condition being satisfied. Options for actions can be found [here](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tools/dotnet-monitor/CollectionRules/Options/CollectionRuleActionOptions.cs); the type of `Settings` is determined by which action is being used (possible action types can be found [here](https://github.com/dotnet/dotnet-monitor/tree/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tools/dotnet-monitor/CollectionRules/Options/Actions)). The interface for all actions can be found [here](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tools/dotnet-monitor/CollectionRules/Actions/ICollectionRuleAction.cs) - this allows `dotnet monitor` to start an action, wait for it to complete, and get its output values regardless of the action's properties. The action list is [executed](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tools/dotnet-monitor/CollectionRules/CollectionRulePipeline.cs#L149) once the triggering condition has been met (assuming the action list isn't throttled), with each action by default starting without waiting for prior actions to complete. ### Filters -Filters can optionally be applied to a collection rule to choose which processes can trigger the rule. This uses the same set of [options](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Microsoft.Diagnostics.Monitoring.Options/ProcessFilterOptions.cs#L47) as setting the default process for `dotnet-monitor`. When starting a collection rule, [these filters are used to check if the current process should have the collection rule applied to it](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tools/dotnet-monitor/CollectionRules/CollectionRuleContainer.cs#L187); if so, the collection rule starts. +Filters can optionally be applied to a collection rule to choose which processes can trigger the rule. This uses the same set of [options](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Microsoft.Diagnostics.Monitoring.Options/ProcessFilterOptions.cs#L47) as setting the default process for `dotnet-monitor`. When starting a collection rule, [these filters are used to check if the current process should have the collection rule applied to it](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tools/dotnet-monitor/CollectionRules/CollectionRuleContainer.cs#L187); if so, the collection rule starts. ### Limits -Limits can optionally be applied to a collection rule to constrain the lifetime of the rule and how often its actions can be run before being throttled. Options for limits can be found [here](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tools/dotnet-monitor/CollectionRules/Options/CollectionRuleLimitsOptions.cs). When provided (or when using default values), limits are evaluated in the collection rule pipeline while running. `RuleDuration` is used to [create a token](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tools/dotnet-monitor/CollectionRules/CollectionRulePipeline.cs#L79) that shuts down the pipeline. `ActionCountSlidingWindowDuration` does not rely on setting cancellation tokens; rather, the number of executions within the sliding window are checked on-demand [here](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Microsoft.Diagnostics.Monitoring.WebApi/CollectionRulePipelineState.cs#L211), and `ActionCount` is referenced to determine whether the rule needs to [terminate](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Microsoft.Diagnostics.Monitoring.WebApi/CollectionRulePipelineState.cs#L194) or [throttle](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Microsoft.Diagnostics.Monitoring.WebApi/CollectionRulePipelineState.cs#L234). +Limits can optionally be applied to a collection rule to constrain the lifetime of the rule and how often its actions can be run before being throttled. Options for limits can be found [here](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tools/dotnet-monitor/CollectionRules/Options/CollectionRuleLimitsOptions.cs). When provided (or when using default values), limits are evaluated in the collection rule pipeline while running. `RuleDuration` is used to [create a token](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tools/dotnet-monitor/CollectionRules/CollectionRulePipeline.cs#L79) that shuts down the pipeline. `ActionCountSlidingWindowDuration` does not rely on setting cancellation tokens; rather, the number of executions within the sliding window are checked on-demand [here](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Microsoft.Diagnostics.Monitoring.WebApi/CollectionRulePipelineState.cs#L211), and `ActionCount` is referenced to determine whether the rule needs to [terminate](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Microsoft.Diagnostics.Monitoring.WebApi/CollectionRulePipelineState.cs#L194) or [throttle](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Microsoft.Diagnostics.Monitoring.WebApi/CollectionRulePipelineState.cs#L234). ## Miscellaneous ### Trigger Shortcuts -Trigger Shortcuts provide improved defaults, range validation, and a simpler syntax for [several commonly used `EventCounter` triggers](https://github.com/dotnet/dotnet-monitor/tree/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tools/dotnet-monitor/CollectionRules/Options/Triggers/EventCounterShortcuts). These shortcuts provide the same functionality as using the standard `EventCounter` syntax, but have fewer available options (since there is no need to specify the `ProviderName` or the `CounterName`) - as a result, shortcuts do not inherit from `EventCounterOptions`, but rather [IEventCounterShortcuts](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tools/dotnet-monitor/CollectionRules/Options/Triggers/EventCounterShortcuts/IEventCounterShortcuts.cs). Each type of shortcut is registered independently [here](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tools/dotnet-monitor/ServiceCollectionExtensions.cs#L158). After binding with configuration and undergoing validation, shortcuts are then converted to be treated as `EventCounter` triggers [here](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tools/dotnet-monitor/CollectionRules/Triggers/EventCounterTriggerFactory.cs), using their respective defaults instead of the generic ones. +Trigger Shortcuts provide improved defaults, range validation, and a simpler syntax for [several commonly used `EventCounter` triggers](https://github.com/dotnet/dotnet-monitor/tree/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tools/dotnet-monitor/CollectionRules/Options/Triggers/EventCounterShortcuts). These shortcuts provide the same functionality as using the standard `EventCounter` syntax, but have fewer available options (since there is no need to specify the `ProviderName` or the `CounterName`) - as a result, shortcuts do not inherit from `EventCounterOptions`, but rather [IEventCounterShortcuts](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tools/dotnet-monitor/CollectionRules/Options/Triggers/EventCounterShortcuts/IEventCounterShortcuts.cs). Each type of shortcut is registered independently [here](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tools/dotnet-monitor/ServiceCollectionExtensions.cs#L159). After binding with configuration and undergoing validation, shortcuts are then converted to be treated as `EventCounter` triggers [here](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tools/dotnet-monitor/CollectionRules/Triggers/EventCounterTriggerFactory.cs), using their respective defaults instead of the generic ones. ### Templates -Templates allow users to design reusable collection rule components by associating a name with a piece of configuration. Options for templates can be found [here](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tools/dotnet-monitor/CollectionRules/Options/TemplateOptions.cs). Before collection rules undergo validation, `dotnet monitor` checks to see if any of the rule's components in configuration [list the name of a template](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tools/dotnet-monitor/CollectionRules/Configuration/CollectionRulePostConfigureNamedOptions.cs) - if so, the collection rule's options are populated from the correspondingly named template. Note that templates undergo the same binding process for triggers/actions as collection rules; however, since templates are treated as separate parts of configuration, this binding instead happens [here](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tools/dotnet-monitor/CollectionRules/Configuration/TemplatesConfigureNamedOptions.cs). +Templates allow users to design reusable collection rule components by associating a name with a piece of configuration. Options for templates can be found [here](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tools/dotnet-monitor/CollectionRules/Options/TemplateOptions.cs). Before collection rules undergo validation, `dotnet monitor` checks to see if any of the rule's components in configuration [list the name of a template](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tools/dotnet-monitor/CollectionRules/Configuration/CollectionRulePostConfigureNamedOptions.cs) - if so, the collection rule's options are populated from the correspondingly named template. Note that templates undergo the same binding process for triggers/actions as collection rules; however, since templates are treated as separate parts of configuration, this binding instead happens [here](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tools/dotnet-monitor/CollectionRules/Configuration/TemplatesConfigureNamedOptions.cs). ### Collection Rule Defaults -Defaults can be used to limit the verbosity of configuration, allowing frequently used values for collection rules to be assigned as defaults. Options for collection rule defaults can be found [here](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tools/dotnet-monitor/CollectionRules/Options/CollectionRuleDefaultsOptions.cs). These defaults are merged with the user's provided configuration [here](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tools/dotnet-monitor/CollectionRules/Options/DefaultCollectionRulePostConfigureOptions.cs) - any properties that the user hasn't set (that have corresponding default values) will be updated at this point to use the default values. This step occurs prior to `dotnet monitor` attempting to use its built-in defaults, which allows user defaults to take precedence. +Defaults can be used to limit the verbosity of configuration, allowing frequently used values for collection rules to be assigned as defaults. Options for collection rule defaults can be found [here](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tools/dotnet-monitor/CollectionRules/Options/CollectionRuleDefaultsOptions.cs). These defaults are merged with the user's provided configuration [here](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tools/dotnet-monitor/CollectionRules/Options/DefaultCollectionRulePostConfigureOptions.cs) - any properties that the user hasn't set (that have corresponding default values) will be updated at this point to use the default values. This step occurs prior to `dotnet monitor` attempting to use its built-in defaults, which allows user defaults to take precedence. ### Collection Rule API Endpoint -The Collection Rule API Endpoint allows users to get information about the state of their collection rules, providing general information [here](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Microsoft.Diagnostics.Monitoring.WebApi/Controllers/DiagController.cs#L525) and more specific information about a particular rule [here](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Microsoft.Diagnostics.Monitoring.WebApi/Controllers/DiagController.cs#L550). **This API is solely for viewing the current state of rules, not altering state**. +The Collection Rule API Endpoint allows users to get information about the state of their collection rules, providing general information [here](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Microsoft.Diagnostics.Monitoring.WebApi/Controllers/DiagController.cs#L525) and more specific information about a particular rule [here](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Microsoft.Diagnostics.Monitoring.WebApi/Controllers/DiagController.cs#L550). **This API is solely for viewing the current state of rules, not altering state**. -Each collection rule pipeline has a [state holder](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Microsoft.Diagnostics.Monitoring.WebApi/CollectionRulePipelineState.cs) that keeps track of the rule's execution. By keeping track of the pipeline's state in real-time, this state doesn't need to be calculated in response to a user hitting the `/collectionrules` endpoint. However, other user-facing information, such as countdowns, are calculated on-demand - these values are solely for display purposes and not used by `dotnet-monitor` when determining when to change state (see [Limits](#limits) for more information). +Each collection rule pipeline has a [state holder](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Microsoft.Diagnostics.Monitoring.WebApi/CollectionRulePipelineState.cs) that keeps track of the rule's execution. By keeping track of the pipeline's state in real-time, this state doesn't need to be calculated in response to a user hitting the `/collectionrules` endpoint. However, other user-facing information, such as countdowns, are calculated on-demand - these values are solely for display purposes and not used by `dotnet-monitor` when determining when to change state (see [Limits](#limits) for more information). ## Keeping Documentation Up-To-Date -When making changes to collection rules that require updates to configuration, these changes should be added [here](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/documentation/configuration/collection-rule-configuration.md). Additional information on collection rules and examples can be provided [here](https://github.com/dotnet/dotnet-monitor/tree/8e99fe93461686b50ea276b406c5046b252b05e4/documentation/collectionrules). +When making changes to collection rules that require updates to configuration, these changes should be added [here](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/documentation/configuration/collection-rule-configuration.md). Additional information on collection rules and examples can be provided [here](https://github.com/dotnet/dotnet-monitor/tree/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/documentation/collectionrules). diff --git a/documentation/learningPath/configuration.md b/documentation/learningPath/configuration.md index 2c04f3c9549..7c221c9df2a 100644 --- a/documentation/learningPath/configuration.md +++ b/documentation/learningPath/configuration.md @@ -6,22 +6,22 @@ ## How Configuration Works -`dotnet-monitor` accepts configuration from several different sources, and must [combine these sources for the host builder](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tools/dotnet-monitor/HostBuilder/HostBuilderHelper.cs#L47). Configuration sources are added in the order of lowest to highest precedence - meaning that if there is a conflict between a property in two configuration sources, the property found in the latter configuration source will be used. +`dotnet-monitor` accepts configuration from several different sources, and must [combine these sources for the host builder](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tools/dotnet-monitor/HostBuilder/HostBuilderHelper.cs#L47). Configuration sources are added in the order of lowest to highest precedence - meaning that if there is a conflict between a property in two configuration sources, the property found in the latter configuration source will be used. -To see the merged configuration, the user can run the `config show` command (see [here](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tools/dotnet-monitor/Program.cs#L71) and [here](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tools/dotnet-monitor/Commands/ConfigShowCommandHandler.cs)); the `--show-sources` flag can be used to reveal which configuration source is responsible for each property. The `config show` command's output is [written out as JSON](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tools/dotnet-monitor/ConfigurationJsonWriter.cs); this section must be manually updated whenever new options are added (or existing options are changed). +To see the merged configuration, the user can run the `config show` command (see [here](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tools/dotnet-monitor/Program.cs#L71) and [here](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tools/dotnet-monitor/Commands/ConfigShowCommandHandler.cs)); the `--show-sources` flag can be used to reveal which configuration source is responsible for each property. The `config show` command's output is [written out as JSON](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tools/dotnet-monitor/ConfigurationJsonWriter.cs); this section must be manually updated whenever new options are added (or existing options are changed). -Once configuration has been merged, any singletons that have been added to the `IServiceCollection` (see [here](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tools/dotnet-monitor/ServiceCollectionExtensions.cs) and [here](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tools/dotnet-monitor/Commands/CollectCommandHandler.cs#L84)), such as `IConfigureOptions`, `IPostConfigureOptions`, and `IValidateOptions`, are called when an object of that type is first used, **not on startup**. This step is often used to incorporate defaults for properties that were not explicitly set by configuration, or to validate that options were set correctly. +Once configuration has been merged, any singletons that have been added to the `IServiceCollection` (see [here](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tools/dotnet-monitor/ServiceCollectionExtensions.cs) and [here](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tools/dotnet-monitor/Commands/CollectCommandHandler.cs#L84)), such as `IConfigureOptions`, `IPostConfigureOptions`, and `IValidateOptions`, are called when an object of that type is first used, **not on startup**. This step is often used to incorporate defaults for properties that were not explicitly set by configuration, or to validate that options were set correctly. -Any changes to the configuration need to be propagated to the [schema](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/documentation/schema.json). **The updated schema should be generated automatically; you should never need to manually edit the JSON.** To update the schema in Visual Studio: -* Set [Microsoft.Diagnostics.Monitoring.ConfigurationSchema](https://github.com/dotnet/dotnet-monitor/tree/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tests/Microsoft.Diagnostics.Monitoring.ConfigurationSchema) as the startup project +Any changes to the configuration need to be propagated to the [schema](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/documentation/schema.json). **The updated schema should be generated automatically; you should never need to manually edit the JSON.** To update the schema in Visual Studio: +* Set [Microsoft.Diagnostics.Monitoring.ConfigurationSchema](https://github.com/dotnet/dotnet-monitor/tree/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tests/Microsoft.Diagnostics.Monitoring.ConfigurationSchema) as the startup project * Build the project, with a single command-line argument for the schema's absolute path -* Validate that the schema was correctly updated using the tests in [Microsoft.Diagnostics.Monitoring.ConfigurationSchema.UnitTests](https://github.com/dotnet/dotnet-monitor/tree/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tests/Microsoft.Diagnostics.Monitoring.ConfigurationSchema.UnitTests) +* Validate that the schema was correctly updated using the tests in [Microsoft.Diagnostics.Monitoring.ConfigurationSchema.UnitTests](https://github.com/dotnet/dotnet-monitor/tree/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tests/Microsoft.Diagnostics.Monitoring.ConfigurationSchema.UnitTests) ## Keeping Documentation Up-To-Date -Our configuration is primarily documented [here](https://github.com/dotnet/dotnet-monitor/tree/8e99fe93461686b50ea276b406c5046b252b05e4/documentation/configuration). Sections are typically comprised of: +Our configuration is primarily documented [here](https://github.com/dotnet/dotnet-monitor/tree/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/documentation/configuration). Sections are typically comprised of: * A brief overview of the feature that is being configured * Configuration samples in all supported formats * A list of properties with descriptions, types, and whether a property is required -Types are defined in [definitions.md](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/documentation/api/definitions.md), and additional information about configuring collection rules can be found in the [collection rules](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/documentation/collectionrules) directory. Where appropriate, indicate if configuration only pertains to a specific version of `dotnet-monitor` (e.g. `7.0+`). +Types are defined in [definitions.md](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/documentation/api/definitions.md), and additional information about configuring collection rules can be found in the [collection rules](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/documentation/collectionrules) directory. Where appropriate, indicate if configuration only pertains to a specific version of `dotnet-monitor` (e.g. `7.0+`). diff --git a/documentation/learningPath/egress.md b/documentation/learningPath/egress.md index 0f745a51e6b..1fe84a64f10 100644 --- a/documentation/learningPath/egress.md +++ b/documentation/learningPath/egress.md @@ -26,11 +26,11 @@ graph LR class ide2 altColor ``` -1. [User initiates collection of artifact with a designated egress provider](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Microsoft.Diagnostics.Monitoring.WebApi/Operation/EgressOperation.cs#L45) -1. [Locate extension's executable and manifest](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tools/dotnet-monitor/Extensibility/ExtensionDiscoverer.cs#L28) -1. [Start extension and pass configuration/artifact via StdIn to the other process](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tools/dotnet-monitor/Egress/Extension/EgressExtension.cs#L102) -1. [Connect to egress provider using configuration and send artifact](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Extensions/AzureBlobStorage/AzureBlobEgressProvider.cs#L36) -1. [Provide success/failure information via StdOut to dotnet-monitor](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Microsoft.Diagnostics.Monitoring.Extension.Common/EgressHelper.cs#L77) +1. [User initiates collection of artifact with a designated egress provider](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Microsoft.Diagnostics.Monitoring.WebApi/Operation/EgressOperation.cs#L45) +1. [Locate extension's executable and manifest](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tools/dotnet-monitor/Extensibility/ExtensionDiscoverer.cs#L28) +1. [Start extension and pass configuration/artifact via StdIn to the other process](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tools/dotnet-monitor/Egress/Extension/EgressExtension.cs#L102) +1. [Connect to egress provider using configuration and send artifact](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Extensions/AzureBlobStorage/AzureBlobEgressProvider.cs#L36) +1. [Provide success/failure information via StdOut to dotnet-monitor](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Microsoft.Diagnostics.Monitoring.Extension.Common/EgressHelper.cs#L77) ## Distribution and Acquisition Model @@ -41,7 +41,7 @@ There are two versions of the `dotnet-monitor` image being offered: `monitor` an ### Well Known Egress Provider Locations -There are 3 [locations](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tools/dotnet-monitor/ServiceCollectionExtensions.cs#L279) that `dotnet-monitor` scans when looking for the extensions directory (the highest priority location is listed first): +There are 3 [locations](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tools/dotnet-monitor/ServiceCollectionExtensions.cs#L280) that `dotnet-monitor` scans when looking for the extensions directory (the highest priority location is listed first): - Next to the executing `dotnet-monitor` assembly - SharedConfigDirectory - On Windows, `%ProgramData%\dotnet-monitor` @@ -59,23 +59,23 @@ The distribution/acquisition model for third-party egress providers is determine ### Extension Manifest -All extensions must include a manifest titled [`extension.json`](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Extensions/AzureBlobStorage/extension.json) that provides `dotnet-monitor` with some basic information about the extension. +All extensions must include a manifest titled [`extension.json`](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Extensions/AzureBlobStorage/extension.json) that provides `dotnet-monitor` with some basic information about the extension. | Name | Required | Type | Description | |---|---|---|---| | `Name` | true | string | The name of the extension (e.g. AzureBlobStorage) that users will use when writing configuration for the egress provider. | | `ExecutableFileName` | false | string | If specified, the executable file (without extension) to be launched when executing the extension; either `AssemblyFileName` or `ExecutableFileName` must be specified. | | `AssemblyFileName` | false | string | If specified, executes the extension using the shared .NET host (e.g. dotnet.exe) with the specified entry point assembly (without extension); either `AssemblyFileName` or `ExecutableFileName` must be specified. | -| `Modes` | false | [[ExtensionMode](../api/definitions.md#extensionmode)] | Additional modes the extension can be configured to run in (see an example of Validation [here](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Microsoft.Diagnostics.Monitoring.Extension.Common/EgressHelper.cs#L80)). | +| `Modes` | false | [[ExtensionMode](../api/definitions.md#extensionmode)] | Additional modes the extension can be configured to run in (see an example of Validation [here](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Microsoft.Diagnostics.Monitoring.Extension.Common/EgressHelper.cs#L80)). | ### Configuration Extensions are designed to receive all user configuration through `dotnet monitor` - the extension itself should not rely on any additional configuration sources. -In addition to the configuration provided specifically for your egress provider, `dotnet-monitor` also includes the values stored in [`Properties`](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Microsoft.Diagnostics.Monitoring.Options/EgressOptions.cs#L21). Note that `Properties` may include information that is not relevant to the current egress provider, since it is a shared bucket between all configured egress providers. +In addition to the configuration provided specifically for your egress provider, `dotnet-monitor` also includes the values stored in [`Properties`](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Microsoft.Diagnostics.Monitoring.Options/EgressOptions.cs#L21). Note that `Properties` may include information that is not relevant to the current egress provider, since it is a shared bucket between all configured egress providers. ### Communicating With Dotnet-Monitor -[`dotnet monitor` will pass serialized configuration via `StdIn` to the extension](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tools/dotnet-monitor/Egress/Extension/EgressExtension.cs#L182); an example of how the `AzureBlobStorage` egress provider interprets the egress payload can be found [here](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Microsoft.Diagnostics.Monitoring.Extension.Common/EgressHelper.cs#L141). **It's important to validate the version number at the beginning of the stream; if an extension does not have the same version as `dotnet-monitor`, it should not attempt to continue reading from the stream, and users may need to update to a newer version of the extension.** +[`dotnet monitor` will pass serialized configuration via `StdIn` to the extension](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tools/dotnet-monitor/Egress/Extension/EgressExtension.cs#L182); an example of how the `AzureBlobStorage` egress provider interprets the egress payload can be found [here](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Microsoft.Diagnostics.Monitoring.Extension.Common/EgressHelper.cs#L141). **It's important to validate the version number at the beginning of the stream; if an extension does not have the same version as `dotnet-monitor`, it should not attempt to continue reading from the stream, and users may need to update to a newer version of the extension.** -All output from the extension will be passed back to `dotnet-monitor`; this is logged [here](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tools/dotnet-monitor/Egress/Extension/EgressExtension.OutputParser.cs#L62). The contents of the `StandardOutput` and `StandardError` streams are handled and logged as seen [here](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tools/dotnet-monitor/Egress/Extension/EgressExtension.OutputParser.cs#L32), with the `StandardOutput` stream being logged at the `Info` level and the `StandardError` stream being logged at the `Warning` level. `Dotnet-Monitor` will continue reading output until it receives a [result](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tools/dotnet-monitor/Egress/Extension/EgressArtifactResult.cs) from the extension via the `StandardOutput` stream, at which point the extension's process will be terminated and `dotnet-monitor` will display the appropriate log message depending on the success/failure of the operation. Exceptions thrown during the egress operation are caught [here](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Microsoft.Diagnostics.Monitoring.Extension.Common/EgressHelper.cs#L71); this allows the extension to report a failure message back to `dotnet-monitor` that will be displayed to the user. +All output from the extension will be passed back to `dotnet-monitor`; this is logged [here](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tools/dotnet-monitor/Egress/Extension/EgressExtension.OutputParser.cs#L62). The contents of the `StandardOutput` and `StandardError` streams are handled and logged as seen [here](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tools/dotnet-monitor/Egress/Extension/EgressExtension.OutputParser.cs#L32), with the `StandardOutput` stream being logged at the `Info` level and the `StandardError` stream being logged at the `Warning` level. `Dotnet-Monitor` will continue reading output until it receives a [result](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tools/dotnet-monitor/Egress/Extension/EgressArtifactResult.cs) from the extension via the `StandardOutput` stream, at which point the extension's process will be terminated and `dotnet-monitor` will display the appropriate log message depending on the success/failure of the operation. Exceptions thrown during the egress operation are caught [here](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Microsoft.Diagnostics.Monitoring.Extension.Common/EgressHelper.cs#L71); this allows the extension to report a failure message back to `dotnet-monitor` that will be displayed to the user. diff --git a/documentation/learningPath/testing.md b/documentation/learningPath/testing.md index 6eb88df2381..a16d4fdf213 100644 --- a/documentation/learningPath/testing.md +++ b/documentation/learningPath/testing.md @@ -7,81 +7,81 @@ Tests can be executed with the command line (via [build.cmd](../../Build.cmd) -test), as part of the PR build, or in Visual Studio. Note that because of limited resources in the build pool, tests ran from the command line or in the build pool are serialized. This avoids test failures associated with parallel testing. Visual Studio does not have such restrictions and is best used for individual tests and test investigations. When running from the command line, using the `-testgroup` parameter can be used to limit the amount of tests executed. For example `build.cmd -test -testgroup PR` will run the same tests as the PR build. -The framework of the test assemblies is controlled by [TestTargetFrameworks](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/eng/Versions.props). The test itself is attributed with a particular framework based on the [TargetFrameworkMonikerTraitAttribute](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tests/Microsoft.Diagnostics.Monitoring.TestCommon/TargetFrameworkMonikerTraitAttribute.cs). +The framework of the test assemblies is controlled by [TestTargetFrameworks](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/eng/Versions.props). The test itself is attributed with a particular framework based on the [TargetFrameworkMonikerTraitAttribute](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tests/Microsoft.Diagnostics.Monitoring.TestCommon/TargetFrameworkMonikerTraitAttribute.cs). ## Unit Tests -- [Microsoft.Diagnostics.Monitoring.Tool.UnitTests](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests) -- [Microsoft.Diagnostics.Monitoring.WebApi.UnitTests](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tests/Microsoft.Diagnostics.Monitoring.WebApi.UnitTests/) -- [CollectionRuleActions.UnitTests](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tests/CollectionRuleActions.UnitTests/) +- [Microsoft.Diagnostics.Monitoring.Tool.UnitTests](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests) +- [Microsoft.Diagnostics.Monitoring.WebApi.UnitTests](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tests/Microsoft.Diagnostics.Monitoring.WebApi.UnitTests/) +- [CollectionRuleActions.UnitTests](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tests/CollectionRuleActions.UnitTests/) Unit test assemblies directly reference types from various dotnet-monitor assemblies. However, since most of dotnet-monitor heavily relies on code injection, there are utility classes to simplify unit test creation. -- [TestHostHelper](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTestCommon/TestHostHelper.cs) can be used to setup a basic unit test scenario using dependency injection. -- [CollectionRuleOptionsExtensions](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTestCommon/Options/CollectionRuleOptionsExtensions.cs) can be used to easily create collection rules from configuration. +- [TestHostHelper](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTestCommon/TestHostHelper.cs) can be used to setup a basic unit test scenario using dependency injection. +- [CollectionRuleOptionsExtensions](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTestCommon/Options/CollectionRuleOptionsExtensions.cs) can be used to easily create collection rules from configuration. ## Functional Tests -- [Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests) -- [Microsoft.Diagnostics.Monitoring.UnitTestApp](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/) +- [Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests) +- [Microsoft.Diagnostics.Monitoring.UnitTestApp](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/) Functional tests are composed of 3 main parts: 1. The test itself, which sets up and validates the results. 1. An instance of dotnet-monitor 1. An instance of an application that is being monitored (from the UnitTestApp assembly) -* [ScenarioRunner](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests/Runners/ScenarioRunner.cs) is typically used to orchestrate test runs. The class will spawn both an instance of dotnet-monitor and an instance of test application. The app and the test communicate via stdio. The test communicates with dotnet-monitor via its Api surface. -* The dotnet-monitor Api surface can be accessed through the [ApiClient](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests/HttpApi/ApiClient.cs). -* New scenarios can be added [here](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/Scenarios/). -* The [AsyncWaitScenario](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/Scenarios/AsyncWaitScenario.cs) is sufficient for most tests. -* Coordination of the scenario and the test is done via message passing (json over stdio) between the test and the app. To send messages to the app from the test, [AppRunner](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tests/Microsoft.Diagnostics.Monitoring.TestCommon/Runners/AppRunner.cs)'s `SendCommandAsync` is used. In the scenario definition, [ScenarioHelpers](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/ScenarioHelpers.cs)'s `WaitForCommandAsync` is used. This can be used to synchronize various points of the test application with the execution of the dotnet-monitor Api from the test itself. +* [ScenarioRunner](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests/Runners/ScenarioRunner.cs) is typically used to orchestrate test runs. The class will spawn both an instance of dotnet-monitor and an instance of test application. The app and the test communicate via stdio. The test communicates with dotnet-monitor via its Api surface. +* The dotnet-monitor Api surface can be accessed through the [ApiClient](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests/HttpApi/ApiClient.cs). +* New scenarios can be added [here](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/Scenarios/). +* The [AsyncWaitScenario](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/Scenarios/AsyncWaitScenario.cs) is sufficient for most tests. +* Coordination of the scenario and the test is done via message passing (json over stdio) between the test and the app. To send messages to the app from the test, [AppRunner](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tests/Microsoft.Diagnostics.Monitoring.TestCommon/Runners/AppRunner.cs)'s `SendCommandAsync` is used. In the scenario definition, [ScenarioHelpers](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/ScenarioHelpers.cs)'s `WaitForCommandAsync` is used. This can be used to synchronize various points of the test application with the execution of the dotnet-monitor Api from the test itself. ## Native/Profiler Tests -- [Microsoft.Diagnostics.Monitoring.Profiler.UnitTests](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tests/Microsoft.Diagnostics.Monitoring.Profiler.UnitTests/) -- [Microsoft.Diagnostics.Monitoring.Profiler.UnitTestApp](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tests/Microsoft.Diagnostics.Monitoring.Profiler.UnitTestApp/) +- [Microsoft.Diagnostics.Monitoring.Profiler.UnitTests](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tests/Microsoft.Diagnostics.Monitoring.Profiler.UnitTests/) +- [Microsoft.Diagnostics.Monitoring.Profiler.UnitTestApp](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tests/Microsoft.Diagnostics.Monitoring.Profiler.UnitTestApp/) This test assembly provides a test to make sure the dotnet-monitor profiler can load into a target app. ## Schema Generation -- [Microsoft.Diagnostics.Monitoring.ConfigurationSchema.UnitTests](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tests/Microsoft.Diagnostics.Monitoring.ConfigurationSchema.UnitTests/) -- [Microsoft.Diagnostics.Monitoring.ConfigurationSchema](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tests/Microsoft.Diagnostics.Monitoring.ConfigurationSchema/) -- [Microsoft.Diagnostics.Monitoring.Options](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Microsoft.Diagnostics.Monitoring.Options) +- [Microsoft.Diagnostics.Monitoring.ConfigurationSchema.UnitTests](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tests/Microsoft.Diagnostics.Monitoring.ConfigurationSchema.UnitTests/) +- [Microsoft.Diagnostics.Monitoring.ConfigurationSchema](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tests/Microsoft.Diagnostics.Monitoring.ConfigurationSchema/) +- [Microsoft.Diagnostics.Monitoring.Options](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Microsoft.Diagnostics.Monitoring.Options) -Dotnet-monitor generates [schema.json](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/documentation/schema.json) using unit tests. If dotnet-monitor's configuration changes, the schema.json file needs to be updated. -Note that it is possible to compile option classes directly into the `ConfigurationSchema` project. This may be necessary in order to attribute properties appropriately for schema generation. See [Microsoft.Diagnostics.Monitoring.ConfigurationSchema.csproj](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tests/Microsoft.Diagnostics.Monitoring.ConfigurationSchema/Microsoft.Diagnostics.Monitoring.ConfigurationSchema.csproj). See the [Configuration](./configuration.md#how-configuration-works) learning path for more details. +Dotnet-monitor generates [schema.json](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/documentation/schema.json) using unit tests. If dotnet-monitor's configuration changes, the schema.json file needs to be updated. +Note that it is possible to compile option classes directly into the `ConfigurationSchema` project. This may be necessary in order to attribute properties appropriately for schema generation. See [Microsoft.Diagnostics.Monitoring.ConfigurationSchema.csproj](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tests/Microsoft.Diagnostics.Monitoring.ConfigurationSchema/Microsoft.Diagnostics.Monitoring.ConfigurationSchema.csproj). See the [Configuration](./configuration.md#how-configuration-works) learning path for more details. ## OpenAPI generation -- [Microsoft.Diagnostics.Monitoring.OpenApiGen.UnitTests](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tests/Microsoft.Diagnostics.Monitoring.OpenApiGen.UnitTests/) -- [Microsoft.Diagnostics.Monitoring.OpenApiGen](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tests/Microsoft.Diagnostics.Monitoring.OpenApiGen/) +- [Microsoft.Diagnostics.Monitoring.OpenApiGen.UnitTests](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tests/Microsoft.Diagnostics.Monitoring.OpenApiGen.UnitTests/) +- [Microsoft.Diagnostics.Monitoring.OpenApiGen](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tests/Microsoft.Diagnostics.Monitoring.OpenApiGen/) -These assemblies and tests are used to generate the [OpenAPI spec](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/documentation/openapi.json) for the dotnet-monitor API. Changes to the dotnet-monitor api surface require updating `openapi.json`. +These assemblies and tests are used to generate the [OpenAPI spec](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/documentation/openapi.json) for the dotnet-monitor API. Changes to the dotnet-monitor api surface require updating `openapi.json`. If using VSCode or Codespaces, you can also use the `Regenerate openapi.json` task. ## Startup hooks / hosting startup -- [Microsoft.Diagnostics.Monitoring.Tool.TestStartupHook](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.TestStartupHook/) +- [Microsoft.Diagnostics.Monitoring.Tool.TestStartupHook](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.TestStartupHook/) This assembly is injected into a dotnet-monitor runner (using `DOTNET_STARTUP_HOOKS`) to facilitate Assembly resolution during test runs. -- [Microsoft.Diagnostics.Monitoring.Tool.TestHostingStartup](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.TestHostingStartup/) +- [Microsoft.Diagnostics.Monitoring.Tool.TestHostingStartup](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.TestHostingStartup/) Uses `ASPNETCORE_HOSTINGSTARTUPASSEMBLIES` to inject a service into dotnet-monitor during test time. This allows tests to locate files that are not normally part of the test deployment, such as the native profiler. -- [Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/) +- [Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/) Unit tests around features that are injected via `DOTNET_STARTUP_HOOKS` into the target application. This currently includes the Exceptions History feature. ## Misc test assemblies -- [Microsoft.Diagnostics.Monitoring.TestCommon](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tests/Microsoft.Diagnostics.Monitoring.TestCommon/) +- [Microsoft.Diagnostics.Monitoring.TestCommon](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tests/Microsoft.Diagnostics.Monitoring.TestCommon/) Utility classes that are shared between Unit Tests and Functional Tests. -- [Microsoft.Diagnostics.Monitoring.Tool.UnitTestCommon](https://github.com/dotnet/dotnet-monitor/blob/8e99fe93461686b50ea276b406c5046b252b05e4/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTestCommon/) +- [Microsoft.Diagnostics.Monitoring.Tool.UnitTestCommon](https://github.com/dotnet/dotnet-monitor/blob/3c31273c42196ec0813b7b5b947ab8e1bd1801ac/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTestCommon/) Utility classes shared between unit test assemblies. From 9da068cdc6b36448ee1101946cb390b9aea2473f Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Sat, 8 Jun 2024 12:58:17 +0000 Subject: [PATCH 033/107] Update dependencies from https://github.com/dotnet/diagnostics build 20240607.1 (#6799) [main] Update dependencies from dotnet/diagnostics --- eng/Version.Details.xml | 12 ++++++------ eng/Versions.props | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index aa2d9f5d025..ef0fb7d8009 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -4,13 +4,13 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore 8e941eb42f819adb116b881195158b3887a70a1c - + https://github.com/dotnet/diagnostics - 5bf29f28ab61dec78a4d9a498f6b7ac0f2ded43a + 33d8bf23a6566cd3fb9055acfc9f1141391d5421 - + https://github.com/dotnet/diagnostics - 5bf29f28ab61dec78a4d9a498f6b7ac0f2ded43a + 33d8bf23a6566cd3fb9055acfc9f1141391d5421 https://github.com/dotnet/command-line-api @@ -46,9 +46,9 @@ https://github.com/dotnet/arcade f2b2071632d5d4c46d0f904f2b0d917b1752551b - + https://github.com/dotnet/diagnostics - 5bf29f28ab61dec78a4d9a498f6b7ac0f2ded43a + 33d8bf23a6566cd3fb9055acfc9f1141391d5421 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime diff --git a/eng/Versions.props b/eng/Versions.props index 8369a97a687..edc66ed616e 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -57,8 +57,8 @@ 2.0.0-beta4.24209.3 - 8.0.0-preview.24306.2 - 8.0.0-preview.24306.2 + 8.0.0-preview.24307.1 + 8.0.0-preview.24307.1 8.0.103-servicing.24114.15 @@ -67,7 +67,7 @@ 8.0.1 8.0.1-servicing.23580.1 - 1.0.530602 + 1.0.530701 $(MicrosoftNETCoreApp31Version) From a5c0f976b77d254fd5e80255d7ca1e4ccbce08f2 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Sat, 8 Jun 2024 14:19:01 +0000 Subject: [PATCH 034/107] Update dependencies from https://github.com/dotnet/diagnostics build 20240607.1 (#6800) [feature/9.x] Update dependencies from dotnet/diagnostics --- eng/Version.Details.xml | 12 ++++++------ eng/Versions.props | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 013eac9ea1e..d89acf789b8 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -4,13 +4,13 @@ https://github.com/dotnet/aspnetcore 10517269f40d53eb22cce6b4d520ed27ed1e1b9f - + https://github.com/dotnet/diagnostics - 5bf29f28ab61dec78a4d9a498f6b7ac0f2ded43a + 33d8bf23a6566cd3fb9055acfc9f1141391d5421 - + https://github.com/dotnet/diagnostics - 5bf29f28ab61dec78a4d9a498f6b7ac0f2ded43a + 33d8bf23a6566cd3fb9055acfc9f1141391d5421 https://github.com/dotnet/command-line-api @@ -42,9 +42,9 @@ https://github.com/dotnet/arcade 7507f80c8db285bbc9939c1dff522a761cf4edc0 - + https://github.com/dotnet/diagnostics - 5bf29f28ab61dec78a4d9a498f6b7ac0f2ded43a + 33d8bf23a6566cd3fb9055acfc9f1141391d5421 https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index 5babdfd66a1..0e435322af1 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -57,8 +57,8 @@ 2.0.0-beta4.24209.3 - 8.0.0-preview.24306.2 - 8.0.0-preview.24306.2 + 8.0.0-preview.24307.1 + 8.0.0-preview.24307.1 9.0.0-preview.24306.2 @@ -67,7 +67,7 @@ 9.0.100-preview.6.24307.5 - 1.0.530602 + 1.0.530701 $(MicrosoftNETCoreApp31Version) From 33395b135f3d1d205b3a5e19a5fd8987d0da0964 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Sat, 8 Jun 2024 14:29:43 +0000 Subject: [PATCH 035/107] Update dependencies from https://github.com/dotnet/sdk build 20240607.18 (#6801) [feature/9.x] Update dependencies from dotnet/sdk - Coherency Updates: - Microsoft.NETCore.App.Runtime.win-x64: from 9.0.0-preview.6.24306.8 to 9.0.0-preview.6.24307.2 (parent: VS.Redist.Common.NetCore.SdkPlaceholder.x64.9.0) - VS.Redist.Common.NetCore.SharedFramework.x64.9.0: from 9.0.0-preview.6.24306.8 to 9.0.0-preview.6.24307.2 (parent: VS.Redist.Common.NetCore.SdkPlaceholder.x64.9.0) --- eng/Version.Details.xml | 12 ++++++------ eng/Versions.props | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index d89acf789b8..228bf9d3612 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -46,21 +46,21 @@ https://github.com/dotnet/diagnostics 33d8bf23a6566cd3fb9055acfc9f1141391d5421 - + https://github.com/dotnet/runtime - f6a7ebbb81540401e6b5520afa3ba87c2bd6bcfe + 8fac5af2b11dc98fa0504f6fd06df790164ec958 https://github.com/dotnet/aspnetcore 10517269f40d53eb22cce6b4d520ed27ed1e1b9f - + https://github.com/dotnet/sdk - b1d6cfcdb15e9b4fd28e5cead8e452083021f29d + cc17704acfbee4b2ef49a82aa6f65aaa9cafffef - + https://github.com/dotnet/runtime - f6a7ebbb81540401e6b5520afa3ba87c2bd6bcfe + 8fac5af2b11dc98fa0504f6fd06df790164ec958 diff --git a/eng/Versions.props b/eng/Versions.props index 0e435322af1..80d7463ccad 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -62,10 +62,10 @@ 9.0.0-preview.24306.2 - 9.0.0-preview.6.24306.8 - 9.0.0-preview.6.24306.8 + 9.0.0-preview.6.24307.2 + 9.0.0-preview.6.24307.2 - 9.0.100-preview.6.24307.5 + 9.0.100-preview.6.24307.18 1.0.530701 From b2090f503738ffd917247211b41fc8a7945ee79d Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 10 Jun 2024 13:52:24 +0000 Subject: [PATCH 036/107] Update dependencies from https://github.com/dotnet/sdk build 20240609.2 (#6805) [feature/9.x] Update dependencies from dotnet/sdk - Coherency Updates: - Microsoft.AspNetCore.App.Runtime.win-x64: from 9.0.0-preview.6.24306.5 to 9.0.0-preview.6.24307.5 (parent: VS.Redist.Common.NetCore.SdkPlaceholder.x64.9.0) - VS.Redist.Common.AspNetCore.SharedFramework.x64.9.0: from 9.0.0-preview.6.24306.5 to 9.0.0-preview.6.24307.5 (parent: VS.Redist.Common.NetCore.SdkPlaceholder.x64.9.0) --- eng/Version.Details.xml | 12 ++++++------ eng/Versions.props | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 228bf9d3612..7d7f0e6eb8a 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,8 +1,8 @@ - + https://github.com/dotnet/aspnetcore - 10517269f40d53eb22cce6b4d520ed27ed1e1b9f + 206b0aeca39d5eb12e55ce4e35ef4c8b9bc63c86 https://github.com/dotnet/diagnostics @@ -50,13 +50,13 @@ https://github.com/dotnet/runtime 8fac5af2b11dc98fa0504f6fd06df790164ec958 - + https://github.com/dotnet/aspnetcore - 10517269f40d53eb22cce6b4d520ed27ed1e1b9f + 206b0aeca39d5eb12e55ce4e35ef4c8b9bc63c86 - + https://github.com/dotnet/sdk - cc17704acfbee4b2ef49a82aa6f65aaa9cafffef + 9099d03a90a003dd2bfee3e2147518c8158c269a https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index 80d7463ccad..6460b41c145 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -52,8 +52,8 @@ 9.0.0-beta.24306.4 9.0.0-beta.24306.4 - 9.0.0-preview.6.24306.5 - 9.0.0-preview.6.24306.5 + 9.0.0-preview.6.24307.5 + 9.0.0-preview.6.24307.5 2.0.0-beta4.24209.3 @@ -65,7 +65,7 @@ 9.0.0-preview.6.24307.2 9.0.0-preview.6.24307.2 - 9.0.100-preview.6.24307.18 + 9.0.100-preview.6.24309.2 1.0.530701 From 75bcdc80a8aa8a24d4a829f4f441d8a883f4ab07 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 10 Jun 2024 09:15:58 -0700 Subject: [PATCH 037/107] generate release notes (#6798) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .../releaseNotes/releaseNotes.v9.0.0-preview.5.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 documentation/releaseNotes/releaseNotes.v9.0.0-preview.5.md diff --git a/documentation/releaseNotes/releaseNotes.v9.0.0-preview.5.md b/documentation/releaseNotes/releaseNotes.v9.0.0-preview.5.md new file mode 100644 index 00000000000..91d55275b55 --- /dev/null +++ b/documentation/releaseNotes/releaseNotes.v9.0.0-preview.5.md @@ -0,0 +1,8 @@ +Today we are releasing the next official preview version of the `dotnet monitor` tool. This release includes: + +- Fix an issue where operations could finish, or fail, but their state would be still be reported as `Starting` ([issue #6683](https://github.com/dotnet/dotnet-monitor/issues/6683)). ([#6686](https://github.com/dotnet/dotnet-monitor/pull/6686)) +- Fix the error log message shown when an action could not be registered. ([#6665](https://github.com/dotnet/dotnet-monitor/pull/6665)) + + + +If you would like to provide additional feedback to the team [please fill out this survey](https://aka.ms/dotnet-monitor-survey?src=rn). \ No newline at end of file From 126d11fc2e349292311f8cdf82ee2c7e0a99fd6f Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 11 Jun 2024 14:31:48 +0000 Subject: [PATCH 038/107] Update dependencies from https://github.com/dotnet/arcade build 20240611.1 (#6807) [feature/9.x] Update dependencies from dotnet/arcade --- eng/Version.Details.xml | 20 ++++++++++---------- eng/Versions.props | 6 +++--- eng/common/post-build/publish-using-darc.ps1 | 2 +- eng/common/tools.ps1 | 2 +- eng/common/tools.sh | 4 ++-- global.json | 4 ++-- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 7d7f0e6eb8a..1ab1a2f5a0d 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -22,25 +22,25 @@ https://github.com/dotnet/roslyn-analyzers 4d5fd9da36d64d4c3370b8813122e226844fc6ed - + https://github.com/dotnet/arcade - 7507f80c8db285bbc9939c1dff522a761cf4edc0 + 11f7d1ae1a87b5d8c469fa00f22a184d2f5d1319 - + https://github.com/dotnet/arcade - 7507f80c8db285bbc9939c1dff522a761cf4edc0 + 11f7d1ae1a87b5d8c469fa00f22a184d2f5d1319 - + https://github.com/dotnet/arcade - 7507f80c8db285bbc9939c1dff522a761cf4edc0 + 11f7d1ae1a87b5d8c469fa00f22a184d2f5d1319 - + https://github.com/dotnet/arcade - 7507f80c8db285bbc9939c1dff522a761cf4edc0 + 11f7d1ae1a87b5d8c469fa00f22a184d2f5d1319 - + https://github.com/dotnet/arcade - 7507f80c8db285bbc9939c1dff522a761cf4edc0 + 11f7d1ae1a87b5d8c469fa00f22a184d2f5d1319 https://github.com/dotnet/diagnostics diff --git a/eng/Versions.props b/eng/Versions.props index 6460b41c145..70ba8e6ea85 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -48,9 +48,9 @@ --> - 9.0.0-beta.24306.4 - 9.0.0-beta.24306.4 - 9.0.0-beta.24306.4 + 9.0.0-beta.24311.1 + 9.0.0-beta.24311.1 + 9.0.0-beta.24311.1 9.0.0-preview.6.24307.5 9.0.0-preview.6.24307.5 diff --git a/eng/common/post-build/publish-using-darc.ps1 b/eng/common/post-build/publish-using-darc.ps1 index d6a39e31cc3..8bc107fa738 100644 --- a/eng/common/post-build/publish-using-darc.ps1 +++ b/eng/common/post-build/publish-using-darc.ps1 @@ -43,7 +43,7 @@ try { --azdev-pat $AzdoToken ` --bar-uri $MaestroApiEndPoint ` --password $MaestroToken ` - --disable-interactive-auth ` + --ci ` @optionalParams if ($LastExitCode -ne 0) { diff --git a/eng/common/tools.ps1 b/eng/common/tools.ps1 index 0febe696dbd..9574f4eb9df 100644 --- a/eng/common/tools.ps1 +++ b/eng/common/tools.ps1 @@ -653,7 +653,7 @@ function GetNuGetPackageCachePath() { $env:NUGET_PACKAGES = Join-Path $env:UserProfile '.nuget\packages\' } else { $env:NUGET_PACKAGES = Join-Path $RepoRoot '.packages\' - $env:RESTORENOCACHE = $true + $env:RESTORENOHTTPCACHE = $true } } diff --git a/eng/common/tools.sh b/eng/common/tools.sh index a4f5d1b7761..5e4f910fc83 100644 --- a/eng/common/tools.sh +++ b/eng/common/tools.sh @@ -347,14 +347,14 @@ function InitializeBuildTool { fi } -# Set RestoreNoCache as a workaround for https://github.com/NuGet/Home/issues/3116 +# Set RestoreNoHttpCache as a workaround for https://github.com/NuGet/Home/issues/3116 function GetNuGetPackageCachePath { if [[ -z ${NUGET_PACKAGES:-} ]]; then if [[ "$use_global_nuget_cache" == true ]]; then export NUGET_PACKAGES="$HOME/.nuget/packages" else export NUGET_PACKAGES="$repo_root/.packages" - export RESTORENOCACHE=true + export RESTORENOHTTPCACHE=true fi fi diff --git a/global.json b/global.json index 0180d30149c..a9b32e1db0e 100644 --- a/global.json +++ b/global.json @@ -31,7 +31,7 @@ }, "msbuild-sdks": { "Microsoft.Build.NoTargets": "3.7.0", - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24306.4", - "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24306.4" + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24311.1", + "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24311.1" } } From b6db090764855e42537b73bcd0475980e969157c Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Wed, 12 Jun 2024 14:15:22 +0000 Subject: [PATCH 039/107] Update dependencies from https://github.com/dotnet/sdk build 20240612.2 (#6816) [feature/9.x] Update dependencies from dotnet/sdk - Coherency Updates: - Microsoft.AspNetCore.App.Runtime.win-x64: from 9.0.0-preview.6.24307.5 to 9.0.0-preview.6.24309.2 (parent: VS.Redist.Common.NetCore.SdkPlaceholder.x64.9.0) - VS.Redist.Common.AspNetCore.SharedFramework.x64.9.0: from 9.0.0-preview.6.24307.5 to 9.0.0-preview.6.24309.2 (parent: VS.Redist.Common.NetCore.SdkPlaceholder.x64.9.0) --- eng/Version.Details.xml | 12 ++++++------ eng/Versions.props | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 1ab1a2f5a0d..27146fbd8de 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,8 +1,8 @@ - + https://github.com/dotnet/aspnetcore - 206b0aeca39d5eb12e55ce4e35ef4c8b9bc63c86 + 7f2dfb0020ff29ab57df31e910f2b2d5ef48bf82 https://github.com/dotnet/diagnostics @@ -50,13 +50,13 @@ https://github.com/dotnet/runtime 8fac5af2b11dc98fa0504f6fd06df790164ec958 - + https://github.com/dotnet/aspnetcore - 206b0aeca39d5eb12e55ce4e35ef4c8b9bc63c86 + 7f2dfb0020ff29ab57df31e910f2b2d5ef48bf82 - + https://github.com/dotnet/sdk - 9099d03a90a003dd2bfee3e2147518c8158c269a + de339b2efe8805dd45fb25060d353121faa42a3a https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index 70ba8e6ea85..ec40e312ad0 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -52,8 +52,8 @@ 9.0.0-beta.24311.1 9.0.0-beta.24311.1 - 9.0.0-preview.6.24307.5 - 9.0.0-preview.6.24307.5 + 9.0.0-preview.6.24309.2 + 9.0.0-preview.6.24309.2 2.0.0-beta4.24209.3 @@ -65,7 +65,7 @@ 9.0.0-preview.6.24307.2 9.0.0-preview.6.24307.2 - 9.0.100-preview.6.24309.2 + 9.0.100-preview.6.24312.2 1.0.530701 From 75dfdb18129c07d673450dcfc9d79b8f6a770f1f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 12 Jun 2024 09:01:33 -0700 Subject: [PATCH 040/107] [main] Bump Swashbuckle.AspNetCore in /eng/dependabot/independent (#6814) Bumps [Swashbuckle.AspNetCore](https://github.com/domaindrivendev/Swashbuckle.AspNetCore) from 6.6.1 to 6.6.2. - [Release notes](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/releases) - [Commits](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/compare/v6.6.1...v6.6.2) --- updated-dependencies: - dependency-name: Swashbuckle.AspNetCore dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- eng/dependabot/independent/Versions.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/dependabot/independent/Versions.props b/eng/dependabot/independent/Versions.props index c40341aaac7..7980ab7ef5b 100644 --- a/eng/dependabot/independent/Versions.props +++ b/eng/dependabot/independent/Versions.props @@ -13,7 +13,7 @@ 13.0.3 11.0.0 - 6.6.1 + 6.6.2 3.7.305.7 3.7.300.33 From 75a5607f29987c2edf582085a928c0429e04ed67 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 12 Jun 2024 09:02:17 -0700 Subject: [PATCH 041/107] [main] Bump the identity-dependencies group (#6813) Bumps the identity-dependencies group in /eng/dependabot/independent with 2 updates: [Azure.Identity](https://github.com/Azure/azure-sdk-for-net) and [Microsoft.Identity.Web](https://github.com/AzureAD/microsoft-identity-web). Updates `Azure.Identity` from 1.11.3 to 1.11.4 - [Release notes](https://github.com/Azure/azure-sdk-for-net/releases) - [Commits](https://github.com/Azure/azure-sdk-for-net/compare/Azure.Identity_1.11.3...Azure.Identity_1.11.4) Updates `Microsoft.Identity.Web` from 2.19.0 to 2.19.1 - [Release notes](https://github.com/AzureAD/microsoft-identity-web/releases) - [Changelog](https://github.com/AzureAD/microsoft-identity-web/blob/master/changelog.md) - [Commits](https://github.com/AzureAD/microsoft-identity-web/commits) Updates `Azure.Identity` from 1.11.3 to 1.11.4 - [Release notes](https://github.com/Azure/azure-sdk-for-net/releases) - [Commits](https://github.com/Azure/azure-sdk-for-net/compare/Azure.Identity_1.11.3...Azure.Identity_1.11.4) --- updated-dependencies: - dependency-name: Azure.Identity dependency-type: direct:production update-type: version-update:semver-patch dependency-group: identity-dependencies - dependency-name: Microsoft.Identity.Web dependency-type: direct:production update-type: version-update:semver-patch dependency-group: identity-dependencies - dependency-name: Azure.Identity dependency-type: direct:production update-type: version-update:semver-patch dependency-group: identity-dependencies ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- eng/dependabot/independent/Versions.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/dependabot/independent/Versions.props b/eng/dependabot/independent/Versions.props index 7980ab7ef5b..d28080c9eab 100644 --- a/eng/dependabot/independent/Versions.props +++ b/eng/dependabot/independent/Versions.props @@ -2,10 +2,10 @@ - 1.11.3 + 1.11.4 12.20.0 12.18.0 - 2.19.0 + 2.19.1 1.6.14 4.3.2 5.0.0 From 0a45d74cf0504415219345c47707df6ca66edaba Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Wed, 12 Jun 2024 09:44:02 -0700 Subject: [PATCH 042/107] [main] Update dependencies from dotnet/arcade (#6806) * Update dependencies from https://github.com/dotnet/arcade build 20240610.5 Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.XUnitExtensions From Version 8.0.0-beta.24270.4 -> To Version 8.0.0-beta.24310.5 * Update dependencies from https://github.com/dotnet/arcade build 20240610.5 Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.XUnitExtensions From Version 8.0.0-beta.24270.4 -> To Version 8.0.0-beta.24310.5 --------- Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 20 +++++++++---------- eng/Versions.props | 6 +++--- .../job/source-index-stage1.yml | 16 +++++++-------- .../templates/job/source-index-stage1.yml | 11 ++++------ global.json | 4 ++-- 5 files changed, 26 insertions(+), 31 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index ef0fb7d8009..0cef1d10f66 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -22,29 +22,29 @@ https://github.com/dotnet/roslyn-analyzers b4d9a1334d5189172977ba8fddd00bda70161e4a - + https://github.com/dotnet/arcade - f2b2071632d5d4c46d0f904f2b0d917b1752551b + 9f6799fdc16ae19b3e9478c55b997a6aab839d09 - + https://github.com/dotnet/arcade - f2b2071632d5d4c46d0f904f2b0d917b1752551b + 9f6799fdc16ae19b3e9478c55b997a6aab839d09 - + https://github.com/dotnet/arcade - f2b2071632d5d4c46d0f904f2b0d917b1752551b + 9f6799fdc16ae19b3e9478c55b997a6aab839d09 - + https://github.com/dotnet/arcade - f2b2071632d5d4c46d0f904f2b0d917b1752551b + 9f6799fdc16ae19b3e9478c55b997a6aab839d09 https://github.com/dotnet/installer 68e8abb1d3e1a240a6e4c29dcd220aae91681676 - + https://github.com/dotnet/arcade - f2b2071632d5d4c46d0f904f2b0d917b1752551b + 9f6799fdc16ae19b3e9478c55b997a6aab839d09 https://github.com/dotnet/diagnostics diff --git a/eng/Versions.props b/eng/Versions.props index edc66ed616e..2c00eddaa4e 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -48,9 +48,9 @@ --> - 8.0.0-beta.24270.4 - 8.0.0-beta.24270.4 - 8.0.0-beta.24270.4 + 8.0.0-beta.24310.5 + 8.0.0-beta.24310.5 + 8.0.0-beta.24310.5 8.0.1 8.0.1-servicing.23580.8 diff --git a/eng/common/templates-official/job/source-index-stage1.yml b/eng/common/templates-official/job/source-index-stage1.yml index 43ee0c202fc..60dfb6b2d1c 100644 --- a/eng/common/templates-official/job/source-index-stage1.yml +++ b/eng/common/templates-official/job/source-index-stage1.yml @@ -23,7 +23,7 @@ jobs: value: ${{ parameters.sourceIndexPackageSource }} - name: BinlogPath value: ${{ parameters.binlogPath }} - - template: /eng/common/templates/variables/pool-providers.yml + - template: /eng/common/templates-official/variables/pool-providers.yml ${{ if ne(parameters.pool, '') }}: pool: ${{ parameters.pool }} @@ -34,7 +34,8 @@ jobs: demands: ImageOverride -equals windows.vs2019.amd64.open ${{ if eq(variables['System.TeamProject'], 'internal') }}: name: $(DncEngInternalBuildPool) - demands: ImageOverride -equals windows.vs2019.amd64 + image: windows.vs2022.amd64 + os: windows steps: - ${{ each preStep in parameters.preSteps }}: @@ -70,16 +71,13 @@ jobs: scriptType: 'ps' scriptLocation: 'inlineScript' inlineScript: | - echo "##vso[task.setvariable variable=ARM_CLIENT_ID]$env:servicePrincipalId" - echo "##vso[task.setvariable variable=ARM_ID_TOKEN]$env:idToken" - echo "##vso[task.setvariable variable=ARM_TENANT_ID]$env:tenantId" + echo "##vso[task.setvariable variable=ARM_CLIENT_ID;issecret=true]$env:servicePrincipalId" + echo "##vso[task.setvariable variable=ARM_ID_TOKEN;issecret=true]$env:idToken" + echo "##vso[task.setvariable variable=ARM_TENANT_ID;issecret=true]$env:tenantId" - script: | - echo "Client ID: $(ARM_CLIENT_ID)" - echo "ID Token: $(ARM_ID_TOKEN)" - echo "Tenant ID: $(ARM_TENANT_ID)" az login --service-principal -u $(ARM_CLIENT_ID) --tenant $(ARM_TENANT_ID) --allow-no-subscriptions --federated-token $(ARM_ID_TOKEN) displayName: "Login to Azure" - script: $(Agent.TempDirectory)/.source-index/tools/UploadIndexStage1 -i .source-index/stage1output -n $(Build.Repository.Name) -s netsourceindexstage1 -b stage1 - displayName: Upload stage1 artifacts to source index \ No newline at end of file + displayName: Upload stage1 artifacts to source index diff --git a/eng/common/templates/job/source-index-stage1.yml b/eng/common/templates/job/source-index-stage1.yml index 43ee0c202fc..0b6bb89dc78 100644 --- a/eng/common/templates/job/source-index-stage1.yml +++ b/eng/common/templates/job/source-index-stage1.yml @@ -70,16 +70,13 @@ jobs: scriptType: 'ps' scriptLocation: 'inlineScript' inlineScript: | - echo "##vso[task.setvariable variable=ARM_CLIENT_ID]$env:servicePrincipalId" - echo "##vso[task.setvariable variable=ARM_ID_TOKEN]$env:idToken" - echo "##vso[task.setvariable variable=ARM_TENANT_ID]$env:tenantId" + echo "##vso[task.setvariable variable=ARM_CLIENT_ID;issecret=true]$env:servicePrincipalId" + echo "##vso[task.setvariable variable=ARM_ID_TOKEN;issecret=true]$env:idToken" + echo "##vso[task.setvariable variable=ARM_TENANT_ID;issecret=true]$env:tenantId" - script: | - echo "Client ID: $(ARM_CLIENT_ID)" - echo "ID Token: $(ARM_ID_TOKEN)" - echo "Tenant ID: $(ARM_TENANT_ID)" az login --service-principal -u $(ARM_CLIENT_ID) --tenant $(ARM_TENANT_ID) --allow-no-subscriptions --federated-token $(ARM_ID_TOKEN) displayName: "Login to Azure" - script: $(Agent.TempDirectory)/.source-index/tools/UploadIndexStage1 -i .source-index/stage1output -n $(Build.Repository.Name) -s netsourceindexstage1 -b stage1 - displayName: Upload stage1 artifacts to source index \ No newline at end of file + displayName: Upload stage1 artifacts to source index diff --git a/global.json b/global.json index 243f0e838f0..9b6a3231bd4 100644 --- a/global.json +++ b/global.json @@ -26,7 +26,7 @@ }, "msbuild-sdks": { "Microsoft.Build.NoTargets": "3.7.0", - "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24270.4", - "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.24270.4" + "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24310.5", + "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.24310.5" } } From 2e28231a92f6b8d53862fa08a91e9f31abb19f8f Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Thu, 13 Jun 2024 14:05:49 +0000 Subject: [PATCH 043/107] Update dependencies from https://github.com/dotnet/sdk build 20240613.1 (#6822) [feature/9.x] Update dependencies from dotnet/sdk --- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 27146fbd8de..21805324171 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -54,9 +54,9 @@ https://github.com/dotnet/aspnetcore 7f2dfb0020ff29ab57df31e910f2b2d5ef48bf82 - + https://github.com/dotnet/sdk - de339b2efe8805dd45fb25060d353121faa42a3a + 3ed3bf67670c92e675313b43c5e733755e781b3d https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index ec40e312ad0..5e06c93cef7 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -65,7 +65,7 @@ 9.0.0-preview.6.24307.2 9.0.0-preview.6.24307.2 - 9.0.100-preview.6.24312.2 + 9.0.100-preview.6.24313.1 1.0.530701 From 57c5c0ca932f70354762d48275e0ada8410f36dd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 13 Jun 2024 11:28:48 -0700 Subject: [PATCH 044/107] Bump dawidd6/action-download-artifact from 5 to 6 (#6817) Bumps [dawidd6/action-download-artifact](https://github.com/dawidd6/action-download-artifact) from 5 to 6. - [Release notes](https://github.com/dawidd6/action-download-artifact/releases) - [Commits](https://github.com/dawidd6/action-download-artifact/compare/deb3bb83256a78589fef6a7b942e5f2573ad7c13...bf251b5aa9c2f7eeb574a96ee720e24f801b7c11) --- updated-dependencies: - dependency-name: dawidd6/action-download-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/submit-linter-suggestions.yml | 2 +- .github/workflows/submit-to-do-issue.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/submit-linter-suggestions.yml b/.github/workflows/submit-linter-suggestions.yml index 688a9abfe04..667e4f3eb77 100644 --- a/.github/workflows/submit-linter-suggestions.yml +++ b/.github/workflows/submit-linter-suggestions.yml @@ -49,7 +49,7 @@ jobs: # The default artifact download action doesn't support cross-workflow # artifacts, so use a 3rd party one. - name: 'Download linting results' - uses: dawidd6/action-download-artifact@deb3bb83256a78589fef6a7b942e5f2573ad7c13 + uses: dawidd6/action-download-artifact@bf251b5aa9c2f7eeb574a96ee720e24f801b7c11 with: workflow: ${{env.workflow_name}} run_id: ${{github.event.workflow_run.id }} diff --git a/.github/workflows/submit-to-do-issue.yml b/.github/workflows/submit-to-do-issue.yml index 1a77ad39cf0..cb39366f211 100644 --- a/.github/workflows/submit-to-do-issue.yml +++ b/.github/workflows/submit-to-do-issue.yml @@ -35,7 +35,7 @@ jobs: # The default artifact download action doesn't support cross-workflow # artifacts, so use a 3rd party one. - name: 'Download linting results' - uses: dawidd6/action-download-artifact@deb3bb83256a78589fef6a7b942e5f2573ad7c13 + uses: dawidd6/action-download-artifact@bf251b5aa9c2f7eeb574a96ee720e24f801b7c11 with: workflow: ${{env.workflow_name}} run_id: ${{github.event.workflow_run.id }} From d56ed6db73f68560848bbbca550dfd0d5037b8ff Mon Sep 17 00:00:00 2001 From: Wiktor Kopec Date: Thu, 13 Jun 2024 14:49:33 -0700 Subject: [PATCH 045/107] Update global.json (#6821) --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index a9b32e1db0e..17e91d612f9 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "tools": { - "dotnet": "9.0.100-preview.4.24267.66", + "dotnet": "9.0.100-preview.5.24307.3", "runtimes": { "aspnetcore": [ "$(MicrosoftAspNetCoreApp60Version)", From 44232afef00b6a6f0862d5b503f3e6634c1e08cb Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 14 Jun 2024 13:41:55 +0000 Subject: [PATCH 046/107] Update dependencies from https://github.com/dotnet/arcade build 20240611.3 (#6827) [main] Update dependencies from dotnet/arcade --- eng/Version.Details.xml | 20 ++++++++++---------- eng/Versions.props | 6 +++--- global.json | 4 ++-- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 0cef1d10f66..9c751693d70 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -22,29 +22,29 @@ https://github.com/dotnet/roslyn-analyzers b4d9a1334d5189172977ba8fddd00bda70161e4a - + https://github.com/dotnet/arcade - 9f6799fdc16ae19b3e9478c55b997a6aab839d09 + c214b6ad17aedca4fa48294d80f6c52ef2463081 - + https://github.com/dotnet/arcade - 9f6799fdc16ae19b3e9478c55b997a6aab839d09 + c214b6ad17aedca4fa48294d80f6c52ef2463081 - + https://github.com/dotnet/arcade - 9f6799fdc16ae19b3e9478c55b997a6aab839d09 + c214b6ad17aedca4fa48294d80f6c52ef2463081 - + https://github.com/dotnet/arcade - 9f6799fdc16ae19b3e9478c55b997a6aab839d09 + c214b6ad17aedca4fa48294d80f6c52ef2463081 https://github.com/dotnet/installer 68e8abb1d3e1a240a6e4c29dcd220aae91681676 - + https://github.com/dotnet/arcade - 9f6799fdc16ae19b3e9478c55b997a6aab839d09 + c214b6ad17aedca4fa48294d80f6c52ef2463081 https://github.com/dotnet/diagnostics diff --git a/eng/Versions.props b/eng/Versions.props index 2c00eddaa4e..655d47bb756 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -48,9 +48,9 @@ --> - 8.0.0-beta.24310.5 - 8.0.0-beta.24310.5 - 8.0.0-beta.24310.5 + 8.0.0-beta.24311.3 + 8.0.0-beta.24311.3 + 8.0.0-beta.24311.3 8.0.1 8.0.1-servicing.23580.8 diff --git a/global.json b/global.json index 9b6a3231bd4..cfba65ba79a 100644 --- a/global.json +++ b/global.json @@ -26,7 +26,7 @@ }, "msbuild-sdks": { "Microsoft.Build.NoTargets": "3.7.0", - "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24310.5", - "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.24310.5" + "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24311.3", + "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.24311.3" } } From 78519b91f19a81a05810e54ef2a871794af23ec6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 14 Jun 2024 08:53:33 -0700 Subject: [PATCH 047/107] Register new release information (#6823) * Register v9.0.0-preview.5.24307.6 release information * Update release date --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Justin Anderson --- .github/releases.json | 6 +++--- documentation/releases.md | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/releases.json b/.github/releases.json index f27bde51f6a..1dac87006c6 100644 --- a/.github/releases.json +++ b/.github/releases.json @@ -75,9 +75,9 @@ "outOfSupportDate": "2024-05-14T00:00:00.000Z" }, "9.0": { - "tag": "v9.0.0-preview.4.24270.1", - "minorReleaseDate": "2024-05-21T00:00:00.000Z", - "patchReleaseDate": "2024-05-21T00:00:00.000Z", + "tag": "v9.0.0-preview.5.24307.6", + "minorReleaseDate": "2024-06-11T00:00:00.000Z", + "patchReleaseDate": "2024-06-11T00:00:00.000Z", "supportedFrameworks": [ "net9.0" ] diff --git a/documentation/releases.md b/documentation/releases.md index 80b33cd4b19..4a6c9ce7f8c 100644 --- a/documentation/releases.md +++ b/documentation/releases.md @@ -25,6 +25,6 @@ | Version | Release Date | Latest Version | Runtime Frameworks | | --- | --- | --- | --- | -| 9.0 | May 21, 2024 | [9.0.0 preview 4](https://github.com/dotnet/dotnet-monitor/releases/tag/v9.0.0-preview.4.24270.1) | net9.0 | +| 9.0 | June 11, 2024 | [9.0.0 preview 5](https://github.com/dotnet/dotnet-monitor/releases/tag/v9.0.0-preview.5.24307.6) | net9.0 | From 93640ade5b0619ed053aadb171298ec033076a47 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 14 Jun 2024 09:13:31 -0700 Subject: [PATCH 048/107] Update dependencies from https://github.com/dotnet/roslyn-analyzers build 20240613.1 (#6829) Microsoft.CodeAnalysis.NetAnalyzers From Version 9.0.0-preview.24306.2 -> To Version 9.0.0-preview.24313.1 Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 21805324171..1e023a44791 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -18,9 +18,9 @@ - + https://github.com/dotnet/roslyn-analyzers - 4d5fd9da36d64d4c3370b8813122e226844fc6ed + 52913b28e20a224a5f6d56fe0b84b13210e274b0 https://github.com/dotnet/arcade diff --git a/eng/Versions.props b/eng/Versions.props index 5e06c93cef7..2c9db82a888 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -60,7 +60,7 @@ 8.0.0-preview.24307.1 8.0.0-preview.24307.1 - 9.0.0-preview.24306.2 + 9.0.0-preview.24313.1 9.0.0-preview.6.24307.2 9.0.0-preview.6.24307.2 From e00795e5cbae48e59ebcec25dba4faedca56ae44 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 14 Jun 2024 16:58:04 +0000 Subject: [PATCH 049/107] Update dependencies from https://github.com/dotnet/sdk build 20240613.50 (#6830) [feature/9.x] Update dependencies from dotnet/sdk --- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 1e023a44791..ef382458801 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -54,9 +54,9 @@ https://github.com/dotnet/aspnetcore 7f2dfb0020ff29ab57df31e910f2b2d5ef48bf82 - + https://github.com/dotnet/sdk - 3ed3bf67670c92e675313b43c5e733755e781b3d + 9199d0efd4e3ba0a3a2d847923fd36e3c0a145ba https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index 2c9db82a888..c24d999dbae 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -65,7 +65,7 @@ 9.0.0-preview.6.24307.2 9.0.0-preview.6.24307.2 - 9.0.100-preview.6.24313.1 + 9.0.100-preview.6.24313.50 1.0.530701 From bdee539fc57286b71fc337105903ac199aaa61bd Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 14 Jun 2024 17:13:09 +0000 Subject: [PATCH 050/107] [feature/9.x] Update dependencies from dotnet/arcade (#6815) [feature/9.x] Update dependencies from dotnet/arcade - Update async void tests - Remove timeout from non-async method --- eng/Version.Details.xml | 20 +++++++++---------- eng/Versions.props | 6 +++--- eng/common/cross/build-rootfs.sh | 13 ++++++++++-- eng/common/cross/riscv64/sources.list.noble | 11 ++++++++++ eng/common/post-build/nuget-validation.ps1 | 7 +++++++ eng/common/tools.sh | 4 ++-- global.json | 4 ++-- .../AzureBlobEgressProviderTests.cs | 2 +- .../TemplatesTests.cs | 5 +++-- 9 files changed, 50 insertions(+), 22 deletions(-) create mode 100644 eng/common/cross/riscv64/sources.list.noble diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index ef382458801..71a60357cfc 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -22,25 +22,25 @@ https://github.com/dotnet/roslyn-analyzers 52913b28e20a224a5f6d56fe0b84b13210e274b0 - + https://github.com/dotnet/arcade - 11f7d1ae1a87b5d8c469fa00f22a184d2f5d1319 + d20e5f76ae843c2f1fe3ba5d05ba3fbf4547e719 - + https://github.com/dotnet/arcade - 11f7d1ae1a87b5d8c469fa00f22a184d2f5d1319 + d20e5f76ae843c2f1fe3ba5d05ba3fbf4547e719 - + https://github.com/dotnet/arcade - 11f7d1ae1a87b5d8c469fa00f22a184d2f5d1319 + d20e5f76ae843c2f1fe3ba5d05ba3fbf4547e719 - + https://github.com/dotnet/arcade - 11f7d1ae1a87b5d8c469fa00f22a184d2f5d1319 + d20e5f76ae843c2f1fe3ba5d05ba3fbf4547e719 - + https://github.com/dotnet/arcade - 11f7d1ae1a87b5d8c469fa00f22a184d2f5d1319 + d20e5f76ae843c2f1fe3ba5d05ba3fbf4547e719 https://github.com/dotnet/diagnostics diff --git a/eng/Versions.props b/eng/Versions.props index c24d999dbae..2806b91502f 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -48,9 +48,9 @@ --> - 9.0.0-beta.24311.1 - 9.0.0-beta.24311.1 - 9.0.0-beta.24311.1 + 9.0.0-beta.24313.4 + 9.0.0-beta.24313.4 + 9.0.0-beta.24313.4 9.0.0-preview.6.24309.2 9.0.0-preview.6.24309.2 diff --git a/eng/common/cross/build-rootfs.sh b/eng/common/cross/build-rootfs.sh index 7455dcb6af4..8bb233ba25b 100644 --- a/eng/common/cross/build-rootfs.sh +++ b/eng/common/cross/build-rootfs.sh @@ -131,6 +131,7 @@ __AlpineKeys=' __Keyring= __SkipSigCheck=0 __UseMirror=0 +__UseDeb822Format=0 __UnprocessedBuildArgs= while :; do @@ -181,7 +182,6 @@ while :; do __AlpinePackages="${__AlpinePackages// lldb-dev/}" __QEMUArch=riscv64 __UbuntuArch=riscv64 - __UbuntuRepo="http://deb.debian.org/debian" __UbuntuPackages="${__UbuntuPackages// libunwind8-dev/}" unset __LLDB_Package @@ -288,6 +288,12 @@ while :; do __CodeName=jammy fi ;; + noble) # Ubuntu 24.04 + if [[ "$__CodeName" != "jessie" ]]; then + __CodeName=noble + fi + __UseDeb822Format=1 + ;; jessie) # Debian 8 __CodeName=jessie @@ -732,8 +738,11 @@ elif [[ -n "$__CodeName" ]]; then fi # shellcheck disable=SC2086 + echo running debootstrap "--variant=minbase" $__Keyring --arch "$__UbuntuArch" "$__CodeName" "$__RootfsDir" "$__UbuntuRepo" debootstrap "--variant=minbase" $__Keyring --arch "$__UbuntuArch" "$__CodeName" "$__RootfsDir" "$__UbuntuRepo" - cp "$__CrossDir/$__BuildArch/sources.list.$__CodeName" "$__RootfsDir/etc/apt/sources.list" + mkdir -p "$__RootfsDir/etc/apt/sources.list.d/" + grep -q "Types:" "$__CrossDir/$__BuildArch/sources.list.$__CodeName" && filename="$__CodeName.sources" || filename="$__CodeName.list" + cp "$__CrossDir/$__BuildArch/sources.list.$__CodeName" "$__RootfsDir/etc/apt/sources.list.d/$filename" chroot "$__RootfsDir" apt-get update chroot "$__RootfsDir" apt-get -f -y install # shellcheck disable=SC2086 diff --git a/eng/common/cross/riscv64/sources.list.noble b/eng/common/cross/riscv64/sources.list.noble new file mode 100644 index 00000000000..4a5b56256da --- /dev/null +++ b/eng/common/cross/riscv64/sources.list.noble @@ -0,0 +1,11 @@ +Types: deb +URIs: http://ports.ubuntu.com/ubuntu-ports/ +Suites: noble noble-updates noble-backports +Components: main universe restricted multiverse +Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg + +Types: deb +URIs: http://ports.ubuntu.com/ubuntu-ports/ +Suites: noble-security +Components: main universe restricted multiverse +Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg diff --git a/eng/common/post-build/nuget-validation.ps1 b/eng/common/post-build/nuget-validation.ps1 index 9c81aa43917..e5de00c8983 100644 --- a/eng/common/post-build/nuget-validation.ps1 +++ b/eng/common/post-build/nuget-validation.ps1 @@ -5,6 +5,13 @@ param( [Parameter(Mandatory=$true)][string] $PackagesPath # Path to where the packages to be validated are ) +# `tools.ps1` checks $ci to perform some actions. Since the post-build +# scripts don't necessarily execute in the same agent that run the +# build.ps1/sh script this variable isn't automatically set. +$ci = $true +$disableConfigureToolsetImport = $true +. $PSScriptRoot\..\tools.ps1 + try { & $PSScriptRoot\nuget-verification.ps1 ${PackagesPath}\*.nupkg } diff --git a/eng/common/tools.sh b/eng/common/tools.sh index 5e4f910fc83..00473c9f918 100644 --- a/eng/common/tools.sh +++ b/eng/common/tools.sh @@ -351,9 +351,9 @@ function InitializeBuildTool { function GetNuGetPackageCachePath { if [[ -z ${NUGET_PACKAGES:-} ]]; then if [[ "$use_global_nuget_cache" == true ]]; then - export NUGET_PACKAGES="$HOME/.nuget/packages" + export NUGET_PACKAGES="$HOME/.nuget/packages/" else - export NUGET_PACKAGES="$repo_root/.packages" + export NUGET_PACKAGES="$repo_root/.packages/" export RESTORENOHTTPCACHE=true fi fi diff --git a/global.json b/global.json index 17e91d612f9..3c22e832261 100644 --- a/global.json +++ b/global.json @@ -31,7 +31,7 @@ }, "msbuild-sdks": { "Microsoft.Build.NoTargets": "3.7.0", - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24311.1", - "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24311.1" + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24313.4", + "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24313.4" } } diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.AzureBlobStorageTests.UnitTests/AzureBlobEgressProviderTests.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.AzureBlobStorageTests.UnitTests/AzureBlobEgressProviderTests.cs index ecc99cce7e9..6636862dcee 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.AzureBlobStorageTests.UnitTests/AzureBlobEgressProviderTests.cs +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.AzureBlobStorageTests.UnitTests/AzureBlobEgressProviderTests.cs @@ -234,7 +234,7 @@ public async Task AzureBlobEgress_DoesNotThrowWhen_QueueDoesNotExistAndUsingRest Assert.Empty(messages); } - [ConditionalFact(Timeout = EgressUnitTestTimeoutMs)] + [Fact] public void AzureBlobEgress_DefaultCredentials() { // These are auth methods we know about. If this test fails, it means a new auth method was added and we need to update the test. diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/TemplatesTests.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/TemplatesTests.cs index cb6d2aa6742..307bedde981 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/TemplatesTests.cs +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/TemplatesTests.cs @@ -15,6 +15,7 @@ using System.IO; using System.Linq; using System.Reflection; +using System.Threading.Tasks; using Xunit; using Xunit.Abstractions; @@ -39,7 +40,7 @@ public TemplatesTests(ITestOutputHelper outputHelper) /// Tests that Templates are correctly translated from JSON to CollectionRuleOptions. /// [Fact] - public async void TemplatesTranslationSuccessTest() + public async Task TemplatesTranslationSuccessTest() { using TemporaryDirectory userConfigDir = new(_outputHelper); @@ -84,7 +85,7 @@ await TestHostHelper.CreateCollectionRulesHost(_outputHelper, rootOptions => { } /// Tests that incorrectly referenced Templates error correctly. /// [Fact] - public async void TemplatesTranslationFailTest() + public async Task TemplatesTranslationFailTest() { using TemporaryDirectory userConfigDir = new(_outputHelper); From db5fc225981809a75452c479a4b953e32379a8d3 Mon Sep 17 00:00:00 2001 From: Joe Schmitt <1146681+schmittjoseph@users.noreply.github.com> Date: Fri, 14 Jun 2024 12:14:34 -0700 Subject: [PATCH 051/107] Fix inline data nullable parameters (#6835) --- .../Formatters/DebuggerDisplay/DebuggerDisplayParserTests.cs | 4 ++-- .../Formatters/DebuggerDisplay/ExpressionBinderTests.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/DebuggerDisplayParserTests.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/DebuggerDisplayParserTests.cs index 718f5386011..cb42ad717d9 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/DebuggerDisplayParserTests.cs +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/DebuggerDisplayParserTests.cs @@ -36,7 +36,7 @@ public class DebuggerDisplayParserTests [InlineData("Test: {prop1} - {prop2} - {method()}", "Test: {0} - {1} - {2}", "prop1", "prop2", "method()")] // Complex expressions [InlineData("Test: {propertyName - 2}", "Test: {0}", "propertyName - 2")] - public void ParseDebuggerDisplay(string debuggerDisplay, string formatString, params string[] expressions) + public void ParseDebuggerDisplay(string debuggerDisplay, string? formatString, params string[] expressions) { // Act ParsedDebuggerDisplay? parsed = DebuggerDisplayParser.ParseDebuggerDisplay(debuggerDisplay); @@ -62,7 +62,7 @@ public void ParseDebuggerDisplay(string debuggerDisplay, string formatString, pa [InlineData("{((a)}", null, FormatSpecifier.None)] [InlineData("{\\}}", null, FormatSpecifier.None)] [InlineData("{a}", "a", FormatSpecifier.None)] - internal void ParseExpression(string rawExpression, string expressionString, FormatSpecifier formatSpecifier) + internal void ParseExpression(string rawExpression, string? expressionString, FormatSpecifier formatSpecifier) { // Act Expression? expression = DebuggerDisplayParser.ParseExpression(rawExpression.AsMemory(), out _); diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/ExpressionBinderTests.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/ExpressionBinderTests.cs index 08175177585..0633204a781 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/ExpressionBinderTests.cs +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/ExpressionBinderTests.cs @@ -52,7 +52,7 @@ public string GetCountAsString() [InlineData("Recursion().RecursionProp.MyUri.Host", true, "www.example.com")] // Chained expression with static property [InlineData("Recursion().StaticProperty.Host", true, "www.example.com")] - public void BindExpression(string expression, bool doesBind, object expected) + public void BindExpression(string expression, bool doesBind, object? expected) { // Arrange DebuggerDisplayClass obj = new("https://www.example.com/abc"); From 81abf5bcbd5993f44eeb1d2e75e6c41df52d8f24 Mon Sep 17 00:00:00 2001 From: Joe Schmitt <1146681+schmittjoseph@users.noreply.github.com> Date: Fri, 14 Jun 2024 14:24:56 -0700 Subject: [PATCH 052/107] Fix more InlineData nullable parameters (#6837) --- .../Formatters/DebuggerDisplay/DebuggerDisplayFormatterTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/DebuggerDisplayFormatterTests.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/DebuggerDisplayFormatterTests.cs index 203c87e1f13..056431cb142 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/DebuggerDisplayFormatterTests.cs +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/ParameterCapturing/ObjectFormatting/Formatters/DebuggerDisplay/DebuggerDisplayFormatterTests.cs @@ -37,7 +37,7 @@ private sealed class DebuggerDisplayClassWithNullField [InlineData(typeof(NoDebuggerDisplay), null)] [InlineData(typeof(DebuggerDisplayClass), "Count = {Count}")] [InlineData(typeof(DerivedWithBaseDebuggerDisplay), "Count = {Count}")] - public void GetDebuggerDisplayAttribute(Type type, string expected) + public void GetDebuggerDisplayAttribute(Type type, string? expected) { // Act DebuggerDisplayAttributeValue? attribute = DebuggerDisplayFormatter.GetDebuggerDisplayAttribute(type); From e144a413348274b7afc0323eab08c3d4f319e0ce Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 14 Jun 2024 21:25:28 +0000 Subject: [PATCH 053/107] Restore branch-specific files --- .../job/source-index-stage1.yml | 74 ++----------------- .../templates/job/source-index-stage1.yml | 57 +------------- 2 files changed, 7 insertions(+), 124 deletions(-) diff --git a/eng/common/templates-official/job/source-index-stage1.yml b/eng/common/templates-official/job/source-index-stage1.yml index 7f362c005e9..6d5ead316f9 100644 --- a/eng/common/templates-official/job/source-index-stage1.yml +++ b/eng/common/templates-official/job/source-index-stage1.yml @@ -1,71 +1,7 @@ jobs: -- job: SourceIndexStage1 - dependsOn: ${{ parameters.dependsOn }} - condition: ${{ parameters.condition }} - variables: - - name: SourceIndexUploadPackageVersion - value: ${{ parameters.sourceIndexUploadPackageVersion }} - - name: SourceIndexProcessBinlogPackageVersion - value: ${{ parameters.sourceIndexProcessBinlogPackageVersion }} - - name: SourceIndexPackageSource - value: ${{ parameters.sourceIndexPackageSource }} - - name: BinlogPath - value: ${{ parameters.binlogPath }} - - template: /eng/common/templates-official/variables/pool-providers.yml +- template: /eng/common/core-templates/job/source-index-stage1.yml + parameters: + is1ESPipeline: true - ${{ if ne(parameters.pool, '') }}: - pool: ${{ parameters.pool }} - ${{ if eq(parameters.pool, '') }}: - pool: - ${{ if eq(variables['System.TeamProject'], 'public') }}: - name: $(DncEngPublicBuildPool) - demands: ImageOverride -equals windows.vs2019.amd64.open - ${{ if eq(variables['System.TeamProject'], 'internal') }}: - name: $(DncEngInternalBuildPool) - image: windows.vs2022.amd64 - os: windows - - steps: - - ${{ each preStep in parameters.preSteps }}: - - ${{ preStep }} - - - task: UseDotNet@2 - displayName: Use .NET 8 SDK - inputs: - packageType: sdk - version: 8.0.x - installationPath: $(Agent.TempDirectory)/dotnet - workingDirectory: $(Agent.TempDirectory) - - - script: | - $(Agent.TempDirectory)/dotnet/dotnet tool install BinLogToSln --version $(sourceIndexProcessBinlogPackageVersion) --add-source $(SourceIndexPackageSource) --tool-path $(Agent.TempDirectory)/.source-index/tools - $(Agent.TempDirectory)/dotnet/dotnet tool install UploadIndexStage1 --version $(sourceIndexUploadPackageVersion) --add-source $(SourceIndexPackageSource) --tool-path $(Agent.TempDirectory)/.source-index/tools - displayName: Download Tools - # Set working directory to temp directory so 'dotnet' doesn't try to use global.json and use the repo's sdk. - workingDirectory: $(Agent.TempDirectory) - - - script: ${{ parameters.sourceIndexBuildCommand }} - displayName: Build Repository - - - script: $(Agent.TempDirectory)/.source-index/tools/BinLogToSln -i $(BinlogPath) -r $(Build.SourcesDirectory) -n $(Build.Repository.Name) -o .source-index/stage1output - displayName: Process Binlog into indexable sln - - - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - - task: AzureCLI@2 - displayName: Get stage 1 auth token - inputs: - azureSubscription: 'SourceDotNet Stage1 Publish' - addSpnToEnvironment: true - scriptType: 'ps' - scriptLocation: 'inlineScript' - inlineScript: | - echo "##vso[task.setvariable variable=ARM_CLIENT_ID;issecret=true]$env:servicePrincipalId" - echo "##vso[task.setvariable variable=ARM_ID_TOKEN;issecret=true]$env:idToken" - echo "##vso[task.setvariable variable=ARM_TENANT_ID;issecret=true]$env:tenantId" - - - script: | - az login --service-principal -u $(ARM_CLIENT_ID) --tenant $(ARM_TENANT_ID) --allow-no-subscriptions --federated-token $(ARM_ID_TOKEN) - displayName: "Login to Azure" - - - script: $(Agent.TempDirectory)/.source-index/tools/UploadIndexStage1 -i .source-index/stage1output -n $(Build.Repository.Name) -s netsourceindexstage1 -b stage1 - displayName: Upload stage1 artifacts to source index + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} diff --git a/eng/common/templates/job/source-index-stage1.yml b/eng/common/templates/job/source-index-stage1.yml index b31f24f0ff3..89f3291593c 100644 --- a/eng/common/templates/job/source-index-stage1.yml +++ b/eng/common/templates/job/source-index-stage1.yml @@ -3,58 +3,5 @@ jobs: parameters: is1ESPipeline: false - ${{ if ne(parameters.pool, '') }}: - pool: ${{ parameters.pool }} - ${{ if eq(parameters.pool, '') }}: - pool: - ${{ if eq(variables['System.TeamProject'], 'public') }}: - name: $(DncEngPublicBuildPool) - demands: ImageOverride -equals windows.vs2019.amd64.open - ${{ if eq(variables['System.TeamProject'], 'internal') }}: - name: $(DncEngInternalBuildPool) - demands: ImageOverride -equals windows.vs2019.amd64 - - steps: - - ${{ each preStep in parameters.preSteps }}: - - ${{ preStep }} - - - task: UseDotNet@2 - displayName: Use .NET 8 SDK - inputs: - packageType: sdk - version: 8.0.x - installationPath: $(Agent.TempDirectory)/dotnet - workingDirectory: $(Agent.TempDirectory) - - - script: | - $(Agent.TempDirectory)/dotnet/dotnet tool install BinLogToSln --version $(sourceIndexProcessBinlogPackageVersion) --add-source $(SourceIndexPackageSource) --tool-path $(Agent.TempDirectory)/.source-index/tools - $(Agent.TempDirectory)/dotnet/dotnet tool install UploadIndexStage1 --version $(sourceIndexUploadPackageVersion) --add-source $(SourceIndexPackageSource) --tool-path $(Agent.TempDirectory)/.source-index/tools - displayName: Download Tools - # Set working directory to temp directory so 'dotnet' doesn't try to use global.json and use the repo's sdk. - workingDirectory: $(Agent.TempDirectory) - - - script: ${{ parameters.sourceIndexBuildCommand }} - displayName: Build Repository - - - script: $(Agent.TempDirectory)/.source-index/tools/BinLogToSln -i $(BinlogPath) -r $(Build.SourcesDirectory) -n $(Build.Repository.Name) -o .source-index/stage1output - displayName: Process Binlog into indexable sln - - - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - - task: AzureCLI@2 - displayName: Get stage 1 auth token - inputs: - azureSubscription: 'SourceDotNet Stage1 Publish' - addSpnToEnvironment: true - scriptType: 'ps' - scriptLocation: 'inlineScript' - inlineScript: | - echo "##vso[task.setvariable variable=ARM_CLIENT_ID;issecret=true]$env:servicePrincipalId" - echo "##vso[task.setvariable variable=ARM_ID_TOKEN;issecret=true]$env:idToken" - echo "##vso[task.setvariable variable=ARM_TENANT_ID;issecret=true]$env:tenantId" - - - script: | - az login --service-principal -u $(ARM_CLIENT_ID) --tenant $(ARM_TENANT_ID) --allow-no-subscriptions --federated-token $(ARM_ID_TOKEN) - displayName: "Login to Azure" - - - script: $(Agent.TempDirectory)/.source-index/tools/UploadIndexStage1 -i .source-index/stage1output -n $(Build.Repository.Name) -s netsourceindexstage1 -b stage1 - displayName: Upload stage1 artifacts to source index + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} From 503870a078c3e363b958fd56200056e1b184a3e1 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Sat, 15 Jun 2024 14:09:24 +0000 Subject: [PATCH 054/107] Update dependencies from https://github.com/dotnet/sdk build 20240614.10 (#6841) [feature/9.x] Update dependencies from dotnet/sdk --- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 71a60357cfc..49a274c1463 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -54,9 +54,9 @@ https://github.com/dotnet/aspnetcore 7f2dfb0020ff29ab57df31e910f2b2d5ef48bf82 - + https://github.com/dotnet/sdk - 9199d0efd4e3ba0a3a2d847923fd36e3c0a145ba + 60e06cc3059bd58e88ec62c878d256ad25b6d568 https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index 2806b91502f..12b016c5532 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -65,7 +65,7 @@ 9.0.0-preview.6.24307.2 9.0.0-preview.6.24307.2 - 9.0.100-preview.6.24313.50 + 9.0.100-preview.6.24314.10 1.0.530701 From 618e604fbd4a3bd38c1fd6c1ed7c3eaba72432cc Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Sun, 16 Jun 2024 13:43:51 +0000 Subject: [PATCH 055/107] [feature/9.x] Update dependencies from dotnet/arcade (#6840) [feature/9.x] Update dependencies from dotnet/arcade --- eng/Version.Details.xml | 20 ++++++++++---------- eng/Versions.props | 6 +++--- global.json | 4 ++-- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 49a274c1463..9dbc20bc517 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -22,25 +22,25 @@ https://github.com/dotnet/roslyn-analyzers 52913b28e20a224a5f6d56fe0b84b13210e274b0 - + https://github.com/dotnet/arcade - d20e5f76ae843c2f1fe3ba5d05ba3fbf4547e719 + 92a725aa4d9d6c13dc5229597b51b0b165b8b535 - + https://github.com/dotnet/arcade - d20e5f76ae843c2f1fe3ba5d05ba3fbf4547e719 + 92a725aa4d9d6c13dc5229597b51b0b165b8b535 - + https://github.com/dotnet/arcade - d20e5f76ae843c2f1fe3ba5d05ba3fbf4547e719 + 92a725aa4d9d6c13dc5229597b51b0b165b8b535 - + https://github.com/dotnet/arcade - d20e5f76ae843c2f1fe3ba5d05ba3fbf4547e719 + 92a725aa4d9d6c13dc5229597b51b0b165b8b535 - + https://github.com/dotnet/arcade - d20e5f76ae843c2f1fe3ba5d05ba3fbf4547e719 + 92a725aa4d9d6c13dc5229597b51b0b165b8b535 https://github.com/dotnet/diagnostics diff --git a/eng/Versions.props b/eng/Versions.props index 12b016c5532..56e1d69ce3e 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -48,9 +48,9 @@ --> - 9.0.0-beta.24313.4 - 9.0.0-beta.24313.4 - 9.0.0-beta.24313.4 + 9.0.0-beta.24314.1 + 9.0.0-beta.24314.1 + 9.0.0-beta.24314.1 9.0.0-preview.6.24309.2 9.0.0-preview.6.24309.2 diff --git a/global.json b/global.json index 3c22e832261..728f1bb1e80 100644 --- a/global.json +++ b/global.json @@ -31,7 +31,7 @@ }, "msbuild-sdks": { "Microsoft.Build.NoTargets": "3.7.0", - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24313.4", - "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24313.4" + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24314.1", + "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24314.1" } } From e9208350636db5e94c673fb2455079109351651f Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 17 Jun 2024 14:43:40 +0000 Subject: [PATCH 056/107] Update dependencies from https://github.com/dotnet/sdk build 20240616.4 (#6843) [feature/9.x] Update dependencies from dotnet/sdk --- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 9dbc20bc517..b00aba540da 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -54,9 +54,9 @@ https://github.com/dotnet/aspnetcore 7f2dfb0020ff29ab57df31e910f2b2d5ef48bf82 - + https://github.com/dotnet/sdk - 60e06cc3059bd58e88ec62c878d256ad25b6d568 + 62a0d68796cc8253e2d8b13b4a0391640f3d6cdc https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index 56e1d69ce3e..ef34a1f089d 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -65,7 +65,7 @@ 9.0.0-preview.6.24307.2 9.0.0-preview.6.24307.2 - 9.0.100-preview.6.24314.10 + 9.0.100-preview.6.24316.4 1.0.530701 From 3a185b6f1e063cfb63e4f6af11120f7b46ebf46f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 17 Jun 2024 09:20:24 -0700 Subject: [PATCH 057/107] Update releases information. (#6842) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .github/releases.json | 13 +------------ documentation/releases.md | 1 - 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/.github/releases.json b/.github/releases.json index 1dac87006c6..33a60321956 100644 --- a/.github/releases.json +++ b/.github/releases.json @@ -13,8 +13,7 @@ "unsupported": [ "7.3", "7.2", - "7.1", - "7.0" + "7.1" ], "releases": { "6.3": { @@ -26,16 +25,6 @@ "netcoreapp3.1" ] }, - "7.0": { - "tag": "v7.0.2", - "minorReleaseDate": "2022-11-11T00:00:00.000Z", - "patchReleaseDate": "2023-02-14T00:00:00.000Z", - "supportedFrameworks": [ - "net6.0", - "net7.0" - ], - "outOfSupportDate": "2023-06-14T00:00:00.000Z" - }, "7.1": { "tag": "v7.1.3", "minorReleaseDate": "2023-03-14T00:00:00.000Z", diff --git a/documentation/releases.md b/documentation/releases.md index 4a6c9ce7f8c..ec5a43ad572 100644 --- a/documentation/releases.md +++ b/documentation/releases.md @@ -18,7 +18,6 @@ | 7.3 | August 8, 2023 | [7.3.4](https://github.com/dotnet/dotnet-monitor/releases/tag/v7.3.4) | May 14, 2024 | May 14, 2024 | net6.0
net7.0 | | 7.2 | June 13, 2023 | [7.2.3](https://github.com/dotnet/dotnet-monitor/releases/tag/v7.2.3) | October 10, 2023 | November 8, 2023 | net6.0
net7.0 | | 7.1 | March 14, 2023 | [7.1.3](https://github.com/dotnet/dotnet-monitor/releases/tag/v7.1.3) | August 8, 2023 | September 13, 2023 | net6.0
net7.0 | -| 7.0 | November 11, 2022 | [7.0.2](https://github.com/dotnet/dotnet-monitor/releases/tag/v7.0.2) | February 14, 2023 | June 14, 2023 | net6.0
net7.0 | ## Preview versions From 6bb2fa55f509cfd15e3fd48e3349ac909a43fd1f Mon Sep 17 00:00:00 2001 From: Julian Wreford <91067643+jwreford99@users.noreply.github.com> Date: Mon, 17 Jun 2024 17:22:11 +0100 Subject: [PATCH 058/107] [Egress provider - S3] Support KMS encryption for artifacts (#6831) * Create new option on S3StorageEgressProviderOptions to represent the optional KMS key to be used for encryption of the request to S3 * Use the new KMS key encryption key option to upload to S3 with KMS * Update schema with new configuration option * Documentation - add documention for kmsEncryptionKey * Add new option which will explicitly set whether the egress provider should use KMS * Use the newly defined option to control if using KMS encryption, and if we are then use the KMS encryption key * Run schema update to include parameter updats with the useKmsEncryption option * Documentation - update documentation with new KMS encryption setting * Set UseSignatureVersion4 inline with the AWS documentation requirements for KMS Encryption https://docs.aws.amazon.com/AmazonS3/latest/userguide/ShareObjectPreSignedURL.html https://docs.aws.amazon.com/AmazonS3/latest/userguide/example_s3_Scenario_PresignedUrl_section.html * Fix incorrect comment on strings Co-authored-by: kkeirstead <85592574+kkeirstead@users.noreply.github.com> * Update documentation for S3 Egress to use generic pattern for bucket arn --------- Co-authored-by: kkeirstead <85592574+kkeirstead@users.noreply.github.com> --- .../configuration/egress-configuration.md | 21 ++++++++++++ documentation/schema.json | 11 ++++++ .../OptionsDisplayStrings.Designer.cs | 19 ++++++++++- .../S3Storage/OptionsDisplayStrings.resx | 8 +++++ src/Extensions/S3Storage/S3Storage.cs | 34 +++++++++++++++++-- .../S3StorageEgressProviderOptions.cs | 10 ++++++ 6 files changed, 100 insertions(+), 3 deletions(-) diff --git a/documentation/configuration/egress-configuration.md b/documentation/configuration/egress-configuration.md index a457175bfe9..29bda145496 100644 --- a/documentation/configuration/egress-configuration.md +++ b/documentation/configuration/egress-configuration.md @@ -159,6 +159,8 @@ The Queue Message's payload will be the blob name (`/` | preSignedUrlExpiry | TimeStamp? | false | When specified, a pre-signed url is returned after successful upload; this value specifies the amount of time the generated pre-signed url should be accessible. The value has to be between 1 minute and 1 day. | | forcePathStyle | bool | false | The boolean flag set for AWS connection configuration ForcePathStyle option. | | copyBufferSize | int | false | The buffer size to use when copying data from the original artifact to the blob stream. There is a minimum size of 5 MB which is set when the given value is lower.| +| useKmsEncryption | bool | false | A boolean flag which controls whether the Egress should use KMS server side encryption. | +| kmsEncryptionKey | string | false | If UseKmsEncryption is true, this specifies the arn of the "customer managed" KMS encryption key to be used for server side encryption. If no value is set for this field then S3 will use an AWS managed key for KMS encryption. | ### Example S3 storage provider @@ -184,6 +186,25 @@ The Queue Message's payload will be the blob name (`/` ``` +
+ JSON with customer managed KMS encryption + + ```json + { + "Egress": { + "S3Storage": { + "monitorS3Blob": { + "endpoint": "http://localhost:9000", + "bucketName": "myS3Bucket", + "useKmsEncryption": true, + "kmsEncryptionKey": "arn:aws:kms:{region}:{account-id}:key/{resource-id}" + } + } + } + } + ``` +
+
Kubernetes Secret diff --git a/documentation/schema.json b/documentation/schema.json index f11d56d8b41..6d29cb04540 100644 --- a/documentation/schema.json +++ b/documentation/schema.json @@ -2988,6 +2988,17 @@ "format": "int32", "maximum": 2147483647.0, "minimum": 1.0 + }, + "UseKmsEncryption": { + "type": "boolean", + "description": "A boolean flag which controls whether the Egress should use KMS server side encryption." + }, + "KmsEncryptionKey": { + "type": [ + "null", + "string" + ], + "description": "If UseKmsEncryption is true, this specifies the arn of the \"customer managed\" KMS encryption key to be used for server side encryption. If no value is set for this field then S3 will use an AWS managed key for KMS encryption." } } } diff --git a/src/Extensions/S3Storage/OptionsDisplayStrings.Designer.cs b/src/Extensions/S3Storage/OptionsDisplayStrings.Designer.cs index 0d45d0dab2e..dfa1b337afc 100644 --- a/src/Extensions/S3Storage/OptionsDisplayStrings.Designer.cs +++ b/src/Extensions/S3Storage/OptionsDisplayStrings.Designer.cs @@ -1,7 +1,6 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -132,6 +131,15 @@ public static string DisplayAttributeDescription_S3StorageEgressProviderOptions_ } } + /// + /// Looks up a localized string similar to If UseKmsEncryption is true, this specifies the arn of the "customer managed" KMS encryption key to be used for server side encryption. If no value is set for this field then S3 will use an AWS managed key for KMS encryption. + /// + public static string DisplayAttributeDescription_S3StorageEgressProviderOptions_KmsEncryptionKey { + get { + return ResourceManager.GetString("DisplayAttributeDescription_S3StorageEgressProviderOptions_KmsEncryptionKey", resourceCulture); + } + } + /// /// Looks up a localized string similar to The amount of time the generated pre-signed url will be accessible.. /// @@ -158,5 +166,14 @@ public static string DisplayAttributeDescription_S3StorageEgressProviderOptions_ return ResourceManager.GetString("DisplayAttributeDescription_S3StorageEgressProviderOptions_SecretAccessKey", resourceCulture); } } + + /// + /// Looks up a localized string similar to A boolean flag which controls whether the Egress should use KMS server side encryption.. + /// + public static string DisplayAttributeDescription_S3StorageEgressProviderOptions_UseKmsEncryption { + get { + return ResourceManager.GetString("DisplayAttributeDescription_S3StorageEgressProviderOptions_UseKmsEncryption", resourceCulture); + } + } } } diff --git a/src/Extensions/S3Storage/OptionsDisplayStrings.resx b/src/Extensions/S3Storage/OptionsDisplayStrings.resx index fbf39e2a960..b8d17917bb2 100644 --- a/src/Extensions/S3Storage/OptionsDisplayStrings.resx +++ b/src/Extensions/S3Storage/OptionsDisplayStrings.resx @@ -157,6 +157,14 @@ The boolean flag set for AWS connection configuration ForcePathStyle option. The description provided for the ForcePathStyle parameter on S3StorageEgressProviderOptions. + + A boolean flag which controls whether the Egress should use KMS server side encryption. + The description provided for the UseKmsEncryption parameter on S3StorageEgressProviderOptions. + + + If UseKmsEncryption is true, this specifies the arn of the "customer managed" KMS encryption key to be used for server side encryption. If no value is set for this field then S3 will use an AWS managed key for KMS encryption. + The description provided for the KmsEncryptionKey parameter on S3StorageEgressProviderOptions. + Buffer size used when copying data from an egress callback returning a stream to the egress callback that is provided a stream to which data is written. The description provided for the CopyBufferSize parameter on all egress provider options. diff --git a/src/Extensions/S3Storage/S3Storage.cs b/src/Extensions/S3Storage/S3Storage.cs index a743c87407b..04829e8e53a 100644 --- a/src/Extensions/S3Storage/S3Storage.cs +++ b/src/Extensions/S3Storage/S3Storage.cs @@ -23,13 +23,17 @@ internal sealed class S3Storage : IS3Storage private readonly string _bucketName; private readonly string _objectId; private readonly string _contentType; + private readonly bool _useKmsEncryption; + private readonly string _kmsEncryptionKey; - public S3Storage(IAmazonS3 client, string bucketName, string objectId, string contentType) + public S3Storage(IAmazonS3 client, string bucketName, string objectId, string contentType, bool useKmsEncryption, string kmsEncryptionKey) { _s3Client = client; _bucketName = bucketName; _objectId = objectId; _contentType = contentType; + _useKmsEncryption = useKmsEncryption; + _kmsEncryptionKey = kmsEncryptionKey; } public static async Task CreateAsync(S3StorageEgressProviderOptions options, EgressArtifactSettings settings, CancellationToken cancellationToken) @@ -73,11 +77,17 @@ public static async Task CreateAsync(S3StorageEgressProviderOptions if (awsCredentials == null) throw new AmazonClientException("Failed to find AWS Credentials for constructing AWS service client"); + if (options.UseKmsEncryption) + { + // Required for generating pre-signed URLs with KMS encryption + AWSConfigsS3.UseSignatureVersion4 = true; + } + IAmazonS3 s3Client = new AmazonS3Client(awsCredentials, configuration); bool exists = await AmazonS3Util.DoesS3BucketExistV2Async(s3Client, options.BucketName); if (!exists) await s3Client.PutBucketAsync(options.BucketName, cancellationToken); - return new S3Storage(s3Client, options.BucketName, settings.Name, settings.ContentType); + return new S3Storage(s3Client, options.BucketName, settings.Name, settings.ContentType, options.UseKmsEncryption, options.KmsEncryptionKey); } public async Task PutAsync(Stream inputStream, CancellationToken token) @@ -90,6 +100,16 @@ public async Task PutAsync(Stream inputStream, CancellationToken token) InputStream = inputStream, AutoCloseStream = false, }; + + if (_useKmsEncryption) + { + request.ServerSideEncryptionMethod = ServerSideEncryptionMethod.AWSKMS; + if (!string.IsNullOrEmpty(_kmsEncryptionKey)) + { + request.ServerSideEncryptionKeyManagementServiceKeyId = _kmsEncryptionKey; + } + } + await _s3Client.PutObjectAsync(request, token); } @@ -102,6 +122,16 @@ public async Task UploadAsync(Stream inputStream, CancellationToken token) public async Task InitMultiPartUploadAsync(IDictionary metadata, CancellationToken cancellationToken) { var request = new InitiateMultipartUploadRequest { BucketName = _bucketName, Key = _objectId, ContentType = _contentType }; + + if (_useKmsEncryption) + { + request.ServerSideEncryptionMethod = ServerSideEncryptionMethod.AWSKMS; + if (!string.IsNullOrEmpty(_kmsEncryptionKey)) + { + request.ServerSideEncryptionKeyManagementServiceKeyId = _kmsEncryptionKey; + } + } + foreach (var metaData in metadata) request.Metadata[metaData.Key] = metaData.Value; var response = await _s3Client.InitiateMultipartUploadAsync(request, cancellationToken); diff --git a/src/Extensions/S3Storage/S3StorageEgressProviderOptions.cs b/src/Extensions/S3Storage/S3StorageEgressProviderOptions.cs index 08ac17a9f0a..d85c576fee8 100644 --- a/src/Extensions/S3Storage/S3StorageEgressProviderOptions.cs +++ b/src/Extensions/S3Storage/S3StorageEgressProviderOptions.cs @@ -63,5 +63,15 @@ internal sealed partial class S3StorageEgressProviderOptions Description = nameof(OptionsDisplayStrings.DisplayAttributeDescription_CommonEgressProviderOptions_CopyBufferSize))] [Range(1, int.MaxValue)] public int? CopyBufferSize { get; set; } + + [Display( + ResourceType = typeof(OptionsDisplayStrings), + Description = nameof(OptionsDisplayStrings.DisplayAttributeDescription_S3StorageEgressProviderOptions_UseKmsEncryption))] + public bool UseKmsEncryption { get; set; } + + [Display( + ResourceType = typeof(OptionsDisplayStrings), + Description = nameof(OptionsDisplayStrings.DisplayAttributeDescription_S3StorageEgressProviderOptions_KmsEncryptionKey))] + public string KmsEncryptionKey { get; set; } } } From 32fa38302fa3293889835062e611ea753b564618 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 17 Jun 2024 19:19:40 +0000 Subject: [PATCH 059/107] Update MacOS version to 12 (#6845) Co-authored-by: Justin Anderson --- eng/pipelines/jobs/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/pipelines/jobs/build.yml b/eng/pipelines/jobs/build.yml index 630ac4971e2..6c2c33613c4 100644 --- a/eng/pipelines/jobs/build.yml +++ b/eng/pipelines/jobs/build.yml @@ -70,7 +70,7 @@ jobs: ${{ if in(parameters.osGroup, 'MacOS') }}: pool: name: Azure Pipelines - vmImage: macos-11 + vmImage: macos-12 os: macOS ${{ if ne(parameters.container, '') }}: From d01cb1d15321aded75985f58933542d36a6b3807 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 18 Jun 2024 14:10:12 +0000 Subject: [PATCH 060/107] Update dependencies from https://github.com/dotnet/arcade build 20240617.3 (#6848) [feature/9.x] Update dependencies from dotnet/arcade --- eng/Version.Details.xml | 20 ++++++++++---------- eng/Versions.props | 6 +++--- global.json | 4 ++-- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index b00aba540da..71ab55a8050 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -22,25 +22,25 @@ https://github.com/dotnet/roslyn-analyzers 52913b28e20a224a5f6d56fe0b84b13210e274b0 - + https://github.com/dotnet/arcade - 92a725aa4d9d6c13dc5229597b51b0b165b8b535 + 579b9d3c2a51de22be7685f0bd624bf83265c901 - + https://github.com/dotnet/arcade - 92a725aa4d9d6c13dc5229597b51b0b165b8b535 + 579b9d3c2a51de22be7685f0bd624bf83265c901 - + https://github.com/dotnet/arcade - 92a725aa4d9d6c13dc5229597b51b0b165b8b535 + 579b9d3c2a51de22be7685f0bd624bf83265c901 - + https://github.com/dotnet/arcade - 92a725aa4d9d6c13dc5229597b51b0b165b8b535 + 579b9d3c2a51de22be7685f0bd624bf83265c901 - + https://github.com/dotnet/arcade - 92a725aa4d9d6c13dc5229597b51b0b165b8b535 + 579b9d3c2a51de22be7685f0bd624bf83265c901 https://github.com/dotnet/diagnostics diff --git a/eng/Versions.props b/eng/Versions.props index ef34a1f089d..9bf8c27d201 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -48,9 +48,9 @@ --> - 9.0.0-beta.24314.1 - 9.0.0-beta.24314.1 - 9.0.0-beta.24314.1 + 9.0.0-beta.24317.3 + 9.0.0-beta.24317.3 + 9.0.0-beta.24317.3 9.0.0-preview.6.24309.2 9.0.0-preview.6.24309.2 diff --git a/global.json b/global.json index 728f1bb1e80..7ecae4f5df8 100644 --- a/global.json +++ b/global.json @@ -31,7 +31,7 @@ }, "msbuild-sdks": { "Microsoft.Build.NoTargets": "3.7.0", - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24314.1", - "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24314.1" + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24317.3", + "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24317.3" } } From ac811c92b925aaac7edd461b76d1c2425223a14b Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 18 Jun 2024 14:11:25 +0000 Subject: [PATCH 061/107] Update dependencies from https://github.com/dotnet/sdk build 20240617.13 (#6849) [feature/9.x] Update dependencies from dotnet/sdk --- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 71ab55a8050..0fc728de442 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -54,9 +54,9 @@ https://github.com/dotnet/aspnetcore 7f2dfb0020ff29ab57df31e910f2b2d5ef48bf82 - + https://github.com/dotnet/sdk - 62a0d68796cc8253e2d8b13b4a0391640f3d6cdc + 5e7c92b9dff9720c2239ea7444571478e0604682 https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index 9bf8c27d201..4bd1444b52c 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -65,7 +65,7 @@ 9.0.0-preview.6.24307.2 9.0.0-preview.6.24307.2 - 9.0.100-preview.6.24316.4 + 9.0.100-preview.6.24317.13 1.0.530701 From bbed243f482dca87839ad50e336e3d40a93cc176 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 18 Jun 2024 15:09:49 -0700 Subject: [PATCH 062/107] [main] Bump Microsoft.OpenApi.Readers in /eng/dependabot/independent (#6853) Bumps [Microsoft.OpenApi.Readers](https://github.com/Microsoft/OpenAPI.NET) from 1.6.14 to 1.6.15. - [Release notes](https://github.com/Microsoft/OpenAPI.NET/releases) - [Commits](https://github.com/Microsoft/OpenAPI.NET/compare/1.6.14...1.6.15) --- updated-dependencies: - dependency-name: Microsoft.OpenApi.Readers dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- eng/dependabot/independent/Versions.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/dependabot/independent/Versions.props b/eng/dependabot/independent/Versions.props index d28080c9eab..e117c943c61 100644 --- a/eng/dependabot/independent/Versions.props +++ b/eng/dependabot/independent/Versions.props @@ -6,7 +6,7 @@ 12.20.0 12.18.0 2.19.1 - 1.6.14 + 1.6.15 4.3.2 5.0.0 From 1d5b5e4262a298b79ee0fc33494918329fa9c998 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 18 Jun 2024 22:31:17 +0000 Subject: [PATCH 063/107] [main] Bump Azure.Identity (#6852) Bumps the identity-dependencies group in /eng/dependabot/independent with 1 update: [Azure.Identity](https://github.com/Azure/azure-sdk-for-net). Updates `Azure.Identity` from 1.11.4 to 1.12.0 - [Release notes](https://github.com/Azure/azure-sdk-for-net/releases) - [Commits](https://github.com/Azure/azure-sdk-for-net/compare/Azure.Identity_1.11.4...Azure.Identity_1.12.0) --- updated-dependencies: - dependency-name: Azure.Identity dependency-type: direct:production update-type: version-update:semver-minor dependency-group: identity-dependencies ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- eng/dependabot/independent/Versions.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/dependabot/independent/Versions.props b/eng/dependabot/independent/Versions.props index e117c943c61..a9d931e2b94 100644 --- a/eng/dependabot/independent/Versions.props +++ b/eng/dependabot/independent/Versions.props @@ -2,7 +2,7 @@ - 1.11.4 + 1.12.0 12.20.0 12.18.0 2.19.1 From 09e8758a254028ea34bd250b73ab330d16fee925 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Wed, 19 Jun 2024 13:03:13 +0000 Subject: [PATCH 064/107] Update dependencies from https://github.com/dotnet/diagnostics build 20240618.2 (#6856) [main] Update dependencies from dotnet/diagnostics --- eng/Version.Details.xml | 12 ++++++------ eng/Versions.props | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 9c751693d70..ce81b9859ec 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -4,13 +4,13 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore 8e941eb42f819adb116b881195158b3887a70a1c - + https://github.com/dotnet/diagnostics - 33d8bf23a6566cd3fb9055acfc9f1141391d5421 + d592e0da173e520ef42d4f9cdd9d7b138a9896fd - + https://github.com/dotnet/diagnostics - 33d8bf23a6566cd3fb9055acfc9f1141391d5421 + d592e0da173e520ef42d4f9cdd9d7b138a9896fd https://github.com/dotnet/command-line-api @@ -46,9 +46,9 @@ https://github.com/dotnet/arcade c214b6ad17aedca4fa48294d80f6c52ef2463081 - + https://github.com/dotnet/diagnostics - 33d8bf23a6566cd3fb9055acfc9f1141391d5421 + d592e0da173e520ef42d4f9cdd9d7b138a9896fd https://dev.azure.com/dnceng/internal/_git/dotnet-runtime diff --git a/eng/Versions.props b/eng/Versions.props index 655d47bb756..5ef20767d1e 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -57,8 +57,8 @@ 2.0.0-beta4.24209.3 - 8.0.0-preview.24307.1 - 8.0.0-preview.24307.1 + 8.0.0-preview.24318.2 + 8.0.0-preview.24318.2 8.0.103-servicing.24114.15 @@ -67,7 +67,7 @@ 8.0.1 8.0.1-servicing.23580.1 - 1.0.530701 + 1.0.531802 $(MicrosoftNETCoreApp31Version) From 2ba187f83d71f451ce46727184c7e913ed4b93ce Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Wed, 19 Jun 2024 13:36:28 +0000 Subject: [PATCH 065/107] Update dependencies from https://github.com/dotnet/diagnostics build 20240618.2 (#6857) [feature/9.x] Update dependencies from dotnet/diagnostics --- eng/Version.Details.xml | 12 ++++++------ eng/Versions.props | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 0fc728de442..1f6d3bb3130 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -4,13 +4,13 @@ https://github.com/dotnet/aspnetcore 7f2dfb0020ff29ab57df31e910f2b2d5ef48bf82 - + https://github.com/dotnet/diagnostics - 33d8bf23a6566cd3fb9055acfc9f1141391d5421 + d592e0da173e520ef42d4f9cdd9d7b138a9896fd - + https://github.com/dotnet/diagnostics - 33d8bf23a6566cd3fb9055acfc9f1141391d5421 + d592e0da173e520ef42d4f9cdd9d7b138a9896fd https://github.com/dotnet/command-line-api @@ -42,9 +42,9 @@ https://github.com/dotnet/arcade 579b9d3c2a51de22be7685f0bd624bf83265c901 - + https://github.com/dotnet/diagnostics - 33d8bf23a6566cd3fb9055acfc9f1141391d5421 + d592e0da173e520ef42d4f9cdd9d7b138a9896fd https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index 4bd1444b52c..442c45b59b5 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -57,8 +57,8 @@ 2.0.0-beta4.24209.3 - 8.0.0-preview.24307.1 - 8.0.0-preview.24307.1 + 8.0.0-preview.24318.2 + 8.0.0-preview.24318.2 9.0.0-preview.24313.1 @@ -67,7 +67,7 @@ 9.0.100-preview.6.24317.13 - 1.0.530701 + 1.0.531802 $(MicrosoftNETCoreApp31Version) From a5acb329ed60076ad00c234dac4f5bf897e8761f Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Wed, 19 Jun 2024 13:45:40 +0000 Subject: [PATCH 066/107] Update dependencies from https://github.com/dotnet/sdk build 20240619.2 (#6859) [feature/9.x] Update dependencies from dotnet/sdk --- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 1f6d3bb3130..761ae668caa 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -54,9 +54,9 @@ https://github.com/dotnet/aspnetcore 7f2dfb0020ff29ab57df31e910f2b2d5ef48bf82 - + https://github.com/dotnet/sdk - 5e7c92b9dff9720c2239ea7444571478e0604682 + fda398e8bc6abf3ee455500c7f189db6f6800180 https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index 442c45b59b5..2ab9b87d3d1 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -65,7 +65,7 @@ 9.0.0-preview.6.24307.2 9.0.0-preview.6.24307.2 - 9.0.100-preview.6.24317.13 + 9.0.100-preview.6.24319.2 1.0.531802 From 94666feff8d4d246f62d885b1cf2f9bb8c972eeb Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Wed, 19 Jun 2024 09:25:06 -0700 Subject: [PATCH 067/107] Update dependencies from https://github.com/dotnet/roslyn-analyzers build 20240618.1 (#6858) Microsoft.CodeAnalysis.NetAnalyzers From Version 9.0.0-preview.24313.1 -> To Version 9.0.0-preview.24318.1 Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 761ae668caa..17c1f7708d7 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -18,9 +18,9 @@ - + https://github.com/dotnet/roslyn-analyzers - 52913b28e20a224a5f6d56fe0b84b13210e274b0 + f1115edce8633ebe03a86191bc05c6969ed9a821 https://github.com/dotnet/arcade diff --git a/eng/Versions.props b/eng/Versions.props index 2ab9b87d3d1..e606911f942 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -60,7 +60,7 @@ 8.0.0-preview.24318.2 8.0.0-preview.24318.2 - 9.0.0-preview.24313.1 + 9.0.0-preview.24318.1 9.0.0-preview.6.24307.2 9.0.0-preview.6.24307.2 From 336aece88b1b41e5a81cf4bf6103d0b6c3f6f3f2 Mon Sep 17 00:00:00 2001 From: William Xie Date: Wed, 19 Jun 2024 14:08:28 -0700 Subject: [PATCH 068/107] Add mvid and mdtoken to callstackframe (#6839) --- documentation/api/definitions.md | 3 + documentation/api/exceptions.md | 50 +++++++++++++- documentation/api/stacks.md | 14 ++++ .../Eventing/ExceptionsEventSource.cs | 8 ++- ...tionsEventSourceIdentifierCacheCallback.cs | 4 +- .../ExceptionGroupIdentifierCache.cs | 21 ++++-- .../Models/CallStackResults.cs | 7 ++ .../Stacks/CallStackData.cs | 5 ++ .../Stacks/EventStacksPipeline.cs | 21 +++++- .../Stacks/NameCache.cs | 11 ++-- .../Stacks/NameFormatter.cs | 6 +- .../Stacks/NameIdentificationEvents.cs | 16 +++-- .../Utilities/StackUtilities.cs | 10 ++- .../Stacks/StacksEventProvider.cpp | 6 +- .../Stacks/StacksEventProvider.h | 8 +-- .../Eventing/ExceptionsEventListener.cs | 10 ++- .../Eventing/ExceptionsEventSourceTests.cs | 52 +++++++++++++++ .../ExceptionGroupIdentifierCacheTests.cs | 2 +- .../ExceptionsTests.cs | 9 +++ ...ics.Monitoring.Tool.FunctionalTests.csproj | 1 + .../StacksTests.cs | 66 +++++++++++++------ ....Diagnostics.Monitoring.UnitTestApp.csproj | 6 +- .../Exceptions/EventExceptionsPipeline.cs | 2 + .../EventExceptionsPipelineNameCache.cs | 8 +-- .../Exceptions/ExceptionsOperation.cs | 2 + 25 files changed, 287 insertions(+), 61 deletions(-) diff --git a/documentation/api/definitions.md b/documentation/api/definitions.md index dff57e617e4..a779a5b2689 100644 --- a/documentation/api/definitions.md +++ b/documentation/api/definitions.md @@ -35,8 +35,11 @@ First Available: 8.0 Preview 7 | Name | Type | Description | |---|---|---| | `methodName` | string | Name of the method for this frame. This includes generic parameters. | +| `methodToken` | int | TypeDef token for the method. | +| `parameterTypes` | string[] | Array of parameter types. Empty array if none. | | `typeName` | string | Name of the class for this frame. This includes generic parameters. | | `moduleName` | string | Name of the module for this frame. | +| `moduleVersionId` | guid | Unique identifier used to distinguish between two versions of the same module. An empty value: `00000000-0000-0000-0000-000000000000`. | ## CallStackResult diff --git a/documentation/api/exceptions.md b/documentation/api/exceptions.md index 764000cdb28..904e83f2733 100644 --- a/documentation/api/exceptions.md +++ b/documentation/api/exceptions.md @@ -126,8 +126,54 @@ Accept: application/x-ndjson HTTP/1.1 200 OK Content-Type: application/x-ndjson -{"id":2,"timestamp":"2023-07-13T21:45:11.8056355Z","typeName":"System.InvalidOperationException","moduleName":"System.Private.CoreLib.dll","message":"Operation is not valid due to the current state of the object.","innerExceptions":[],"stack":{"threadId":4768,"threadName":null,"frames":[{"methodName":"MoveNext","parameterTypes":[],"typeName":"WebApplication3.Pages.IndexModel\u002B\u003CGetData\u003Ed__3","moduleName":"WebApplication3.dll"},{"methodName":"RunInternal","parameterTypes":["System.Threading.ExecutionContext","System.Threading.ContextCallback","System.Object"],"typeName":"System.Threading.ExecutionContext","moduleName":"System.Private.CoreLib.dll"},{"methodName":"MoveNext","parameterTypes":["System.Threading.Thread"],"typeName":"System.Runtime.CompilerServices.AsyncTaskMethodBuilder\u00601\u002BAsyncStateMachineBox\u00601[System.Runtime.CompilerServices.AsyncTaskMethodBuilder\u00601\u002BAsyncStateMachineBox\u00601\u002BTResult,System.Runtime.CompilerServices.AsyncTaskMethodBuilder\u00601\u002BAsyncStateMachineBox\u00601\u002BTStateMachine]","moduleName":"System.Private.CoreLib.dll"},{"methodName":"\u003COutputCorrelationEtwEvent\u003Eb__6_0","parameterTypes":["System.Action","System.Threading.Tasks.Task"],"typeName":"System.Runtime.CompilerServices.YieldAwaitable\u002BYieldAwaiter\u002B\u003C\u003Ec","moduleName":"System.Private.CoreLib.dll"},{"methodName":"Dispatch","parameterTypes":[],"typeName":"System.Threading.ThreadPoolWorkQueue","moduleName":"System.Private.CoreLib.dll"},{"methodName":"WorkerThreadStart","parameterTypes":[],"typeName":"System.Threading.PortableThreadPool\u002BWorkerThread","moduleName":"System.Private.CoreLib.dll"}]}} -{"id":3,"timestamp":"2023-07-13T21:46:18.7530773Z","typeName":"System.ObjectDisposedException","moduleName":"System.Private.CoreLib.dll","message":"Cannot access a disposed object.\r\nObject name: \u0027System.Net.Sockets.NetworkStream\u0027.","innerExceptions":[],"stack":{"threadId":15912,"threadName":null,"frames":[{"methodName":"ThrowObjectDisposedException","parameterTypes":["System.Object"],"typeName":"System.ThrowHelper","moduleName":"System.Private.CoreLib.dll"},{"methodName":"ThrowIf","parameterTypes":["System.Boolean","System.Object"],"typeName":"System.ObjectDisposedException","moduleName":"System.Private.CoreLib.dll"},{"methodName":"ReadAsync","parameterTypes":["System.Memory\u00601[[System.Byte, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]][System.Byte]","System.Threading.CancellationToken"],"typeName":"System.Net.Sockets.NetworkStream","moduleName":"System.Net.Sockets.dll"},{"methodName":"MoveNext","parameterTypes":[],"typeName":"System.Net.Http.HttpConnection\u002B\u003C\u003CEnsureReadAheadTaskHasStarted\u003Eg__ReadAheadWithZeroByteReadAsync|43_0\u003Ed","moduleName":"System.Net.Http.dll"},{"methodName":"ExecutionContextCallback","parameterTypes":["System.Object"],"typeName":"System.Runtime.CompilerServices.AsyncTaskMethodBuilder\u00601\u002BAsyncStateMachineBox\u00601[System.Runtime.CompilerServices.AsyncTaskMethodBuilder\u00601\u002BAsyncStateMachineBox\u00601\u002BTResult,System.Runtime.CompilerServices.AsyncTaskMethodBuilder\u00601\u002BAsyncStateMachineBox\u00601\u002BTStateMachine]","moduleName":"System.Private.CoreLib.dll"},{"methodName":"RunInternal","parameterTypes":["System.Threading.ExecutionContext","System.Threading.ContextCallback","System.Object"],"typeName":"System.Threading.ExecutionContext","moduleName":"System.Private.CoreLib.dll"},{"methodName":"MoveNext","parameterTypes":["System.Threading.Thread"],"typeName":"System.Runtime.CompilerServices.AsyncTaskMethodBuilder\u00601\u002BAsyncStateMachineBox\u00601[System.Runtime.CompilerServices.AsyncTaskMethodBuilder\u00601\u002BAsyncStateMachineBox\u00601\u002BTResult,System.Runtime.CompilerServices.AsyncTaskMethodBuilder\u00601\u002BAsyncStateMachineBox\u00601\u002BTStateMachine]","moduleName":"System.Private.CoreLib.dll"},{"methodName":"MoveNext","parameterTypes":[],"typeName":"System.Runtime.CompilerServices.AsyncTaskMethodBuilder\u00601\u002BAsyncStateMachineBox\u00601[System.Runtime.CompilerServices.AsyncTaskMethodBuilder\u00601\u002BAsyncStateMachineBox\u00601\u002BTResult,System.Runtime.CompilerServices.AsyncTaskMethodBuilder\u00601\u002BAsyncStateMachineBox\u00601\u002BTStateMachine]","moduleName":"System.Private.CoreLib.dll"},{"methodName":"\u003C.cctor\u003Eb__176_0","parameterTypes":["System.UInt32","System.UInt32","System.Threading.NativeOverlapped*"],"typeName":"System.Net.Sockets.SocketAsyncEventArgs\u002B\u003C\u003Ec","moduleName":"System.Net.Sockets.dll"},{"methodName":"Invoke","parameterTypes":["System.Threading.PortableThreadPool\u002BIOCompletionPoller\u002BEvent"],"typeName":"System.Threading.PortableThreadPool\u002BIOCompletionPoller\u002BCallback","moduleName":"System.Private.CoreLib.dll"},{"methodName":"System.Threading.IThreadPoolWorkItem.Execute","parameterTypes":[],"typeName":"System.Threading.ThreadPoolTypedWorkItemQueue\u00602[System.Threading.ThreadPoolTypedWorkItemQueue\u00602\u002BT,System.Threading.ThreadPoolTypedWorkItemQueue\u00602\u002BTCallback]","moduleName":"System.Private.CoreLib.dll"},{"methodName":"Dispatch","parameterTypes":[],"typeName":"System.Threading.ThreadPoolWorkQueue","moduleName":"System.Private.CoreLib.dll"},{"methodName":"WorkerThreadStart","parameterTypes":[],"typeName":"System.Threading.PortableThreadPool\u002BWorkerThread","moduleName":"System.Private.CoreLib.dll"}]}} +{ + "id": 2, + "timestamp": "2023-07-13T21:45:11.8056355Z", + "typeName": "System.InvalidOperationException", + "moduleName": "System.Private.CoreLib.dll", + "message": "Operation is not valid due to the current state of the object.", + "innerExceptions": [], + "stack": { + "threadId": 4768, + "threadName": null, + "frames": [ + { + "methodName": "MoveNext", + "methodToken": 100663639, + "parameterTypes": [], + "typeName": "WebApplication3.Pages.IndexModel\u002B\u003CGetData\u003Ed__3", + "moduleName": "WebApplication3.dll", + "moduleVersionId": "bf769014-c2e2-496a-93b7-76fbbcd04be5" + }, + ... // see stacks.md + ] + } +} +{ + "id": 3, + "timestamp": "2023-07-13T21:46:18.7530773Z", + "typeName": "System.ObjectDisposedException", + "moduleName": "System.Private.CoreLib.dll", + "message": "Cannot access a disposed object.\r\nObject name: \u0027System.Net.Sockets.NetworkStream\u0027.", + "innerExceptions": [], + "stack": { + "threadId": 15912, + "threadName": null, + "frames": [ + { + "methodName": "ThrowObjectDisposedException", + "methodToken": 100663639, + "parameterTypes": [ + "System.Object" + ], + "typeName": "System.ThrowHelper", + "moduleName": "System.Private.CoreLib.dll", + "moduleVersionId": "bf769014-c2e2-496a-93b7-76fbbcd04be5" + }, + ... // see stacks.md + ] + } +} ``` ## Supported Runtimes diff --git a/documentation/api/stacks.md b/documentation/api/stacks.md index 4147e7f57a4..eeec2510332 100644 --- a/documentation/api/stacks.md +++ b/documentation/api/stacks.md @@ -81,19 +81,33 @@ Location: localhost:52323/operations/67f07e40-5cca-4709-9062-26302c484f18 "frames": [ { "methodName": "GetQueuedCompletionStatus", + "methodToken": 100663634, + "parameterTypes": [], "typeName": "Interop\u002BKernel32", "moduleName": "System.Private.CoreLib.dll", + "moduleVersionId": "194ddabd-a802-4520-90ef-854e2f1cd606" }, { "methodName": "WaitForSignal", + "methodToken": 100663639, + "parameterTypes": [ + "System.Threading.ExecutionContext", + "System.Threading.ContextCallback", + "System.Object" + ], "typeName": "System.Threading.LowLevelLifoSemaphore", "moduleName": "System.Private.CoreLib.dll", + "moduleVersionId": "194ddabd-a802-4520-90ef-854e2f1cd606" }, { "methodName": "Wait", + "methodToken": 100663643, + "parameterTypes": [], "typeName": "System.Threading.LowLevelLifoSemaphore", "moduleName": "System.Private.CoreLib.dll", + "moduleVersionId": "194ddabd-a802-4520-90ef-854e2f1cd606" } + ] } ``` diff --git a/src/Microsoft.Diagnostics.Monitoring.StartupHook/Exceptions/Eventing/ExceptionsEventSource.cs b/src/Microsoft.Diagnostics.Monitoring.StartupHook/Exceptions/Eventing/ExceptionsEventSource.cs index 3bcb89b13da..efa325bb9a9 100644 --- a/src/Microsoft.Diagnostics.Monitoring.StartupHook/Exceptions/Eventing/ExceptionsEventSource.cs +++ b/src/Microsoft.Diagnostics.Monitoring.StartupHook/Exceptions/Eventing/ExceptionsEventSource.cs @@ -97,6 +97,7 @@ public void ClassDescription( [Event(ExceptionEvents.EventIds.FunctionDescription)] public void FunctionDescription( ulong FunctionId, + uint MethodToken, ulong ClassId, uint ClassToken, ulong ModuleId, @@ -104,7 +105,7 @@ public void FunctionDescription( ulong[] TypeArgs, ulong[] ParameterTypes) { - Span data = stackalloc EventData[7]; + Span data = stackalloc EventData[8]; using PinnedData namePinned = PinnedData.Create(Name); Span typeArgsSpan = stackalloc byte[GetArrayDataSize(TypeArgs)]; FillArrayData(typeArgsSpan, TypeArgs); @@ -112,6 +113,7 @@ public void FunctionDescription( FillArrayData(parameterTypesSpan, ParameterTypes); SetValue(ref data[NameIdentificationEvents.FunctionDescPayloads.FunctionId], FunctionId); + SetValue(ref data[NameIdentificationEvents.FunctionDescPayloads.MethodToken], MethodToken); SetValue(ref data[NameIdentificationEvents.FunctionDescPayloads.ClassId], ClassId); SetValue(ref data[NameIdentificationEvents.FunctionDescPayloads.ClassToken], ClassToken); SetValue(ref data[NameIdentificationEvents.FunctionDescPayloads.ModuleId], ModuleId); @@ -125,12 +127,14 @@ public void FunctionDescription( [Event(ExceptionEvents.EventIds.ModuleDescription)] public void ModuleDescription( ulong ModuleId, + Guid ModuleVersionId, string Name) { - Span data = stackalloc EventData[2]; + Span data = stackalloc EventData[3]; using PinnedData namePinned = PinnedData.Create(Name); SetValue(ref data[NameIdentificationEvents.ModuleDescPayloads.ModuleId], ModuleId); + SetValue(ref data[NameIdentificationEvents.ModuleDescPayloads.ModuleVersionId], ModuleVersionId); SetValue(ref data[NameIdentificationEvents.ModuleDescPayloads.Name], namePinned); WriteEventWithFlushing(ExceptionEvents.EventIds.ModuleDescription, data); diff --git a/src/Microsoft.Diagnostics.Monitoring.StartupHook/Exceptions/Eventing/ExceptionsEventSourceIdentifierCacheCallback.cs b/src/Microsoft.Diagnostics.Monitoring.StartupHook/Exceptions/Eventing/ExceptionsEventSourceIdentifierCacheCallback.cs index f59bd20b5b2..5a76d8ea968 100644 --- a/src/Microsoft.Diagnostics.Monitoring.StartupHook/Exceptions/Eventing/ExceptionsEventSourceIdentifierCacheCallback.cs +++ b/src/Microsoft.Diagnostics.Monitoring.StartupHook/Exceptions/Eventing/ExceptionsEventSourceIdentifierCacheCallback.cs @@ -38,8 +38,9 @@ public override void OnFunctionData(ulong functionId, FunctionData data) { _source.FunctionDescription( functionId, + data.MethodToken, data.ParentClass, - data.ParentToken, + data.ParentClassToken, data.ModuleId, data.Name, data.TypeArgs, @@ -50,6 +51,7 @@ public override void OnModuleData(ulong moduleId, ModuleData data) { _source.ModuleDescription( moduleId, + data.ModuleVersionId, data.Name); } diff --git a/src/Microsoft.Diagnostics.Monitoring.StartupHook/Exceptions/Identification/ExceptionGroupIdentifierCache.cs b/src/Microsoft.Diagnostics.Monitoring.StartupHook/Exceptions/Identification/ExceptionGroupIdentifierCache.cs index 9b93c7e6f22..99ef3d1f5e6 100644 --- a/src/Microsoft.Diagnostics.Monitoring.StartupHook/Exceptions/Identification/ExceptionGroupIdentifierCache.cs +++ b/src/Microsoft.Diagnostics.Monitoring.StartupHook/Exceptions/Identification/ExceptionGroupIdentifierCache.cs @@ -83,13 +83,19 @@ public ulong GetOrAdd(MethodBase method) return methodId; // Dynamic methods do not have metadata tokens - uint metadataToken = 0; + uint methodToken = 0; try { - metadataToken = Convert.ToUInt32(method.MetadataToken); + methodToken = Convert.ToUInt32(method.MetadataToken); } catch (Exception) { } + uint parentClassToken = 0; + if (null != method.DeclaringType) + { + parentClassToken = Convert.ToUInt32(method.DeclaringType.MetadataToken); + } + // RTDynamicMethod does not implement GetGenericArguments. Type[] genericArguments = Array.Empty(); try @@ -100,8 +106,9 @@ public ulong GetOrAdd(MethodBase method) FunctionData data = new( method.Name, + methodToken, AddOrDefault(method.DeclaringType), - metadataToken, + parentClassToken, GetOrAdd(method.Module), GetOrAdd(genericArguments), GetOrAdd(method.GetParameters()) @@ -128,7 +135,7 @@ public ulong GetOrAdd(Module module) if (!GetOrCreateIdentifier(_moduleIds, module, ref _nextModuleId, out ulong moduleId)) return moduleId; - ModuleData data = new(module.Name); + ModuleData data = new(module.Name, module.ModuleVersionId); if (_nameCache.ModuleData.TryAdd(moduleId, data)) { @@ -212,16 +219,16 @@ public ulong GetOrAdd(Type type) ModuleScopedToken key = new(moduleId, typeToken); if (!_nameCache.TokenData.ContainsKey(key)) { - uint parentToken = 0; + uint parentClassToken = 0; if (null != type.DeclaringType) { - parentToken = Convert.ToUInt32(type.DeclaringType.MetadataToken); + parentClassToken = Convert.ToUInt32(type.DeclaringType.MetadataToken); } TokenData tokenData = new( type.Name, null == type.DeclaringType ? type.Namespace ?? string.Empty : string.Empty, - parentToken); + parentClassToken); if (!_nameCache.TokenData.TryAdd(key, tokenData)) break; diff --git a/src/Microsoft.Diagnostics.Monitoring.WebApi/Models/CallStackResults.cs b/src/Microsoft.Diagnostics.Monitoring.WebApi/Models/CallStackResults.cs index a93e0f2ecb9..3d410000a49 100644 --- a/src/Microsoft.Diagnostics.Monitoring.WebApi/Models/CallStackResults.cs +++ b/src/Microsoft.Diagnostics.Monitoring.WebApi/Models/CallStackResults.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System; using System.Collections.Generic; using System.Text.Json.Serialization; @@ -11,12 +12,18 @@ public class CallStackFrame [JsonPropertyName("methodName")] public string MethodName { get; set; } + [JsonPropertyName("methodToken")] + public uint MethodToken { get; set; } + [JsonPropertyName("typeName")] public string TypeName { get; set; } [JsonPropertyName("moduleName")] public string ModuleName { get; set; } + [JsonPropertyName("moduleVersionId")] + public Guid ModuleVersionId { get; set; } + [JsonIgnore] internal IList SimpleGenericArgTypes { get; set; } = new List(); diff --git a/src/Microsoft.Diagnostics.Monitoring.WebApi/Stacks/CallStackData.cs b/src/Microsoft.Diagnostics.Monitoring.WebApi/Stacks/CallStackData.cs index 5e8acce7503..47e4f73b5ae 100644 --- a/src/Microsoft.Diagnostics.Monitoring.WebApi/Stacks/CallStackData.cs +++ b/src/Microsoft.Diagnostics.Monitoring.WebApi/Stacks/CallStackData.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System; using System.Collections.Generic; namespace Microsoft.Diagnostics.Monitoring.WebApi.Stacks @@ -20,6 +21,10 @@ internal sealed class CallStackFrame { public ulong FunctionId { get; set; } + public uint MethodToken { get; set; } + + public Guid ModuleVersionId { get; set; } + public ulong Offset { get; set; } } diff --git a/src/Microsoft.Diagnostics.Monitoring.WebApi/Stacks/EventStacksPipeline.cs b/src/Microsoft.Diagnostics.Monitoring.WebApi/Stacks/EventStacksPipeline.cs index ec280574838..50508001b1e 100644 --- a/src/Microsoft.Diagnostics.Monitoring.WebApi/Stacks/EventStacksPipeline.cs +++ b/src/Microsoft.Diagnostics.Monitoring.WebApi/Stacks/EventStacksPipeline.cs @@ -85,7 +85,22 @@ private void Callback(TraceEvent action) { for (int i = 0; i < functionIds.Length; i++) { - stack.Frames.Add(new CallStackFrame { FunctionId = functionIds[i], Offset = offsets[i] }); + CallStackFrame stackFrame = new CallStackFrame + { + FunctionId = functionIds[i], + Offset = offsets[i] + }; + + if (_result.NameCache.FunctionData.TryGetValue(stackFrame.FunctionId, out FunctionData functionData)) + { + stackFrame.MethodToken = functionData.MethodToken; + if (_result.NameCache.ModuleData.TryGetValue(functionData.ModuleId, out ModuleData moduleData)) + { + stackFrame.ModuleVersionId = moduleData.ModuleVersionId; + } + } + + stack.Frames.Add(stackFrame); } } } @@ -94,6 +109,7 @@ private void Callback(TraceEvent action) ulong id = action.GetPayload(NameIdentificationEvents.FunctionDescPayloads.FunctionId); var functionData = new FunctionData( action.GetPayload(NameIdentificationEvents.FunctionDescPayloads.Name), + action.GetPayload(NameIdentificationEvents.FunctionDescPayloads.MethodToken), action.GetPayload(NameIdentificationEvents.FunctionDescPayloads.ClassId), action.GetPayload(NameIdentificationEvents.FunctionDescPayloads.ClassToken), action.GetPayload(NameIdentificationEvents.FunctionDescPayloads.ModuleId), @@ -119,7 +135,8 @@ private void Callback(TraceEvent action) { ulong id = action.GetPayload(NameIdentificationEvents.ModuleDescPayloads.ModuleId); var moduleData = new ModuleData( - action.GetPayload(NameIdentificationEvents.ModuleDescPayloads.Name) + action.GetPayload(NameIdentificationEvents.ModuleDescPayloads.Name), + action.GetPayload(NameIdentificationEvents.ModuleDescPayloads.ModuleVersionId) ); _result.NameCache.ModuleData.TryAdd(id, moduleData); diff --git a/src/Microsoft.Diagnostics.Monitoring.WebApi/Stacks/NameCache.cs b/src/Microsoft.Diagnostics.Monitoring.WebApi/Stacks/NameCache.cs index 9fb10cfe8e2..6207e0837a5 100644 --- a/src/Microsoft.Diagnostics.Monitoring.WebApi/Stacks/NameCache.cs +++ b/src/Microsoft.Diagnostics.Monitoring.WebApi/Stacks/NameCache.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System; using System.Collections.Concurrent; using System.Diagnostics; @@ -43,20 +44,22 @@ internal sealed record class ClassData(uint Token, ulong ModuleId, ClassFlags Fl internal sealed record class TokenData(string Name, string Namespace, uint OuterToken); /// The name of the function. + /// The method token of the function (methodDef token). /// The parent class identifier of the function. - /// The parent metadata token of the function. + /// The parent metadata token of the function (typeDef token). /// The identifier of the module that contains the function. /// The class identifiers of the generic type arguments of the function. /// The class identifiers of the parameter types of the function. /// - /// If is 0, then use . + /// If is 0, then use . /// [DebuggerDisplay("{Name}")] - internal sealed record class FunctionData(string Name, ulong ParentClass, uint ParentToken, ulong ModuleId, ulong[] TypeArgs, ulong[] ParameterTypes); + internal sealed record class FunctionData(string Name, uint MethodToken, ulong ParentClass, uint ParentClassToken, ulong ModuleId, ulong[] TypeArgs, ulong[] ParameterTypes); /// The name of the module. + /// The version identifier of the module. [DebuggerDisplay("{Name}")] - internal sealed record class ModuleData(string Name); + internal sealed record class ModuleData(string Name, Guid ModuleVersionId); internal sealed record class ModuleScopedToken(ulong ModuleId, uint Token); } diff --git a/src/Microsoft.Diagnostics.Monitoring.WebApi/Stacks/NameFormatter.cs b/src/Microsoft.Diagnostics.Monitoring.WebApi/Stacks/NameFormatter.cs index 3d5d9031076..050ab763dc8 100644 --- a/src/Microsoft.Diagnostics.Monitoring.WebApi/Stacks/NameFormatter.cs +++ b/src/Microsoft.Diagnostics.Monitoring.WebApi/Stacks/NameFormatter.cs @@ -42,7 +42,7 @@ public static void BuildTypeName(StringBuilder builder, NameCache cache, Functio } else { - BuildTypeName(builder, cache, functionData.ModuleId, functionData.ParentToken, TypeFormat.Full); + BuildTypeName(builder, cache, functionData.ModuleId, functionData.ParentClassToken, TypeFormat.Full); } } @@ -80,11 +80,11 @@ public static void BuildTypeName(StringBuilder builder, NameCache cache, ulong c } } - private static void BuildTypeName(StringBuilder builder, NameCache cache, ulong moduleId, uint token, TypeFormat typeFormat) + private static void BuildTypeName(StringBuilder builder, NameCache cache, ulong moduleId, uint classToken, TypeFormat typeFormat) { var typeNames = new Stack(); - uint currentToken = token; + uint currentToken = classToken; while (currentToken != 0 && cache.TokenData.TryGetValue(new ModuleScopedToken(moduleId, currentToken), out TokenData? tokenData)) { string typeName = tokenData.Name; diff --git a/src/Microsoft.Diagnostics.Monitoring.WebApi/Stacks/NameIdentificationEvents.cs b/src/Microsoft.Diagnostics.Monitoring.WebApi/Stacks/NameIdentificationEvents.cs index 5991b064d66..91394002118 100644 --- a/src/Microsoft.Diagnostics.Monitoring.WebApi/Stacks/NameIdentificationEvents.cs +++ b/src/Microsoft.Diagnostics.Monitoring.WebApi/Stacks/NameIdentificationEvents.cs @@ -12,12 +12,13 @@ internal static class NameIdentificationEvents public static class FunctionDescPayloads { public const int FunctionId = 0; - public const int ClassId = 1; - public const int ClassToken = 2; - public const int ModuleId = 3; - public const int Name = 4; - public const int TypeArgs = 5; - public const int ParameterTypes = 6; + public const int MethodToken = 1; + public const int ClassId = 2; + public const int ClassToken = 3; + public const int ModuleId = 4; + public const int Name = 5; + public const int TypeArgs = 6; + public const int ParameterTypes = 7; } public static class ClassDescPayloads @@ -32,7 +33,8 @@ public static class ClassDescPayloads public static class ModuleDescPayloads { public const int ModuleId = 0; - public const int Name = 1; + public const int ModuleVersionId = 1; + public const int Name = 2; } public static class TokenDescPayloads diff --git a/src/Microsoft.Diagnostics.Monitoring.WebApi/Utilities/StackUtilities.cs b/src/Microsoft.Diagnostics.Monitoring.WebApi/Utilities/StackUtilities.cs index 269b2a55dad..c20962c5fad 100644 --- a/src/Microsoft.Diagnostics.Monitoring.WebApi/Utilities/StackUtilities.cs +++ b/src/Microsoft.Diagnostics.Monitoring.WebApi/Utilities/StackUtilities.cs @@ -48,9 +48,11 @@ internal static Models.CallStackFrame CreateFrameModel(CallStackFrame frame, Nam { TypeName = NameFormatter.UnknownClass, MethodName = StacksFormatter.UnknownFunction, + MethodToken = 0, //TODO Bring this back once we have a useful offset value //Offset = frame.Offset, - ModuleName = NameFormatter.UnknownModule + ModuleName = NameFormatter.UnknownModule, + ModuleVersionId = Guid.Empty }; if (frame.FunctionId == 0) { @@ -60,8 +62,14 @@ internal static Models.CallStackFrame CreateFrameModel(CallStackFrame frame, Nam } else if (cache.FunctionData.TryGetValue(frame.FunctionId, out FunctionData functionData)) { + frameModel.MethodToken = functionData.MethodToken; frameModel.ModuleName = NameFormatter.GetModuleName(cache, functionData.ModuleId); + if (cache.ModuleData.TryGetValue(functionData.ModuleId, out ModuleData moduleData)) + { + frameModel.ModuleVersionId = moduleData.ModuleVersionId; + } + builder.Clear(); builder.Append(functionData.Name); diff --git a/src/Profilers/MonitorProfiler/Stacks/StacksEventProvider.cpp b/src/Profilers/MonitorProfiler/Stacks/StacksEventProvider.cpp index d3f69b4599a..5f148ee4520 100644 --- a/src/Profilers/MonitorProfiler/Stacks/StacksEventProvider.cpp +++ b/src/Profilers/MonitorProfiler/Stacks/StacksEventProvider.cpp @@ -53,6 +53,7 @@ HRESULT StacksEventProvider::WriteFunctionData(FunctionID functionId, const Func { return _functionEvent->WritePayload( static_cast(functionId), + functionData.GetMethodToken(), static_cast(functionData.GetClass()), functionData.GetClassToken(), static_cast(functionData.GetModuleId()), @@ -63,7 +64,10 @@ HRESULT StacksEventProvider::WriteFunctionData(FunctionID functionId, const Func HRESULT StacksEventProvider::WriteModuleData(ModuleID moduleId, const ModuleData& moduleData) { - return _moduleEvent->WritePayload(moduleId, moduleData.GetName()); + return _moduleEvent->WritePayload( + moduleId, + moduleData.GetMvid(), + moduleData.GetName()); } HRESULT StacksEventProvider::WriteTokenData(ModuleID moduleId, mdTypeDef typeDef, const TokenData& tokenData) diff --git a/src/Profilers/MonitorProfiler/Stacks/StacksEventProvider.h b/src/Profilers/MonitorProfiler/Stacks/StacksEventProvider.h index 4a66cfdc0d1..e2d6af6ce45 100644 --- a/src/Profilers/MonitorProfiler/Stacks/StacksEventProvider.h +++ b/src/Profilers/MonitorProfiler/Stacks/StacksEventProvider.h @@ -42,8 +42,8 @@ class StacksEventProvider std::unique_ptr, std::vector>> _callstackEvent; //Note we will either send a ClassId or a ClassToken. For Shared generic functions, there is no ClassID. - const WCHAR* FunctionPayloads[7] = { _T("FunctionId"), _T("ClassId"), _T("ClassToken"), _T("ModuleId"), _T("Name"), _T("TypeArgs"), _T("ParameterTypes") }; - std::unique_ptr, std::vector>> _functionEvent; + const WCHAR* FunctionPayloads[8] = { _T("FunctionId"), _T("MethodToken"), _T("ClassId"), _T("ClassToken"), _T("ModuleId"), _T("Name"), _T("TypeArgs"), _T("ParameterTypes") }; + std::unique_ptr, std::vector>> _functionEvent; //We cannot retrieve detailed information for some ClassIds. Flags is used to indicate these conditions. const WCHAR* ClassPayloads[5] = { _T("ClassId"), _T("ModuleId"), _T("Token"), _T("Flags"), _T("TypeArgs") }; @@ -52,8 +52,8 @@ class StacksEventProvider const WCHAR* TokenPayloads[5] = { _T("ModuleId"), _T("Token"), _T("OuterToken"), _T("Name"), _T("Namespace") }; std::unique_ptr> _tokenEvent; - const WCHAR* ModulePayloads[2] = { _T("ModuleId"), _T("Name") }; - std::unique_ptr> _moduleEvent; + const WCHAR* ModulePayloads[3] = { _T("ModuleId"), _T("ModuleVersionId"), _T("Name") }; + std::unique_ptr> _moduleEvent; //TODO Once ProfilerEvent supports it, use an event with no payload. const WCHAR* EndPayloads[1] = { _T("Unused") }; diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/Exceptions/Eventing/ExceptionsEventListener.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/Exceptions/Eventing/ExceptionsEventListener.cs index 3d1458faffb..c9444ab823d 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/Exceptions/Eventing/ExceptionsEventListener.cs +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/Exceptions/Eventing/ExceptionsEventListener.cs @@ -68,6 +68,7 @@ protected override void OnEventWritten(EventWrittenEventArgs eventData) ToUInt64(eventData.Payload[NameIdentificationEvents.FunctionDescPayloads.FunctionId]), new FunctionData( ToString(eventData.Payload[NameIdentificationEvents.FunctionDescPayloads.Name]), + ToUInt32(eventData.Payload[NameIdentificationEvents.FunctionDescPayloads.MethodToken]), ToUInt64(eventData.Payload[NameIdentificationEvents.FunctionDescPayloads.ClassId]), ToUInt32(eventData.Payload[NameIdentificationEvents.FunctionDescPayloads.ClassToken]), ToUInt64(eventData.Payload[NameIdentificationEvents.FunctionDescPayloads.ModuleId]), @@ -78,7 +79,9 @@ protected override void OnEventWritten(EventWrittenEventArgs eventData) NameCache.ModuleData.TryAdd( ToUInt64(eventData.Payload[NameIdentificationEvents.ModuleDescPayloads.ModuleId]), new ModuleData( - ToString(eventData.Payload[NameIdentificationEvents.ModuleDescPayloads.Name]))); + ToString(eventData.Payload[NameIdentificationEvents.ModuleDescPayloads.Name]), + ToGuid(eventData.Payload[NameIdentificationEvents.ModuleDescPayloads.ModuleVersionId]) + )); break; case ExceptionEvents.EventIds.StackFrameDescription: StackFrameIdentifiers.TryAdd( @@ -104,6 +107,11 @@ protected override void OnEventWritten(EventWrittenEventArgs eventData) } } + private static Guid ToGuid(object? value) + { + return ToType(value); + } + private static int ToInt32(object? value) { return ToType(value); diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/Exceptions/Eventing/ExceptionsEventSourceTests.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/Exceptions/Eventing/ExceptionsEventSourceTests.cs index 685da3af35a..64b9ba75129 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/Exceptions/Eventing/ExceptionsEventSourceTests.cs +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/Exceptions/Eventing/ExceptionsEventSourceTests.cs @@ -142,6 +142,58 @@ public void ExceptionsEventSource_WriteStackFrame_Event(ulong id, ulong methodId Assert.Equal(ilOffset, frameIdentifier.ILOffset); } + [Theory] + [InlineData(0, 0, 0, 0, 0, "", new ulong[0], new ulong[0])] + [InlineData(1, 100663639, 128, 256, 512, "ThrowObjectDisposedException", new ulong[1] { 1024 }, new ulong[2] { 2048, 4096 })] + public void ExceptionsEventSource_WriteFunction_Event( + ulong functionId, + uint methodToken, + ulong classId, + uint classToken, + ulong moduleId, + string name, + ulong[] typeArgs, + ulong[] parameterTypes) + { + using ExceptionsEventSource source = new(); + + using ExceptionsEventListener listener = new(); + listener.EnableEvents(source, EventLevel.Informational); + + source.FunctionDescription(functionId, methodToken, classId, classToken, moduleId, name, typeArgs, parameterTypes); + + Assert.True(listener.NameCache.FunctionData.TryGetValue(functionId, out FunctionData? function)); + Assert.Equal(methodToken, function.MethodToken); + Assert.Equal(classId, function.ParentClass); + Assert.Equal(classToken, function.ParentClassToken); + Assert.Equal(moduleId, function.ModuleId); + Assert.Equal(name, function.Name); + // We would normally expect the following to return an array of the stack frame IDs + // but in-process listener doesn't decode non-byte arrays correctly. + Assert.Equal(Array.Empty(), function.TypeArgs); + Assert.Equal(Array.Empty(), function.ParameterTypes); + } + + [Theory] + [InlineData(0, "00000000-0000-0000-0000-000000000000", "")] + [InlineData(1, NonEmptyGuidString, "Module")] + public void ExceptionsEventSource_WriteModule_Event( + ulong moduleId, + Guid moduleVersionId, + string name) + { + using ExceptionsEventSource source = new(); + + using ExceptionsEventListener listener = new(); + listener.EnableEvents(source, EventLevel.Informational); + + source.ModuleDescription(moduleId, moduleVersionId, name); + + Assert.True(listener.NameCache.ModuleData.TryGetValue(moduleId, out ModuleData? module)); + Assert.Equal(moduleVersionId, module.ModuleVersionId); + Assert.Equal(name, module.Name); + } + private static string CoalesceNull(string? value) { return value ?? ExceptionsEventListener.NullValue; diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/Exceptions/Identification/ExceptionGroupIdentifierCacheTests.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/Exceptions/Identification/ExceptionGroupIdentifierCacheTests.cs index 798086c179d..9a5917eb2b2 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/Exceptions/Identification/ExceptionGroupIdentifierCacheTests.cs +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.StartupHook.UnitTests/Exceptions/Identification/ExceptionGroupIdentifierCacheTests.cs @@ -178,7 +178,7 @@ public void ExceptionGroupIdentifierCache_ThrownException() // Validate throwing method remaining properties Assert.Equal(nameof(ExceptionGroupIdentifierCache_ThrownException), throwingMethodData.Name); Assert.NotEqual(InvalidId, throwingMethodData.ParentClass); - Assert.NotEqual(InvalidToken, throwingMethodData.ParentToken); + Assert.NotEqual(InvalidToken, throwingMethodData.ParentClassToken); Assert.Empty(throwingMethodData.TypeArgs); // Validate stack frame data diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests/ExceptionsTests.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests/ExceptionsTests.cs index 207eef01c35..7e70cf70c16 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests/ExceptionsTests.cs +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests/ExceptionsTests.cs @@ -15,6 +15,7 @@ using System.IO; using System.Linq; using System.Net.Http; +using System.Reflection; using System.Runtime.InteropServices; using System.Text.Json; using System.Threading.Tasks; @@ -130,12 +131,20 @@ await ScenarioRunner.SingleTarget( var topFrame = callStackResultsRootElement.GetProperty("frames").EnumerateArray().FirstOrDefault(); + MethodInfo methodInfo = typeof(Microsoft.Diagnostics.Monitoring.UnitTestApp.Scenarios.ExceptionsScenario).GetMethod( + FrameMethodName, + BindingFlags.Static | BindingFlags.NonPublic, + [typeof(bool), typeof(bool)]); + Assert.NotNull(methodInfo); + Assert.Equal(FrameMethodName, topFrame.GetProperty("methodName").ToString()); + Assert.Equal((uint)methodInfo.MetadataToken, topFrame.GetProperty("methodToken").GetUInt32()); Assert.Equal(2, topFrame.GetProperty("parameterTypes").GetArrayLength()); Assert.Equal(FrameParameterType, topFrame.GetProperty("parameterTypes")[0].ToString()); Assert.Equal(FrameParameterType, topFrame.GetProperty("parameterTypes")[1].ToString()); Assert.Equal(FrameTypeName, topFrame.GetProperty("typeName").ToString()); Assert.Equal(UnitTestAppModule, topFrame.GetProperty("moduleName").ToString()); + Assert.Equal(methodInfo.Module.ModuleVersionId, topFrame.GetProperty("moduleVersionId").GetGuid()); }, configureApp: runner => { diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests.csproj b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests.csproj index c2373b90b27..352877b0203 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests.csproj +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests.csproj @@ -94,6 +94,7 @@ TargetFramework=net8.0 + diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests/StacksTests.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests/StacksTests.cs index 100f281177c..0a8631cbcae 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests/StacksTests.cs +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests/StacksTests.cs @@ -40,6 +40,23 @@ public class StacksTests private const string NativeFrame = "[NativeFrame]"; private const string ExpectedThreadName = "TestThread"; + private static MethodInfo GetMethodInfo(string methodName) + { + // Strip off any generic type information. + if (methodName.Contains('[')) + { + methodName = methodName[..methodName.IndexOf('[')]; + } + + // Return null on psuedo frames (e.g. [NativeFrame]) + if (methodName.Length == 0) + { + return null; + } + + return typeof(Microsoft.Diagnostics.Monitoring.UnitTestApp.Scenarios.StacksWorker.StacksWorkerNested).GetMethod(methodName); + } + public StacksTests(ITestOutputHelper outputHelper, ServiceProviderFixture serviceProviderFixture) { _httpClientFactory = serviceProviderFixture.ServiceProvider.GetService(); @@ -452,8 +469,17 @@ await appRunner.ExecuteAsync(async () => private static string FormatFrame(string module, string @class, string function) => FormattableString.Invariant($"{module}!{@class}.{function}"); - private static bool AreFramesEqual(WebApi.Models.CallStackFrame left, WebApi.Models.CallStackFrame right) => - (left.ModuleName == right.ModuleName) && (left.TypeName == right.TypeName) && (left.MethodName == right.MethodName); + private static bool AreFramesEqual(WebApi.Models.CallStackFrame expected, WebApi.Models.CallStackFrame actual) + { + MethodInfo expectedMethodInfo = GetMethodInfo(expected.MethodName); + + return (expected.ModuleName == actual.ModuleName) && + (expected.TypeName == actual.TypeName) && + (expected.MethodName == actual.MethodName) && + ((expectedMethodInfo?.MetadataToken ?? 0) == actual.MethodToken) && + ((expectedMethodInfo?.Module.ModuleVersionId ?? Guid.Empty) == actual.ModuleVersionId); + + } private static bool AreFramesEqual(WebApi.Models.ProfileEvent left, WebApi.Models.ProfileEvent right) => (left.Frame == right.Frame) && (left.At == right.At) && (left.Type == right.Type); @@ -535,24 +561,24 @@ private static (WebApi.Models.CallStack, IList) Ge private static WebApi.Models.CallStackFrame[] ExpectedFrames() => new WebApi.Models.CallStackFrame[] { - new WebApi.Models.CallStackFrame - { - ModuleName = ExpectedModule, - TypeName = ExpectedClass, - MethodName = ExpectedCallbackFunction - }, - new WebApi.Models.CallStackFrame - { - ModuleName = NativeFrame, - TypeName = NativeFrame, - MethodName = NativeFrame - }, - new WebApi.Models.CallStackFrame - { - ModuleName = ExpectedModule, - TypeName = ExpectedClass, - MethodName = ExpectedFunction - } + new WebApi.Models.CallStackFrame + { + ModuleName = ExpectedModule, + TypeName = ExpectedClass, + MethodName = ExpectedCallbackFunction, + }, + new WebApi.Models.CallStackFrame + { + ModuleName = NativeFrame, + TypeName = NativeFrame, + MethodName = NativeFrame, + }, + new WebApi.Models.CallStackFrame + { + ModuleName = ExpectedModule, + TypeName = ExpectedClass, + MethodName = ExpectedFunction, + } }; } } diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/Microsoft.Diagnostics.Monitoring.UnitTestApp.csproj b/src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/Microsoft.Diagnostics.Monitoring.UnitTestApp.csproj index cd3ab6d95da..185ac82e527 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/Microsoft.Diagnostics.Monitoring.UnitTestApp.csproj +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/Microsoft.Diagnostics.Monitoring.UnitTestApp.csproj @@ -1,4 +1,4 @@ - + Exe @@ -7,6 +7,10 @@ true + + + + diff --git a/src/Tools/dotnet-monitor/Exceptions/EventExceptionsPipeline.cs b/src/Tools/dotnet-monitor/Exceptions/EventExceptionsPipeline.cs index c98d758d853..d302e5d6c02 100644 --- a/src/Tools/dotnet-monitor/Exceptions/EventExceptionsPipeline.cs +++ b/src/Tools/dotnet-monitor/Exceptions/EventExceptionsPipeline.cs @@ -94,6 +94,7 @@ private void Callback(TraceEvent traceEvent) case "FunctionDescription": _cache.AddFunction( traceEvent.GetPayload(NameIdentificationEvents.FunctionDescPayloads.FunctionId), + traceEvent.GetPayload(NameIdentificationEvents.FunctionDescPayloads.MethodToken), traceEvent.GetPayload(NameIdentificationEvents.FunctionDescPayloads.ClassId), traceEvent.GetPayload(NameIdentificationEvents.FunctionDescPayloads.ClassToken), traceEvent.GetPayload(NameIdentificationEvents.FunctionDescPayloads.ModuleId), @@ -105,6 +106,7 @@ private void Callback(TraceEvent traceEvent) case "ModuleDescription": _cache.AddModule( traceEvent.GetPayload(NameIdentificationEvents.ModuleDescPayloads.ModuleId), + traceEvent.GetPayload(NameIdentificationEvents.ModuleDescPayloads.ModuleVersionId), traceEvent.GetPayload(NameIdentificationEvents.ModuleDescPayloads.Name) ); break; diff --git a/src/Tools/dotnet-monitor/Exceptions/EventExceptionsPipelineNameCache.cs b/src/Tools/dotnet-monitor/Exceptions/EventExceptionsPipelineNameCache.cs index 8f761b50c40..3660d68925b 100644 --- a/src/Tools/dotnet-monitor/Exceptions/EventExceptionsPipelineNameCache.cs +++ b/src/Tools/dotnet-monitor/Exceptions/EventExceptionsPipelineNameCache.cs @@ -26,9 +26,9 @@ public void AddExceptionGroup(ulong id, ulong exceptionClassId, ulong throwingMe _exceptionGroupMap.Add(id, new ExceptionGroup(exceptionClassId, throwingMethodId, ilOffset)); } - public void AddFunction(ulong id, ulong classId, uint classToken, ulong moduleId, string name, ulong[] typeArgs, ulong[] parameterTypes) + public void AddFunction(ulong id, uint methodToken, ulong classId, uint classToken, ulong moduleId, string name, ulong[] typeArgs, ulong[] parameterTypes) { - _nameCache.FunctionData.TryAdd(id, new FunctionData(name, classId, classToken, moduleId, typeArgs ?? Array.Empty(), parameterTypes ?? Array.Empty())); + _nameCache.FunctionData.TryAdd(id, new FunctionData(name, methodToken, classId, classToken, moduleId, typeArgs ?? Array.Empty(), parameterTypes ?? Array.Empty())); } public void AddStackFrame(ulong id, ulong functionId, int ilOffset) @@ -36,9 +36,9 @@ public void AddStackFrame(ulong id, ulong functionId, int ilOffset) _stackFrames.Add(id, new StackFrameInstance(functionId, ilOffset)); } - public void AddModule(ulong id, string moduleName) + public void AddModule(ulong id, Guid moduleVersionId, string moduleName) { - _nameCache.ModuleData.TryAdd(id, new ModuleData(moduleName)); + _nameCache.ModuleData.TryAdd(id, new ModuleData(moduleName, moduleVersionId)); } public void AddToken(ulong moduleId, uint token, uint outerToken, string name, string @namespace) diff --git a/src/Tools/dotnet-monitor/Exceptions/ExceptionsOperation.cs b/src/Tools/dotnet-monitor/Exceptions/ExceptionsOperation.cs index f8063f2a13f..bd1ee3eb0cc 100644 --- a/src/Tools/dotnet-monitor/Exceptions/ExceptionsOperation.cs +++ b/src/Tools/dotnet-monitor/Exceptions/ExceptionsOperation.cs @@ -195,6 +195,7 @@ private async Task WriteJsonInstance(Stream stream, IExceptionInstance instance, assembledMethodName += builder.ToString(); } writer.WriteString("methodName", assembledMethodName); + writer.WriteNumber("methodToken", frame.MethodToken); writer.WriteStartArray("parameterTypes"); foreach (string parameterType in frame.FullParameterTypes) { @@ -203,6 +204,7 @@ private async Task WriteJsonInstance(Stream stream, IExceptionInstance instance, writer.WriteEndArray(); // end parameterTypes writer.WriteString("typeName", frame.TypeName); writer.WriteString("moduleName", frame.ModuleName); + writer.WriteString("moduleVersionId", frame.ModuleVersionId.ToString("D")); writer.WriteEndObject(); } From f462a72c0018000ae1561d221505ad8add78941a Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Thu, 20 Jun 2024 13:26:49 +0000 Subject: [PATCH 069/107] Update dependencies from https://github.com/dotnet/diagnostics build 20240619.2 (#6860) [main] Update dependencies from dotnet/diagnostics --- eng/Version.Details.xml | 6 +++--- eng/Versions.props | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index ce81b9859ec..53590f3d989 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -4,11 +4,11 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore 8e941eb42f819adb116b881195158b3887a70a1c - + https://github.com/dotnet/diagnostics d592e0da173e520ef42d4f9cdd9d7b138a9896fd - + https://github.com/dotnet/diagnostics d592e0da173e520ef42d4f9cdd9d7b138a9896fd @@ -46,7 +46,7 @@ https://github.com/dotnet/arcade c214b6ad17aedca4fa48294d80f6c52ef2463081 - + https://github.com/dotnet/diagnostics d592e0da173e520ef42d4f9cdd9d7b138a9896fd diff --git a/eng/Versions.props b/eng/Versions.props index 5ef20767d1e..774cf15d280 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -57,8 +57,8 @@ 2.0.0-beta4.24209.3 - 8.0.0-preview.24318.2 - 8.0.0-preview.24318.2 + 8.0.0-preview.24319.2 + 8.0.0-preview.24319.2 8.0.103-servicing.24114.15 @@ -67,7 +67,7 @@ 8.0.1 8.0.1-servicing.23580.1 - 1.0.531802 + 1.0.531902 $(MicrosoftNETCoreApp31Version) From 221132625266ed81f04596d3bd04d26640ff7e1c Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Thu, 20 Jun 2024 13:43:35 +0000 Subject: [PATCH 070/107] Update dependencies from https://github.com/dotnet/diagnostics build 20240619.2 (#6861) [feature/9.x] Update dependencies from dotnet/diagnostics --- eng/Version.Details.xml | 6 +++--- eng/Versions.props | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 17c1f7708d7..33d2d12a2a6 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -4,11 +4,11 @@ https://github.com/dotnet/aspnetcore 7f2dfb0020ff29ab57df31e910f2b2d5ef48bf82 - + https://github.com/dotnet/diagnostics d592e0da173e520ef42d4f9cdd9d7b138a9896fd - + https://github.com/dotnet/diagnostics d592e0da173e520ef42d4f9cdd9d7b138a9896fd @@ -42,7 +42,7 @@ https://github.com/dotnet/arcade 579b9d3c2a51de22be7685f0bd624bf83265c901 - + https://github.com/dotnet/diagnostics d592e0da173e520ef42d4f9cdd9d7b138a9896fd diff --git a/eng/Versions.props b/eng/Versions.props index e606911f942..d1582bd9e85 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -57,8 +57,8 @@ 2.0.0-beta4.24209.3 - 8.0.0-preview.24318.2 - 8.0.0-preview.24318.2 + 8.0.0-preview.24319.2 + 8.0.0-preview.24319.2 9.0.0-preview.24318.1 @@ -67,7 +67,7 @@ 9.0.100-preview.6.24319.2 - 1.0.531802 + 1.0.531902 $(MicrosoftNETCoreApp31Version) From f73e906fcecc046f33f061ec7442152e2fb4ad48 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Thu, 20 Jun 2024 13:51:30 +0000 Subject: [PATCH 071/107] Update dependencies from https://github.com/dotnet/sdk build 20240619.5 (#6862) [feature/9.x] Update dependencies from dotnet/sdk --- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 33d2d12a2a6..a7de48542a8 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -54,9 +54,9 @@ https://github.com/dotnet/aspnetcore 7f2dfb0020ff29ab57df31e910f2b2d5ef48bf82 - + https://github.com/dotnet/sdk - fda398e8bc6abf3ee455500c7f189db6f6800180 + f3ebfb5ccb1ca3b072cee5b8f52a9e1087b2ad11 https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index d1582bd9e85..ef30ed14727 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -65,7 +65,7 @@ 9.0.0-preview.6.24307.2 9.0.0-preview.6.24307.2 - 9.0.100-preview.6.24319.2 + 9.0.100-preview.6.24319.5 1.0.531902 From c8b6b81b77b68ca284bdab34317383682525748c Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 21 Jun 2024 13:10:59 +0000 Subject: [PATCH 072/107] Update dependencies from https://github.com/dotnet/diagnostics build 20240620.2 (#6866) [main] Update dependencies from dotnet/diagnostics --- eng/Version.Details.xml | 12 ++++++------ eng/Versions.props | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 53590f3d989..fff17b84712 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -4,13 +4,13 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore 8e941eb42f819adb116b881195158b3887a70a1c - + https://github.com/dotnet/diagnostics - d592e0da173e520ef42d4f9cdd9d7b138a9896fd + 464e06c9a8602dff44ff5c59e9a0c3777f68e41c - + https://github.com/dotnet/diagnostics - d592e0da173e520ef42d4f9cdd9d7b138a9896fd + 464e06c9a8602dff44ff5c59e9a0c3777f68e41c https://github.com/dotnet/command-line-api @@ -46,9 +46,9 @@ https://github.com/dotnet/arcade c214b6ad17aedca4fa48294d80f6c52ef2463081 - + https://github.com/dotnet/diagnostics - d592e0da173e520ef42d4f9cdd9d7b138a9896fd + 464e06c9a8602dff44ff5c59e9a0c3777f68e41c https://dev.azure.com/dnceng/internal/_git/dotnet-runtime diff --git a/eng/Versions.props b/eng/Versions.props index 774cf15d280..af04c3eae21 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -57,8 +57,8 @@ 2.0.0-beta4.24209.3 - 8.0.0-preview.24319.2 - 8.0.0-preview.24319.2 + 8.0.0-preview.24320.2 + 8.0.0-preview.24320.2 8.0.103-servicing.24114.15 @@ -67,7 +67,7 @@ 8.0.1 8.0.1-servicing.23580.1 - 1.0.531902 + 1.0.532002 $(MicrosoftNETCoreApp31Version) From ca43eb7b249551ca4d08d46320e9cd9a6bcad51f Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 21 Jun 2024 14:01:40 +0000 Subject: [PATCH 073/107] Update dependencies from https://github.com/dotnet/diagnostics build 20240620.2 (#6867) [feature/9.x] Update dependencies from dotnet/diagnostics --- eng/Version.Details.xml | 12 ++++++------ eng/Versions.props | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index a7de48542a8..420eeed6689 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -4,13 +4,13 @@ https://github.com/dotnet/aspnetcore 7f2dfb0020ff29ab57df31e910f2b2d5ef48bf82 - + https://github.com/dotnet/diagnostics - d592e0da173e520ef42d4f9cdd9d7b138a9896fd + 464e06c9a8602dff44ff5c59e9a0c3777f68e41c - + https://github.com/dotnet/diagnostics - d592e0da173e520ef42d4f9cdd9d7b138a9896fd + 464e06c9a8602dff44ff5c59e9a0c3777f68e41c https://github.com/dotnet/command-line-api @@ -42,9 +42,9 @@ https://github.com/dotnet/arcade 579b9d3c2a51de22be7685f0bd624bf83265c901 - + https://github.com/dotnet/diagnostics - d592e0da173e520ef42d4f9cdd9d7b138a9896fd + 464e06c9a8602dff44ff5c59e9a0c3777f68e41c https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index ef30ed14727..4db79e29f2b 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -57,8 +57,8 @@ 2.0.0-beta4.24209.3 - 8.0.0-preview.24319.2 - 8.0.0-preview.24319.2 + 8.0.0-preview.24320.2 + 8.0.0-preview.24320.2 9.0.0-preview.24318.1 @@ -67,7 +67,7 @@ 9.0.100-preview.6.24319.5 - 1.0.531902 + 1.0.532002 $(MicrosoftNETCoreApp31Version) From 5f5f3b33654bec60d555f83b7893585ad1f851e1 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 21 Jun 2024 14:05:39 +0000 Subject: [PATCH 074/107] Update dependencies from https://github.com/dotnet/arcade build 20240620.6 (#6868) [feature/9.x] Update dependencies from dotnet/arcade --- eng/Version.Details.xml | 20 +-- eng/Versions.props | 6 +- eng/common/SetupNugetSources.ps1 | 143 ++++++++++-------- eng/common/SetupNugetSources.sh | 2 +- .../steps/enable-internal-sources.yml | 46 +++--- global.json | 4 +- 6 files changed, 126 insertions(+), 95 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 420eeed6689..282e92983fd 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -22,25 +22,25 @@ https://github.com/dotnet/roslyn-analyzers f1115edce8633ebe03a86191bc05c6969ed9a821 - + https://github.com/dotnet/arcade - 579b9d3c2a51de22be7685f0bd624bf83265c901 + bfd4f951527e37d08f16f5cff09173943061601e - + https://github.com/dotnet/arcade - 579b9d3c2a51de22be7685f0bd624bf83265c901 + bfd4f951527e37d08f16f5cff09173943061601e - + https://github.com/dotnet/arcade - 579b9d3c2a51de22be7685f0bd624bf83265c901 + bfd4f951527e37d08f16f5cff09173943061601e - + https://github.com/dotnet/arcade - 579b9d3c2a51de22be7685f0bd624bf83265c901 + bfd4f951527e37d08f16f5cff09173943061601e - + https://github.com/dotnet/arcade - 579b9d3c2a51de22be7685f0bd624bf83265c901 + bfd4f951527e37d08f16f5cff09173943061601e https://github.com/dotnet/diagnostics diff --git a/eng/Versions.props b/eng/Versions.props index 4db79e29f2b..9cf30c383b6 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -48,9 +48,9 @@ --> - 9.0.0-beta.24317.3 - 9.0.0-beta.24317.3 - 9.0.0-beta.24317.3 + 9.0.0-beta.24320.6 + 9.0.0-beta.24320.6 + 9.0.0-beta.24320.6 9.0.0-preview.6.24309.2 9.0.0-preview.6.24309.2 diff --git a/eng/common/SetupNugetSources.ps1 b/eng/common/SetupNugetSources.ps1 index c07f6a52601..2b0a5c9e665 100644 --- a/eng/common/SetupNugetSources.ps1 +++ b/eng/common/SetupNugetSources.ps1 @@ -1,32 +1,31 @@ # This script adds internal feeds required to build commits that depend on internal package sources. For instance, # dotnet6-internal would be added automatically if dotnet6 was found in the nuget.config file. In addition also enables # disabled internal Maestro (darc-int*) feeds. -# -# Optionally, this script also adds a credential entry for each of the internal feeds if supplied. This credential -# is added via the standard environment variable VSS_NUGET_EXTERNAL_FEED_ENDPOINTS. See -# https://github.com/microsoft/artifacts-credprovider/tree/v1.1.1?tab=readme-ov-file#environment-variables for more details +# +# Optionally, this script also adds a credential entry for each of the internal feeds if supplied. # # See example call for this script below. # # - task: PowerShell@2 -# displayName: Setup Internal Feeds +# displayName: Setup Private Feeds Credentials # condition: eq(variables['Agent.OS'], 'Windows_NT') # inputs: # filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1 -# arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config -# - task: NuGetAuthenticate@1 -# +# arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config -Password $Env:Token +# env: +# Token: $(dn-bot-dnceng-artifact-feeds-rw) +# # Note that the NuGetAuthenticate task should be called after SetupNugetSources. # This ensures that: # - Appropriate creds are set for the added internal feeds (if not supplied to the scrupt) -# - The credential provider is installed +# - The credential provider is installed. # # This logic is also abstracted into enable-internal-sources.yml. [CmdletBinding()] param ( [Parameter(Mandatory = $true)][string]$ConfigFile, - [string]$Password + $Password ) $ErrorActionPreference = "Stop" @@ -35,23 +34,12 @@ Set-StrictMode -Version 2.0 . $PSScriptRoot\tools.ps1 -$feedEndpoints = $null - -# If a credential is provided, ensure that we don't overwrite the current set of -# credentials that may have been provided by a previous call to the credential provider. -if ($Password -and $null -ne $env:VSS_NUGET_EXTERNAL_FEED_ENDPOINTS) { - $feedEndpoints = $env:VSS_NUGET_EXTERNAL_FEED_ENDPOINTS | ConvertFrom-Json -} elseif ($Password) { - $feedEndpoints = @{ endpointCredentials = @() } -} - # Add source entry to PackageSources -function AddPackageSource($sources, $SourceName, $SourceEndPoint, $pwd) { +function AddPackageSource($sources, $SourceName, $SourceEndPoint, $creds, $Username, $pwd) { $packageSource = $sources.SelectSingleNode("add[@key='$SourceName']") - if ($null -eq $packageSource) + if ($packageSource -eq $null) { - Write-Host "`tAdding package source" $SourceName $packageSource = $doc.CreateElement("add") $packageSource.SetAttribute("key", $SourceName) $packageSource.SetAttribute("value", $SourceEndPoint) @@ -61,33 +49,63 @@ function AddPackageSource($sources, $SourceName, $SourceEndPoint, $pwd) { Write-Host "Package source $SourceName already present." } - if ($pwd) { - $feedEndpoints.endpointCredentials = AddCredential -endpointCredentials $feedEndpoints.endpointCredentials -source $SourceEndPoint -pwd $pwd - } + AddCredential -Creds $creds -Source $SourceName -Username $Username -pwd $pwd } -# Add a new feed endpoint credential -function AddCredential([array]$endpointCredentials, $source, $pwd) { - $endpointCredentials += @{ - endpoint = $source; - password = $pwd +# Add a credential node for the specified source +function AddCredential($creds, $source, $username, $pwd) { + # If no cred supplied, don't do anything. + if (!$pwd) { + return; } - return $endpointCredentials + + # Looks for credential configuration for the given SourceName. Create it if none is found. + $sourceElement = $creds.SelectSingleNode($Source) + if ($sourceElement -eq $null) + { + $sourceElement = $doc.CreateElement($Source) + $creds.AppendChild($sourceElement) | Out-Null + } + + # Add the node to the credential if none is found. + $usernameElement = $sourceElement.SelectSingleNode("add[@key='Username']") + if ($usernameElement -eq $null) + { + $usernameElement = $doc.CreateElement("add") + $usernameElement.SetAttribute("key", "Username") + $sourceElement.AppendChild($usernameElement) | Out-Null + } + $usernameElement.SetAttribute("value", $Username) + + # Add the to the credential if none is found. + # Add it as a clear text because there is no support for encrypted ones in non-windows .Net SDKs. + # -> https://github.com/NuGet/Home/issues/5526 + $passwordElement = $sourceElement.SelectSingleNode("add[@key='ClearTextPassword']") + if ($passwordElement -eq $null) + { + $passwordElement = $doc.CreateElement("add") + $passwordElement.SetAttribute("key", "ClearTextPassword") + $sourceElement.AppendChild($passwordElement) | Out-Null + } + + $passwordElement.SetAttribute("value", $pwd) } -function InsertMaestroInternalFeedCredentials($Sources, $pwd) { - $maestroInternalSources = $Sources.SelectNodes("add[contains(@key,'darc-int')]") +function InsertMaestroPrivateFeedCredentials($Sources, $Creds, $Username, $pwd) { + $maestroPrivateSources = $Sources.SelectNodes("add[contains(@key,'darc-int')]") - ForEach ($PackageSource in $maestroInternalSources) { - Write-Host "`tAdding credential for Maestro's feed:" $PackageSource.Key - $feedEndpoints.endpointCredentials = AddCredential -endpointCredentials $feedEndpoints.endpointCredentials -source $PackageSource.value -pwd $pwd + Write-Host "Inserting credentials for $($maestroPrivateSources.Count) Maestro's private feeds." + + ForEach ($PackageSource in $maestroPrivateSources) { + Write-Host "`tInserting credential for Maestro's feed:" $PackageSource.Key + AddCredential -Creds $creds -Source $PackageSource.Key -Username $Username -pwd $pwd } } -function EnableInternalPackageSources($DisabledPackageSources) { - $maestroInternalSources = $DisabledPackageSources.SelectNodes("add[contains(@key,'darc-int')]") - ForEach ($DisabledPackageSource in $maestroInternalSources) { - Write-Host "`tEnsuring internal source '$($DisabledPackageSource.key)' is enabled by deleting it from disabledPackageSource" +function EnablePrivatePackageSources($DisabledPackageSources) { + $maestroPrivateSources = $DisabledPackageSources.SelectNodes("add[contains(@key,'darc-int')]") + ForEach ($DisabledPackageSource in $maestroPrivateSources) { + Write-Host "`tEnsuring private source '$($DisabledPackageSource.key)' is enabled by deleting it from disabledPackageSource" # Due to https://github.com/NuGet/Home/issues/10291, we must actually remove the disabled entries $DisabledPackageSources.RemoveChild($DisabledPackageSource) } @@ -105,27 +123,38 @@ $doc.Load($filename) # Get reference to or create one if none exist already $sources = $doc.DocumentElement.SelectSingleNode("packageSources") -if ($null -eq $sources) { +if ($sources -eq $null) { $sources = $doc.CreateElement("packageSources") $doc.DocumentElement.AppendChild($sources) | Out-Null } +$creds = $null +if ($Password) { + # Looks for a node. Create it if none is found. + $creds = $doc.DocumentElement.SelectSingleNode("packageSourceCredentials") + if ($creds -eq $null) { + $creds = $doc.CreateElement("packageSourceCredentials") + $doc.DocumentElement.AppendChild($creds) | Out-Null + } +} + # Check for disabledPackageSources; we'll enable any darc-int ones we find there $disabledSources = $doc.DocumentElement.SelectSingleNode("disabledPackageSources") -if ($null -ne $disabledSources) { +if ($disabledSources -ne $null) { Write-Host "Checking for any darc-int disabled package sources in the disabledPackageSources node" - EnableInternalPackageSources -DisabledPackageSources $disabledSources + EnablePrivatePackageSources -DisabledPackageSources $disabledSources } -if ($Password) { - InsertMaestroInternalFeedCredentials -Sources $sources -pwd $Password -} +$userName = "dn-bot" + +# Insert credential nodes for Maestro's private feeds +InsertMaestroPrivateFeedCredentials -Sources $sources -Creds $creds -Username $userName -pwd $Password # 3.1 uses a different feed url format so it's handled differently here $dotnet31Source = $sources.SelectSingleNode("add[@key='dotnet3.1']") -if ($null -ne $dotnet31Source) { - AddPackageSource -Sources $sources -SourceName "dotnet3.1-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal/nuget/v3/index.json" -pwd $Password - AddPackageSource -Sources $sources -SourceName "dotnet3.1-internal-transport" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal-transport/nuget/v3/index.json" -pwd $Password +if ($dotnet31Source -ne $null) { + AddPackageSource -Sources $sources -SourceName "dotnet3.1-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal/nuget/v2" -Creds $creds -Username $userName -pwd $Password + AddPackageSource -Sources $sources -SourceName "dotnet3.1-internal-transport" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal-transport/nuget/v2" -Creds $creds -Username $userName -pwd $Password } $dotnetVersions = @('5','6','7','8') @@ -133,18 +162,10 @@ $dotnetVersions = @('5','6','7','8') foreach ($dotnetVersion in $dotnetVersions) { $feedPrefix = "dotnet" + $dotnetVersion; $dotnetSource = $sources.SelectSingleNode("add[@key='$feedPrefix']") - if ($dotnetSource) { - AddPackageSource -Sources $sources -SourceName "$feedPrefix-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/$feedprefix-internal/nuget/v3/index.json" -pwd $Password - AddPackageSource -Sources $sources -SourceName "$feedPrefix-internal-transport" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/$feedPrefix-internal-transport/nuget/v3/index.json" -pwd $Password + if ($dotnetSource -ne $null) { + AddPackageSource -Sources $sources -SourceName "$feedPrefix-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/$feedPrefix-internal/nuget/v2" -Creds $creds -Username $userName -pwd $Password + AddPackageSource -Sources $sources -SourceName "$feedPrefix-internal-transport" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/$feedPrefix-internal-transport/nuget/v2" -Creds $creds -Username $userName -pwd $Password } } $doc.Save($filename) - -# If any credentials were added or altered, update the VSS_NUGET_EXTERNAL_FEED_ENDPOINTS environment variable -if ($null -ne $feedEndpoints) { - # ci is set to true so vso logging commands will be used. - $ci = $true - Write-PipelineSetVariable -Name 'VSS_NUGET_EXTERNAL_FEED_ENDPOINTS' -Value $($feedEndpoints | ConvertTo-Json) -IsMultiJobVariable $false - Write-PipelineSetVariable -Name 'NUGET_CREDENTIALPROVIDER_SESSIONTOKENCACHE_ENABLED' -Value "False" -IsMultiJobVariable $false -} \ No newline at end of file diff --git a/eng/common/SetupNugetSources.sh b/eng/common/SetupNugetSources.sh index 16c1e29ea3b..b493479a1da 100644 --- a/eng/common/SetupNugetSources.sh +++ b/eng/common/SetupNugetSources.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# This script adds internal feeds required to build commits that depend on intenral package sources. For instance, +# This script adds internal feeds required to build commits that depend on internal package sources. For instance, # dotnet6-internal would be added automatically if dotnet6 was found in the nuget.config file. In addition also enables # disabled internal Maestro (darc-int*) feeds. # diff --git a/eng/common/core-templates/steps/enable-internal-sources.yml b/eng/common/core-templates/steps/enable-internal-sources.yml index 80deddafb1b..4a06b529082 100644 --- a/eng/common/core-templates/steps/enable-internal-sources.yml +++ b/eng/common/core-templates/steps/enable-internal-sources.yml @@ -6,30 +6,40 @@ parameters: - name: is1ESPipeline type: boolean default: false +# Legacy parameters to allow for PAT usage +- name: legacyCredential + type: string + default: '' steps: - ${{ if ne(variables['System.TeamProject'], 'public') }}: - # If running on dnceng (internal project), just use the default behavior for NuGetAuthenticate. - # If running on DevDiv, NuGetAuthenticate is not really an option. It's scoped to a single feed, and we have many feeds that - # may be added. Instead, we'll use the traditional approach (add cred to nuget.config), but use an account token. - - ${{ if eq(variables['System.TeamProject'], 'internal') }}: + - ${{ if ne(parameters.legacyCredential, '') }}: - task: PowerShell@2 displayName: Setup Internal Feeds inputs: filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1 arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config - - task: NuGetAuthenticate@1 + # If running on dnceng (internal project), just use the default behavior for NuGetAuthenticate. + # If running on DevDiv, NuGetAuthenticate is not really an option. It's scoped to a single feed, and we have many feeds that + # may be added. Instead, we'll use the traditional approach (add cred to nuget.config), but use an account token. - ${{ else }}: - - template: /eng/common/templates/steps/get-federated-access-token.yml - parameters: - federatedServiceConnection: ${{ parameters.nugetFederatedServiceConnection }} - outputVariableName: 'dnceng-artifacts-feeds-read-access-token' - - task: PowerShell@2 - displayName: Setup Internal Feeds - inputs: - filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1 - arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config -Password $(dnceng-artifacts-feeds-read-access-token) - # This is required in certain scenarios to install the ADO credential provider. - # It installed by default in some msbuild invocations (e.g. VS msbuild), but needs to be installed for others - # (e.g. dotnet msbuild). - - task: NuGetAuthenticate@1 + - ${{ if eq(variables['System.TeamProject'], 'internal') }}: + - task: PowerShell@2 + displayName: Setup Internal Feeds + inputs: + filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1 + arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config + - ${{ else }}: + - template: /eng/common/templates/steps/get-federated-access-token.yml + parameters: + federatedServiceConnection: ${{ parameters.nugetFederatedServiceConnection }} + outputVariableName: 'dnceng-artifacts-feeds-read-access-token' + - task: PowerShell@2 + displayName: Setup Internal Feeds + inputs: + filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1 + arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config -Password $(dnceng-artifacts-feeds-read-access-token) + # This is required in certain scenarios to install the ADO credential provider. + # It installed by default in some msbuild invocations (e.g. VS msbuild), but needs to be installed for others + # (e.g. dotnet msbuild). + - task: NuGetAuthenticate@1 diff --git a/global.json b/global.json index 7ecae4f5df8..9844c4edeb7 100644 --- a/global.json +++ b/global.json @@ -31,7 +31,7 @@ }, "msbuild-sdks": { "Microsoft.Build.NoTargets": "3.7.0", - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24317.3", - "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24317.3" + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24320.6", + "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24320.6" } } From 2fd73054d81bbb1a6ec28b9d4396cc6f04c27663 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 21 Jun 2024 14:11:33 +0000 Subject: [PATCH 075/107] Update dependencies from https://github.com/dotnet/sdk build 20240621.2 (#6869) [feature/9.x] Update dependencies from dotnet/sdk - Coherency Updates: - Microsoft.AspNetCore.App.Runtime.win-x64: from 9.0.0-preview.6.24309.2 to 9.0.0-preview.6.24320.4 (parent: VS.Redist.Common.NetCore.SdkPlaceholder.x64.9.0) - Microsoft.NETCore.App.Runtime.win-x64: from 9.0.0-preview.6.24307.2 to 9.0.0-preview.6.24319.11 (parent: VS.Redist.Common.NetCore.SdkPlaceholder.x64.9.0) - VS.Redist.Common.AspNetCore.SharedFramework.x64.9.0: from 9.0.0-preview.6.24309.2 to 9.0.0-preview.6.24320.4 (parent: VS.Redist.Common.NetCore.SdkPlaceholder.x64.9.0) - VS.Redist.Common.NetCore.SharedFramework.x64.9.0: from 9.0.0-preview.6.24307.2 to 9.0.0-preview.6.24319.11 (parent: VS.Redist.Common.NetCore.SdkPlaceholder.x64.9.0) --- eng/Version.Details.xml | 20 ++++++++++---------- eng/Versions.props | 10 +++++----- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 282e92983fd..6bfb3968c56 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,8 +1,8 @@ - + https://github.com/dotnet/aspnetcore - 7f2dfb0020ff29ab57df31e910f2b2d5ef48bf82 + 613c1e990b6b6411bda84456aefe14fe8e194279 https://github.com/dotnet/diagnostics @@ -46,21 +46,21 @@ https://github.com/dotnet/diagnostics 464e06c9a8602dff44ff5c59e9a0c3777f68e41c - + https://github.com/dotnet/runtime - 8fac5af2b11dc98fa0504f6fd06df790164ec958 + 117cfccdd71abc164e6b933ca7602b509a1365dd - + https://github.com/dotnet/aspnetcore - 7f2dfb0020ff29ab57df31e910f2b2d5ef48bf82 + 613c1e990b6b6411bda84456aefe14fe8e194279 - + https://github.com/dotnet/sdk - f3ebfb5ccb1ca3b072cee5b8f52a9e1087b2ad11 + dda66101344d41c7e1040cd5bcadcb2166780197 - + https://github.com/dotnet/runtime - 8fac5af2b11dc98fa0504f6fd06df790164ec958 + 117cfccdd71abc164e6b933ca7602b509a1365dd diff --git a/eng/Versions.props b/eng/Versions.props index 9cf30c383b6..838b8f91205 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -52,8 +52,8 @@ 9.0.0-beta.24320.6 9.0.0-beta.24320.6 - 9.0.0-preview.6.24309.2 - 9.0.0-preview.6.24309.2 + 9.0.0-preview.6.24320.4 + 9.0.0-preview.6.24320.4 2.0.0-beta4.24209.3 @@ -62,10 +62,10 @@ 9.0.0-preview.24318.1 - 9.0.0-preview.6.24307.2 - 9.0.0-preview.6.24307.2 + 9.0.0-preview.6.24319.11 + 9.0.0-preview.6.24319.11 - 9.0.100-preview.6.24319.5 + 9.0.100-preview.6.24321.2 1.0.532002 From 4eae3f1e03c790616250da059b90c0bd69b3e7d7 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Sat, 22 Jun 2024 13:06:56 +0000 Subject: [PATCH 076/107] Update dependencies from https://github.com/dotnet/arcade build 20240621.3 (#6870) [main] Update dependencies from dotnet/arcade --- eng/Version.Details.xml | 20 ++++----- eng/Versions.props | 6 +-- .../templates-official/job/source-build.yml | 8 ++++ .../templates-official/jobs/source-build.yml | 8 ++++ .../steps/enable-internal-runtimes.yml | 28 ++++++++++++ .../steps/get-delegation-sas.yml | 43 +++++++++++++++++++ .../steps/get-federated-access-token.yml | 28 ++++++++++++ eng/common/templates/job/source-build.yml | 8 ++++ eng/common/templates/jobs/source-build.yml | 8 ++++ .../steps/enable-internal-runtimes.yml | 28 ++++++++++++ .../templates/steps/get-delegation-sas.yml | 43 +++++++++++++++++++ .../steps/get-federated-access-token.yml | 28 ++++++++++++ global.json | 4 +- 13 files changed, 245 insertions(+), 15 deletions(-) create mode 100644 eng/common/templates-official/steps/enable-internal-runtimes.yml create mode 100644 eng/common/templates-official/steps/get-delegation-sas.yml create mode 100644 eng/common/templates-official/steps/get-federated-access-token.yml create mode 100644 eng/common/templates/steps/enable-internal-runtimes.yml create mode 100644 eng/common/templates/steps/get-delegation-sas.yml create mode 100644 eng/common/templates/steps/get-federated-access-token.yml diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index fff17b84712..1a1edf98931 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -22,29 +22,29 @@ https://github.com/dotnet/roslyn-analyzers b4d9a1334d5189172977ba8fddd00bda70161e4a - + https://github.com/dotnet/arcade - c214b6ad17aedca4fa48294d80f6c52ef2463081 + a95bcc256e9bdf47394e4dab04872811c16daaea - + https://github.com/dotnet/arcade - c214b6ad17aedca4fa48294d80f6c52ef2463081 + a95bcc256e9bdf47394e4dab04872811c16daaea - + https://github.com/dotnet/arcade - c214b6ad17aedca4fa48294d80f6c52ef2463081 + a95bcc256e9bdf47394e4dab04872811c16daaea - + https://github.com/dotnet/arcade - c214b6ad17aedca4fa48294d80f6c52ef2463081 + a95bcc256e9bdf47394e4dab04872811c16daaea https://github.com/dotnet/installer 68e8abb1d3e1a240a6e4c29dcd220aae91681676 - + https://github.com/dotnet/arcade - c214b6ad17aedca4fa48294d80f6c52ef2463081 + a95bcc256e9bdf47394e4dab04872811c16daaea https://github.com/dotnet/diagnostics diff --git a/eng/Versions.props b/eng/Versions.props index af04c3eae21..8ed860bff1f 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -48,9 +48,9 @@ --> - 8.0.0-beta.24311.3 - 8.0.0-beta.24311.3 - 8.0.0-beta.24311.3 + 8.0.0-beta.24321.3 + 8.0.0-beta.24321.3 + 8.0.0-beta.24321.3 8.0.1 8.0.1-servicing.23580.8 diff --git a/eng/common/templates-official/job/source-build.yml b/eng/common/templates-official/job/source-build.yml index f193dfbe236..f983033bb02 100644 --- a/eng/common/templates-official/job/source-build.yml +++ b/eng/common/templates-official/job/source-build.yml @@ -31,6 +31,12 @@ parameters: # container and pool. platform: {} + # If set to true and running on a non-public project, + # Internal blob storage locations will be enabled. + # This is not enabled by default because many repositories do not need internal sources + # and do not need to have the required service connections approved in the pipeline. + enableInternalSources: false + jobs: - job: ${{ parameters.jobNamePrefix }}_${{ parameters.platform.name }} displayName: Source-Build (${{ parameters.platform.name }}) @@ -62,6 +68,8 @@ jobs: clean: all steps: + - ${{ if eq(parameters.enableInternalSources, true) }}: + - template: /eng/common/templates-official/steps/enable-internal-runtimes.yml - template: /eng/common/templates-official/steps/source-build.yml parameters: platform: ${{ parameters.platform }} diff --git a/eng/common/templates-official/jobs/source-build.yml b/eng/common/templates-official/jobs/source-build.yml index 08e5db9bb11..5cf6a269c0b 100644 --- a/eng/common/templates-official/jobs/source-build.yml +++ b/eng/common/templates-official/jobs/source-build.yml @@ -21,6 +21,12 @@ parameters: # one job runs on 'defaultManagedPlatform'. platforms: [] + # If set to true and running on a non-public project, + # Internal nuget and blob storage locations will be enabled. + # This is not enabled by default because many repositories do not need internal sources + # and do not need to have the required service connections approved in the pipeline. + enableInternalSources: false + jobs: - ${{ if ne(parameters.allCompletedJobId, '') }}: @@ -38,9 +44,11 @@ jobs: parameters: jobNamePrefix: ${{ parameters.jobNamePrefix }} platform: ${{ platform }} + enableInternalSources: ${{ parameters.enableInternalSources }} - ${{ if eq(length(parameters.platforms), 0) }}: - template: /eng/common/templates-official/job/source-build.yml parameters: jobNamePrefix: ${{ parameters.jobNamePrefix }} platform: ${{ parameters.defaultManagedPlatform }} + enableInternalSources: ${{ parameters.enableInternalSources }} diff --git a/eng/common/templates-official/steps/enable-internal-runtimes.yml b/eng/common/templates-official/steps/enable-internal-runtimes.yml new file mode 100644 index 00000000000..93a8394a666 --- /dev/null +++ b/eng/common/templates-official/steps/enable-internal-runtimes.yml @@ -0,0 +1,28 @@ +# Obtains internal runtime download credentials and populates the 'dotnetbuilds-internal-container-read-token-base64' +# variable with the base64-encoded SAS token, by default + +parameters: +- name: federatedServiceConnection + type: string + default: 'dotnetbuilds-internal-read' +- name: outputVariableName + type: string + default: 'dotnetbuilds-internal-container-read-token-base64' +- name: expiryInHours + type: number + default: 1 +- name: base64Encode + type: boolean + default: true + +steps: +- ${{ if ne(variables['System.TeamProject'], 'public') }}: + - template: /eng/common/templates-official/steps/get-delegation-sas.yml + parameters: + federatedServiceConnection: ${{ parameters.federatedServiceConnection }} + outputVariableName: ${{ parameters.outputVariableName }} + expiryInHours: ${{ parameters.expiryInHours }} + base64Encode: ${{ parameters.base64Encode }} + storageAccount: dotnetbuilds + container: internal + permissions: rl diff --git a/eng/common/templates-official/steps/get-delegation-sas.yml b/eng/common/templates-official/steps/get-delegation-sas.yml new file mode 100644 index 00000000000..c0e8f91317f --- /dev/null +++ b/eng/common/templates-official/steps/get-delegation-sas.yml @@ -0,0 +1,43 @@ +parameters: +- name: federatedServiceConnection + type: string +- name: outputVariableName + type: string +- name: expiryInHours + type: number + default: 1 +- name: base64Encode + type: boolean + default: false +- name: storageAccount + type: string +- name: container + type: string +- name: permissions + type: string + default: 'rl' + +steps: +- task: AzureCLI@2 + displayName: 'Generate delegation SAS Token for ${{ parameters.storageAccount }}/${{ parameters.container }}' + inputs: + azureSubscription: ${{ parameters.federatedServiceConnection }} + scriptType: 'pscore' + scriptLocation: 'inlineScript' + inlineScript: | + # Calculate the expiration of the SAS token and convert to UTC + $expiry = (Get-Date).AddHours(${{ parameters.expiryInHours }}).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ") + + $sas = az storage container generate-sas --account-name ${{ parameters.storageAccount }} --name ${{ parameters.container }} --permissions ${{ parameters.permissions }} --expiry $expiry --auth-mode login --as-user -o tsv + + if ($LASTEXITCODE -ne 0) { + Write-Error "Failed to generate SAS token." + exit 1 + } + + if ('${{ parameters.base64Encode }}' -eq 'true') { + $sas = [Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes($sas)) + } + + Write-Host "Setting '${{ parameters.outputVariableName }}' with the access token value" + Write-Host "##vso[task.setvariable variable=${{ parameters.outputVariableName }};issecret=true]$sas" diff --git a/eng/common/templates-official/steps/get-federated-access-token.yml b/eng/common/templates-official/steps/get-federated-access-token.yml new file mode 100644 index 00000000000..e3786cef6df --- /dev/null +++ b/eng/common/templates-official/steps/get-federated-access-token.yml @@ -0,0 +1,28 @@ +parameters: +- name: federatedServiceConnection + type: string +- name: outputVariableName + type: string +# Resource to get a token for. Common values include: +# - '499b84ac-1321-427f-aa17-267ca6975798' for Azure DevOps +# - 'https://storage.azure.com/' for storage +# Defaults to Azure DevOps +- name: resource + type: string + default: '499b84ac-1321-427f-aa17-267ca6975798' + +steps: +- task: AzureCLI@2 + displayName: 'Getting federated access token for feeds' + inputs: + azureSubscription: ${{ parameters.federatedServiceConnection }} + scriptType: 'pscore' + scriptLocation: 'inlineScript' + inlineScript: | + $accessToken = az account get-access-token --query accessToken --resource ${{ parameters.resource }} --output tsv + if ($LASTEXITCODE -ne 0) { + Write-Error "Failed to get access token for resource '${{ parameters.resource }}'" + exit 1 + } + Write-Host "Setting '${{ parameters.outputVariableName }}' with the access token value" + Write-Host "##vso[task.setvariable variable=${{ parameters.outputVariableName }};issecret=true]$accessToken" diff --git a/eng/common/templates/job/source-build.yml b/eng/common/templates/job/source-build.yml index 8a3deef2b72..c0ff472b697 100644 --- a/eng/common/templates/job/source-build.yml +++ b/eng/common/templates/job/source-build.yml @@ -31,6 +31,12 @@ parameters: # container and pool. platform: {} + # If set to true and running on a non-public project, + # Internal blob storage locations will be enabled. + # This is not enabled by default because many repositories do not need internal sources + # and do not need to have the required service connections approved in the pipeline. + enableInternalSources: false + jobs: - job: ${{ parameters.jobNamePrefix }}_${{ parameters.platform.name }} displayName: Source-Build (${{ parameters.platform.name }}) @@ -61,6 +67,8 @@ jobs: clean: all steps: + - ${{ if eq(parameters.enableInternalSources, true) }}: + - template: /eng/common/templates/steps/enable-internal-runtimes.yml - template: /eng/common/templates/steps/source-build.yml parameters: platform: ${{ parameters.platform }} diff --git a/eng/common/templates/jobs/source-build.yml b/eng/common/templates/jobs/source-build.yml index a15b07eb51d..5f46bfa895c 100644 --- a/eng/common/templates/jobs/source-build.yml +++ b/eng/common/templates/jobs/source-build.yml @@ -21,6 +21,12 @@ parameters: # one job runs on 'defaultManagedPlatform'. platforms: [] + # If set to true and running on a non-public project, + # Internal nuget and blob storage locations will be enabled. + # This is not enabled by default because many repositories do not need internal sources + # and do not need to have the required service connections approved in the pipeline. + enableInternalSources: false + jobs: - ${{ if ne(parameters.allCompletedJobId, '') }}: @@ -38,9 +44,11 @@ jobs: parameters: jobNamePrefix: ${{ parameters.jobNamePrefix }} platform: ${{ platform }} + enableInternalSources: ${{ parameters.enableInternalSources }} - ${{ if eq(length(parameters.platforms), 0) }}: - template: /eng/common/templates/job/source-build.yml parameters: jobNamePrefix: ${{ parameters.jobNamePrefix }} platform: ${{ parameters.defaultManagedPlatform }} + enableInternalSources: ${{ parameters.enableInternalSources }} diff --git a/eng/common/templates/steps/enable-internal-runtimes.yml b/eng/common/templates/steps/enable-internal-runtimes.yml new file mode 100644 index 00000000000..54dc9416c51 --- /dev/null +++ b/eng/common/templates/steps/enable-internal-runtimes.yml @@ -0,0 +1,28 @@ +# Obtains internal runtime download credentials and populates the 'dotnetbuilds-internal-container-read-token-base64' +# variable with the base64-encoded SAS token, by default + +parameters: +- name: federatedServiceConnection + type: string + default: 'dotnetbuilds-internal-read' +- name: outputVariableName + type: string + default: 'dotnetbuilds-internal-container-read-token-base64' +- name: expiryInHours + type: number + default: 1 +- name: base64Encode + type: boolean + default: true + +steps: +- ${{ if ne(variables['System.TeamProject'], 'public') }}: + - template: /eng/common/templates/steps/get-delegation-sas.yml + parameters: + federatedServiceConnection: ${{ parameters.federatedServiceConnection }} + outputVariableName: ${{ parameters.outputVariableName }} + expiryInHours: ${{ parameters.expiryInHours }} + base64Encode: ${{ parameters.base64Encode }} + storageAccount: dotnetbuilds + container: internal + permissions: rl diff --git a/eng/common/templates/steps/get-delegation-sas.yml b/eng/common/templates/steps/get-delegation-sas.yml new file mode 100644 index 00000000000..c0e8f91317f --- /dev/null +++ b/eng/common/templates/steps/get-delegation-sas.yml @@ -0,0 +1,43 @@ +parameters: +- name: federatedServiceConnection + type: string +- name: outputVariableName + type: string +- name: expiryInHours + type: number + default: 1 +- name: base64Encode + type: boolean + default: false +- name: storageAccount + type: string +- name: container + type: string +- name: permissions + type: string + default: 'rl' + +steps: +- task: AzureCLI@2 + displayName: 'Generate delegation SAS Token for ${{ parameters.storageAccount }}/${{ parameters.container }}' + inputs: + azureSubscription: ${{ parameters.federatedServiceConnection }} + scriptType: 'pscore' + scriptLocation: 'inlineScript' + inlineScript: | + # Calculate the expiration of the SAS token and convert to UTC + $expiry = (Get-Date).AddHours(${{ parameters.expiryInHours }}).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ") + + $sas = az storage container generate-sas --account-name ${{ parameters.storageAccount }} --name ${{ parameters.container }} --permissions ${{ parameters.permissions }} --expiry $expiry --auth-mode login --as-user -o tsv + + if ($LASTEXITCODE -ne 0) { + Write-Error "Failed to generate SAS token." + exit 1 + } + + if ('${{ parameters.base64Encode }}' -eq 'true') { + $sas = [Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes($sas)) + } + + Write-Host "Setting '${{ parameters.outputVariableName }}' with the access token value" + Write-Host "##vso[task.setvariable variable=${{ parameters.outputVariableName }};issecret=true]$sas" diff --git a/eng/common/templates/steps/get-federated-access-token.yml b/eng/common/templates/steps/get-federated-access-token.yml new file mode 100644 index 00000000000..c8c49cc0e8f --- /dev/null +++ b/eng/common/templates/steps/get-federated-access-token.yml @@ -0,0 +1,28 @@ +parameters: +- name: federatedServiceConnection + type: string +- name: outputVariableName + type: string +# Resource to get a token for. Common values include: +# - '499b84ac-1321-427f-aa17-267ca6975798' for Azure DevOps +# - 'https://storage.azure.com/' for storage +# Defaults to Azure DevOps +- name: resource + type: string + default: '499b84ac-1321-427f-aa17-267ca6975798' + +steps: +- task: AzureCLI@2 + displayName: 'Getting federated access token for feeds' + inputs: + azureSubscription: ${{ parameters.federatedServiceConnection }} + scriptType: 'pscore' + scriptLocation: 'inlineScript' + inlineScript: | + $accessToken = az account get-access-token --query accessToken --resource ${{ parameters.resource }} --output tsv + if ($LASTEXITCODE -ne 0) { + Write-Error "Failed to get access token for resource '${{ parameters.resource }}'" + exit 1 + } + Write-Host "Setting '${{ parameters.outputVariableName }}' with the access token value" + Write-Host "##vso[task.setvariable variable=${{ parameters.outputVariableName }};issecret=true]$accessToken" \ No newline at end of file diff --git a/global.json b/global.json index cfba65ba79a..3c696a7ea05 100644 --- a/global.json +++ b/global.json @@ -26,7 +26,7 @@ }, "msbuild-sdks": { "Microsoft.Build.NoTargets": "3.7.0", - "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24311.3", - "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.24311.3" + "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24321.3", + "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.24321.3" } } From c1a6401994cda9ebd082fabc8811a2ed8a2f03d1 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Sat, 22 Jun 2024 14:05:51 +0000 Subject: [PATCH 077/107] Update dependencies from https://github.com/dotnet/arcade build 20240621.4 (#6871) [feature/9.x] Update dependencies from dotnet/arcade --- eng/Version.Details.xml | 20 ++++----- eng/Versions.props | 6 +-- .../job/publish-build-assets.yml | 9 ++-- .../post-build/common-variables.yml | 2 - .../core-templates/post-build/post-build.yml | 8 ++-- .../post-build/setup-maestro-vars.yml | 30 +++++++------- .../steps/component-governance.yml | 4 +- .../core-templates/steps/source-build.yml | 10 +++-- eng/common/cross/arm/sources.list.bionic | 11 ----- eng/common/cross/arm/sources.list.focal | 11 ----- eng/common/cross/arm/sources.list.jammy | 11 ----- eng/common/cross/arm/sources.list.jessie | 3 -- eng/common/cross/arm/sources.list.xenial | 11 ----- eng/common/cross/arm/sources.list.zesty | 11 ----- eng/common/cross/arm64/sources.list.bionic | 11 ----- eng/common/cross/arm64/sources.list.buster | 11 ----- eng/common/cross/arm64/sources.list.focal | 11 ----- eng/common/cross/arm64/sources.list.jammy | 11 ----- eng/common/cross/arm64/sources.list.stretch | 12 ------ eng/common/cross/arm64/sources.list.xenial | 11 ----- eng/common/cross/arm64/sources.list.zesty | 11 ----- eng/common/cross/armel/sources.list.jessie | 3 -- eng/common/cross/armv6/sources.list.bookworm | 2 - eng/common/cross/armv6/sources.list.buster | 2 - eng/common/cross/build-rootfs.sh | 41 ++++++++++++++----- eng/common/cross/ppc64le/sources.list.bionic | 11 ----- eng/common/cross/riscv64/sources.list.noble | 11 ----- eng/common/cross/riscv64/sources.list.sid | 1 - eng/common/cross/s390x/sources.list.bionic | 11 ----- eng/common/cross/x86/sources.list.bionic | 11 ----- eng/common/cross/x86/sources.list.focal | 11 ----- eng/common/cross/x86/sources.list.jammy | 11 ----- eng/common/cross/x86/sources.list.xenial | 11 ----- eng/common/post-build/publish-using-darc.ps1 | 16 ++++---- global.json | 4 +- 35 files changed, 86 insertions(+), 285 deletions(-) delete mode 100644 eng/common/cross/arm/sources.list.bionic delete mode 100644 eng/common/cross/arm/sources.list.focal delete mode 100644 eng/common/cross/arm/sources.list.jammy delete mode 100644 eng/common/cross/arm/sources.list.jessie delete mode 100644 eng/common/cross/arm/sources.list.xenial delete mode 100644 eng/common/cross/arm/sources.list.zesty delete mode 100644 eng/common/cross/arm64/sources.list.bionic delete mode 100644 eng/common/cross/arm64/sources.list.buster delete mode 100644 eng/common/cross/arm64/sources.list.focal delete mode 100644 eng/common/cross/arm64/sources.list.jammy delete mode 100644 eng/common/cross/arm64/sources.list.stretch delete mode 100644 eng/common/cross/arm64/sources.list.xenial delete mode 100644 eng/common/cross/arm64/sources.list.zesty delete mode 100644 eng/common/cross/armel/sources.list.jessie delete mode 100644 eng/common/cross/armv6/sources.list.bookworm delete mode 100644 eng/common/cross/armv6/sources.list.buster delete mode 100644 eng/common/cross/ppc64le/sources.list.bionic delete mode 100644 eng/common/cross/riscv64/sources.list.noble delete mode 100644 eng/common/cross/riscv64/sources.list.sid delete mode 100644 eng/common/cross/s390x/sources.list.bionic delete mode 100644 eng/common/cross/x86/sources.list.bionic delete mode 100644 eng/common/cross/x86/sources.list.focal delete mode 100644 eng/common/cross/x86/sources.list.jammy delete mode 100644 eng/common/cross/x86/sources.list.xenial diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 6bfb3968c56..68453b23a77 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -22,25 +22,25 @@ https://github.com/dotnet/roslyn-analyzers f1115edce8633ebe03a86191bc05c6969ed9a821 - + https://github.com/dotnet/arcade - bfd4f951527e37d08f16f5cff09173943061601e + 3aba80fecac252e1cdaffcebc0a37a24a960228b - + https://github.com/dotnet/arcade - bfd4f951527e37d08f16f5cff09173943061601e + 3aba80fecac252e1cdaffcebc0a37a24a960228b - + https://github.com/dotnet/arcade - bfd4f951527e37d08f16f5cff09173943061601e + 3aba80fecac252e1cdaffcebc0a37a24a960228b - + https://github.com/dotnet/arcade - bfd4f951527e37d08f16f5cff09173943061601e + 3aba80fecac252e1cdaffcebc0a37a24a960228b - + https://github.com/dotnet/arcade - bfd4f951527e37d08f16f5cff09173943061601e + 3aba80fecac252e1cdaffcebc0a37a24a960228b https://github.com/dotnet/diagnostics diff --git a/eng/Versions.props b/eng/Versions.props index 838b8f91205..62a06c046a5 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -48,9 +48,9 @@ --> - 9.0.0-beta.24320.6 - 9.0.0-beta.24320.6 - 9.0.0-beta.24320.6 + 9.0.0-beta.24321.4 + 9.0.0-beta.24321.4 + 9.0.0-beta.24321.4 9.0.0-preview.6.24320.4 9.0.0-preview.6.24320.4 diff --git a/eng/common/core-templates/job/publish-build-assets.yml b/eng/common/core-templates/job/publish-build-assets.yml index 8fe9299542c..2cf8e1853d0 100644 --- a/eng/common/core-templates/job/publish-build-assets.yml +++ b/eng/common/core-templates/job/publish-build-assets.yml @@ -87,13 +87,15 @@ jobs: - task: NuGetAuthenticate@1 - - task: PowerShell@2 + - task: AzureCLI@2 displayName: Publish Build Assets inputs: - filePath: eng\common\sdk-task.ps1 + azureSubscription: "Darc: Maestro Production" + scriptType: ps + scriptLocation: scriptPath + scriptPath: $(Build.SourcesDirectory)/eng/common/sdk-task.ps1 arguments: -task PublishBuildAssets -restore -msbuildEngine dotnet /p:ManifestsPath='$(Build.StagingDirectory)/Download/AssetManifests' - /p:BuildAssetRegistryToken=$(MaestroAccessToken) /p:MaestroApiEndpoint=https://maestro.dot.net /p:PublishUsingPipelines=${{ parameters.publishUsingPipelines }} /p:OfficialBuildId=$(Build.BuildNumber) @@ -160,7 +162,6 @@ jobs: arguments: -BuildId $(BARBuildId) -PublishingInfraVersion 3 -AzdoToken '$(publishing-dnceng-devdiv-code-r-build-re)' - -MaestroToken '$(MaestroApiAccessToken)' -WaitPublishingFinish true -ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}' -SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}' diff --git a/eng/common/core-templates/post-build/common-variables.yml b/eng/common/core-templates/post-build/common-variables.yml index b9ede10bf09..d5627a994ae 100644 --- a/eng/common/core-templates/post-build/common-variables.yml +++ b/eng/common/core-templates/post-build/common-variables.yml @@ -8,8 +8,6 @@ variables: # Default Maestro++ API Endpoint and API Version - name: MaestroApiEndPoint value: "https://maestro.dot.net" - - name: MaestroApiAccessToken - value: $(MaestroAccessToken) - name: MaestroApiVersion value: "2020-02-20" diff --git a/eng/common/core-templates/post-build/post-build.yml b/eng/common/core-templates/post-build/post-build.yml index fb15c40c03d..20924366b8a 100644 --- a/eng/common/core-templates/post-build/post-build.yml +++ b/eng/common/core-templates/post-build/post-build.yml @@ -300,14 +300,16 @@ stages: - task: NuGetAuthenticate@1 - - task: PowerShell@2 + - task: AzureCLI@2 displayName: Publish Using Darc inputs: - filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1 + azureSubscription: "Darc: Maestro Production" + scriptType: ps + scriptLocation: scriptPath + scriptPath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1 arguments: -BuildId $(BARBuildId) -PublishingInfraVersion ${{ parameters.publishingInfraVersion }} -AzdoToken '$(publishing-dnceng-devdiv-code-r-build-re)' - -MaestroToken '$(MaestroApiAccessToken)' -WaitPublishingFinish true -ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}' -SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}' diff --git a/eng/common/core-templates/post-build/setup-maestro-vars.yml b/eng/common/core-templates/post-build/setup-maestro-vars.yml index 8d56b572679..f7602980dbe 100644 --- a/eng/common/core-templates/post-build/setup-maestro-vars.yml +++ b/eng/common/core-templates/post-build/setup-maestro-vars.yml @@ -15,19 +15,20 @@ steps: artifactName: ReleaseConfigs checkDownloadedFiles: true - - task: PowerShell@2 + - task: AzureCLI@2 name: setReleaseVars displayName: Set Release Configs Vars inputs: - targetType: inline - pwsh: true - script: | + azureSubscription: "Darc: Maestro Production" + scriptType: pscore + scriptLocation: inlineScript + inlineScript: | try { if (!$Env:PromoteToMaestroChannels -or $Env:PromoteToMaestroChannels.Trim() -eq '') { $Content = Get-Content $(Build.StagingDirectory)/ReleaseConfigs/ReleaseConfigs.txt $BarId = $Content | Select -Index 0 - $Channels = $Content | Select -Index 1 + $Channels = $Content | Select -Index 1 $IsStableBuild = $Content | Select -Index 2 $AzureDevOpsProject = $Env:System_TeamProject @@ -35,15 +36,16 @@ steps: $AzureDevOpsBuildId = $Env:Build_BuildId } else { - $buildApiEndpoint = "${Env:MaestroApiEndPoint}/api/builds/${Env:BARBuildId}?api-version=${Env:MaestroApiVersion}" + . $(Build.SourcesDirectory)\eng\common\tools.ps1 + $darc = Get-Darc + $buildInfo = & $darc get-build ` + --id ${{ parameters.BARBuildId }} ` + --extended ` + --output-format json ` + --ci ` + | convertFrom-Json - $apiHeaders = New-Object 'System.Collections.Generic.Dictionary[[String],[String]]' - $apiHeaders.Add('Accept', 'application/json') - $apiHeaders.Add('Authorization',"Bearer ${Env:MAESTRO_API_TOKEN}") - - $buildInfo = try { Invoke-WebRequest -Method Get -Uri $buildApiEndpoint -Headers $apiHeaders | ConvertFrom-Json } catch { Write-Host "Error: $_" } - - $BarId = $Env:BARBuildId + $BarId = ${{ parameters.BARBuildId }} $Channels = $Env:PromoteToMaestroChannels -split "," $Channels = $Channels -join "][" $Channels = "[$Channels]" @@ -69,6 +71,4 @@ steps: exit 1 } env: - MAESTRO_API_TOKEN: $(MaestroApiAccessToken) - BARBuildId: ${{ parameters.BARBuildId }} PromoteToMaestroChannels: ${{ parameters.PromoteToChannelIds }} diff --git a/eng/common/core-templates/steps/component-governance.yml b/eng/common/core-templates/steps/component-governance.yml index df449a34c11..b8815892a5e 100644 --- a/eng/common/core-templates/steps/component-governance.yml +++ b/eng/common/core-templates/steps/component-governance.yml @@ -2,7 +2,8 @@ parameters: disableComponentGovernance: false componentGovernanceIgnoreDirectories: '' is1ESPipeline: false - + displayName: 'Component Detection' + steps: - ${{ if eq(parameters.disableComponentGovernance, 'true') }}: - script: echo "##vso[task.setvariable variable=skipComponentGovernanceDetection]true" @@ -10,5 +11,6 @@ steps: - ${{ if ne(parameters.disableComponentGovernance, 'true') }}: - task: ComponentGovernanceComponentDetection@0 continueOnError: true + displayName: ${{ parameters.displayName }} inputs: ignoreDirectories: ${{ parameters.componentGovernanceIgnoreDirectories }} \ No newline at end of file diff --git a/eng/common/core-templates/steps/source-build.yml b/eng/common/core-templates/steps/source-build.yml index 16c778d92cb..2915d29bb7f 100644 --- a/eng/common/core-templates/steps/source-build.yml +++ b/eng/common/core-templates/steps/source-build.yml @@ -121,7 +121,9 @@ steps: # a nupkg cache of input packages (a local feed). # This path must match the upstream cache path in property 'CurrentRepoSourceBuiltNupkgCacheDir' # in src\Microsoft.DotNet.Arcade.Sdk\tools\SourceBuild\SourceBuildArcade.targets -- task: ComponentGovernanceComponentDetection@0 - displayName: Component Detection (Exclude upstream cache) - inputs: - ignoreDirectories: '$(Build.SourcesDirectory)/artifacts/sb/src/artifacts/obj/source-built-upstream-cache' +- template: /eng/common/core-templates/steps/component-governance.yml + parameters: + displayName: Component Detection (Exclude upstream cache) + is1ESPipeline: ${{ parameters.is1ESPipeline }} + componentGovernanceIgnoreDirectories: '$(Build.SourcesDirectory)/artifacts/sb/src/artifacts/obj/source-built-upstream-cache' + disableComponentGovernance: ${{ eq(variables['System.TeamProject'], 'public') }} diff --git a/eng/common/cross/arm/sources.list.bionic b/eng/common/cross/arm/sources.list.bionic deleted file mode 100644 index 21095574095..00000000000 --- a/eng/common/cross/arm/sources.list.bionic +++ /dev/null @@ -1,11 +0,0 @@ -deb http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted universe -deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted universe - -deb http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted universe -deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted universe - -deb http://ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted -deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted - -deb http://ports.ubuntu.com/ubuntu-ports/ bionic-security main restricted universe multiverse -deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-security main restricted universe multiverse diff --git a/eng/common/cross/arm/sources.list.focal b/eng/common/cross/arm/sources.list.focal deleted file mode 100644 index 4de2600c174..00000000000 --- a/eng/common/cross/arm/sources.list.focal +++ /dev/null @@ -1,11 +0,0 @@ -deb http://ports.ubuntu.com/ubuntu-ports/ focal main restricted universe -deb-src http://ports.ubuntu.com/ubuntu-ports/ focal main restricted universe - -deb http://ports.ubuntu.com/ubuntu-ports/ focal-updates main restricted universe -deb-src http://ports.ubuntu.com/ubuntu-ports/ focal-updates main restricted universe - -deb http://ports.ubuntu.com/ubuntu-ports/ focal-backports main restricted -deb-src http://ports.ubuntu.com/ubuntu-ports/ focal-backports main restricted - -deb http://ports.ubuntu.com/ubuntu-ports/ focal-security main restricted universe multiverse -deb-src http://ports.ubuntu.com/ubuntu-ports/ focal-security main restricted universe multiverse diff --git a/eng/common/cross/arm/sources.list.jammy b/eng/common/cross/arm/sources.list.jammy deleted file mode 100644 index 6bb0453029c..00000000000 --- a/eng/common/cross/arm/sources.list.jammy +++ /dev/null @@ -1,11 +0,0 @@ -deb http://ports.ubuntu.com/ubuntu-ports/ jammy main restricted universe -deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy main restricted universe - -deb http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted universe -deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted universe - -deb http://ports.ubuntu.com/ubuntu-ports/ jammy-backports main restricted -deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-backports main restricted - -deb http://ports.ubuntu.com/ubuntu-ports/ jammy-security main restricted universe multiverse -deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-security main restricted universe multiverse diff --git a/eng/common/cross/arm/sources.list.jessie b/eng/common/cross/arm/sources.list.jessie deleted file mode 100644 index 4d142ac9b10..00000000000 --- a/eng/common/cross/arm/sources.list.jessie +++ /dev/null @@ -1,3 +0,0 @@ -# Debian (sid) # UNSTABLE -deb http://ftp.debian.org/debian/ sid main contrib non-free -deb-src http://ftp.debian.org/debian/ sid main contrib non-free diff --git a/eng/common/cross/arm/sources.list.xenial b/eng/common/cross/arm/sources.list.xenial deleted file mode 100644 index 56fbb36a59f..00000000000 --- a/eng/common/cross/arm/sources.list.xenial +++ /dev/null @@ -1,11 +0,0 @@ -deb http://ports.ubuntu.com/ubuntu-ports/ xenial main restricted universe -deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial main restricted universe - -deb http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main restricted universe -deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main restricted universe - -deb http://ports.ubuntu.com/ubuntu-ports/ xenial-backports main restricted -deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-backports main restricted - -deb http://ports.ubuntu.com/ubuntu-ports/ xenial-security main restricted universe multiverse -deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-security main restricted universe multiverse diff --git a/eng/common/cross/arm/sources.list.zesty b/eng/common/cross/arm/sources.list.zesty deleted file mode 100644 index ea2c14a7874..00000000000 --- a/eng/common/cross/arm/sources.list.zesty +++ /dev/null @@ -1,11 +0,0 @@ -deb http://ports.ubuntu.com/ubuntu-ports/ zesty main restricted universe -deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty main restricted universe - -deb http://ports.ubuntu.com/ubuntu-ports/ zesty-updates main restricted universe -deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty-updates main restricted universe - -deb http://ports.ubuntu.com/ubuntu-ports/ zesty-backports main restricted -deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty-backports main restricted - -deb http://ports.ubuntu.com/ubuntu-ports/ zesty-security main restricted universe multiverse -deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty-security main restricted universe multiverse diff --git a/eng/common/cross/arm64/sources.list.bionic b/eng/common/cross/arm64/sources.list.bionic deleted file mode 100644 index 21095574095..00000000000 --- a/eng/common/cross/arm64/sources.list.bionic +++ /dev/null @@ -1,11 +0,0 @@ -deb http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted universe -deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted universe - -deb http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted universe -deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted universe - -deb http://ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted -deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted - -deb http://ports.ubuntu.com/ubuntu-ports/ bionic-security main restricted universe multiverse -deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-security main restricted universe multiverse diff --git a/eng/common/cross/arm64/sources.list.buster b/eng/common/cross/arm64/sources.list.buster deleted file mode 100644 index 7194ac64a96..00000000000 --- a/eng/common/cross/arm64/sources.list.buster +++ /dev/null @@ -1,11 +0,0 @@ -deb http://deb.debian.org/debian buster main -deb-src http://deb.debian.org/debian buster main - -deb http://deb.debian.org/debian-security/ buster/updates main -deb-src http://deb.debian.org/debian-security/ buster/updates main - -deb http://deb.debian.org/debian buster-updates main -deb-src http://deb.debian.org/debian buster-updates main - -deb http://deb.debian.org/debian buster-backports main contrib non-free -deb-src http://deb.debian.org/debian buster-backports main contrib non-free diff --git a/eng/common/cross/arm64/sources.list.focal b/eng/common/cross/arm64/sources.list.focal deleted file mode 100644 index 4de2600c174..00000000000 --- a/eng/common/cross/arm64/sources.list.focal +++ /dev/null @@ -1,11 +0,0 @@ -deb http://ports.ubuntu.com/ubuntu-ports/ focal main restricted universe -deb-src http://ports.ubuntu.com/ubuntu-ports/ focal main restricted universe - -deb http://ports.ubuntu.com/ubuntu-ports/ focal-updates main restricted universe -deb-src http://ports.ubuntu.com/ubuntu-ports/ focal-updates main restricted universe - -deb http://ports.ubuntu.com/ubuntu-ports/ focal-backports main restricted -deb-src http://ports.ubuntu.com/ubuntu-ports/ focal-backports main restricted - -deb http://ports.ubuntu.com/ubuntu-ports/ focal-security main restricted universe multiverse -deb-src http://ports.ubuntu.com/ubuntu-ports/ focal-security main restricted universe multiverse diff --git a/eng/common/cross/arm64/sources.list.jammy b/eng/common/cross/arm64/sources.list.jammy deleted file mode 100644 index 6bb0453029c..00000000000 --- a/eng/common/cross/arm64/sources.list.jammy +++ /dev/null @@ -1,11 +0,0 @@ -deb http://ports.ubuntu.com/ubuntu-ports/ jammy main restricted universe -deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy main restricted universe - -deb http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted universe -deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted universe - -deb http://ports.ubuntu.com/ubuntu-ports/ jammy-backports main restricted -deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-backports main restricted - -deb http://ports.ubuntu.com/ubuntu-ports/ jammy-security main restricted universe multiverse -deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-security main restricted universe multiverse diff --git a/eng/common/cross/arm64/sources.list.stretch b/eng/common/cross/arm64/sources.list.stretch deleted file mode 100644 index 0e121577436..00000000000 --- a/eng/common/cross/arm64/sources.list.stretch +++ /dev/null @@ -1,12 +0,0 @@ -deb http://deb.debian.org/debian stretch main -deb-src http://deb.debian.org/debian stretch main - -deb http://deb.debian.org/debian-security/ stretch/updates main -deb-src http://deb.debian.org/debian-security/ stretch/updates main - -deb http://deb.debian.org/debian stretch-updates main -deb-src http://deb.debian.org/debian stretch-updates main - -deb http://deb.debian.org/debian stretch-backports main contrib non-free -deb-src http://deb.debian.org/debian stretch-backports main contrib non-free - diff --git a/eng/common/cross/arm64/sources.list.xenial b/eng/common/cross/arm64/sources.list.xenial deleted file mode 100644 index 56fbb36a59f..00000000000 --- a/eng/common/cross/arm64/sources.list.xenial +++ /dev/null @@ -1,11 +0,0 @@ -deb http://ports.ubuntu.com/ubuntu-ports/ xenial main restricted universe -deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial main restricted universe - -deb http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main restricted universe -deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main restricted universe - -deb http://ports.ubuntu.com/ubuntu-ports/ xenial-backports main restricted -deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-backports main restricted - -deb http://ports.ubuntu.com/ubuntu-ports/ xenial-security main restricted universe multiverse -deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-security main restricted universe multiverse diff --git a/eng/common/cross/arm64/sources.list.zesty b/eng/common/cross/arm64/sources.list.zesty deleted file mode 100644 index ea2c14a7874..00000000000 --- a/eng/common/cross/arm64/sources.list.zesty +++ /dev/null @@ -1,11 +0,0 @@ -deb http://ports.ubuntu.com/ubuntu-ports/ zesty main restricted universe -deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty main restricted universe - -deb http://ports.ubuntu.com/ubuntu-ports/ zesty-updates main restricted universe -deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty-updates main restricted universe - -deb http://ports.ubuntu.com/ubuntu-ports/ zesty-backports main restricted -deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty-backports main restricted - -deb http://ports.ubuntu.com/ubuntu-ports/ zesty-security main restricted universe multiverse -deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty-security main restricted universe multiverse diff --git a/eng/common/cross/armel/sources.list.jessie b/eng/common/cross/armel/sources.list.jessie deleted file mode 100644 index 3d9c3059d89..00000000000 --- a/eng/common/cross/armel/sources.list.jessie +++ /dev/null @@ -1,3 +0,0 @@ -# Debian (jessie) # Stable -deb http://ftp.debian.org/debian/ jessie main contrib non-free -deb-src http://ftp.debian.org/debian/ jessie main contrib non-free diff --git a/eng/common/cross/armv6/sources.list.bookworm b/eng/common/cross/armv6/sources.list.bookworm deleted file mode 100644 index 10161135265..00000000000 --- a/eng/common/cross/armv6/sources.list.bookworm +++ /dev/null @@ -1,2 +0,0 @@ -deb http://raspbian.raspberrypi.org/raspbian/ bookworm main contrib non-free rpi -deb-src http://raspbian.raspberrypi.org/raspbian/ bookworm main contrib non-free rpi diff --git a/eng/common/cross/armv6/sources.list.buster b/eng/common/cross/armv6/sources.list.buster deleted file mode 100644 index f27fc4fb346..00000000000 --- a/eng/common/cross/armv6/sources.list.buster +++ /dev/null @@ -1,2 +0,0 @@ -deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi -deb-src http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi diff --git a/eng/common/cross/build-rootfs.sh b/eng/common/cross/build-rootfs.sh index 8bb233ba25b..eb1a9080464 100644 --- a/eng/common/cross/build-rootfs.sh +++ b/eng/common/cross/build-rootfs.sh @@ -30,7 +30,8 @@ __IllumosArch=arm7 __HaikuArch=arm __QEMUArch=arm __UbuntuArch=armhf -__UbuntuRepo="http://ports.ubuntu.com/" +__UbuntuRepo= +__UbuntuSuites="updates security backports" __LLDB_Package="liblldb-3.9-dev" __SkipUnmount=0 @@ -129,9 +130,9 @@ __AlpineKeys=' 616db30d:MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAnpUpyWDWjlUk3smlWeA0\nlIMW+oJ38t92CRLHH3IqRhyECBRW0d0aRGtq7TY8PmxjjvBZrxTNDpJT6KUk4LRm\na6A6IuAI7QnNK8SJqM0DLzlpygd7GJf8ZL9SoHSH+gFsYF67Cpooz/YDqWrlN7Vw\ntO00s0B+eXy+PCXYU7VSfuWFGK8TGEv6HfGMALLjhqMManyvfp8hz3ubN1rK3c8C\nUS/ilRh1qckdbtPvoDPhSbTDmfU1g/EfRSIEXBrIMLg9ka/XB9PvWRrekrppnQzP\nhP9YE3x/wbFc5QqQWiRCYyQl/rgIMOXvIxhkfe8H5n1Et4VAorkpEAXdsfN8KSVv\nLSMazVlLp9GYq5SUpqYX3KnxdWBgN7BJoZ4sltsTpHQ/34SXWfu3UmyUveWj7wp0\nx9hwsPirVI00EEea9AbP7NM2rAyu6ukcm4m6ATd2DZJIViq2es6m60AE6SMCmrQF\nwmk4H/kdQgeAELVfGOm2VyJ3z69fQuywz7xu27S6zTKi05Qlnohxol4wVb6OB7qG\nLPRtK9ObgzRo/OPumyXqlzAi/Yvyd1ZQk8labZps3e16bQp8+pVPiumWioMFJDWV\nGZjCmyMSU8V6MB6njbgLHoyg2LCukCAeSjbPGGGYhnKLm1AKSoJh3IpZuqcKCk5C\n8CM1S15HxV78s9dFntEqIokCAwEAAQ== ' __Keyring= +__KeyringFile="/usr/share/keyrings/ubuntu-archive-keyring.gpg" __SkipSigCheck=0 __UseMirror=0 -__UseDeb822Format=0 __UnprocessedBuildArgs= while :; do @@ -163,6 +164,7 @@ while :; do __UbuntuArch=armel __UbuntuRepo="http://ftp.debian.org/debian/" __CodeName=jessie + __KeyringFile="/usr/share/keyrings/debian-archive-keyring.gpg" ;; armv6) __BuildArch=armv6 @@ -170,10 +172,12 @@ while :; do __QEMUArch=arm __UbuntuRepo="http://raspbian.raspberrypi.org/raspbian/" __CodeName=buster + __KeyringFile="/usr/share/keyrings/raspbian-archive-keyring.gpg" __LLDB_Package="liblldb-6.0-dev" + __UbuntuSuites= - if [[ -e "/usr/share/keyrings/raspbian-archive-keyring.gpg" ]]; then - __Keyring="--keyring /usr/share/keyrings/raspbian-archive-keyring.gpg" + if [[ -e "$__KeyringFile" ]]; then + __Keyring="--keyring $__KeyringFile" fi ;; riscv64) @@ -184,10 +188,6 @@ while :; do __UbuntuArch=riscv64 __UbuntuPackages="${__UbuntuPackages// libunwind8-dev/}" unset __LLDB_Package - - if [[ -e "/usr/share/keyrings/debian-archive-keyring.gpg" ]]; then - __Keyring="--keyring /usr/share/keyrings/debian-archive-keyring.gpg --include=debian-archive-keyring" - fi ;; ppc64le) __BuildArch=ppc64le @@ -292,10 +292,13 @@ while :; do if [[ "$__CodeName" != "jessie" ]]; then __CodeName=noble fi - __UseDeb822Format=1 + if [[ -n "$__LLDB_Package" ]]; then + __LLDB_Package="liblldb-18-dev" + fi ;; jessie) # Debian 8 __CodeName=jessie + __KeyringFile="/usr/share/keyrings/debian-archive-keyring.gpg" if [[ -z "$__UbuntuRepo" ]]; then __UbuntuRepo="http://ftp.debian.org/debian/" @@ -304,6 +307,7 @@ while :; do stretch) # Debian 9 __CodeName=stretch __LLDB_Package="liblldb-6.0-dev" + __KeyringFile="/usr/share/keyrings/debian-archive-keyring.gpg" if [[ -z "$__UbuntuRepo" ]]; then __UbuntuRepo="http://ftp.debian.org/debian/" @@ -312,6 +316,7 @@ while :; do buster) # Debian 10 __CodeName=buster __LLDB_Package="liblldb-6.0-dev" + __KeyringFile="/usr/share/keyrings/debian-archive-keyring.gpg" if [[ -z "$__UbuntuRepo" ]]; then __UbuntuRepo="http://ftp.debian.org/debian/" @@ -319,6 +324,7 @@ while :; do ;; bullseye) # Debian 11 __CodeName=bullseye + __KeyringFile="/usr/share/keyrings/debian-archive-keyring.gpg" if [[ -z "$__UbuntuRepo" ]]; then __UbuntuRepo="http://ftp.debian.org/debian/" @@ -326,6 +332,7 @@ while :; do ;; bookworm) # Debian 12 __CodeName=bookworm + __KeyringFile="/usr/share/keyrings/debian-archive-keyring.gpg" if [[ -z "$__UbuntuRepo" ]]; then __UbuntuRepo="http://ftp.debian.org/debian/" @@ -333,6 +340,7 @@ while :; do ;; sid) # Debian sid __CodeName=sid + __KeyringFile="/usr/share/keyrings/debian-archive-keyring.gpg" if [[ -z "$__UbuntuRepo" ]]; then __UbuntuRepo="http://ftp.debian.org/debian/" @@ -442,6 +450,10 @@ fi __UbuntuPackages+=" ${__LLDB_Package:-}" +if [[ -z "$__UbuntuRepo" ]]; then + __UbuntuRepo="http://ports.ubuntu.com/" +fi + if [[ -n "$__LLVM_MajorVersion" ]]; then __UbuntuPackages+=" libclang-common-${__LLVM_MajorVersion}${__LLVM_MinorVersion:+.$__LLVM_MinorVersion}-dev" fi @@ -740,9 +752,16 @@ elif [[ -n "$__CodeName" ]]; then # shellcheck disable=SC2086 echo running debootstrap "--variant=minbase" $__Keyring --arch "$__UbuntuArch" "$__CodeName" "$__RootfsDir" "$__UbuntuRepo" debootstrap "--variant=minbase" $__Keyring --arch "$__UbuntuArch" "$__CodeName" "$__RootfsDir" "$__UbuntuRepo" + mkdir -p "$__RootfsDir/etc/apt/sources.list.d/" - grep -q "Types:" "$__CrossDir/$__BuildArch/sources.list.$__CodeName" && filename="$__CodeName.sources" || filename="$__CodeName.list" - cp "$__CrossDir/$__BuildArch/sources.list.$__CodeName" "$__RootfsDir/etc/apt/sources.list.d/$filename" + cat > "$__RootfsDir/etc/apt/sources.list.d/$__CodeName.sources" < Date: Sat, 22 Jun 2024 14:16:52 +0000 Subject: [PATCH 078/107] Update dependencies from https://github.com/dotnet/sdk build 20240621.3 (#6873) [feature/9.x] Update dependencies from dotnet/sdk --- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 68453b23a77..7c7748601ce 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -54,9 +54,9 @@ https://github.com/dotnet/aspnetcore 613c1e990b6b6411bda84456aefe14fe8e194279 - + https://github.com/dotnet/sdk - dda66101344d41c7e1040cd5bcadcb2166780197 + 941ec62ab28b01b4efcab6bcdaec37b2d319b965 https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index 62a06c046a5..9488677cc7c 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -65,7 +65,7 @@ 9.0.0-preview.6.24319.11 9.0.0-preview.6.24319.11 - 9.0.100-preview.6.24321.2 + 9.0.100-preview.7.24321.3 1.0.532002 From 797f30f1cb4d6327b0c8a0c756d800200e28f82e Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Sun, 23 Jun 2024 12:52:07 +0000 Subject: [PATCH 079/107] Update dependencies from https://github.com/dotnet/roslyn-analyzers build 20240623.1 Microsoft.CodeAnalysis.NetAnalyzers From Version 9.0.0-preview.24318.1 -> To Version 9.0.0-preview.24323.1 --- eng/Version.Details.xml | 2 +- eng/Versions.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 7c7748601ce..f0842c2b434 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -18,7 +18,7 @@ - + https://github.com/dotnet/roslyn-analyzers f1115edce8633ebe03a86191bc05c6969ed9a821 diff --git a/eng/Versions.props b/eng/Versions.props index 9488677cc7c..e310fb1ddcb 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -60,7 +60,7 @@ 8.0.0-preview.24320.2 8.0.0-preview.24320.2 - 9.0.0-preview.24318.1 + 9.0.0-preview.24323.1 9.0.0-preview.6.24319.11 9.0.0-preview.6.24319.11 From 3645d12378550821c9195262c3ed52900c4c4caf Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 24 Jun 2024 00:08:31 +0000 Subject: [PATCH 080/107] Restore branch-specific files --- .../templates-official/job/source-build.yml | 73 +------------------ .../templates-official/jobs/source-build.yml | 54 +------------- .../steps/enable-internal-runtimes.yml | 31 ++------ .../steps/get-delegation-sas.yml | 46 ++---------- .../steps/get-federated-access-token.yml | 33 ++------- eng/common/templates/job/source-build.yml | 72 +----------------- eng/common/templates/jobs/source-build.yml | 54 +------------- .../steps/enable-internal-runtimes.yml | 30 ++------ .../templates/steps/get-delegation-sas.yml | 46 ++---------- .../steps/get-federated-access-token.yml | 33 ++------- 10 files changed, 42 insertions(+), 430 deletions(-) diff --git a/eng/common/templates-official/job/source-build.yml b/eng/common/templates-official/job/source-build.yml index a258867dd22..1a480034b67 100644 --- a/eng/common/templates-official/job/source-build.yml +++ b/eng/common/templates-official/job/source-build.yml @@ -1,76 +1,7 @@ -parameters: - # This template adds arcade-powered source-build to CI. The template produces a server job with a - # default ID 'Source_Build_Complete' to put in a dependency list if necessary. - - # Specifies the prefix for source-build jobs added to pipeline. Use this if disambiguation needed. - jobNamePrefix: 'Source_Build' - - # Defines the platform on which to run the job. By default, a linux-x64 machine, suitable for - # managed-only repositories. This is an object with these properties: - # - # name: '' - # The name of the job. This is included in the job ID. - # targetRID: '' - # The name of the target RID to use, instead of the one auto-detected by Arcade. - # nonPortable: false - # Enables non-portable mode. This means a more specific RID (e.g. fedora.32-x64 rather than - # linux-x64), and compiling against distro-provided packages rather than portable ones. - # skipPublishValidation: false - # Disables publishing validation. By default, a check is performed to ensure no packages are - # published by source-build. - # container: '' - # A container to use. Runs in docker. - # pool: {} - # A pool to use. Runs directly on an agent. - # buildScript: '' - # Specifies the build script to invoke to perform the build in the repo. The default - # './build.sh' should work for typical Arcade repositories, but this is customizable for - # difficult situations. - # jobProperties: {} - # A list of job properties to inject at the top level, for potential extensibility beyond - # container and pool. - platform: {} - - # If set to true and running on a non-public project, - # Internal blob storage locations will be enabled. - # This is not enabled by default because many repositories do not need internal sources - # and do not need to have the required service connections approved in the pipeline. - enableInternalSources: false - jobs: - template: /eng/common/core-templates/job/source-build.yml parameters: is1ESPipeline: true - ${{ each property in parameters.platform.jobProperties }}: - ${{ property.key }}: ${{ property.value }} - - ${{ if ne(parameters.platform.container, '') }}: - container: ${{ parameters.platform.container }} - - ${{ if eq(parameters.platform.pool, '') }}: - # The default VM host AzDO pool. This should be capable of running Docker containers: almost all - # source-build builds run in Docker, including the default managed platform. - # /eng/common/templates-official/variables/pool-providers.yml can't be used here (some customers declare variables already), so duplicate its logic - pool: - ${{ if eq(variables['System.TeamProject'], 'public') }}: - name: $[replace(replace(eq(contains(coalesce(variables['System.PullRequest.TargetBranch'], variables['Build.SourceBranch'], 'refs/heads/main'), 'release'), 'true'), True, 'NetCore-Svc-Public' ), False, 'NetCore-Public')] - demands: ImageOverride -equals Build.Ubuntu.1804.Amd64.Open - - ${{ if eq(variables['System.TeamProject'], 'internal') }}: - name: $[replace(replace(eq(contains(coalesce(variables['System.PullRequest.TargetBranch'], variables['Build.SourceBranch'], 'refs/heads/main'), 'release'), 'true'), True, 'NetCore1ESPool-Svc-Internal'), False, 'NetCore1ESPool-Internal')] - image: 1es-mariner-2 - os: linux - - ${{ if ne(parameters.platform.pool, '') }}: - pool: ${{ parameters.platform.pool }} - - workspace: - clean: all - - steps: - - ${{ if eq(parameters.enableInternalSources, true) }}: - - template: /eng/common/templates-official/steps/enable-internal-runtimes.yml - - template: /eng/common/templates-official/steps/source-build.yml - parameters: - platform: ${{ parameters.platform }} + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} diff --git a/eng/common/templates-official/jobs/source-build.yml b/eng/common/templates-official/jobs/source-build.yml index 914bcd1c3e9..483e7b611f3 100644 --- a/eng/common/templates-official/jobs/source-build.yml +++ b/eng/common/templates-official/jobs/source-build.yml @@ -1,57 +1,7 @@ -parameters: - # This template adds arcade-powered source-build to CI. A job is created for each platform, as - # well as an optional server job that completes when all platform jobs complete. - - # The name of the "join" job for all source-build platforms. If set to empty string, the job is - # not included. Existing repo pipelines can use this job depend on all source-build jobs - # completing without maintaining a separate list of every single job ID: just depend on this one - # server job. By default, not included. Recommended name if used: 'Source_Build_Complete'. - allCompletedJobId: '' - - # See /eng/common/templates-official/job/source-build.yml - jobNamePrefix: 'Source_Build' - - # This is the default platform provided by Arcade, intended for use by a managed-only repo. - defaultManagedPlatform: - name: 'Managed' - container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream8' - - # Defines the platforms on which to run build jobs. One job is created for each platform, and the - # object in this array is sent to the job template as 'platform'. If no platforms are specified, - # one job runs on 'defaultManagedPlatform'. - platforms: [] - - # If set to true and running on a non-public project, - # Internal nuget and blob storage locations will be enabled. - # This is not enabled by default because many repositories do not need internal sources - # and do not need to have the required service connections approved in the pipeline. - enableInternalSources: false - jobs: - template: /eng/common/core-templates/jobs/source-build.yml parameters: is1ESPipeline: true -- ${{ if ne(parameters.allCompletedJobId, '') }}: - - job: ${{ parameters.allCompletedJobId }} - displayName: Source-Build Complete - pool: server - dependsOn: - - ${{ each platform in parameters.platforms }}: - - ${{ parameters.jobNamePrefix }}_${{ platform.name }} - - ${{ if eq(length(parameters.platforms), 0) }}: - - ${{ parameters.jobNamePrefix }}_${{ parameters.defaultManagedPlatform.name }} - -- ${{ each platform in parameters.platforms }}: - - template: /eng/common/templates-official/job/source-build.yml - parameters: - jobNamePrefix: ${{ parameters.jobNamePrefix }} - platform: ${{ platform }} - enableInternalSources: ${{ parameters.enableInternalSources }} - -- ${{ if eq(length(parameters.platforms), 0) }}: - - template: /eng/common/templates-official/job/source-build.yml - parameters: - jobNamePrefix: ${{ parameters.jobNamePrefix }} - platform: ${{ parameters.defaultManagedPlatform }} - enableInternalSources: ${{ parameters.enableInternalSources }} + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} \ No newline at end of file diff --git a/eng/common/templates-official/steps/enable-internal-runtimes.yml b/eng/common/templates-official/steps/enable-internal-runtimes.yml index 93a8394a666..f9dd238c6cd 100644 --- a/eng/common/templates-official/steps/enable-internal-runtimes.yml +++ b/eng/common/templates-official/steps/enable-internal-runtimes.yml @@ -1,28 +1,9 @@ # Obtains internal runtime download credentials and populates the 'dotnetbuilds-internal-container-read-token-base64' # variable with the base64-encoded SAS token, by default - -parameters: -- name: federatedServiceConnection - type: string - default: 'dotnetbuilds-internal-read' -- name: outputVariableName - type: string - default: 'dotnetbuilds-internal-container-read-token-base64' -- name: expiryInHours - type: number - default: 1 -- name: base64Encode - type: boolean - default: true - steps: -- ${{ if ne(variables['System.TeamProject'], 'public') }}: - - template: /eng/common/templates-official/steps/get-delegation-sas.yml - parameters: - federatedServiceConnection: ${{ parameters.federatedServiceConnection }} - outputVariableName: ${{ parameters.outputVariableName }} - expiryInHours: ${{ parameters.expiryInHours }} - base64Encode: ${{ parameters.base64Encode }} - storageAccount: dotnetbuilds - container: internal - permissions: rl +- template: /eng/common/core-templates/steps/enable-internal-runtimes.yml + parameters: + is1ESPipeline: true + + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} diff --git a/eng/common/templates-official/steps/get-delegation-sas.yml b/eng/common/templates-official/steps/get-delegation-sas.yml index c0e8f91317f..c5a9c1f8275 100644 --- a/eng/common/templates-official/steps/get-delegation-sas.yml +++ b/eng/common/templates-official/steps/get-delegation-sas.yml @@ -1,43 +1,7 @@ -parameters: -- name: federatedServiceConnection - type: string -- name: outputVariableName - type: string -- name: expiryInHours - type: number - default: 1 -- name: base64Encode - type: boolean - default: false -- name: storageAccount - type: string -- name: container - type: string -- name: permissions - type: string - default: 'rl' - steps: -- task: AzureCLI@2 - displayName: 'Generate delegation SAS Token for ${{ parameters.storageAccount }}/${{ parameters.container }}' - inputs: - azureSubscription: ${{ parameters.federatedServiceConnection }} - scriptType: 'pscore' - scriptLocation: 'inlineScript' - inlineScript: | - # Calculate the expiration of the SAS token and convert to UTC - $expiry = (Get-Date).AddHours(${{ parameters.expiryInHours }}).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ") - - $sas = az storage container generate-sas --account-name ${{ parameters.storageAccount }} --name ${{ parameters.container }} --permissions ${{ parameters.permissions }} --expiry $expiry --auth-mode login --as-user -o tsv - - if ($LASTEXITCODE -ne 0) { - Write-Error "Failed to generate SAS token." - exit 1 - } - - if ('${{ parameters.base64Encode }}' -eq 'true') { - $sas = [Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes($sas)) - } +- template: /eng/common/core-templates/steps/get-delegation-sas.yml + parameters: + is1ESPipeline: true - Write-Host "Setting '${{ parameters.outputVariableName }}' with the access token value" - Write-Host "##vso[task.setvariable variable=${{ parameters.outputVariableName }};issecret=true]$sas" + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} diff --git a/eng/common/templates-official/steps/get-federated-access-token.yml b/eng/common/templates-official/steps/get-federated-access-token.yml index e3786cef6df..c8dcf6b8139 100644 --- a/eng/common/templates-official/steps/get-federated-access-token.yml +++ b/eng/common/templates-official/steps/get-federated-access-token.yml @@ -1,28 +1,7 @@ -parameters: -- name: federatedServiceConnection - type: string -- name: outputVariableName - type: string -# Resource to get a token for. Common values include: -# - '499b84ac-1321-427f-aa17-267ca6975798' for Azure DevOps -# - 'https://storage.azure.com/' for storage -# Defaults to Azure DevOps -- name: resource - type: string - default: '499b84ac-1321-427f-aa17-267ca6975798' - steps: -- task: AzureCLI@2 - displayName: 'Getting federated access token for feeds' - inputs: - azureSubscription: ${{ parameters.federatedServiceConnection }} - scriptType: 'pscore' - scriptLocation: 'inlineScript' - inlineScript: | - $accessToken = az account get-access-token --query accessToken --resource ${{ parameters.resource }} --output tsv - if ($LASTEXITCODE -ne 0) { - Write-Error "Failed to get access token for resource '${{ parameters.resource }}'" - exit 1 - } - Write-Host "Setting '${{ parameters.outputVariableName }}' with the access token value" - Write-Host "##vso[task.setvariable variable=${{ parameters.outputVariableName }};issecret=true]$accessToken" +- template: /eng/common/core-templates/steps/get-federated-access-token.yml + parameters: + is1ESPipeline: true + + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} \ No newline at end of file diff --git a/eng/common/templates/job/source-build.yml b/eng/common/templates/job/source-build.yml index 4799ccac88c..e44d47b1d76 100644 --- a/eng/common/templates/job/source-build.yml +++ b/eng/common/templates/job/source-build.yml @@ -1,75 +1,7 @@ -parameters: - # This template adds arcade-powered source-build to CI. The template produces a server job with a - # default ID 'Source_Build_Complete' to put in a dependency list if necessary. - - # Specifies the prefix for source-build jobs added to pipeline. Use this if disambiguation needed. - jobNamePrefix: 'Source_Build' - - # Defines the platform on which to run the job. By default, a linux-x64 machine, suitable for - # managed-only repositories. This is an object with these properties: - # - # name: '' - # The name of the job. This is included in the job ID. - # targetRID: '' - # The name of the target RID to use, instead of the one auto-detected by Arcade. - # nonPortable: false - # Enables non-portable mode. This means a more specific RID (e.g. fedora.32-x64 rather than - # linux-x64), and compiling against distro-provided packages rather than portable ones. - # skipPublishValidation: false - # Disables publishing validation. By default, a check is performed to ensure no packages are - # published by source-build. - # container: '' - # A container to use. Runs in docker. - # pool: {} - # A pool to use. Runs directly on an agent. - # buildScript: '' - # Specifies the build script to invoke to perform the build in the repo. The default - # './build.sh' should work for typical Arcade repositories, but this is customizable for - # difficult situations. - # jobProperties: {} - # A list of job properties to inject at the top level, for potential extensibility beyond - # container and pool. - platform: {} - - # If set to true and running on a non-public project, - # Internal blob storage locations will be enabled. - # This is not enabled by default because many repositories do not need internal sources - # and do not need to have the required service connections approved in the pipeline. - enableInternalSources: false - jobs: - template: /eng/common/core-templates/job/source-build.yml parameters: is1ESPipeline: false - ${{ each property in parameters.platform.jobProperties }}: - ${{ property.key }}: ${{ property.value }} - - ${{ if ne(parameters.platform.container, '') }}: - container: ${{ parameters.platform.container }} - - ${{ if eq(parameters.platform.pool, '') }}: - # The default VM host AzDO pool. This should be capable of running Docker containers: almost all - # source-build builds run in Docker, including the default managed platform. - # /eng/common/templates/variables/pool-providers.yml can't be used here (some customers declare variables already), so duplicate its logic - pool: - ${{ if eq(variables['System.TeamProject'], 'public') }}: - name: $[replace(replace(eq(contains(coalesce(variables['System.PullRequest.TargetBranch'], variables['Build.SourceBranch'], 'refs/heads/main'), 'release'), 'true'), True, 'NetCore-Svc-Public' ), False, 'NetCore-Public')] - demands: ImageOverride -equals Build.Ubuntu.1804.Amd64.Open - - ${{ if eq(variables['System.TeamProject'], 'internal') }}: - name: $[replace(replace(eq(contains(coalesce(variables['System.PullRequest.TargetBranch'], variables['Build.SourceBranch'], 'refs/heads/main'), 'release'), 'true'), True, 'NetCore1ESPool-Svc-Internal'), False, 'NetCore1ESPool-Internal')] - demands: ImageOverride -equals Build.Ubuntu.1804.Amd64 - - ${{ if ne(parameters.platform.pool, '') }}: - pool: ${{ parameters.platform.pool }} - - workspace: - clean: all - - steps: - - ${{ if eq(parameters.enableInternalSources, true) }}: - - template: /eng/common/templates/steps/enable-internal-runtimes.yml - - template: /eng/common/templates/steps/source-build.yml - parameters: - platform: ${{ parameters.platform }} + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} diff --git a/eng/common/templates/jobs/source-build.yml b/eng/common/templates/jobs/source-build.yml index c415255685c..818d4c326db 100644 --- a/eng/common/templates/jobs/source-build.yml +++ b/eng/common/templates/jobs/source-build.yml @@ -1,57 +1,7 @@ -parameters: - # This template adds arcade-powered source-build to CI. A job is created for each platform, as - # well as an optional server job that completes when all platform jobs complete. - - # The name of the "join" job for all source-build platforms. If set to empty string, the job is - # not included. Existing repo pipelines can use this job depend on all source-build jobs - # completing without maintaining a separate list of every single job ID: just depend on this one - # server job. By default, not included. Recommended name if used: 'Source_Build_Complete'. - allCompletedJobId: '' - - # See /eng/common/templates/job/source-build.yml - jobNamePrefix: 'Source_Build' - - # This is the default platform provided by Arcade, intended for use by a managed-only repo. - defaultManagedPlatform: - name: 'Managed' - container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream8' - - # Defines the platforms on which to run build jobs. One job is created for each platform, and the - # object in this array is sent to the job template as 'platform'. If no platforms are specified, - # one job runs on 'defaultManagedPlatform'. - platforms: [] - - # If set to true and running on a non-public project, - # Internal nuget and blob storage locations will be enabled. - # This is not enabled by default because many repositories do not need internal sources - # and do not need to have the required service connections approved in the pipeline. - enableInternalSources: false - jobs: - template: /eng/common/core-templates/jobs/source-build.yml parameters: is1ESPipeline: false -- ${{ if ne(parameters.allCompletedJobId, '') }}: - - job: ${{ parameters.allCompletedJobId }} - displayName: Source-Build Complete - pool: server - dependsOn: - - ${{ each platform in parameters.platforms }}: - - ${{ parameters.jobNamePrefix }}_${{ platform.name }} - - ${{ if eq(length(parameters.platforms), 0) }}: - - ${{ parameters.jobNamePrefix }}_${{ parameters.defaultManagedPlatform.name }} - -- ${{ each platform in parameters.platforms }}: - - template: /eng/common/templates/job/source-build.yml - parameters: - jobNamePrefix: ${{ parameters.jobNamePrefix }} - platform: ${{ platform }} - enableInternalSources: ${{ parameters.enableInternalSources }} - -- ${{ if eq(length(parameters.platforms), 0) }}: - - template: /eng/common/templates/job/source-build.yml - parameters: - jobNamePrefix: ${{ parameters.jobNamePrefix }} - platform: ${{ parameters.defaultManagedPlatform }} - enableInternalSources: ${{ parameters.enableInternalSources }} + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} \ No newline at end of file diff --git a/eng/common/templates/steps/enable-internal-runtimes.yml b/eng/common/templates/steps/enable-internal-runtimes.yml index 54dc9416c51..b21a8038cc1 100644 --- a/eng/common/templates/steps/enable-internal-runtimes.yml +++ b/eng/common/templates/steps/enable-internal-runtimes.yml @@ -1,28 +1,10 @@ # Obtains internal runtime download credentials and populates the 'dotnetbuilds-internal-container-read-token-base64' # variable with the base64-encoded SAS token, by default -parameters: -- name: federatedServiceConnection - type: string - default: 'dotnetbuilds-internal-read' -- name: outputVariableName - type: string - default: 'dotnetbuilds-internal-container-read-token-base64' -- name: expiryInHours - type: number - default: 1 -- name: base64Encode - type: boolean - default: true - steps: -- ${{ if ne(variables['System.TeamProject'], 'public') }}: - - template: /eng/common/templates/steps/get-delegation-sas.yml - parameters: - federatedServiceConnection: ${{ parameters.federatedServiceConnection }} - outputVariableName: ${{ parameters.outputVariableName }} - expiryInHours: ${{ parameters.expiryInHours }} - base64Encode: ${{ parameters.base64Encode }} - storageAccount: dotnetbuilds - container: internal - permissions: rl +- template: /eng/common/core-templates/steps/enable-internal-runtimes.yml + parameters: + is1ESPipeline: false + + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} diff --git a/eng/common/templates/steps/get-delegation-sas.yml b/eng/common/templates/steps/get-delegation-sas.yml index c0e8f91317f..83760c9798e 100644 --- a/eng/common/templates/steps/get-delegation-sas.yml +++ b/eng/common/templates/steps/get-delegation-sas.yml @@ -1,43 +1,7 @@ -parameters: -- name: federatedServiceConnection - type: string -- name: outputVariableName - type: string -- name: expiryInHours - type: number - default: 1 -- name: base64Encode - type: boolean - default: false -- name: storageAccount - type: string -- name: container - type: string -- name: permissions - type: string - default: 'rl' - steps: -- task: AzureCLI@2 - displayName: 'Generate delegation SAS Token for ${{ parameters.storageAccount }}/${{ parameters.container }}' - inputs: - azureSubscription: ${{ parameters.federatedServiceConnection }} - scriptType: 'pscore' - scriptLocation: 'inlineScript' - inlineScript: | - # Calculate the expiration of the SAS token and convert to UTC - $expiry = (Get-Date).AddHours(${{ parameters.expiryInHours }}).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ") - - $sas = az storage container generate-sas --account-name ${{ parameters.storageAccount }} --name ${{ parameters.container }} --permissions ${{ parameters.permissions }} --expiry $expiry --auth-mode login --as-user -o tsv - - if ($LASTEXITCODE -ne 0) { - Write-Error "Failed to generate SAS token." - exit 1 - } - - if ('${{ parameters.base64Encode }}' -eq 'true') { - $sas = [Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes($sas)) - } +- template: /eng/common/core-templates/steps/get-delegation-sas.yml + parameters: + is1ESPipeline: false - Write-Host "Setting '${{ parameters.outputVariableName }}' with the access token value" - Write-Host "##vso[task.setvariable variable=${{ parameters.outputVariableName }};issecret=true]$sas" + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} diff --git a/eng/common/templates/steps/get-federated-access-token.yml b/eng/common/templates/steps/get-federated-access-token.yml index c8c49cc0e8f..31e151d9d9e 100644 --- a/eng/common/templates/steps/get-federated-access-token.yml +++ b/eng/common/templates/steps/get-federated-access-token.yml @@ -1,28 +1,7 @@ -parameters: -- name: federatedServiceConnection - type: string -- name: outputVariableName - type: string -# Resource to get a token for. Common values include: -# - '499b84ac-1321-427f-aa17-267ca6975798' for Azure DevOps -# - 'https://storage.azure.com/' for storage -# Defaults to Azure DevOps -- name: resource - type: string - default: '499b84ac-1321-427f-aa17-267ca6975798' - steps: -- task: AzureCLI@2 - displayName: 'Getting federated access token for feeds' - inputs: - azureSubscription: ${{ parameters.federatedServiceConnection }} - scriptType: 'pscore' - scriptLocation: 'inlineScript' - inlineScript: | - $accessToken = az account get-access-token --query accessToken --resource ${{ parameters.resource }} --output tsv - if ($LASTEXITCODE -ne 0) { - Write-Error "Failed to get access token for resource '${{ parameters.resource }}'" - exit 1 - } - Write-Host "Setting '${{ parameters.outputVariableName }}' with the access token value" - Write-Host "##vso[task.setvariable variable=${{ parameters.outputVariableName }};issecret=true]$accessToken" \ No newline at end of file +- template: /eng/common/core-templates/steps/get-federated-access-token.yml + parameters: + is1ESPipeline: false + + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} \ No newline at end of file From 7eb30380de54597a558789f59204ada8cb5d8e7c Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Mon, 24 Jun 2024 12:46:03 +0000 Subject: [PATCH 081/107] Update dependencies from https://github.com/dotnet/roslyn-analyzers build 20240623.1 Microsoft.CodeAnalysis.NetAnalyzers From Version 9.0.0-preview.24318.1 -> To Version 9.0.0-preview.24323.1 From a3f034406cfe2ce359ad4337750a41f7ba5b0ad7 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 24 Jun 2024 13:03:32 +0000 Subject: [PATCH 082/107] Update dependencies from https://github.com/dotnet/diagnostics build 20240621.1 (#6879) [main] Update dependencies from dotnet/diagnostics --- eng/Version.Details.xml | 12 ++++++------ eng/Versions.props | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 1a1edf98931..e0852c54e7f 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -4,13 +4,13 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore 8e941eb42f819adb116b881195158b3887a70a1c - + https://github.com/dotnet/diagnostics - 464e06c9a8602dff44ff5c59e9a0c3777f68e41c + 842c9603a97cf417814cf6c8d96e5c881025bf0e - + https://github.com/dotnet/diagnostics - 464e06c9a8602dff44ff5c59e9a0c3777f68e41c + 842c9603a97cf417814cf6c8d96e5c881025bf0e https://github.com/dotnet/command-line-api @@ -46,9 +46,9 @@ https://github.com/dotnet/arcade a95bcc256e9bdf47394e4dab04872811c16daaea - + https://github.com/dotnet/diagnostics - 464e06c9a8602dff44ff5c59e9a0c3777f68e41c + 842c9603a97cf417814cf6c8d96e5c881025bf0e https://dev.azure.com/dnceng/internal/_git/dotnet-runtime diff --git a/eng/Versions.props b/eng/Versions.props index 8ed860bff1f..77d9909dd42 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -57,8 +57,8 @@ 2.0.0-beta4.24209.3 - 8.0.0-preview.24320.2 - 8.0.0-preview.24320.2 + 8.0.0-preview.24321.1 + 8.0.0-preview.24321.1 8.0.103-servicing.24114.15 @@ -67,7 +67,7 @@ 8.0.1 8.0.1-servicing.23580.1 - 1.0.532002 + 1.0.532101 $(MicrosoftNETCoreApp31Version) From f388442e97049adec4f295a72bbf6d2e11c2c37c Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 24 Jun 2024 13:54:34 +0000 Subject: [PATCH 083/107] Update dependencies from https://github.com/dotnet/diagnostics build 20240621.1 (#6880) [feature/9.x] Update dependencies from dotnet/diagnostics --- eng/Version.Details.xml | 12 ++++++------ eng/Versions.props | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 7c7748601ce..b9d00d36e9c 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -4,13 +4,13 @@ https://github.com/dotnet/aspnetcore 613c1e990b6b6411bda84456aefe14fe8e194279 - + https://github.com/dotnet/diagnostics - 464e06c9a8602dff44ff5c59e9a0c3777f68e41c + 842c9603a97cf417814cf6c8d96e5c881025bf0e - + https://github.com/dotnet/diagnostics - 464e06c9a8602dff44ff5c59e9a0c3777f68e41c + 842c9603a97cf417814cf6c8d96e5c881025bf0e https://github.com/dotnet/command-line-api @@ -42,9 +42,9 @@ https://github.com/dotnet/arcade 3aba80fecac252e1cdaffcebc0a37a24a960228b - + https://github.com/dotnet/diagnostics - 464e06c9a8602dff44ff5c59e9a0c3777f68e41c + 842c9603a97cf417814cf6c8d96e5c881025bf0e https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index 9488677cc7c..7cbe72b8c50 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -57,8 +57,8 @@ 2.0.0-beta4.24209.3 - 8.0.0-preview.24320.2 - 8.0.0-preview.24320.2 + 8.0.0-preview.24321.1 + 8.0.0-preview.24321.1 9.0.0-preview.24318.1 @@ -67,7 +67,7 @@ 9.0.100-preview.7.24321.3 - 1.0.532002 + 1.0.532101 $(MicrosoftNETCoreApp31Version) From 88bf4068942260919236a576e4ad308679c501b2 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 24 Jun 2024 14:14:04 +0000 Subject: [PATCH 084/107] Update dependencies from https://github.com/dotnet/sdk build 20240623.5 (#6881) [feature/9.x] Update dependencies from dotnet/sdk --- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index b9d00d36e9c..b89af10b4b3 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -54,9 +54,9 @@ https://github.com/dotnet/aspnetcore 613c1e990b6b6411bda84456aefe14fe8e194279 - + https://github.com/dotnet/sdk - 941ec62ab28b01b4efcab6bcdaec37b2d319b965 + ea9243f9cb36e56aba4cf6364a4d53a5c2d458fb https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index 7cbe72b8c50..75eb6ec0fd5 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -65,7 +65,7 @@ 9.0.0-preview.6.24319.11 9.0.0-preview.6.24319.11 - 9.0.100-preview.7.24321.3 + 9.0.100-preview.7.24323.5 1.0.532101 From ccb6d1cf6b5a856c0643f3e63ab8f1e008c03c67 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Jun 2024 10:53:23 -0700 Subject: [PATCH 085/107] Bump streetsidesoftware/cspell-action from 6.3.0 to 6.4.0 (#6864) Bumps [streetsidesoftware/cspell-action](https://github.com/streetsidesoftware/cspell-action) from 6.3.0 to 6.4.0. - [Release notes](https://github.com/streetsidesoftware/cspell-action/releases) - [Changelog](https://github.com/streetsidesoftware/cspell-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell-action/compare/104110db58e8c9a11c1c6be025e2082f4dded3bb...542d05c6a8980c81277ec229f9beadf4ab3f5a34) --- updated-dependencies: - dependency-name: streetsidesoftware/cspell-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/spellcheck.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/spellcheck.yml b/.github/workflows/spellcheck.yml index f959d793362..e43eec26e12 100644 --- a/.github/workflows/spellcheck.yml +++ b/.github/workflows/spellcheck.yml @@ -17,7 +17,7 @@ jobs: with: persist-credentials: false - - uses: streetsidesoftware/cspell-action@104110db58e8c9a11c1c6be025e2082f4dded3bb + - uses: streetsidesoftware/cspell-action@542d05c6a8980c81277ec229f9beadf4ab3f5a34 name: Documentation spellcheck if: ${{ !cancelled() }} with: @@ -25,7 +25,7 @@ jobs: inline: error incremental_files_only: true - - uses: streetsidesoftware/cspell-action@104110db58e8c9a11c1c6be025e2082f4dded3bb + - uses: streetsidesoftware/cspell-action@542d05c6a8980c81277ec229f9beadf4ab3f5a34 name: Resx spellcheck if: ${{ !cancelled() }} with: @@ -33,7 +33,7 @@ jobs: inline: error incremental_files_only: true - - uses: streetsidesoftware/cspell-action@104110db58e8c9a11c1c6be025e2082f4dded3bb + - uses: streetsidesoftware/cspell-action@542d05c6a8980c81277ec229f9beadf4ab3f5a34 name: Source code spellcheck if: ${{ !cancelled() }} with: From ac63772178bf8e063cd088a8bfdfc9e9425dd930 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 25 Jun 2024 13:00:43 +0000 Subject: [PATCH 086/107] Update dependencies from https://github.com/dotnet/diagnostics build 20240624.2 (#6882) [main] Update dependencies from dotnet/diagnostics --- eng/Version.Details.xml | 12 ++++++------ eng/Versions.props | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index e0852c54e7f..59574f5f9fa 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -4,13 +4,13 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore 8e941eb42f819adb116b881195158b3887a70a1c - + https://github.com/dotnet/diagnostics - 842c9603a97cf417814cf6c8d96e5c881025bf0e + f9c76c57cfa222944222cb84f2cd90505a565435 - + https://github.com/dotnet/diagnostics - 842c9603a97cf417814cf6c8d96e5c881025bf0e + f9c76c57cfa222944222cb84f2cd90505a565435 https://github.com/dotnet/command-line-api @@ -46,9 +46,9 @@ https://github.com/dotnet/arcade a95bcc256e9bdf47394e4dab04872811c16daaea - + https://github.com/dotnet/diagnostics - 842c9603a97cf417814cf6c8d96e5c881025bf0e + f9c76c57cfa222944222cb84f2cd90505a565435 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime diff --git a/eng/Versions.props b/eng/Versions.props index 77d9909dd42..b00a7ae3333 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -57,8 +57,8 @@ 2.0.0-beta4.24209.3 - 8.0.0-preview.24321.1 - 8.0.0-preview.24321.1 + 8.0.0-preview.24324.2 + 8.0.0-preview.24324.2 8.0.103-servicing.24114.15 @@ -67,7 +67,7 @@ 8.0.1 8.0.1-servicing.23580.1 - 1.0.532101 + 1.0.532402 $(MicrosoftNETCoreApp31Version) From 011ae25d7e59a9ca9d445a6ffadced3e451b9983 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 25 Jun 2024 13:02:13 +0000 Subject: [PATCH 087/107] Update dependencies from https://github.com/dotnet/arcade build 20240624.7 (#6883) [main] Update dependencies from dotnet/arcade --- eng/Version.Details.xml | 20 ++++++------- eng/Versions.props | 6 ++-- eng/common/post-build/publish-using-darc.ps1 | 15 +++++----- .../job/publish-build-assets.yml | 12 ++++---- .../post-build/post-build.yml | 8 ++++-- .../templates/job/publish-build-assets.yml | 12 ++++---- .../templates/post-build/post-build.yml | 8 ++++-- .../post-build/setup-maestro-vars.yml | 28 +++++++++---------- global.json | 4 +-- 9 files changed, 60 insertions(+), 53 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 59574f5f9fa..46d27a5f738 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -22,29 +22,29 @@ https://github.com/dotnet/roslyn-analyzers b4d9a1334d5189172977ba8fddd00bda70161e4a - + https://github.com/dotnet/arcade - a95bcc256e9bdf47394e4dab04872811c16daaea + 3fe41d9e97519a4e9b48293906dbf58714ea9a0d - + https://github.com/dotnet/arcade - a95bcc256e9bdf47394e4dab04872811c16daaea + 3fe41d9e97519a4e9b48293906dbf58714ea9a0d - + https://github.com/dotnet/arcade - a95bcc256e9bdf47394e4dab04872811c16daaea + 3fe41d9e97519a4e9b48293906dbf58714ea9a0d - + https://github.com/dotnet/arcade - a95bcc256e9bdf47394e4dab04872811c16daaea + 3fe41d9e97519a4e9b48293906dbf58714ea9a0d https://github.com/dotnet/installer 68e8abb1d3e1a240a6e4c29dcd220aae91681676 - + https://github.com/dotnet/arcade - a95bcc256e9bdf47394e4dab04872811c16daaea + 3fe41d9e97519a4e9b48293906dbf58714ea9a0d https://github.com/dotnet/diagnostics diff --git a/eng/Versions.props b/eng/Versions.props index b00a7ae3333..c1e96617a97 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -48,9 +48,9 @@ --> - 8.0.0-beta.24321.3 - 8.0.0-beta.24321.3 - 8.0.0-beta.24321.3 + 8.0.0-beta.24324.7 + 8.0.0-beta.24324.7 + 8.0.0-beta.24324.7 8.0.1 8.0.1-servicing.23580.8 diff --git a/eng/common/post-build/publish-using-darc.ps1 b/eng/common/post-build/publish-using-darc.ps1 index 5a3a32ea8d7..238945cb5ab 100644 --- a/eng/common/post-build/publish-using-darc.ps1 +++ b/eng/common/post-build/publish-using-darc.ps1 @@ -2,7 +2,6 @@ param( [Parameter(Mandatory=$true)][int] $BuildId, [Parameter(Mandatory=$true)][int] $PublishingInfraVersion, [Parameter(Mandatory=$true)][string] $AzdoToken, - [Parameter(Mandatory=$true)][string] $MaestroToken, [Parameter(Mandatory=$false)][string] $MaestroApiEndPoint = 'https://maestro.dot.net', [Parameter(Mandatory=$true)][string] $WaitPublishingFinish, [Parameter(Mandatory=$false)][string] $ArtifactsPublishingAdditionalParameters, @@ -31,13 +30,13 @@ try { } & $darc add-build-to-channel ` - --id $buildId ` - --publishing-infra-version $PublishingInfraVersion ` - --default-channels ` - --source-branch main ` - --azdev-pat $AzdoToken ` - --bar-uri $MaestroApiEndPoint ` - --password $MaestroToken ` + --id $buildId ` + --publishing-infra-version $PublishingInfraVersion ` + --default-channels ` + --source-branch main ` + --azdev-pat "$AzdoToken" ` + --bar-uri "$MaestroApiEndPoint" ` + --ci ` @optionalParams if ($LastExitCode -ne 0) { diff --git a/eng/common/templates-official/job/publish-build-assets.yml b/eng/common/templates-official/job/publish-build-assets.yml index 589ac80a18b..d01739c1285 100644 --- a/eng/common/templates-official/job/publish-build-assets.yml +++ b/eng/common/templates-official/job/publish-build-assets.yml @@ -76,13 +76,16 @@ jobs: - task: NuGetAuthenticate@1 - - task: PowerShell@2 + - task: AzureCLI@2 displayName: Publish Build Assets inputs: - filePath: eng\common\sdk-task.ps1 - arguments: -task PublishBuildAssets -restore -msbuildEngine dotnet + azureSubscription: "Darc: Maestro Production" + scriptType: ps + scriptLocation: scriptPath + scriptPath: $(Build.SourcesDirectory)/eng/common/sdk-task.ps1 + arguments: > + -task PublishBuildAssets -restore -msbuildEngine dotnet /p:ManifestsPath='$(Build.StagingDirectory)/Download/AssetManifests' - /p:BuildAssetRegistryToken=$(MaestroAccessToken) /p:MaestroApiEndpoint=https://maestro-prod.westus2.cloudapp.azure.com /p:PublishUsingPipelines=${{ parameters.publishUsingPipelines }} /p:OfficialBuildId=$(Build.BuildNumber) @@ -144,7 +147,6 @@ jobs: arguments: -BuildId $(BARBuildId) -PublishingInfraVersion 3 -AzdoToken '$(publishing-dnceng-devdiv-code-r-build-re)' - -MaestroToken '$(MaestroApiAccessToken)' -WaitPublishingFinish true -ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}' -SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}' diff --git a/eng/common/templates-official/post-build/post-build.yml b/eng/common/templates-official/post-build/post-build.yml index da1f40958b4..0dfa387e7b7 100644 --- a/eng/common/templates-official/post-build/post-build.yml +++ b/eng/common/templates-official/post-build/post-build.yml @@ -272,14 +272,16 @@ stages: - task: NuGetAuthenticate@1 - - task: PowerShell@2 + - task: AzureCLI@2 displayName: Publish Using Darc inputs: - filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1 + azureSubscription: "Darc: Maestro Production" + scriptType: ps + scriptLocation: scriptPath + scriptPath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1 arguments: -BuildId $(BARBuildId) -PublishingInfraVersion ${{ parameters.publishingInfraVersion }} -AzdoToken '$(publishing-dnceng-devdiv-code-r-build-re)' - -MaestroToken '$(MaestroApiAccessToken)' -WaitPublishingFinish true -ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}' -SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}' diff --git a/eng/common/templates/job/publish-build-assets.yml b/eng/common/templates/job/publish-build-assets.yml index 8ec0151def2..9fd69fa7c9b 100644 --- a/eng/common/templates/job/publish-build-assets.yml +++ b/eng/common/templates/job/publish-build-assets.yml @@ -74,13 +74,16 @@ jobs: - task: NuGetAuthenticate@1 - - task: PowerShell@2 + - task: AzureCLI@2 displayName: Publish Build Assets inputs: - filePath: eng\common\sdk-task.ps1 - arguments: -task PublishBuildAssets -restore -msbuildEngine dotnet + azureSubscription: "Darc: Maestro Production" + scriptType: ps + scriptLocation: scriptPath + scriptPath: $(Build.SourcesDirectory)/eng/common/sdk-task.ps1 + arguments: > + -task PublishBuildAssets -restore -msbuildEngine dotnet /p:ManifestsPath='$(Build.StagingDirectory)/Download/AssetManifests' - /p:BuildAssetRegistryToken=$(MaestroAccessToken) /p:MaestroApiEndpoint=https://maestro.dot.net /p:PublishUsingPipelines=${{ parameters.publishUsingPipelines }} /p:OfficialBuildId=$(Build.BuildNumber) @@ -140,7 +143,6 @@ jobs: arguments: -BuildId $(BARBuildId) -PublishingInfraVersion 3 -AzdoToken '$(publishing-dnceng-devdiv-code-r-build-re)' - -MaestroToken '$(MaestroApiAccessToken)' -WaitPublishingFinish true -ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}' -SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}' diff --git a/eng/common/templates/post-build/post-build.yml b/eng/common/templates/post-build/post-build.yml index aba44a25a33..2db4933468f 100644 --- a/eng/common/templates/post-build/post-build.yml +++ b/eng/common/templates/post-build/post-build.yml @@ -268,14 +268,16 @@ stages: - task: NuGetAuthenticate@1 - - task: PowerShell@2 + - task: AzureCLI@2 displayName: Publish Using Darc inputs: - filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1 + azureSubscription: "Darc: Maestro Production" + scriptType: ps + scriptLocation: scriptPath + scriptPath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1 arguments: -BuildId $(BARBuildId) -PublishingInfraVersion ${{ parameters.publishingInfraVersion }} -AzdoToken '$(publishing-dnceng-devdiv-code-r-build-re)' - -MaestroToken '$(MaestroApiAccessToken)' -WaitPublishingFinish true -ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}' -SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}' diff --git a/eng/common/templates/post-build/setup-maestro-vars.yml b/eng/common/templates/post-build/setup-maestro-vars.yml index 0c87f149a4a..64b9abc6850 100644 --- a/eng/common/templates/post-build/setup-maestro-vars.yml +++ b/eng/common/templates/post-build/setup-maestro-vars.yml @@ -11,13 +11,14 @@ steps: artifactName: ReleaseConfigs checkDownloadedFiles: true - - task: PowerShell@2 + - task: AzureCLI@2 name: setReleaseVars displayName: Set Release Configs Vars inputs: - targetType: inline - pwsh: true - script: | + azureSubscription: "Darc: Maestro Production" + scriptType: pscore + scriptLocation: inlineScript + inlineScript: | try { if (!$Env:PromoteToMaestroChannels -or $Env:PromoteToMaestroChannels.Trim() -eq '') { $Content = Get-Content $(Build.StagingDirectory)/ReleaseConfigs/ReleaseConfigs.txt @@ -31,15 +32,16 @@ steps: $AzureDevOpsBuildId = $Env:Build_BuildId } else { - $buildApiEndpoint = "${Env:MaestroApiEndPoint}/api/builds/${Env:BARBuildId}?api-version=${Env:MaestroApiVersion}" + . $(Build.SourcesDirectory)\eng\common\tools.ps1 + $darc = Get-Darc + $buildInfo = & $darc get-build ` + --id ${{ parameters.BARBuildId }} ` + --extended ` + --output-format json ` + --ci ` + | convertFrom-Json - $apiHeaders = New-Object 'System.Collections.Generic.Dictionary[[String],[String]]' - $apiHeaders.Add('Accept', 'application/json') - $apiHeaders.Add('Authorization',"Bearer ${Env:MAESTRO_API_TOKEN}") - - $buildInfo = try { Invoke-WebRequest -Method Get -Uri $buildApiEndpoint -Headers $apiHeaders | ConvertFrom-Json } catch { Write-Host "Error: $_" } - - $BarId = $Env:BARBuildId + $BarId = ${{ parameters.BARBuildId }} $Channels = $Env:PromoteToMaestroChannels -split "," $Channels = $Channels -join "][" $Channels = "[$Channels]" @@ -65,6 +67,4 @@ steps: exit 1 } env: - MAESTRO_API_TOKEN: $(MaestroApiAccessToken) - BARBuildId: ${{ parameters.BARBuildId }} PromoteToMaestroChannels: ${{ parameters.PromoteToChannelIds }} diff --git a/global.json b/global.json index 3c696a7ea05..a01e14d61e2 100644 --- a/global.json +++ b/global.json @@ -26,7 +26,7 @@ }, "msbuild-sdks": { "Microsoft.Build.NoTargets": "3.7.0", - "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24321.3", - "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.24321.3" + "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24324.7", + "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.24324.7" } } From 2eeb20cba5d235d2eed010dce35ab19e3e2df603 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 25 Jun 2024 13:29:25 +0000 Subject: [PATCH 088/107] Update dependencies from https://github.com/dotnet/command-line-api build 20240624.3 (#6884) [main] Update dependencies from dotnet/command-line-api --- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 46d27a5f738..69bb693dc33 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -12,9 +12,9 @@ https://github.com/dotnet/diagnostics f9c76c57cfa222944222cb84f2cd90505a565435 - + https://github.com/dotnet/command-line-api - 963d34b1fb712c673bfb198133d7e988182c9ef4 + 803d8598f98fb4efd94604b32627ee9407f246db diff --git a/eng/Versions.props b/eng/Versions.props index c1e96617a97..96ed14c10f4 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -55,7 +55,7 @@ 8.0.1 8.0.1-servicing.23580.8 - 2.0.0-beta4.24209.3 + 2.0.0-beta4.24324.3 8.0.0-preview.24324.2 8.0.0-preview.24324.2 From c6e81499287f75ab4c925dc6a84c4625af695d11 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 25 Jun 2024 13:44:08 +0000 Subject: [PATCH 089/107] Update dependencies from https://github.com/dotnet/diagnostics build 20240624.2 (#6886) [feature/9.x] Update dependencies from dotnet/diagnostics --- eng/Version.Details.xml | 12 ++++++------ eng/Versions.props | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 56441e99fa4..d0ddea5566c 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -4,13 +4,13 @@ https://github.com/dotnet/aspnetcore 613c1e990b6b6411bda84456aefe14fe8e194279 - + https://github.com/dotnet/diagnostics - 842c9603a97cf417814cf6c8d96e5c881025bf0e + f9c76c57cfa222944222cb84f2cd90505a565435 - + https://github.com/dotnet/diagnostics - 842c9603a97cf417814cf6c8d96e5c881025bf0e + f9c76c57cfa222944222cb84f2cd90505a565435 https://github.com/dotnet/command-line-api @@ -42,9 +42,9 @@ https://github.com/dotnet/arcade 3aba80fecac252e1cdaffcebc0a37a24a960228b - + https://github.com/dotnet/diagnostics - 842c9603a97cf417814cf6c8d96e5c881025bf0e + f9c76c57cfa222944222cb84f2cd90505a565435 https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index cb1426bfbd0..92a740e1aca 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -57,8 +57,8 @@ 2.0.0-beta4.24209.3 - 8.0.0-preview.24321.1 - 8.0.0-preview.24321.1 + 8.0.0-preview.24324.2 + 8.0.0-preview.24324.2 9.0.0-preview.24323.1 @@ -67,7 +67,7 @@ 9.0.100-preview.7.24323.5 - 1.0.532101 + 1.0.532402 $(MicrosoftNETCoreApp31Version) From 70464307be75940a116d7ed346de7bd15e2be784 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 25 Jun 2024 13:49:16 +0000 Subject: [PATCH 090/107] Update dependencies from https://github.com/dotnet/command-line-api build 20240624.3 (#6887) [feature/9.x] Update dependencies from dotnet/command-line-api --- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index d0ddea5566c..851dc12dfcc 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -12,9 +12,9 @@ https://github.com/dotnet/diagnostics f9c76c57cfa222944222cb84f2cd90505a565435 - + https://github.com/dotnet/command-line-api - 963d34b1fb712c673bfb198133d7e988182c9ef4 + 803d8598f98fb4efd94604b32627ee9407f246db diff --git a/eng/Versions.props b/eng/Versions.props index 92a740e1aca..79a596dfbde 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -55,7 +55,7 @@ 9.0.0-preview.6.24320.4 9.0.0-preview.6.24320.4 - 2.0.0-beta4.24209.3 + 2.0.0-beta4.24324.3 8.0.0-preview.24324.2 8.0.0-preview.24324.2 From 92e2b1e13fdb818e803a33bfdfb6457ecda42b34 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 25 Jun 2024 14:04:39 +0000 Subject: [PATCH 091/107] Update dependencies from https://github.com/dotnet/arcade build 20240624.8 (#6888) [feature/9.x] Update dependencies from dotnet/arcade --- eng/Version.Details.xml | 20 ++++++++++---------- eng/Versions.props | 6 +++--- global.json | 4 ++-- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 851dc12dfcc..5ffef98a49e 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -22,25 +22,25 @@ https://github.com/dotnet/roslyn-analyzers f1115edce8633ebe03a86191bc05c6969ed9a821 - + https://github.com/dotnet/arcade - 3aba80fecac252e1cdaffcebc0a37a24a960228b + 79f0a2e647b3dcec3a88dcdcb9037736c21fe965 - + https://github.com/dotnet/arcade - 3aba80fecac252e1cdaffcebc0a37a24a960228b + 79f0a2e647b3dcec3a88dcdcb9037736c21fe965 - + https://github.com/dotnet/arcade - 3aba80fecac252e1cdaffcebc0a37a24a960228b + 79f0a2e647b3dcec3a88dcdcb9037736c21fe965 - + https://github.com/dotnet/arcade - 3aba80fecac252e1cdaffcebc0a37a24a960228b + 79f0a2e647b3dcec3a88dcdcb9037736c21fe965 - + https://github.com/dotnet/arcade - 3aba80fecac252e1cdaffcebc0a37a24a960228b + 79f0a2e647b3dcec3a88dcdcb9037736c21fe965 https://github.com/dotnet/diagnostics diff --git a/eng/Versions.props b/eng/Versions.props index 79a596dfbde..65097dd4ba0 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -48,9 +48,9 @@ --> - 9.0.0-beta.24321.4 - 9.0.0-beta.24321.4 - 9.0.0-beta.24321.4 + 9.0.0-beta.24324.8 + 9.0.0-beta.24324.8 + 9.0.0-beta.24324.8 9.0.0-preview.6.24320.4 9.0.0-preview.6.24320.4 diff --git a/global.json b/global.json index f665abe46e8..8247fe29b11 100644 --- a/global.json +++ b/global.json @@ -31,7 +31,7 @@ }, "msbuild-sdks": { "Microsoft.Build.NoTargets": "3.7.0", - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24321.4", - "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24321.4" + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24324.8", + "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24324.8" } } From 04df58bbc8709acd5f985581d6ac32aa398215d1 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Wed, 26 Jun 2024 14:11:23 +0000 Subject: [PATCH 092/107] Update dependencies from https://github.com/dotnet/diagnostics build 20240625.1 (#6893) [main] Update dependencies from dotnet/diagnostics --- eng/Version.Details.xml | 12 ++++++------ eng/Versions.props | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 69bb693dc33..60632b1c23b 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -4,13 +4,13 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore 8e941eb42f819adb116b881195158b3887a70a1c - + https://github.com/dotnet/diagnostics - f9c76c57cfa222944222cb84f2cd90505a565435 + cb11e39fd51a82531457478b52d58d9498903b40 - + https://github.com/dotnet/diagnostics - f9c76c57cfa222944222cb84f2cd90505a565435 + cb11e39fd51a82531457478b52d58d9498903b40 https://github.com/dotnet/command-line-api @@ -46,9 +46,9 @@ https://github.com/dotnet/arcade 3fe41d9e97519a4e9b48293906dbf58714ea9a0d - + https://github.com/dotnet/diagnostics - f9c76c57cfa222944222cb84f2cd90505a565435 + cb11e39fd51a82531457478b52d58d9498903b40 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime diff --git a/eng/Versions.props b/eng/Versions.props index 96ed14c10f4..286df6ea0d5 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -57,8 +57,8 @@ 2.0.0-beta4.24324.3 - 8.0.0-preview.24324.2 - 8.0.0-preview.24324.2 + 8.0.0-preview.24325.1 + 8.0.0-preview.24325.1 8.0.103-servicing.24114.15 @@ -67,7 +67,7 @@ 8.0.1 8.0.1-servicing.23580.1 - 1.0.532402 + 1.0.532501 $(MicrosoftNETCoreApp31Version) From 8f40541e3ab729d036ea542280cc99c173e553ac Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Thu, 27 Jun 2024 13:00:52 +0000 Subject: [PATCH 093/107] Update dependencies from https://github.com/dotnet/diagnostics build 20240626.1 (#6896) [main] Update dependencies from dotnet/diagnostics --- eng/Version.Details.xml | 12 ++++++------ eng/Versions.props | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 60632b1c23b..f59c755ba53 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -4,13 +4,13 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore 8e941eb42f819adb116b881195158b3887a70a1c - + https://github.com/dotnet/diagnostics - cb11e39fd51a82531457478b52d58d9498903b40 + 24e70219872cf1f46c9e291bf110ee4baf9c9ba8 - + https://github.com/dotnet/diagnostics - cb11e39fd51a82531457478b52d58d9498903b40 + 24e70219872cf1f46c9e291bf110ee4baf9c9ba8 https://github.com/dotnet/command-line-api @@ -46,9 +46,9 @@ https://github.com/dotnet/arcade 3fe41d9e97519a4e9b48293906dbf58714ea9a0d - + https://github.com/dotnet/diagnostics - cb11e39fd51a82531457478b52d58d9498903b40 + 24e70219872cf1f46c9e291bf110ee4baf9c9ba8 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime diff --git a/eng/Versions.props b/eng/Versions.props index 286df6ea0d5..d51ad1d1d68 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -57,8 +57,8 @@ 2.0.0-beta4.24324.3 - 8.0.0-preview.24325.1 - 8.0.0-preview.24325.1 + 8.0.0-preview.24326.1 + 8.0.0-preview.24326.1 8.0.103-servicing.24114.15 @@ -67,7 +67,7 @@ 8.0.1 8.0.1-servicing.23580.1 - 1.0.532501 + 1.0.532601 $(MicrosoftNETCoreApp31Version) From 7e917b7635a7e731bcd8bd2a3445a6ca0801ccee Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Thu, 27 Jun 2024 09:05:27 -0700 Subject: [PATCH 094/107] [feature/9.x] Update dependencies from dotnet/diagnostics (#6894) * Update dependencies from https://github.com/dotnet/diagnostics build 20240625.1 Microsoft.Diagnostics.Monitoring , Microsoft.Diagnostics.Monitoring.EventPipe , Microsoft.FileFormats From Version 8.0.0-preview.24324.2 -> To Version 8.0.0-preview.24325.1 * Update dependencies from https://github.com/dotnet/diagnostics build 20240626.1 Microsoft.Diagnostics.Monitoring , Microsoft.Diagnostics.Monitoring.EventPipe , Microsoft.FileFormats From Version 8.0.0-preview.24324.2 -> To Version 8.0.0-preview.24326.1 --------- Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 12 ++++++------ eng/Versions.props | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 5ffef98a49e..1bdab896d38 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -4,13 +4,13 @@ https://github.com/dotnet/aspnetcore 613c1e990b6b6411bda84456aefe14fe8e194279 - + https://github.com/dotnet/diagnostics - f9c76c57cfa222944222cb84f2cd90505a565435 + 24e70219872cf1f46c9e291bf110ee4baf9c9ba8 - + https://github.com/dotnet/diagnostics - f9c76c57cfa222944222cb84f2cd90505a565435 + 24e70219872cf1f46c9e291bf110ee4baf9c9ba8 https://github.com/dotnet/command-line-api @@ -42,9 +42,9 @@ https://github.com/dotnet/arcade 79f0a2e647b3dcec3a88dcdcb9037736c21fe965 - + https://github.com/dotnet/diagnostics - f9c76c57cfa222944222cb84f2cd90505a565435 + 24e70219872cf1f46c9e291bf110ee4baf9c9ba8 https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index 65097dd4ba0..6333316092a 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -57,8 +57,8 @@ 2.0.0-beta4.24324.3 - 8.0.0-preview.24324.2 - 8.0.0-preview.24324.2 + 8.0.0-preview.24326.1 + 8.0.0-preview.24326.1 9.0.0-preview.24323.1 @@ -67,7 +67,7 @@ 9.0.100-preview.7.24323.5 - 1.0.532402 + 1.0.532601 $(MicrosoftNETCoreApp31Version) From ace2d3a053c71a0ded933c468c56116acf93a063 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Thu, 27 Jun 2024 09:05:38 -0700 Subject: [PATCH 095/107] [feature/9.x] Update dependencies from dotnet/roslyn-analyzers (#6891) * Update dependencies from https://github.com/dotnet/roslyn-analyzers build 20240624.1 Microsoft.CodeAnalysis.NetAnalyzers From Version 9.0.0-preview.24323.1 -> To Version 9.0.0-preview.24324.1 * Update dependencies from https://github.com/dotnet/roslyn-analyzers build 20240624.1 Microsoft.CodeAnalysis.NetAnalyzers From Version 9.0.0-preview.24323.1 -> To Version 9.0.0-preview.24324.1 * Update dependencies from https://github.com/dotnet/roslyn-analyzers build 20240624.1 Microsoft.CodeAnalysis.NetAnalyzers From Version 9.0.0-preview.24323.1 -> To Version 9.0.0-preview.24324.1 --------- Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 1bdab896d38..a446416a731 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -18,9 +18,9 @@ - + https://github.com/dotnet/roslyn-analyzers - f1115edce8633ebe03a86191bc05c6969ed9a821 + 43709af7570da7140fb3e9a5237f55ffb24677e7 https://github.com/dotnet/arcade diff --git a/eng/Versions.props b/eng/Versions.props index 6333316092a..e07874c70ea 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -60,7 +60,7 @@ 8.0.0-preview.24326.1 8.0.0-preview.24326.1 - 9.0.0-preview.24323.1 + 9.0.0-preview.24324.1 9.0.0-preview.6.24319.11 9.0.0-preview.6.24319.11 From 535aa9feef87ceff33f5b79c81ccacc9819738eb Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Thu, 27 Jun 2024 09:06:27 -0700 Subject: [PATCH 096/107] [feature/9.x] Update dependencies from dotnet/arcade (#6895) * Update dependencies from https://github.com/dotnet/arcade build 20240626.1 Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.XUnitExtensions From Version 9.0.0-beta.24324.8 -> To Version 9.0.0-beta.24326.1 * Update dependencies from https://github.com/dotnet/arcade build 20240627.1 Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.XUnitExtensions From Version 9.0.0-beta.24324.8 -> To Version 9.0.0-beta.24327.1 --------- Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 20 +++++++++---------- eng/Versions.props | 6 +++--- .../job/publish-build-assets.yml | 7 +++++-- .../steps/enable-internal-sources.yml | 4 +++- eng/common/dotnet-install.sh | 3 +++ eng/common/native/CommonLibrary.psm1 | 3 ++- global.json | 4 ++-- 7 files changed, 28 insertions(+), 19 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index a446416a731..31b64fda605 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -22,25 +22,25 @@ https://github.com/dotnet/roslyn-analyzers 43709af7570da7140fb3e9a5237f55ffb24677e7 - + https://github.com/dotnet/arcade - 79f0a2e647b3dcec3a88dcdcb9037736c21fe965 + ede13bd35571c0c8b0c01edcb057031904c5c955 - + https://github.com/dotnet/arcade - 79f0a2e647b3dcec3a88dcdcb9037736c21fe965 + ede13bd35571c0c8b0c01edcb057031904c5c955 - + https://github.com/dotnet/arcade - 79f0a2e647b3dcec3a88dcdcb9037736c21fe965 + ede13bd35571c0c8b0c01edcb057031904c5c955 - + https://github.com/dotnet/arcade - 79f0a2e647b3dcec3a88dcdcb9037736c21fe965 + ede13bd35571c0c8b0c01edcb057031904c5c955 - + https://github.com/dotnet/arcade - 79f0a2e647b3dcec3a88dcdcb9037736c21fe965 + ede13bd35571c0c8b0c01edcb057031904c5c955 https://github.com/dotnet/diagnostics diff --git a/eng/Versions.props b/eng/Versions.props index e07874c70ea..3ec274153c2 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -48,9 +48,9 @@ --> - 9.0.0-beta.24324.8 - 9.0.0-beta.24324.8 - 9.0.0-beta.24324.8 + 9.0.0-beta.24327.1 + 9.0.0-beta.24327.1 + 9.0.0-beta.24327.1 9.0.0-preview.6.24320.4 9.0.0-preview.6.24320.4 diff --git a/eng/common/core-templates/job/publish-build-assets.yml b/eng/common/core-templates/job/publish-build-assets.yml index 2cf8e1853d0..d99a1a3b284 100644 --- a/eng/common/core-templates/job/publish-build-assets.yml +++ b/eng/common/core-templates/job/publish-build-assets.yml @@ -155,10 +155,13 @@ jobs: PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} is1ESPipeline: ${{ parameters.is1ESPipeline }} - - task: PowerShell@2 + - task: AzureCLI@2 displayName: Publish Using Darc inputs: - filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1 + azureSubscription: "Darc: Maestro Production" + scriptType: ps + scriptLocation: scriptPath + scriptPath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1 arguments: -BuildId $(BARBuildId) -PublishingInfraVersion 3 -AzdoToken '$(publishing-dnceng-devdiv-code-r-build-re)' diff --git a/eng/common/core-templates/steps/enable-internal-sources.yml b/eng/common/core-templates/steps/enable-internal-sources.yml index 4a06b529082..64f881bffc3 100644 --- a/eng/common/core-templates/steps/enable-internal-sources.yml +++ b/eng/common/core-templates/steps/enable-internal-sources.yml @@ -18,7 +18,9 @@ steps: displayName: Setup Internal Feeds inputs: filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1 - arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config + arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config -Password $Env:Token + env: + Token: ${{ parameters.legacyCredential }} # If running on dnceng (internal project), just use the default behavior for NuGetAuthenticate. # If running on DevDiv, NuGetAuthenticate is not really an option. It's scoped to a single feed, and we have many feeds that # may be added. Instead, we'll use the traditional approach (add cred to nuget.config), but use an account token. diff --git a/eng/common/dotnet-install.sh b/eng/common/dotnet-install.sh index a2fba470380..7b9d97e3bd4 100755 --- a/eng/common/dotnet-install.sh +++ b/eng/common/dotnet-install.sh @@ -71,6 +71,9 @@ case $cpuname in i[3-6]86) buildarch=x86 ;; + riscv64) + buildarch=riscv64 + ;; *) echo "Unknown CPU $cpuname detected, treating it as x64" buildarch=x64 diff --git a/eng/common/native/CommonLibrary.psm1 b/eng/common/native/CommonLibrary.psm1 index ca38268c44d..f71f6af6cdb 100644 --- a/eng/common/native/CommonLibrary.psm1 +++ b/eng/common/native/CommonLibrary.psm1 @@ -277,7 +277,8 @@ function Get-MachineArchitecture { if (($ProcessorArchitecture -Eq "AMD64") -Or ($ProcessorArchitecture -Eq "IA64") -Or ($ProcessorArchitecture -Eq "ARM64") -Or - ($ProcessorArchitecture -Eq "LOONGARCH64")) { + ($ProcessorArchitecture -Eq "LOONGARCH64") -Or + ($ProcessorArchitecture -Eq "RISCV64")) { return "x64" } return "x86" diff --git a/global.json b/global.json index 8247fe29b11..5f91d176963 100644 --- a/global.json +++ b/global.json @@ -31,7 +31,7 @@ }, "msbuild-sdks": { "Microsoft.Build.NoTargets": "3.7.0", - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24324.8", - "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24324.8" + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24327.1", + "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24327.1" } } From ee7b2f52917da7a47ae64f24c15d4864171ffcfc Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 28 Jun 2024 13:05:31 +0000 Subject: [PATCH 097/107] Update dependencies from https://github.com/dotnet/diagnostics build 20240627.1 (#6900) [main] Update dependencies from dotnet/diagnostics --- eng/Version.Details.xml | 12 ++++++------ eng/Versions.props | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index f59c755ba53..8162694e888 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -4,13 +4,13 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore 8e941eb42f819adb116b881195158b3887a70a1c - + https://github.com/dotnet/diagnostics - 24e70219872cf1f46c9e291bf110ee4baf9c9ba8 + e009bfe09b92ef8d2064c4103f3cac85915b3ceb - + https://github.com/dotnet/diagnostics - 24e70219872cf1f46c9e291bf110ee4baf9c9ba8 + e009bfe09b92ef8d2064c4103f3cac85915b3ceb https://github.com/dotnet/command-line-api @@ -46,9 +46,9 @@ https://github.com/dotnet/arcade 3fe41d9e97519a4e9b48293906dbf58714ea9a0d - + https://github.com/dotnet/diagnostics - 24e70219872cf1f46c9e291bf110ee4baf9c9ba8 + e009bfe09b92ef8d2064c4103f3cac85915b3ceb https://dev.azure.com/dnceng/internal/_git/dotnet-runtime diff --git a/eng/Versions.props b/eng/Versions.props index d51ad1d1d68..62967d3f127 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -57,8 +57,8 @@ 2.0.0-beta4.24324.3 - 8.0.0-preview.24326.1 - 8.0.0-preview.24326.1 + 8.0.0-preview.24327.1 + 8.0.0-preview.24327.1 8.0.103-servicing.24114.15 @@ -67,7 +67,7 @@ 8.0.1 8.0.1-servicing.23580.1 - 1.0.532601 + 1.0.532701 $(MicrosoftNETCoreApp31Version) From eea5e09ab4290bfb1757a194762fd8ce593d1401 Mon Sep 17 00:00:00 2001 From: Justin Anderson Date: Fri, 28 Jun 2024 09:18:54 -0700 Subject: [PATCH 098/107] Update build asset staging to use managed identity (#6899) --- eng/pipelines/dotnet-monitor-compliance.yml | 2 - eng/pipelines/stages/preparerelease.yml | 57 +++++++++++------ .../Common/AzureBlobPublisher.cs | 63 +++++-------------- eng/release/DiagnosticsReleaseTool/Config.cs | 11 ++-- .../DiagnosticsReleaseCommandLine.cs | 5 +- .../DiagnosticsReleaseRunner.cs | 2 +- .../DiagnosticsReleaseTool.csproj | 17 ++--- eng/release/Directory.Build.props | 3 +- eng/release/Scripts/AcquireBuild.ps1 | 10 +-- 9 files changed, 71 insertions(+), 99 deletions(-) diff --git a/eng/pipelines/dotnet-monitor-compliance.yml b/eng/pipelines/dotnet-monitor-compliance.yml index e443bd43067..86caff41e50 100644 --- a/eng/pipelines/dotnet-monitor-compliance.yml +++ b/eng/pipelines/dotnet-monitor-compliance.yml @@ -71,8 +71,6 @@ extends: arguments: >- -BarBuildId "$(BuildBarId)" -AzdoToken "$(dn-bot-all-drop-rw-code-rw-release-all)" - -MaestroToken "$(MaestroAccessToken)" - -GitHubToken "$(BotAccount-dotnet-bot-repo-PAT)" -DownloadTargetPath "$(System.ArtifactsDirectory)\BuildAssets" -SasSuffixes "$(dotnetbuilds-internal-checksums-container-read-token),$(dotnetbuilds-internal-container-read-token)" -ReleaseVersion "$(BuildVersion)" diff --git a/eng/pipelines/stages/preparerelease.yml b/eng/pipelines/stages/preparerelease.yml index 6a728d15ebf..743f9aaf2d4 100644 --- a/eng/pipelines/stages/preparerelease.yml +++ b/eng/pipelines/stages/preparerelease.yml @@ -28,14 +28,18 @@ stages: packageType: runtime version: 6.x installationPath: '$(Build.Repository.LocalPath)\.dotnet' + - script: mkdir $(System.ArtifactsDirectory)\StagingToolLogs displayName: Create Staging Tool Logs Directory + - script: '$(Build.SourcesDirectory)\dotnet.cmd build $(Build.Repository.LocalPath)\eng\release\DiagnosticsReleaseTool\DiagnosticsReleaseTool.csproj -c Release /bl' workingDirectory: '$(System.ArtifactsDirectory)\StagingToolLogs' displayName: 'Build Staging Tool' + # Run tool for release and test release branches - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest'), or(startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'), startsWith(variables['Build.SourceBranch'], 'refs/heads/internal/release/'), startsWith(variables['Build.SourceBranch'], 'refs/heads/test/release/'))) }}: - template: /eng/common/templates-official/post-build/setup-maestro-vars.yml@self + - task: PowerShell@2 displayName: Get Build Version inputs: @@ -44,42 +48,53 @@ stages: -BarId $(BARBuildId) -MaestroToken $(MaestroAccessToken) -TaskVariableName 'BuildVersion' - - task: PowerShell@2 + + - task: AzureCLI@2 displayName: 'Download Build Assets' inputs: - targetType: filePath - filePath: '$(Build.Repository.LocalPath)/eng/release/Scripts/AcquireBuild.ps1' + azureSubscription: 'Darc: Maestro Production' + scriptType: ps + scriptPath: '$(Build.Repository.LocalPath)/eng/release/Scripts/AcquireBuild.ps1' arguments: >- -BarBuildId "$(BARBuildId)" -AzdoToken "$(dn-bot-all-drop-rw-code-rw-release-all)" - -MaestroToken "$(MaestroAccessToken)" - -GitHubToken "$(BotAccount-dotnet-bot-repo-PAT)" -DownloadTargetPath "$(System.ArtifactsDirectory)\BuildAssets" -SasSuffixes "$(dotnetbuilds-internal-checksums-container-read-token),$(dotnetbuilds-internal-container-read-token)" -ReleaseVersion "$(Build.BuildNumber)" workingDirectory: '$(Build.Repository.LocalPath)' continueOnError: true - - script: >- - $(Build.SourcesDirectory)\dotnet.cmd run --project $(Build.Repository.LocalPath)\eng\release\DiagnosticsReleaseTool\DiagnosticsReleaseTool.csproj -c Release - -- - prepare-release - --input-drop-path "$(System.ArtifactsDirectory)\BuildAssets" - --tool-manifest "$(Build.Repository.LocalPath)\eng\release\tool-list.json" - --staging-directory "$(System.ArtifactsDirectory)\AssetsLayout" - --release-name "$(Build.BuildNumber)" - --build-version "$(BuildVersion)" - --account-name "$(dotnet-diagnostics-storage-accountname)" - --account-key "$(dotnetstage-storage-key)" - --sas-valid-days "$(dotnet-diagnostics-storage-retentiondays)" - -v True - workingDirectory: '$(System.ArtifactsDirectory)\StagingToolLogs' - displayName: 'Stage Build Assets and Manifest' + + - task: AzureCLI@2 + displayName: 'Manifest Generation and Asset Publishing' + inputs: + workingDirectory: '$(System.ArtifactsDirectory)\StagingToolLogs' + azureSubscription: 'dotnetstage-dotnet-monitor-rw' + scriptType: pscore + scriptLocation: inlineScript + addSpnToEnvironment: true + inlineScript: >- + $(Build.SourcesDirectory)\dotnet.cmd run + --project $(Build.Repository.LocalPath)\eng\release\DiagnosticsReleaseTool\DiagnosticsReleaseTool.csproj + -c Release + -- + prepare-release + --input-drop-path "$(System.ArtifactsDirectory)\BuildAssets" + --tool-manifest "$(Build.Repository.LocalPath)\eng\release\tool-list.json" + --staging-directory "$(System.ArtifactsDirectory)\AssetsLayout" + --release-name "$(Build.BuildNumber)" + --build-version "$(BuildVersion)" + --account-name "$(dotnet-diagnostics-storage-accountname)" + --container-name $(dotnet-monitor-container-name) + --client-id "$env:servicePrincipalId" + -v True + - template: /eng/pipelines/steps/publish-pipeline-artifact.yml@self parameters: displayName: 'Upload Assets Layout' targetPath: '$(System.ArtifactsDirectory)\AssetsLayout' artifact: 'StagingToolAssetsLayout' is1ESPipeline: ${{ parameters.is1ESPipeline }} + # Only tag build from real release branches - ${{ if not(startsWith(variables['Build.SourceBranch'], 'refs/heads/test/release/')) }}: - task: Powershell@2 @@ -87,12 +102,14 @@ stages: inputs: targetType: inline script: Write-Host "##vso[build.addbuildtag]MonitorRelease" + - template: /eng/pipelines/steps/publish-pipeline-artifact.yml@self parameters: displayName: 'Upload Staging Tool Logs' targetPath: '$(System.ArtifactsDirectory)\StagingToolLogs' artifact: 'StagingToolLogs' is1ESPipeline: ${{ parameters.is1ESPipeline }} + - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - task: Powershell@2 displayName: 'Tag Build with update-docker' diff --git a/eng/release/DiagnosticsReleaseTool/Common/AzureBlobPublisher.cs b/eng/release/DiagnosticsReleaseTool/Common/AzureBlobPublisher.cs index 04becfb2293..945ac240ed8 100644 --- a/eng/release/DiagnosticsReleaseTool/Common/AzureBlobPublisher.cs +++ b/eng/release/DiagnosticsReleaseTool/Common/AzureBlobPublisher.cs @@ -1,10 +1,10 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using Azure.Storage; +using Azure.Core; +using Azure.Identity; using Azure.Storage.Blobs; using Azure.Storage.Blobs.Models; -using Azure.Storage.Sas; using Microsoft.Extensions.Logging; using System; using System.Buffers; @@ -17,17 +17,14 @@ namespace ReleaseTool.Core { public class AzureBlobBublisher : IPublisher { - private const int ClockSkewSec = 15 * 60; private const int MaxRetries = 15; private const int MaxFullLoopRetries = 5; private readonly TimeSpan FullLoopRetryDelay = TimeSpan.FromSeconds(1); - private const string AccessPolicyDownloadId = "DownloadDrop"; private readonly string _accountName; - private readonly string _accountKey; + private readonly string _clientId; private readonly string _containerName; private readonly string _buildVersion; - private readonly int _sasValidDays; private readonly ILogger _logger; private BlobContainerClient _client; @@ -40,12 +37,17 @@ private Uri AccountBlobUri } } - private StorageSharedKeyCredential AccountCredential + private TokenCredential Credentials { get { - StorageSharedKeyCredential credential = new StorageSharedKeyCredential(_accountName, _accountKey); - return credential; + if (_clientId == null) + { + // Local development scenario. Use the default credential. + return new DefaultAzureCredential(); + } + + return new DefaultAzureCredential(new DefaultAzureCredentialOptions { ManagedIdentityClientId = _clientId }); } } @@ -68,13 +70,12 @@ private BlobClientOptions BlobOptions } } - public AzureBlobBublisher(string accountName, string accountKey, string containerName, string buildVersion, int sasValidDays, ILogger logger) + public AzureBlobBublisher(string accountName, string clientId, string containerName, string buildVersion, ILogger logger) { _accountName = accountName; - _accountKey = accountKey; + _clientId = clientId; _containerName = containerName; _buildVersion = buildVersion; - _sasValidDays = sasValidDays; _logger = logger; } @@ -107,20 +108,11 @@ public async Task PublishFileAsync(FileMapping fileMap, CancellationToke await blobClient.UploadAsync(srcStream, overwrite: true, ct); - BlobSasBuilder sasBuilder = new BlobSasBuilder() - { - BlobContainerName = client.Name, - BlobName = blobClient.Name, - Identifier = AccessPolicyDownloadId, - Protocol = SasProtocol.Https - }; - Uri accessUri = blobClient.GenerateSasUri(sasBuilder); - using BlobDownloadStreamingResult blobStream = (await blobClient.DownloadStreamingAsync(cancellationToken: ct)).Value; srcStream.Position = 0; completed = await VerifyFileStreamsMatchAsync(srcStream, blobStream, ct); - result = accessUri; + result = blobClient.Uri; } catch (IOException ioEx) when (!(ioEx is PathTooLongException)) { @@ -155,7 +147,7 @@ private async Task GetClient(CancellationToken ct) { if (_client == null) { - BlobServiceClient serviceClient = new BlobServiceClient(AccountBlobUri, AccountCredential, BlobOptions); + BlobServiceClient serviceClient = new BlobServiceClient(AccountBlobUri, Credentials, BlobOptions); _logger.LogInformation($"Attempting to connect to {serviceClient.Uri} to store blobs."); BlobContainerClient newClient; @@ -176,31 +168,6 @@ private async Task GetClient(CancellationToken ct) continue; } - try - { - DateTime baseTime = DateTime.UtcNow; - // Add the new (or update existing) "download" policy to the container - // This is used to mint the SAS tokens without an expiration policy - // Expiration can be added later by modifying this policy - BlobSignedIdentifier downloadPolicyIdentifier = new BlobSignedIdentifier() - { - Id = AccessPolicyDownloadId, - AccessPolicy = new BlobAccessPolicy() - { - Permissions = "r", - PolicyStartsOn = new DateTimeOffset(baseTime.AddSeconds(-ClockSkewSec)), - PolicyExpiresOn = new DateTimeOffset(DateTime.UtcNow.AddDays(_sasValidDays).AddSeconds(ClockSkewSec)), - } - }; - _logger.LogInformation($"Writing download access policy: {AccessPolicyDownloadId} to {_containerName}."); - await newClient.SetAccessPolicyAsync(PublicAccessType.None, new BlobSignedIdentifier[] { downloadPolicyIdentifier }, cancellationToken: ct); - } - catch (Exception ex) - { - _logger.LogWarning(ex, $"Failed to write access policy for {_containerName}, retrying."); - continue; - } - _logger.LogInformation($"Container {_containerName} is ready."); _client = newClient; break; diff --git a/eng/release/DiagnosticsReleaseTool/Config.cs b/eng/release/DiagnosticsReleaseTool/Config.cs index 637fda3a393..475b84c8188 100644 --- a/eng/release/DiagnosticsReleaseTool/Config.cs +++ b/eng/release/DiagnosticsReleaseTool/Config.cs @@ -14,9 +14,8 @@ internal class Config public string ReleaseName { get; } public string BuildVersion { get; } public string AccountName { get; } - public string AccountKey { get; } + public string ClientId { get; } public string ContainerName { get; } - public int SasValidDays { get; } public Config( FileInfo toolManifest, @@ -26,9 +25,8 @@ public Config( string releaseName, string buildVersion, string accountName, - string accountKey, - string containerName, - int sasValidDays) + string clientId, + string containerName) { ToolManifest = toolManifest; ShouldVerifyManifest = verifyToolManifest; @@ -37,9 +35,8 @@ public Config( ReleaseName = releaseName; BuildVersion = buildVersion; AccountName = accountName; - AccountKey = accountKey; + ClientId = clientId; ContainerName = containerName; - SasValidDays = sasValidDays; } } } diff --git a/eng/release/DiagnosticsReleaseTool/DiagnosticsReleaseCommandLine.cs b/eng/release/DiagnosticsReleaseTool/DiagnosticsReleaseCommandLine.cs index 06072d77a3e..5884f3a3cb6 100644 --- a/eng/release/DiagnosticsReleaseTool/DiagnosticsReleaseCommandLine.cs +++ b/eng/release/DiagnosticsReleaseTool/DiagnosticsReleaseCommandLine.cs @@ -107,8 +107,9 @@ private static Option AzureStorageAccountNameOption() => private static Option AzureStorageAccountKeyOption() => new Option( - aliases: new[] { "-k", "--account-key" }, - description: "Storage account key, in base 64 format.") + aliases: new[] { "-k", "--client-id" }, + description: "Identity Client ID. If left blank, ambient identity will be used.", + getDefaultValue: () => null) { IsRequired = true, }; diff --git a/eng/release/DiagnosticsReleaseTool/DiagnosticsReleaseRunner.cs b/eng/release/DiagnosticsReleaseTool/DiagnosticsReleaseRunner.cs index 3ecfa62f936..e9024d55d48 100644 --- a/eng/release/DiagnosticsReleaseTool/DiagnosticsReleaseRunner.cs +++ b/eng/release/DiagnosticsReleaseTool/DiagnosticsReleaseRunner.cs @@ -49,7 +49,7 @@ internal async static Task PrepareRelease(Config releaseConfig, bool verbos IPublisher releasePublisher = dryRun ? new SkipPublisher() : - new AzureBlobBublisher(releaseConfig.AccountName, releaseConfig.AccountKey, releaseConfig.ContainerName, releaseConfig.BuildVersion, releaseConfig.SasValidDays, logger); + new AzureBlobBublisher(releaseConfig.AccountName, releaseConfig.ClientId, releaseConfig.ContainerName, releaseConfig.BuildVersion, logger); IManifestGenerator manifestGenerator = new DiagnosticsManifestGenerator(releaseMetadata, releaseConfig.ToolManifest, logger); using var diagnosticsRelease = new Release( diff --git a/eng/release/DiagnosticsReleaseTool/DiagnosticsReleaseTool.csproj b/eng/release/DiagnosticsReleaseTool/DiagnosticsReleaseTool.csproj index fc0720a3fb5..336e0567bce 100644 --- a/eng/release/DiagnosticsReleaseTool/DiagnosticsReleaseTool.csproj +++ b/eng/release/DiagnosticsReleaseTool/DiagnosticsReleaseTool.csproj @@ -13,15 +13,16 @@ - - - - - - + + + + + + - - + + + diff --git a/eng/release/Directory.Build.props b/eng/release/Directory.Build.props index a8133bfcf5e..100d8a4ebf8 100644 --- a/eng/release/Directory.Build.props +++ b/eng/release/Directory.Build.props @@ -1,4 +1,3 @@ - - + \ No newline at end of file diff --git a/eng/release/Scripts/AcquireBuild.ps1 b/eng/release/Scripts/AcquireBuild.ps1 index b76c6279a09..220c6ff13fd 100644 --- a/eng/release/Scripts/AcquireBuild.ps1 +++ b/eng/release/Scripts/AcquireBuild.ps1 @@ -4,9 +4,6 @@ param( [Parameter(Mandatory=$true)][string] $DownloadTargetPath, [Parameter(Mandatory=$true)][string] $SasSuffixes, [Parameter(Mandatory=$true)][string] $AzdoToken, - [Parameter(Mandatory=$true)][string] $MaestroToken, - [Parameter(Mandatory=$true)][string] $GitHubToken, - [Parameter(Mandatory=$false)][string] $MaestroApiEndPoint = 'https://maestro-prod.westus2.cloudapp.azure.com', [Parameter(Mandatory=$false)][string] $DarcVersion = $null, [Parameter(Mandatory=$false)][bool] $Separated = $true, [switch] $help, @@ -19,9 +16,6 @@ function Write-Help() { Write-Host " -DownloadTargetPath Path to download the build to." Write-Host " -SasSuffixes Comma separated list of potential uri suffixes that can be used if anonymous access to a blob uri fails. Appended directly to the end of the URI. Use full SAS syntax with ?." Write-Host " -AzdoToken Azure DevOps token to use for builds queries" - Write-Host " -MaestroToken Maestro token to use for querying BAR" - Write-Host " -GitHubToken GitHub token to use for querying repository information" - Write-Host " -MaestroApiEndPoint BAR endpoint to use for build queries." Write-Host " -Separated <`$true|`$false> Download files to their repo separated locations." Write-Host "" } @@ -62,12 +56,10 @@ try { --output-dir $DownloadTargetPath ` --overwrite ` --sas-suffixes $SasSuffixes ` - --github-pat $GitHubToken ` --azdev-pat $AzdoToken ` - --bar-uri $MaestroApiEndPoint ` - --password $MaestroToken ` --verbose ` --continue-on-error ` + --ci ` $separatedArgs if ($LastExitCode -ne 0) { From 4404dcc5ca400479b7f9501f6ffda22883c48226 Mon Sep 17 00:00:00 2001 From: Joe Schmitt <1146681+schmittjoseph@users.noreply.github.com> Date: Fri, 28 Jun 2024 10:06:48 -0700 Subject: [PATCH 099/107] Use managed identity to publish release assets (#6898) --- eng/pipelines/dotnet-monitor-release.yml | 53 ++++++++----------- eng/release/Scripts/PublishToBlobAccounts.ps1 | 53 ++++--------------- 2 files changed, 31 insertions(+), 75 deletions(-) diff --git a/eng/pipelines/dotnet-monitor-release.yml b/eng/pipelines/dotnet-monitor-release.yml index 4e31668eb9d..2dec67a9cc8 100644 --- a/eng/pipelines/dotnet-monitor-release.yml +++ b/eng/pipelines/dotnet-monitor-release.yml @@ -70,7 +70,7 @@ extends: -BarId $(BarId) -MaestroToken $(MaestroAccessToken) -TaskVariableName 'ReleaseVersion' - + - task: PowerShell@2 displayName: Get Build Version inputs: @@ -107,10 +107,15 @@ extends: variables: - ${{ if eq(parameters.IsTestRun, 'true') }}: - - group: DotNet-Diagnostics-Storage-Test + - name: DestinationAccountName + value: monitortestcli + - name: ChecksumsAccountName + value: monitortestchecksums - ${{ else }}: - - group: DotNetCli storage account tokens - - group: DotNet-DotNetStage-Storage + - name: DestinationAccountName + value: dotnetcli + - name: ChecksumsAccountName + value: dotnetclichecksums workspace: clean: all @@ -164,42 +169,28 @@ extends: - powershell: Install-Module Az.Storage -Force -Scope CurrentUser -AllowClobber -Verbose -RequiredVersion 5.10.1 displayName: Install Az.Storage Module 5.10.1 - - powershell: | - Write-Host "##vso[task.setvariable variable=DestinationAccountName]$env:DESTINATION_ACCOUNT_NAME" - Write-Host "##vso[task.setvariable variable=DestinationSasTokenBase64;issecret=true]$env:DESTINATION_SAS_TOKEN_BASE64" - Write-Host "##vso[task.setvariable variable=ChecksumsAccountName]$env:CHECKSUMS_ACCOUNT_NAME" - Write-Host "##vso[task.setvariable variable=ChecksumsSasTokenBase64;issecret=true]$env:CHECKSUMS_SAS_TOKEN_BASE64" - displayName: Set Storage Accounts - ${{ if eq(parameters.IsTestRun, 'true') }}: - env: - # Variables provided by DotNet-Diagnostics-Storage-Test group - DESTINATION_ACCOUNT_NAME: $(dotnet-monitor-test-storage-accountname) - DESTINATION_SAS_TOKEN_BASE64: $(dotnet-monitor-test-blob-write-token-base64) - CHECKSUMS_ACCOUNT_NAME: $(dotnet-monitor-checksums-test-storage-accountname) - CHECKSUMS_SAS_TOKEN_BASE64: $(dotnet-monitor-checksums-test-blob-write-token-base64) - ${{ else }}: - env: - # Variables provided by "DotNetCli storage account tokens" group - DESTINATION_ACCOUNT_NAME: dotnetcli - DESTINATION_SAS_TOKEN_BASE64: $(dotnetcli-account-blob-write-token-base64) - CHECKSUMS_ACCOUNT_NAME: dotnetclichecksums - CHECKSUMS_SAS_TOKEN_BASE64: $(dotnetclichecksums-account-blob-write-token-base64) - - - task: PowerShell@2 + - task: AzureCLI@2 displayName: Publish Assets inputs: - filePath: $(Build.SourcesDirectory)/eng/release/Scripts/PublishToBlobAccounts.ps1 + # It seems that azureSubscription can't use runtime expressions, so we need to use a compile time expression + # to set it. + ${{ if eq(parameters.IsTestRun, 'true') }}: + azureSubscription: dotnet-monitor-test-publish + ${{ else }}: + azureSubscription: dotnet-monitor-cli-storage-accounts-publish + # Save the service principal details to the environment so that azcopy can use them + addSpnToEnvironment: true + scriptType: ps + scriptLocation: scriptPath + scriptPath: $(Build.SourcesDirectory)/eng/release/Scripts/PublishToBlobAccounts.ps1 arguments: >- -AzCopyPath $(AzCopyPath) -BuildVersion $(BuildVersion) -ReleaseVersion $(ReleaseVersion) - -DotnetStageAccountKey $(dotnetstage-storage-key) -DestinationAccountName $(DestinationAccountName) - -DestinationSasTokenBase64 $(DestinationSasTokenBase64) -ChecksumsAccountName $(ChecksumsAccountName) - -ChecksumsSasTokenBase64 $(ChecksumsSasTokenBase64) -WhatIf:${{ format('${0}', parameters.IsDryRun) }} - + - task: 1ES.PublishBuildArtifacts@1 displayName: Publish Logs inputs: diff --git a/eng/release/Scripts/PublishToBlobAccounts.ps1 b/eng/release/Scripts/PublishToBlobAccounts.ps1 index 4e0313a464b..19e418a677f 100644 --- a/eng/release/Scripts/PublishToBlobAccounts.ps1 +++ b/eng/release/Scripts/PublishToBlobAccounts.ps1 @@ -3,23 +3,20 @@ Param( [Parameter(Mandatory=$true)][string]$AzCopyPath, [Parameter(Mandatory=$true)][string]$BuildVersion, [Parameter(Mandatory=$true)][string]$ReleaseVersion, - [Parameter(Mandatory=$true)][string]$DotnetStageAccountKey, [Parameter(Mandatory=$true)][string]$DestinationAccountName, - [Parameter(Mandatory=$true)][string]$DestinationSasTokenBase64, - [Parameter(Mandatory=$true)][string]$ChecksumsAccountName, - [Parameter(Mandatory=$true)][string]$ChecksumsSasTokenBase64 + [Parameter(Mandatory=$true)][string]$ChecksumsAccountName ) $ErrorActionPreference = 'Stop' Set-StrictMode -Version 2.0 +# Use the OAuth token that was obtained by the az cli when it logged in. +$Env:AZCOPY_AUTO_LOGIN_TYPE="AZCLI" + $sourceAccountName = 'dotnetstage' $sourceContainerName = 'dotnet-monitor' $destinationContainerName = 'dotnet' -$destinationSasToken = [Text.Encoding]::UTF8.GetString([Convert]::FromBase64String($DestinationSasTokenBase64)) -$checksumsSasToken = [Text.Encoding]::UTF8.GetString([Convert]::FromBase64String($ChecksumsSasTokenBase64)) - function Generate-Source-Uri{ [CmdletBinding()] Param( @@ -38,34 +35,11 @@ function Generate-Destination-Uri{ return "https://$AccountName.blob.core.windows.net/$destinationContainerName/diagnostics/monitor/$ReleaseVersion" } -function Generate-Sas-Token{ - [CmdletBinding()] - Param( - [Parameter(Mandatory=$true)][string]$StorageAccountName, - [Parameter(Mandatory=$true)][string]$ContainerName, - [Parameter(Mandatory=$true)][string]$AccountKey, - [Parameter(Mandatory=$true)][string]$Permissions - ) - - $context = New-AzStorageContext ` - -StorageAccountName $StorageAccountName ` - -StorageAccountKey $AccountKey - - return New-AzStorageContainerSASToken ` - -Container $ContainerName ` - -Context $context ` - -Permission $Permissions ` - -StartTime (Get-Date).AddMinutes(-15.0) ` - -ExpiryTime (Get-Date).AddHours(1.0) -} - function Transfer-File{ [CmdletBinding(SupportsShouldProcess)] Param( [Parameter(Mandatory=$true)][string]$From, - [Parameter(Mandatory=$true)][string]$To, - [Parameter(Mandatory=$true)][string]$FromToken, - [Parameter(Mandatory=$true)][string]$ToToken + [Parameter(Mandatory=$true)][string]$To ) Write-Host "Copy $From -> $To" @@ -73,8 +47,8 @@ function Transfer-File{ if ($From -eq $to) { Write-Host 'Skipping copy because source and destination are the same.' } else { - [array]$azCopyArgs = "$From$FromToken" - $azCopyArgs += "$To$ToToken" + [array]$azCopyArgs = "$From" + $azCopyArgs += "$To" $azCopyArgs += "--s2s-preserve-properties" $azCopyArgs += "--s2s-preserve-access-tier=false" if ($WhatIfPreference) { @@ -84,14 +58,9 @@ function Transfer-File{ } } -# Create source URI and SAS token +# Create source URI $sourceUri = Generate-Source-Uri ` -AssetType 'Blob' -$soureSasToken = Generate-Sas-Token ` - -StorageAccountName $sourceAccountName ` - -ContainerName $sourceContainerName ` - -AccountKey $DotnetStageAccountKey ` - -Permissions 'rl' # Create destination URI $destinationUri = Generate-Destination-Uri ` @@ -100,9 +69,7 @@ $destinationUri = Generate-Destination-Uri ` # Copy files to destination account Transfer-File ` -From $sourceUri ` - -FromToken $soureSasToken ` -To $destinationUri ` - -ToToken $destinationSasToken ` -WhatIf:$WhatIfPreference # Create source checksums URI @@ -116,7 +83,5 @@ $checksumsDestinationUri = Generate-Destination-Uri ` # Copy checksums to checksum account Transfer-File ` -From $checksumsSourceUri ` - -FromToken $soureSasToken ` -To $checksumsDestinationUri ` - -ToToken $checksumsSasToken ` - -WhatIf:$WhatIfPreference \ No newline at end of file + -WhatIf:$WhatIfPreference From a8f38afd17fce098e4a3fc9df65f6cfb883752ed Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 28 Jun 2024 17:41:24 +0000 Subject: [PATCH 100/107] Update dependencies from https://github.com/dotnet/diagnostics build 20240627.1 (#6901) [feature/9.x] Update dependencies from dotnet/diagnostics --- eng/Version.Details.xml | 12 ++++++------ eng/Versions.props | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 31b64fda605..adee9ae1328 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -4,13 +4,13 @@ https://github.com/dotnet/aspnetcore 613c1e990b6b6411bda84456aefe14fe8e194279 - + https://github.com/dotnet/diagnostics - 24e70219872cf1f46c9e291bf110ee4baf9c9ba8 + e009bfe09b92ef8d2064c4103f3cac85915b3ceb - + https://github.com/dotnet/diagnostics - 24e70219872cf1f46c9e291bf110ee4baf9c9ba8 + e009bfe09b92ef8d2064c4103f3cac85915b3ceb https://github.com/dotnet/command-line-api @@ -42,9 +42,9 @@ https://github.com/dotnet/arcade ede13bd35571c0c8b0c01edcb057031904c5c955 - + https://github.com/dotnet/diagnostics - 24e70219872cf1f46c9e291bf110ee4baf9c9ba8 + e009bfe09b92ef8d2064c4103f3cac85915b3ceb https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index 3ec274153c2..1184a781505 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -57,8 +57,8 @@ 2.0.0-beta4.24324.3 - 8.0.0-preview.24326.1 - 8.0.0-preview.24326.1 + 8.0.0-preview.24327.1 + 8.0.0-preview.24327.1 9.0.0-preview.24324.1 @@ -67,7 +67,7 @@ 9.0.100-preview.7.24323.5 - 1.0.532601 + 1.0.532701 $(MicrosoftNETCoreApp31Version) From 4c0a2ae377050c6573dba06a83bbb98d5584cb00 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 28 Jun 2024 18:00:09 +0000 Subject: [PATCH 101/107] [main] Bump Microsoft.Diagnostics.DbgShim in /eng/dependabot/nuget.org (#6905) Bumps [Microsoft.Diagnostics.DbgShim](https://github.com/dotnet/diagnostics) from 8.0.510501 to 8.0.532401. - [Release notes](https://github.com/dotnet/diagnostics/releases) - [Commits](https://github.com/dotnet/diagnostics/compare/v8.0.510501...v8.0.532401) --- updated-dependencies: - dependency-name: Microsoft.Diagnostics.DbgShim dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- eng/dependabot/nuget.org/Versions.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/dependabot/nuget.org/Versions.props b/eng/dependabot/nuget.org/Versions.props index 285eba92209..44806cae084 100644 --- a/eng/dependabot/nuget.org/Versions.props +++ b/eng/dependabot/nuget.org/Versions.props @@ -2,6 +2,6 @@ - 8.0.510501 + 8.0.532401 From dc25f21858ea590c459419293f4a1aef6efc8125 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Sat, 29 Jun 2024 12:53:35 +0000 Subject: [PATCH 102/107] Update dependencies from https://github.com/dotnet/arcade build 20240626.4 (#6908) [main] Update dependencies from dotnet/arcade --- eng/Version.Details.xml | 20 ++++++++++---------- eng/Versions.props | 6 +++--- global.json | 4 ++-- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 8162694e888..d76270ee5a1 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -22,29 +22,29 @@ https://github.com/dotnet/roslyn-analyzers b4d9a1334d5189172977ba8fddd00bda70161e4a - + https://github.com/dotnet/arcade - 3fe41d9e97519a4e9b48293906dbf58714ea9a0d + bee35f3044609d08c40566f8a008baa4d0451a9e - + https://github.com/dotnet/arcade - 3fe41d9e97519a4e9b48293906dbf58714ea9a0d + bee35f3044609d08c40566f8a008baa4d0451a9e - + https://github.com/dotnet/arcade - 3fe41d9e97519a4e9b48293906dbf58714ea9a0d + bee35f3044609d08c40566f8a008baa4d0451a9e - + https://github.com/dotnet/arcade - 3fe41d9e97519a4e9b48293906dbf58714ea9a0d + bee35f3044609d08c40566f8a008baa4d0451a9e https://github.com/dotnet/installer 68e8abb1d3e1a240a6e4c29dcd220aae91681676 - + https://github.com/dotnet/arcade - 3fe41d9e97519a4e9b48293906dbf58714ea9a0d + bee35f3044609d08c40566f8a008baa4d0451a9e https://github.com/dotnet/diagnostics diff --git a/eng/Versions.props b/eng/Versions.props index 62967d3f127..80374cfabbd 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -48,9 +48,9 @@ --> - 8.0.0-beta.24324.7 - 8.0.0-beta.24324.7 - 8.0.0-beta.24324.7 + 8.0.0-beta.24326.4 + 8.0.0-beta.24326.4 + 8.0.0-beta.24326.4 8.0.1 8.0.1-servicing.23580.8 diff --git a/global.json b/global.json index a01e14d61e2..380a28a72cd 100644 --- a/global.json +++ b/global.json @@ -26,7 +26,7 @@ }, "msbuild-sdks": { "Microsoft.Build.NoTargets": "3.7.0", - "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24324.7", - "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.24324.7" + "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24326.4", + "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.24326.4" } } From 42545ba85eb79eb9d2da115a10ec6f60002117ff Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Sat, 29 Jun 2024 14:08:42 +0000 Subject: [PATCH 103/107] Update dependencies from https://github.com/dotnet/sdk build 20240628.18 (#6910) [feature/9.x] Update dependencies from dotnet/sdk - Coherency Updates: - Microsoft.AspNetCore.App.Runtime.win-x64: from 9.0.0-preview.6.24320.4 to 9.0.0-preview.7.24321.1 (parent: VS.Redist.Common.NetCore.SdkPlaceholder.x64.9.0) - Microsoft.NETCore.App.Runtime.win-x64: from 9.0.0-preview.6.24319.11 to 9.0.0-preview.7.24327.11 (parent: VS.Redist.Common.NetCore.SdkPlaceholder.x64.9.0) - VS.Redist.Common.AspNetCore.SharedFramework.x64.9.0: from 9.0.0-preview.6.24320.4 to 9.0.0-preview.7.24321.1 (parent: VS.Redist.Common.NetCore.SdkPlaceholder.x64.9.0) - VS.Redist.Common.NetCore.SharedFramework.x64.9.0: from 9.0.0-preview.6.24319.11 to 9.0.0-preview.7.24327.11 (parent: VS.Redist.Common.NetCore.SdkPlaceholder.x64.9.0) --- eng/Version.Details.xml | 20 ++++++++++---------- eng/Versions.props | 10 +++++----- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index adee9ae1328..1171dc20812 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,8 +1,8 @@ - + https://github.com/dotnet/aspnetcore - 613c1e990b6b6411bda84456aefe14fe8e194279 + 28481ab0d6a31883a6c058d045ca8f72591a7eca https://github.com/dotnet/diagnostics @@ -46,21 +46,21 @@ https://github.com/dotnet/diagnostics e009bfe09b92ef8d2064c4103f3cac85915b3ceb - + https://github.com/dotnet/runtime - 117cfccdd71abc164e6b933ca7602b509a1365dd + d88e6680e1f9e2cb4f5ee428aa169ab715158eab - + https://github.com/dotnet/aspnetcore - 613c1e990b6b6411bda84456aefe14fe8e194279 + 28481ab0d6a31883a6c058d045ca8f72591a7eca - + https://github.com/dotnet/sdk - ea9243f9cb36e56aba4cf6364a4d53a5c2d458fb + a6b5d017d4aadcb5cc2bc21352c6e83c559b26d6 - + https://github.com/dotnet/runtime - 117cfccdd71abc164e6b933ca7602b509a1365dd + d88e6680e1f9e2cb4f5ee428aa169ab715158eab diff --git a/eng/Versions.props b/eng/Versions.props index 1184a781505..79ea6942a99 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -52,8 +52,8 @@ 9.0.0-beta.24327.1 9.0.0-beta.24327.1 - 9.0.0-preview.6.24320.4 - 9.0.0-preview.6.24320.4 + 9.0.0-preview.7.24321.1 + 9.0.0-preview.7.24321.1 2.0.0-beta4.24324.3 @@ -62,10 +62,10 @@ 9.0.0-preview.24324.1 - 9.0.0-preview.6.24319.11 - 9.0.0-preview.6.24319.11 + 9.0.0-preview.7.24327.11 + 9.0.0-preview.7.24327.11 - 9.0.100-preview.7.24323.5 + 9.0.100-preview.7.24328.18 1.0.532701 From b5bf953026d47318e521e5580524866ef0aab764 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Sun, 30 Jun 2024 12:57:12 +0000 Subject: [PATCH 104/107] Update dependencies from https://github.com/dotnet/diagnostics build 20240628.1 (#6911) [main] Update dependencies from dotnet/diagnostics --- eng/Version.Details.xml | 12 ++++++------ eng/Versions.props | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index d76270ee5a1..a60a5e0ee2b 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -4,13 +4,13 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore 8e941eb42f819adb116b881195158b3887a70a1c - + https://github.com/dotnet/diagnostics - e009bfe09b92ef8d2064c4103f3cac85915b3ceb + 36353b20e53e0c4af482e4fbe1d0a572515f14a2 - + https://github.com/dotnet/diagnostics - e009bfe09b92ef8d2064c4103f3cac85915b3ceb + 36353b20e53e0c4af482e4fbe1d0a572515f14a2 https://github.com/dotnet/command-line-api @@ -46,9 +46,9 @@ https://github.com/dotnet/arcade bee35f3044609d08c40566f8a008baa4d0451a9e - + https://github.com/dotnet/diagnostics - e009bfe09b92ef8d2064c4103f3cac85915b3ceb + 36353b20e53e0c4af482e4fbe1d0a572515f14a2 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime diff --git a/eng/Versions.props b/eng/Versions.props index 80374cfabbd..be88abc4387 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -57,8 +57,8 @@ 2.0.0-beta4.24324.3 - 8.0.0-preview.24327.1 - 8.0.0-preview.24327.1 + 8.0.0-preview.24328.1 + 8.0.0-preview.24328.1 8.0.103-servicing.24114.15 @@ -67,7 +67,7 @@ 8.0.1 8.0.1-servicing.23580.1 - 1.0.532701 + 1.0.532801 $(MicrosoftNETCoreApp31Version) From 5f0e8eb2ada22016c4ace7401d0f441a27eaef4b Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Sun, 30 Jun 2024 13:30:12 +0000 Subject: [PATCH 105/107] Update dependencies from https://github.com/dotnet/diagnostics build 20240628.1 (#6912) [feature/9.x] Update dependencies from dotnet/diagnostics --- eng/Version.Details.xml | 12 ++++++------ eng/Versions.props | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 1171dc20812..5f4e0ac3e51 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -4,13 +4,13 @@ https://github.com/dotnet/aspnetcore 28481ab0d6a31883a6c058d045ca8f72591a7eca - + https://github.com/dotnet/diagnostics - e009bfe09b92ef8d2064c4103f3cac85915b3ceb + 36353b20e53e0c4af482e4fbe1d0a572515f14a2 - + https://github.com/dotnet/diagnostics - e009bfe09b92ef8d2064c4103f3cac85915b3ceb + 36353b20e53e0c4af482e4fbe1d0a572515f14a2 https://github.com/dotnet/command-line-api @@ -42,9 +42,9 @@ https://github.com/dotnet/arcade ede13bd35571c0c8b0c01edcb057031904c5c955 - + https://github.com/dotnet/diagnostics - e009bfe09b92ef8d2064c4103f3cac85915b3ceb + 36353b20e53e0c4af482e4fbe1d0a572515f14a2 https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index 79ea6942a99..8b5dd6dc19d 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -57,8 +57,8 @@ 2.0.0-beta4.24324.3 - 8.0.0-preview.24327.1 - 8.0.0-preview.24327.1 + 8.0.0-preview.24328.1 + 8.0.0-preview.24328.1 9.0.0-preview.24324.1 @@ -67,7 +67,7 @@ 9.0.100-preview.7.24328.18 - 1.0.532701 + 1.0.532801 $(MicrosoftNETCoreApp31Version) From 213972fcee6d83c2e81291095fec2480feb4bc0d Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Sun, 30 Jun 2024 14:29:52 +0000 Subject: [PATCH 106/107] Update dependencies from https://github.com/dotnet/sdk build 20240629.1 (#6913) [feature/9.x] Update dependencies from dotnet/sdk - Coherency Updates: - Microsoft.AspNetCore.App.Runtime.win-x64: from 9.0.0-preview.7.24321.1 to 9.0.0-preview.7.24328.7 (parent: VS.Redist.Common.NetCore.SdkPlaceholder.x64.9.0) - VS.Redist.Common.AspNetCore.SharedFramework.x64.9.0: from 9.0.0-preview.7.24321.1 to 9.0.0-preview.7.24328.7 (parent: VS.Redist.Common.NetCore.SdkPlaceholder.x64.9.0) --- eng/Version.Details.xml | 12 ++++++------ eng/Versions.props | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 5f4e0ac3e51..bc22aa8a2ab 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,8 +1,8 @@ - + https://github.com/dotnet/aspnetcore - 28481ab0d6a31883a6c058d045ca8f72591a7eca + 77994c64cee73e0093fe25cd434bee8bd2580b4e https://github.com/dotnet/diagnostics @@ -50,13 +50,13 @@ https://github.com/dotnet/runtime d88e6680e1f9e2cb4f5ee428aa169ab715158eab - + https://github.com/dotnet/aspnetcore - 28481ab0d6a31883a6c058d045ca8f72591a7eca + 77994c64cee73e0093fe25cd434bee8bd2580b4e - + https://github.com/dotnet/sdk - a6b5d017d4aadcb5cc2bc21352c6e83c559b26d6 + a081e8d8cdcce5cb0b0329cf68cf190060e870a6 https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index 8b5dd6dc19d..ba5edd9fc56 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -52,8 +52,8 @@ 9.0.0-beta.24327.1 9.0.0-beta.24327.1 - 9.0.0-preview.7.24321.1 - 9.0.0-preview.7.24321.1 + 9.0.0-preview.7.24328.7 + 9.0.0-preview.7.24328.7 2.0.0-beta4.24324.3 @@ -65,7 +65,7 @@ 9.0.0-preview.7.24327.11 9.0.0-preview.7.24327.11 - 9.0.100-preview.7.24328.18 + 9.0.100-preview.7.24329.1 1.0.532801 From fd08b35b6ba6079a6082b97bad60acbf1eab8f08 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 1 Jul 2024 00:08:45 +0000 Subject: [PATCH 107/107] Restore branch-specific files --- .../job/publish-build-assets.yml | 124 +------------ .../post-build/post-build.yml | 174 +----------------- .../templates/job/publish-build-assets.yml | 120 +----------- .../templates/post-build/post-build.yml | 173 +---------------- .../post-build/setup-maestro-vars.yml | 59 +----- 5 files changed, 10 insertions(+), 640 deletions(-) diff --git a/eng/common/templates-official/job/publish-build-assets.yml b/eng/common/templates-official/job/publish-build-assets.yml index 9ea50856209..d667a70e8de 100644 --- a/eng/common/templates-official/job/publish-build-assets.yml +++ b/eng/common/templates-official/job/publish-build-assets.yml @@ -3,125 +3,5 @@ jobs: parameters: is1ESPipeline: true - dependsOn: ${{ parameters.dependsOn }} - timeoutInMinutes: 150 - - ${{ if eq(parameters.publishAssetsImmediately, 'true') }}: - displayName: Publish Assets - ${{ else }}: - displayName: Publish to Build Asset Registry - - variables: - - template: /eng/common/templates-official/variables/pool-providers.yml - - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - - group: Publish-Build-Assets - - group: AzureDevOps-Artifact-Feeds-Pats - - name: runCodesignValidationInjection - value: false - - ${{ if eq(parameters.publishAssetsImmediately, 'true') }}: - - template: /eng/common/templates-official/post-build/common-variables.yml - - pool: - # We don't use the collection uri here because it might vary (.visualstudio.com vs. dev.azure.com) - ${{ if eq(variables['System.TeamProject'], 'DevDiv') }}: - name: AzurePipelines-EO - image: 1ESPT-Windows2022 - demands: Cmd - os: windows - # If it's not devdiv, it's dnceng - ${{ if ne(variables['System.TeamProject'], 'DevDiv') }}: - name: NetCore1ESPool-Publishing-Internal - image: windows.vs2019.amd64 - os: windows - steps: - - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - - task: DownloadBuildArtifacts@0 - displayName: Download artifact - inputs: - artifactName: AssetManifests - downloadPath: '$(Build.StagingDirectory)/Download' - checkDownloadedFiles: true - condition: ${{ parameters.condition }} - continueOnError: ${{ parameters.continueOnError }} - - - task: NuGetAuthenticate@1 - - - task: AzureCLI@2 - displayName: Publish Build Assets - inputs: - azureSubscription: "Darc: Maestro Production" - scriptType: ps - scriptLocation: scriptPath - scriptPath: $(Build.SourcesDirectory)/eng/common/sdk-task.ps1 - arguments: > - -task PublishBuildAssets -restore -msbuildEngine dotnet - /p:ManifestsPath='$(Build.StagingDirectory)/Download/AssetManifests' - /p:MaestroApiEndpoint=https://maestro-prod.westus2.cloudapp.azure.com - /p:PublishUsingPipelines=${{ parameters.publishUsingPipelines }} - /p:OfficialBuildId=$(Build.BuildNumber) - condition: ${{ parameters.condition }} - continueOnError: ${{ parameters.continueOnError }} - - - task: powershell@2 - displayName: Create ReleaseConfigs Artifact - inputs: - targetType: inline - script: | - New-Item -Path "$(Build.StagingDirectory)/ReleaseConfigs" -ItemType Directory -Force - $filePath = "$(Build.StagingDirectory)/ReleaseConfigs/ReleaseConfigs.txt" - Add-Content -Path $filePath -Value $(BARBuildId) - Add-Content -Path $filePath -Value "$(DefaultChannels)" - Add-Content -Path $filePath -Value $(IsStableBuild) - - - task: 1ES.PublishBuildArtifacts@1 - displayName: Publish ReleaseConfigs Artifact - inputs: - PathtoPublish: '$(Build.StagingDirectory)/ReleaseConfigs' - PublishLocation: Container - ArtifactName: ReleaseConfigs - - - task: powershell@2 - displayName: Check if SymbolPublishingExclusionsFile.txt exists - inputs: - targetType: inline - script: | - $symbolExclusionfile = "$(Build.SourcesDirectory)/eng/SymbolPublishingExclusionsFile.txt" - if(Test-Path -Path $symbolExclusionfile) - { - Write-Host "SymbolExclusionFile exists" - Write-Host "##vso[task.setvariable variable=SymbolExclusionFile]true" - } - else{ - Write-Host "Symbols Exclusion file does not exists" - Write-Host "##vso[task.setvariable variable=SymbolExclusionFile]false" - } - - - task: 1ES.PublishBuildArtifacts@1 - displayName: Publish SymbolPublishingExclusionsFile Artifact - condition: eq(variables['SymbolExclusionFile'], 'true') - inputs: - PathtoPublish: '$(Build.SourcesDirectory)/eng/SymbolPublishingExclusionsFile.txt' - PublishLocation: Container - ArtifactName: ReleaseConfigs - - - ${{ if eq(parameters.publishAssetsImmediately, 'true') }}: - - template: /eng/common/templates-official/post-build/setup-maestro-vars.yml - parameters: - BARBuildId: ${{ parameters.BARBuildId }} - PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - - - task: PowerShell@2 - displayName: Publish Using Darc - inputs: - filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1 - arguments: -BuildId $(BARBuildId) - -PublishingInfraVersion 3 - -AzdoToken '$(publishing-dnceng-devdiv-code-r-build-re)' - -WaitPublishingFinish true - -ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}' - -SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}' - - - ${{ if eq(parameters.enablePublishBuildArtifacts, 'true') }}: - - template: /eng/common/templates-official/steps/publish-logs.yml - parameters: - JobLabel: 'Publish_Artifacts_Logs' + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} diff --git a/eng/common/templates-official/post-build/post-build.yml b/eng/common/templates-official/post-build/post-build.yml index 563484310aa..2364c0fd4a5 100644 --- a/eng/common/templates-official/post-build/post-build.yml +++ b/eng/common/templates-official/post-build/post-build.yml @@ -4,175 +4,5 @@ stages: # Specifies whether to use 1ES is1ESPipeline: true - steps: - - template: setup-maestro-vars.yml - parameters: - BARBuildId: ${{ parameters.BARBuildId }} - PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - - - task: DownloadBuildArtifacts@0 - displayName: Download Package Artifacts - inputs: - buildType: specific - buildVersionToDownload: specific - project: $(AzDOProjectName) - pipeline: $(AzDOPipelineId) - buildId: $(AzDOBuildId) - artifactName: PackageArtifacts - checkDownloadedFiles: true - - - task: PowerShell@2 - displayName: Validate - inputs: - filePath: $(Build.SourcesDirectory)/eng/common/post-build/nuget-validation.ps1 - arguments: -PackagesPath $(Build.ArtifactStagingDirectory)/PackageArtifacts/ - -ToolDestinationPath $(Agent.BuildDirectory)/Extract/ - - - job: - displayName: Signing Validation - condition: and( eq( ${{ parameters.enableSigningValidation }}, 'true'), ne( variables['PostBuildSign'], 'true')) - pool: - # We don't use the collection uri here because it might vary (.visualstudio.com vs. dev.azure.com) - ${{ if eq(variables['System.TeamProject'], 'DevDiv') }}: - name: AzurePipelines-EO - image: 1ESPT-Windows2022 - demands: Cmd - os: windows - # If it's not devdiv, it's dnceng - ${{ else }}: - name: $(DncEngInternalBuildPool) - image: 1es-windows-2022 - os: windows - steps: - - template: setup-maestro-vars.yml - parameters: - BARBuildId: ${{ parameters.BARBuildId }} - PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - - - task: DownloadBuildArtifacts@0 - displayName: Download Package Artifacts - inputs: - buildType: specific - buildVersionToDownload: specific - project: $(AzDOProjectName) - pipeline: $(AzDOPipelineId) - buildId: $(AzDOBuildId) - artifactName: PackageArtifacts - checkDownloadedFiles: true - itemPattern: | - ** - !**/Microsoft.SourceBuild.Intermediate.*.nupkg - - # This is necessary whenever we want to publish/restore to an AzDO private feed - # Since sdk-task.ps1 tries to restore packages we need to do this authentication here - # otherwise it'll complain about accessing a private feed. - - task: NuGetAuthenticate@1 - displayName: 'Authenticate to AzDO Feeds' - - # Signing validation will optionally work with the buildmanifest file which is downloaded from - # Azure DevOps above. - - task: PowerShell@2 - displayName: Validate - inputs: - filePath: eng\common\sdk-task.ps1 - arguments: -task SigningValidation -restore -msbuildEngine vs - /p:PackageBasePath='$(Build.ArtifactStagingDirectory)/PackageArtifacts' - /p:SignCheckExclusionsFile='$(Build.SourcesDirectory)/eng/SignCheckExclusionsFile.txt' - ${{ parameters.signingValidationAdditionalParameters }} - - - template: ../steps/publish-logs.yml - parameters: - StageLabel: 'Validation' - JobLabel: 'Signing' - BinlogToolVersion: $(BinlogToolVersion) - - - job: - displayName: SourceLink Validation - condition: eq( ${{ parameters.enableSourceLinkValidation }}, 'true') - pool: - # We don't use the collection uri here because it might vary (.visualstudio.com vs. dev.azure.com) - ${{ if eq(variables['System.TeamProject'], 'DevDiv') }}: - name: AzurePipelines-EO - image: 1ESPT-Windows2022 - demands: Cmd - os: windows - # If it's not devdiv, it's dnceng - ${{ else }}: - name: $(DncEngInternalBuildPool) - image: 1es-windows-2022 - os: windows - steps: - - template: setup-maestro-vars.yml - parameters: - BARBuildId: ${{ parameters.BARBuildId }} - PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - - - task: DownloadBuildArtifacts@0 - displayName: Download Blob Artifacts - inputs: - buildType: specific - buildVersionToDownload: specific - project: $(AzDOProjectName) - pipeline: $(AzDOPipelineId) - buildId: $(AzDOBuildId) - artifactName: BlobArtifacts - checkDownloadedFiles: true - - - task: PowerShell@2 - displayName: Validate - inputs: - filePath: $(Build.SourcesDirectory)/eng/common/post-build/sourcelink-validation.ps1 - arguments: -InputPath $(Build.ArtifactStagingDirectory)/BlobArtifacts/ - -ExtractPath $(Agent.BuildDirectory)/Extract/ - -GHRepoName $(Build.Repository.Name) - -GHCommit $(Build.SourceVersion) - -SourcelinkCliVersion $(SourceLinkCLIVersion) - continueOnError: true - -- ${{ if ne(parameters.publishAssetsImmediately, 'true') }}: - - stage: publish_using_darc - ${{ if or(eq(parameters.enableNugetValidation, 'true'), eq(parameters.enableSigningValidation, 'true'), eq(parameters.enableSourceLinkValidation, 'true'), eq(parameters.SDLValidationParameters.enable, 'true')) }}: - dependsOn: ${{ parameters.publishDependsOn }} - ${{ else }}: - dependsOn: ${{ parameters.validateDependsOn }} - displayName: Publish using Darc - variables: - - template: common-variables.yml - - template: /eng/common/templates-official/variables/pool-providers.yml - jobs: - - job: - displayName: Publish Using Darc - timeoutInMinutes: 120 - pool: - # We don't use the collection uri here because it might vary (.visualstudio.com vs. dev.azure.com) - ${{ if eq(variables['System.TeamProject'], 'DevDiv') }}: - name: AzurePipelines-EO - image: 1ESPT-Windows2022 - demands: Cmd - os: windows - # If it's not devdiv, it's dnceng - ${{ else }}: - name: NetCore1ESPool-Publishing-Internal - image: windows.vs2019.amd64 - os: windows - steps: - - template: setup-maestro-vars.yml - parameters: - BARBuildId: ${{ parameters.BARBuildId }} - PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - - - task: NuGetAuthenticate@1 - - - task: AzureCLI@2 - displayName: Publish Using Darc - inputs: - azureSubscription: "Darc: Maestro Production" - scriptType: ps - scriptLocation: scriptPath - scriptPath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1 - arguments: -BuildId $(BARBuildId) - -PublishingInfraVersion ${{ parameters.publishingInfraVersion }} - -AzdoToken '$(publishing-dnceng-devdiv-code-r-build-re)' - -WaitPublishingFinish true - -ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}' - -SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}' + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} diff --git a/eng/common/templates/job/publish-build-assets.yml b/eng/common/templates/job/publish-build-assets.yml index 604856e2bb5..ab2edec2adb 100644 --- a/eng/common/templates/job/publish-build-assets.yml +++ b/eng/common/templates/job/publish-build-assets.yml @@ -3,121 +3,5 @@ jobs: parameters: is1ESPipeline: false - dependsOn: ${{ parameters.dependsOn }} - timeoutInMinutes: 150 - - ${{ if eq(parameters.publishAssetsImmediately, 'true') }}: - displayName: Publish Assets - ${{ else }}: - displayName: Publish to Build Asset Registry - - variables: - - template: /eng/common/templates/variables/pool-providers.yml - - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - - group: Publish-Build-Assets - - group: AzureDevOps-Artifact-Feeds-Pats - - name: runCodesignValidationInjection - value: false - - ${{ if eq(parameters.publishAssetsImmediately, 'true') }}: - - template: /eng/common/templates/post-build/common-variables.yml - - pool: - # We don't use the collection uri here because it might vary (.visualstudio.com vs. dev.azure.com) - ${{ if eq(variables['System.TeamProject'], 'DevDiv') }}: - name: VSEngSS-MicroBuild2022-1ES - demands: Cmd - # If it's not devdiv, it's dnceng - ${{ if ne(variables['System.TeamProject'], 'DevDiv') }}: - name: NetCore1ESPool-Publishing-Internal - demands: ImageOverride -equals windows.vs2019.amd64 - - steps: - - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - - task: DownloadBuildArtifacts@0 - displayName: Download artifact - inputs: - artifactName: AssetManifests - downloadPath: '$(Build.StagingDirectory)/Download' - checkDownloadedFiles: true - condition: ${{ parameters.condition }} - continueOnError: ${{ parameters.continueOnError }} - - - task: NuGetAuthenticate@1 - - - task: AzureCLI@2 - displayName: Publish Build Assets - inputs: - azureSubscription: "Darc: Maestro Production" - scriptType: ps - scriptLocation: scriptPath - scriptPath: $(Build.SourcesDirectory)/eng/common/sdk-task.ps1 - arguments: > - -task PublishBuildAssets -restore -msbuildEngine dotnet - /p:ManifestsPath='$(Build.StagingDirectory)/Download/AssetManifests' - /p:MaestroApiEndpoint=https://maestro.dot.net - /p:PublishUsingPipelines=${{ parameters.publishUsingPipelines }} - /p:OfficialBuildId=$(Build.BuildNumber) - condition: ${{ parameters.condition }} - continueOnError: ${{ parameters.continueOnError }} - - - task: powershell@2 - displayName: Create ReleaseConfigs Artifact - inputs: - targetType: inline - script: | - Add-Content -Path "$(Build.StagingDirectory)/ReleaseConfigs.txt" -Value $(BARBuildId) - Add-Content -Path "$(Build.StagingDirectory)/ReleaseConfigs.txt" -Value "$(DefaultChannels)" - Add-Content -Path "$(Build.StagingDirectory)/ReleaseConfigs.txt" -Value $(IsStableBuild) - - - task: PublishBuildArtifacts@1 - displayName: Publish ReleaseConfigs Artifact - inputs: - PathtoPublish: '$(Build.StagingDirectory)/ReleaseConfigs.txt' - PublishLocation: Container - ArtifactName: ReleaseConfigs - - - task: powershell@2 - displayName: Check if SymbolPublishingExclusionsFile.txt exists - inputs: - targetType: inline - script: | - $symbolExclusionfile = "$(Build.SourcesDirectory)/eng/SymbolPublishingExclusionsFile.txt" - if(Test-Path -Path $symbolExclusionfile) - { - Write-Host "SymbolExclusionFile exists" - Write-Host "##vso[task.setvariable variable=SymbolExclusionFile]true" - } - else{ - Write-Host "Symbols Exclusion file does not exists" - Write-Host "##vso[task.setvariable variable=SymbolExclusionFile]false" - } - - - task: PublishBuildArtifacts@1 - displayName: Publish SymbolPublishingExclusionsFile Artifact - condition: eq(variables['SymbolExclusionFile'], 'true') - inputs: - PathtoPublish: '$(Build.SourcesDirectory)/eng/SymbolPublishingExclusionsFile.txt' - PublishLocation: Container - ArtifactName: ReleaseConfigs - - - ${{ if eq(parameters.publishAssetsImmediately, 'true') }}: - - template: /eng/common/templates/post-build/setup-maestro-vars.yml - parameters: - BARBuildId: ${{ parameters.BARBuildId }} - PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - - - task: PowerShell@2 - displayName: Publish Using Darc - inputs: - filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1 - arguments: -BuildId $(BARBuildId) - -PublishingInfraVersion 3 - -AzdoToken '$(publishing-dnceng-devdiv-code-r-build-re)' - -WaitPublishingFinish true - -ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}' - -SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}' - - - ${{ if eq(parameters.enablePublishBuildArtifacts, 'true') }}: - - template: /eng/common/templates/steps/publish-logs.yml - parameters: - JobLabel: 'Publish_Artifacts_Logs' + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} diff --git a/eng/common/templates/post-build/post-build.yml b/eng/common/templates/post-build/post-build.yml index 732b91b12ae..53ede714bdd 100644 --- a/eng/common/templates/post-build/post-build.yml +++ b/eng/common/templates/post-build/post-build.yml @@ -4,174 +4,5 @@ stages: # Specifies whether to use 1ES is1ESPipeline: false - steps: - - template: setup-maestro-vars.yml - parameters: - BARBuildId: ${{ parameters.BARBuildId }} - PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - - - task: DownloadBuildArtifacts@0 - displayName: Download Package Artifacts - inputs: - buildType: specific - buildVersionToDownload: specific - project: $(AzDOProjectName) - pipeline: $(AzDOPipelineId) - buildId: $(AzDOBuildId) - artifactName: PackageArtifacts - checkDownloadedFiles: true - - - task: PowerShell@2 - displayName: Validate - inputs: - filePath: $(Build.SourcesDirectory)/eng/common/post-build/nuget-validation.ps1 - arguments: -PackagesPath $(Build.ArtifactStagingDirectory)/PackageArtifacts/ - -ToolDestinationPath $(Agent.BuildDirectory)/Extract/ - - - job: - displayName: Signing Validation - condition: and( eq( ${{ parameters.enableSigningValidation }}, 'true'), ne( variables['PostBuildSign'], 'true')) - pool: - # We don't use the collection uri here because it might vary (.visualstudio.com vs. dev.azure.com) - ${{ if eq(variables['System.TeamProject'], 'DevDiv') }}: - name: VSEngSS-MicroBuild2022-1ES - demands: Cmd - # If it's not devdiv, it's dnceng - ${{ else }}: - name: $(DncEngInternalBuildPool) - demands: ImageOverride -equals windows.vs2019.amd64 - steps: - - template: setup-maestro-vars.yml - parameters: - BARBuildId: ${{ parameters.BARBuildId }} - PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - - - task: DownloadBuildArtifacts@0 - displayName: Download Package Artifacts - inputs: - buildType: specific - buildVersionToDownload: specific - project: $(AzDOProjectName) - pipeline: $(AzDOPipelineId) - buildId: $(AzDOBuildId) - artifactName: PackageArtifacts - checkDownloadedFiles: true - itemPattern: | - ** - !**/Microsoft.SourceBuild.Intermediate.*.nupkg - - # This is necessary whenever we want to publish/restore to an AzDO private feed - # Since sdk-task.ps1 tries to restore packages we need to do this authentication here - # otherwise it'll complain about accessing a private feed. - - task: NuGetAuthenticate@1 - displayName: 'Authenticate to AzDO Feeds' - - # Signing validation will optionally work with the buildmanifest file which is downloaded from - # Azure DevOps above. - - task: PowerShell@2 - displayName: Validate - inputs: - filePath: eng\common\sdk-task.ps1 - arguments: -task SigningValidation -restore -msbuildEngine vs - /p:PackageBasePath='$(Build.ArtifactStagingDirectory)/PackageArtifacts' - /p:SignCheckExclusionsFile='$(Build.SourcesDirectory)/eng/SignCheckExclusionsFile.txt' - ${{ parameters.signingValidationAdditionalParameters }} - - - template: ../steps/publish-logs.yml - parameters: - StageLabel: 'Validation' - JobLabel: 'Signing' - - - job: - displayName: SourceLink Validation - condition: eq( ${{ parameters.enableSourceLinkValidation }}, 'true') - pool: - # We don't use the collection uri here because it might vary (.visualstudio.com vs. dev.azure.com) - ${{ if eq(variables['System.TeamProject'], 'DevDiv') }}: - name: VSEngSS-MicroBuild2022-1ES - demands: Cmd - # If it's not devdiv, it's dnceng - ${{ else }}: - name: $(DncEngInternalBuildPool) - demands: ImageOverride -equals windows.vs2019.amd64 - steps: - - template: setup-maestro-vars.yml - parameters: - BARBuildId: ${{ parameters.BARBuildId }} - PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - - - task: DownloadBuildArtifacts@0 - displayName: Download Blob Artifacts - inputs: - buildType: specific - buildVersionToDownload: specific - project: $(AzDOProjectName) - pipeline: $(AzDOPipelineId) - buildId: $(AzDOBuildId) - artifactName: BlobArtifacts - checkDownloadedFiles: true - - - task: PowerShell@2 - displayName: Validate - inputs: - filePath: $(Build.SourcesDirectory)/eng/common/post-build/sourcelink-validation.ps1 - arguments: -InputPath $(Build.ArtifactStagingDirectory)/BlobArtifacts/ - -ExtractPath $(Agent.BuildDirectory)/Extract/ - -GHRepoName $(Build.Repository.Name) - -GHCommit $(Build.SourceVersion) - -SourcelinkCliVersion $(SourceLinkCLIVersion) - continueOnError: true - - - template: /eng/common/templates/job/execute-sdl.yml - parameters: - enable: ${{ parameters.SDLValidationParameters.enable }} - publishGuardianDirectoryToPipeline: ${{ parameters.SDLValidationParameters.publishGdn }} - additionalParameters: ${{ parameters.SDLValidationParameters.params }} - continueOnError: ${{ parameters.SDLValidationParameters.continueOnError }} - artifactNames: ${{ parameters.SDLValidationParameters.artifactNames }} - downloadArtifacts: ${{ parameters.SDLValidationParameters.downloadArtifacts }} - -- ${{ if ne(parameters.publishAssetsImmediately, 'true') }}: - - stage: publish_using_darc - ${{ if or(eq(parameters.enableNugetValidation, 'true'), eq(parameters.enableSigningValidation, 'true'), eq(parameters.enableSourceLinkValidation, 'true'), eq(parameters.SDLValidationParameters.enable, 'true')) }}: - dependsOn: ${{ parameters.publishDependsOn }} - ${{ else }}: - dependsOn: ${{ parameters.validateDependsOn }} - displayName: Publish using Darc - variables: - - template: common-variables.yml - - template: /eng/common/templates/variables/pool-providers.yml - jobs: - - job: - displayName: Publish Using Darc - timeoutInMinutes: 120 - pool: - # We don't use the collection uri here because it might vary (.visualstudio.com vs. dev.azure.com) - ${{ if eq(variables['System.TeamProject'], 'DevDiv') }}: - name: VSEngSS-MicroBuild2022-1ES - demands: Cmd - # If it's not devdiv, it's dnceng - ${{ else }}: - name: NetCore1ESPool-Publishing-Internal - demands: ImageOverride -equals windows.vs2019.amd64 - steps: - - template: setup-maestro-vars.yml - parameters: - BARBuildId: ${{ parameters.BARBuildId }} - PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - - - task: NuGetAuthenticate@1 - - - task: AzureCLI@2 - displayName: Publish Using Darc - inputs: - azureSubscription: "Darc: Maestro Production" - scriptType: ps - scriptLocation: scriptPath - scriptPath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1 - arguments: -BuildId $(BARBuildId) - -PublishingInfraVersion ${{ parameters.publishingInfraVersion }} - -AzdoToken '$(publishing-dnceng-devdiv-code-r-build-re)' - -WaitPublishingFinish true - -ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}' - -SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}' + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} \ No newline at end of file diff --git a/eng/common/templates/post-build/setup-maestro-vars.yml b/eng/common/templates/post-build/setup-maestro-vars.yml index df06c91d4e3..a79fab5b441 100644 --- a/eng/common/templates/post-build/setup-maestro-vars.yml +++ b/eng/common/templates/post-build/setup-maestro-vars.yml @@ -4,60 +4,5 @@ steps: # Specifies whether to use 1ES is1ESPipeline: false - - task: AzureCLI@2 - name: setReleaseVars - displayName: Set Release Configs Vars - inputs: - azureSubscription: "Darc: Maestro Production" - scriptType: pscore - scriptLocation: inlineScript - inlineScript: | - try { - if (!$Env:PromoteToMaestroChannels -or $Env:PromoteToMaestroChannels.Trim() -eq '') { - $Content = Get-Content $(Build.StagingDirectory)/ReleaseConfigs/ReleaseConfigs.txt - - $BarId = $Content | Select -Index 0 - $Channels = $Content | Select -Index 1 - $IsStableBuild = $Content | Select -Index 2 - - $AzureDevOpsProject = $Env:System_TeamProject - $AzureDevOpsBuildDefinitionId = $Env:System_DefinitionId - $AzureDevOpsBuildId = $Env:Build_BuildId - } - else { - . $(Build.SourcesDirectory)\eng\common\tools.ps1 - $darc = Get-Darc - $buildInfo = & $darc get-build ` - --id ${{ parameters.BARBuildId }} ` - --extended ` - --output-format json ` - --ci ` - | convertFrom-Json - - $BarId = ${{ parameters.BARBuildId }} - $Channels = $Env:PromoteToMaestroChannels -split "," - $Channels = $Channels -join "][" - $Channels = "[$Channels]" - - $IsStableBuild = $buildInfo.stable - $AzureDevOpsProject = $buildInfo.azureDevOpsProject - $AzureDevOpsBuildDefinitionId = $buildInfo.azureDevOpsBuildDefinitionId - $AzureDevOpsBuildId = $buildInfo.azureDevOpsBuildId - } - - Write-Host "##vso[task.setvariable variable=BARBuildId]$BarId" - Write-Host "##vso[task.setvariable variable=TargetChannels]$Channels" - Write-Host "##vso[task.setvariable variable=IsStableBuild]$IsStableBuild" - - Write-Host "##vso[task.setvariable variable=AzDOProjectName]$AzureDevOpsProject" - Write-Host "##vso[task.setvariable variable=AzDOPipelineId]$AzureDevOpsBuildDefinitionId" - Write-Host "##vso[task.setvariable variable=AzDOBuildId]$AzureDevOpsBuildId" - } - catch { - Write-Host $_ - Write-Host $_.Exception - Write-Host $_.ScriptStackTrace - exit 1 - } - env: - PromoteToMaestroChannels: ${{ parameters.PromoteToChannelIds }} + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} \ No newline at end of file