From 4f2a0edc978d17d21f1b06ecc7f3526dd57958c2 Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Mon, 25 Feb 2019 09:50:01 -0800 Subject: [PATCH 01/15] Update Azure queues for Linux and MacOS builds (#7231) - aspnet/AspNetCore-Internal#1717 - use a specific Linux image --- .azure/pipelines/jobs/default-build.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.azure/pipelines/jobs/default-build.yml b/.azure/pipelines/jobs/default-build.yml index 7e79628ce3..6e9547976a 100644 --- a/.azure/pipelines/jobs/default-build.yml +++ b/.azure/pipelines/jobs/default-build.yml @@ -73,11 +73,17 @@ jobs: ${{ if ne(parameters.poolName, '') }}: name: ${{ parameters.poolName }} ${{ if and(eq(parameters.poolName, ''), eq(parameters.agentOs, 'macOS')) }}: - name: Hosted macOS + ${{ if eq(variables['System.TeamProject'], 'internal') }}: + name: Hosted Mac Internal + ${{ if ne(variables['System.TeamProject'], 'internal') }}: + name: Hosted macOS vmImage: macOS-10.13 ${{ if and(eq(parameters.poolName, ''), eq(parameters.agentOs, 'Linux')) }}: - name: Hosted Ubuntu 1604 - vmImage: ubuntu-16.04 + ${{ if eq(variables['System.TeamProject'], 'internal') }}: + name: dnceng-linux-internal-temp + ${{ if ne(variables['System.TeamProject'], 'internal') }}: + name: dnceng-linux-external-temp + vmImage: Linux_Ubuntu_16.04 ${{ if and(eq(parameters.poolName, ''), eq(parameters.agentOs, 'Windows')) }}: ${{ if eq(variables['System.TeamProject'], 'internal') }}: name: dotnet-internal-temp @@ -160,4 +166,3 @@ jobs: - task: MicroBuildCleanup@1 displayName: Cleanup MicroBuild tasks condition: always() - From 5661c41909d6bd9a7aac9ab79d1da750291b4478 Mon Sep 17 00:00:00 2001 From: Mikael Mengistu Date: Tue, 26 Feb 2019 09:12:51 -0800 Subject: [PATCH 02/15] Add baseline version test (#7627) --- test/SharedFx.UnitTests/ConsoleReporter.cs | 71 +++++++++++++++++++ test/SharedFx.UnitTests/RetryHelper.cs | 65 +++++++++++++++++ .../SharedFx.UnitTests.csproj | 5 ++ test/SharedFx.UnitTests/SharedFxTests.cs | 63 ++++++++++++++++ test/SharedFx.UnitTests/TestData.cs | 2 + 5 files changed, 206 insertions(+) create mode 100644 test/SharedFx.UnitTests/ConsoleReporter.cs create mode 100644 test/SharedFx.UnitTests/RetryHelper.cs diff --git a/test/SharedFx.UnitTests/ConsoleReporter.cs b/test/SharedFx.UnitTests/ConsoleReporter.cs new file mode 100644 index 0000000000..190e805dc2 --- /dev/null +++ b/test/SharedFx.UnitTests/ConsoleReporter.cs @@ -0,0 +1,71 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using System.IO; +using McMaster.Extensions.CommandLineUtils; + +namespace Microsoft.Extensions.Tools.Internal +{ + public class ConsoleReporter : IReporter + { + private object _writeLock = new object(); + + public ConsoleReporter(IConsole console) + : this(console, verbose: false, quiet: false) + { } + + public ConsoleReporter(IConsole console, bool verbose, bool quiet) + { + Console = console; + IsVerbose = verbose; + IsQuiet = quiet; + } + + protected IConsole Console { get; } + public bool IsVerbose { get; } + public bool IsQuiet { get; } + + protected virtual void WriteLine(TextWriter writer, string message, ConsoleColor? color) + { + lock (_writeLock) + { + if (color.HasValue) + { + Console.ForegroundColor = color.Value; + } + + writer.WriteLine(message); + + if (color.HasValue) + { + Console.ResetColor(); + } + } + } + + public virtual void Error(string message) + => WriteLine(Console.Error, message, ConsoleColor.Red); + public virtual void Warn(string message) + => WriteLine(Console.Out, message, ConsoleColor.Yellow); + + public virtual void Output(string message) + { + if (IsQuiet) + { + return; + } + WriteLine(Console.Out, message, color: null); + } + + public virtual void Verbose(string message) + { + if (!IsVerbose) + { + return; + } + + WriteLine(Console.Out, message, ConsoleColor.DarkGray); + } + } +} diff --git a/test/SharedFx.UnitTests/RetryHelper.cs b/test/SharedFx.UnitTests/RetryHelper.cs new file mode 100644 index 0000000000..2d92113e36 --- /dev/null +++ b/test/SharedFx.UnitTests/RetryHelper.cs @@ -0,0 +1,65 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using System.Threading.Tasks; +using McMaster.Extensions.CommandLineUtils; + +namespace TriageBuildFailures +{ + internal static class RetryHelpers + { + /// + /// Constrain the exponential back-off to this many minutes. + /// + private const int MaxRetryMinutes = 15; + + private static int TotalRetriesUsed; + + public static int GetTotalRetriesUsed() + { + return TotalRetriesUsed; + } + + public static async Task RetryAsync(Func action, IReporter reporter) + { + await RetryAsync( + async () => + { + await action(); + return null; + }, + reporter); + } + + public static async Task RetryAsync(Func> action, IReporter reporter) + { + Exception firstException = null; + + var retriesRemaining = 10; + var retryDelayInMinutes = 1; + + while (retriesRemaining > 0) + { + try + { + return await action(); + } + catch (Exception e) + { + firstException = firstException ?? e; + reporter.Output($"Exception thrown! {e.Message}"); + reporter.Output($"Waiting {retryDelayInMinutes} minute(s) to retry ({retriesRemaining} left)..."); + await Task.Delay(retryDelayInMinutes * 60 * 1000); + + // Do exponential back-off, but limit it (1, 2, 4, 8, 15, 15, 15, ...) + // With MaxRetryMinutes=15 and MaxRetries=10, this will delay a maximum of 105 minutes + retryDelayInMinutes = Math.Min(2 * retryDelayInMinutes, MaxRetryMinutes); + retriesRemaining--; + TotalRetriesUsed++; + } + } + throw new InvalidOperationException("Max exception retries reached, giving up.", firstException); + } + } +} diff --git a/test/SharedFx.UnitTests/SharedFx.UnitTests.csproj b/test/SharedFx.UnitTests/SharedFx.UnitTests.csproj index e574f7d305..e439e2842b 100644 --- a/test/SharedFx.UnitTests/SharedFx.UnitTests.csproj +++ b/test/SharedFx.UnitTests/SharedFx.UnitTests.csproj @@ -26,6 +26,10 @@ <_Parameter1>MicrosoftNETCoreAppPackageVersion <_Parameter2>$(RuntimeFrameworkVersion) + + <_Parameter1>PreviousAspNetCoreReleaseVersion + <_Parameter2>$(PreviousAspNetCoreReleaseVersion) + @@ -34,6 +38,7 @@ + diff --git a/test/SharedFx.UnitTests/SharedFxTests.cs b/test/SharedFx.UnitTests/SharedFxTests.cs index 36160360df..74956cde87 100644 --- a/test/SharedFx.UnitTests/SharedFxTests.cs +++ b/test/SharedFx.UnitTests/SharedFxTests.cs @@ -1,14 +1,77 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +using System; +using System.Collections.Generic; using System.IO; +using System.IO.Compression; +using System.Net; +using System.Reflection; +using System.Threading.Tasks; +using McMaster.Extensions.CommandLineUtils; using Newtonsoft.Json.Linq; +using TriageBuildFailures; using Xunit; namespace Microsoft.AspNetCore { public class SharedFxTests { + + [Theory] + [MemberData(nameof(GetSharedFxConfig))] + public async Task BaselineTest(SharedFxConfig config) + { + var previousVersion = TestData.GetPreviousAspNetCoreReleaseVersion(); + var url = new Uri($"https://dotnetcli.blob.core.windows.net/dotnet/aspnetcore/Runtime/" + previousVersion + "/aspnetcore-runtime-internal-" + previousVersion + "-win-x64.zip"); + var zipName = "assemblies.zip"; + var nugetAssemblyVersions = new Dictionary(); + var root = TestData.GetDotNetRoot(); + var dir = Path.Combine(root, "shared", config.Name, config.Version); + + using (var testClient = new WebClient()) + { + var reporter = new ConsoleReporter(PhysicalConsole.Singleton); + await RetryHelpers.RetryAsync(async () => await testClient.DownloadFileTaskAsync(url, zipName), reporter); + } + + var zipPath = Path.Combine(AppContext.BaseDirectory, zipName); + + if (!Directory.Exists(AppContext.BaseDirectory + "unzipped")) + { + ZipFile.ExtractToDirectory(AppContext.BaseDirectory, "unzipped"); + } + + var nugetAssembliesPath = Path.Combine(AppContext.BaseDirectory, "unzipped", "shared", config.Name, previousVersion); + + var files = Directory.GetFiles(nugetAssembliesPath, "*.dll"); + foreach (var file in files) + { + try + { + var assemblyVersion = AssemblyName.GetAssemblyName(file).Version; + var dllName = Path.GetFileName(file); + nugetAssemblyVersions.Add(dllName, assemblyVersion); + } + catch (BadImageFormatException) { } + } + + files = Directory.GetFiles(dir, "*.dll"); + + Assert.All(files, file => + { + try + { + var localAssemblyVersion = AssemblyName.GetAssemblyName(file).Version; + var dllName = Path.GetFileName(file); + Assert.True(nugetAssemblyVersions.ContainsKey(dllName), $"Expected {dllName} to be in the downloaded dlls"); + Assert.True(localAssemblyVersion.CompareTo(nugetAssemblyVersions[dllName]) >= 0, $"Expected the local version of {dllName} to be greater than or equal to the already released version."); + } + catch (BadImageFormatException) { } + + }); + } + [Theory] [MemberData(nameof(GetSharedFxConfig))] public void ItContainsValidRuntimeConfigFile(SharedFxConfig config) diff --git a/test/SharedFx.UnitTests/TestData.cs b/test/SharedFx.UnitTests/TestData.cs index eb01f60e8b..dd024ae3bd 100644 --- a/test/SharedFx.UnitTests/TestData.cs +++ b/test/SharedFx.UnitTests/TestData.cs @@ -10,6 +10,8 @@ namespace Microsoft.AspNetCore { public static string GetPackageVersion() => GetTestDataValue("PackageVersion"); + public static string GetPreviousAspNetCoreReleaseVersion() => GetTestDataValue("PreviousAspNetCoreReleaseVersion"); + public static string GetMicrosoftNETCoreAppPackageVersion() => GetTestDataValue("MicrosoftNETCoreAppPackageVersion"); public static string GetDotNetRoot() => GetTestDataValue("DotNetRoot"); From f8c3f02345045c42a49ada0dc9f5f06d0dd8dc92 Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Tue, 26 Feb 2019 16:50:35 -0800 Subject: [PATCH 03/15] [2.1. test only] Remove checks for Microsoft.VisualStudio.Web.CodeGeneration.Design in templates (#7983) - see aspnet/AspNetCore-Internal#1759 --- src/Templating/test/Templates.Test/MvcTemplateTest.cs | 4 ++-- src/Templating/test/Templates.Test/RazorPagesTemplateTest.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Templating/test/Templates.Test/MvcTemplateTest.cs b/src/Templating/test/Templates.Test/MvcTemplateTest.cs index e8bb66ed4b..07a6e9f683 100644 --- a/src/Templating/test/Templates.Test/MvcTemplateTest.cs +++ b/src/Templating/test/Templates.Test/MvcTemplateTest.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.AspNetCore.Testing.xunit; @@ -112,7 +112,7 @@ namespace Templates.Test { Assert.Contains(".db", projectFileContents); } - Assert.Contains("Microsoft.VisualStudio.Web.CodeGeneration.Design", projectFileContents); + Assert.DoesNotContain("Microsoft.VisualStudio.Web.CodeGeneration.Design", projectFileContents); if (targetFrameworkOverride != null) { diff --git a/src/Templating/test/Templates.Test/RazorPagesTemplateTest.cs b/src/Templating/test/Templates.Test/RazorPagesTemplateTest.cs index 314f72cb1d..639efb9dc8 100644 --- a/src/Templating/test/Templates.Test/RazorPagesTemplateTest.cs +++ b/src/Templating/test/Templates.Test/RazorPagesTemplateTest.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.AspNetCore.Testing.xunit; @@ -92,7 +92,7 @@ namespace Templates.Test { Assert.Contains(".db", projectFileContents); } - Assert.Contains("Microsoft.VisualStudio.Web.CodeGeneration.Design", projectFileContents); + Assert.DoesNotContain("Microsoft.VisualStudio.Web.CodeGeneration.Design", projectFileContents); if (targetFrameworkOverride != null) { From d2a4435ac8072edc97adb6f15c165698e4d6795f Mon Sep 17 00:00:00 2001 From: Mikael Mengistu Date: Thu, 28 Feb 2019 17:11:23 -0800 Subject: [PATCH 04/15] Update baseline test (#8014) --- test/SharedFx.UnitTests/SharedFxTests.cs | 55 +++++++++++++----------- 1 file changed, 30 insertions(+), 25 deletions(-) diff --git a/test/SharedFx.UnitTests/SharedFxTests.cs b/test/SharedFx.UnitTests/SharedFxTests.cs index 74956cde87..7d0c222298 100644 --- a/test/SharedFx.UnitTests/SharedFxTests.cs +++ b/test/SharedFx.UnitTests/SharedFxTests.cs @@ -36,40 +36,45 @@ namespace Microsoft.AspNetCore } var zipPath = Path.Combine(AppContext.BaseDirectory, zipName); + var tempDirectoryPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); - if (!Directory.Exists(AppContext.BaseDirectory + "unzipped")) + try { - ZipFile.ExtractToDirectory(AppContext.BaseDirectory, "unzipped"); - } + Directory.CreateDirectory(tempDirectoryPath); + ZipFile.ExtractToDirectory(zipPath, tempDirectoryPath); + var nugetAssembliesPath = Path.Combine(tempDirectoryPath, "shared", config.Name, previousVersion); - var nugetAssembliesPath = Path.Combine(AppContext.BaseDirectory, "unzipped", "shared", config.Name, previousVersion); - - var files = Directory.GetFiles(nugetAssembliesPath, "*.dll"); - foreach (var file in files) - { - try + var files = Directory.GetFiles(nugetAssembliesPath, "*.dll"); + foreach (var file in files) { - var assemblyVersion = AssemblyName.GetAssemblyName(file).Version; - var dllName = Path.GetFileName(file); - nugetAssemblyVersions.Add(dllName, assemblyVersion); + try + { + var assemblyVersion = AssemblyName.GetAssemblyName(file).Version; + var dllName = Path.GetFileName(file); + nugetAssemblyVersions.Add(dllName, assemblyVersion); + } + catch (BadImageFormatException) { } } - catch (BadImageFormatException) { } - } - files = Directory.GetFiles(dir, "*.dll"); + files = Directory.GetFiles(dir, "*.dll"); - Assert.All(files, file => - { - try + Assert.All(files, file => { - var localAssemblyVersion = AssemblyName.GetAssemblyName(file).Version; - var dllName = Path.GetFileName(file); - Assert.True(nugetAssemblyVersions.ContainsKey(dllName), $"Expected {dllName} to be in the downloaded dlls"); - Assert.True(localAssemblyVersion.CompareTo(nugetAssemblyVersions[dllName]) >= 0, $"Expected the local version of {dllName} to be greater than or equal to the already released version."); - } - catch (BadImageFormatException) { } + try + { + var localAssemblyVersion = AssemblyName.GetAssemblyName(file).Version; + var dllName = Path.GetFileName(file); + Assert.Contains(dllName, nugetAssemblyVersions.Keys); + Assert.InRange(localAssemblyVersion.CompareTo(nugetAssemblyVersions[dllName]), 0, int.MaxValue); + } + catch (BadImageFormatException) { } - }); + }); + } + finally + { + Directory.Delete(tempDirectoryPath, true); + } } [Theory] From 1ca6202e7e39b11103f48272c37b91f9ccee5d21 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Fri, 1 Mar 2019 10:49:54 -0800 Subject: [PATCH 05/15] Add some additional logging to ErrorPageMiddlewareWebSite (#8049) * Add some additional logging to ErrorPageMiddlewareWebSite DeveloperExceptionMiddleware will log an error if rendering the exception page throws. The test failure in https://github.com/aspnet/AspNetCore-Internal/issues/1730 suggests that we encountered an error like so but do not have anything further to go by. This change adds logging to the test so we could identify possible issues --- .../Mvc.FunctionalTests/ErrorPageTests.cs | 30 ++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/src/Mvc/test/Mvc.FunctionalTests/ErrorPageTests.cs b/src/Mvc/test/Mvc.FunctionalTests/ErrorPageTests.cs index 644a4ac067..ec976ac0dc 100644 --- a/src/Mvc/test/Mvc.FunctionalTests/ErrorPageTests.cs +++ b/src/Mvc/test/Mvc.FunctionalTests/ErrorPageTests.cs @@ -1,27 +1,44 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +using System; +using System.Linq; using System.Net; using System.Net.Http; using System.Net.Http.Headers; using System.Text.Encodings.Web; using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc.Razor.Internal; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Logging.Testing; using Xunit; +using Xunit.Abstractions; namespace Microsoft.AspNetCore.Mvc.FunctionalTests { /// /// Functional test to verify the error reporting of Razor compilation by diagnostic middleware. /// - public class ErrorPageTests : IClassFixture> + public class ErrorPageTests : IClassFixture>, IDisposable { private static readonly string PreserveCompilationContextMessage = HtmlEncoder.Default.Encode( "One or more compilation references are missing. Ensure that your project is referencing " + "'Microsoft.NET.Sdk.Web' and the 'PreserveCompilationContext' property is not set to false."); - public ErrorPageTests(MvcTestFixture fixture) + private readonly AssemblyTestLog _assemblyTestLog; + + public ErrorPageTests( + MvcTestFixture fixture, + ITestOutputHelper testOutputHelper) { - Client = fixture.CreateDefaultClient(); + _assemblyTestLog = AssemblyTestLog.ForAssembly(GetType().Assembly); + + var loggerProvider = _assemblyTestLog.CreateLoggerFactory(testOutputHelper, GetType().Name); + + var factory = fixture.Factories.FirstOrDefault() ?? fixture.WithWebHostBuilder(b => b.UseStartup()); + Client = factory + .WithWebHostBuilder(builder => builder.ConfigureLogging(l => l.Services.AddSingleton(loggerProvider))) + .CreateDefaultClient(); } public HttpClient Client { get; } @@ -144,5 +161,10 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests Assert.Contains(nullReferenceException, content); Assert.Contains(indexOutOfRangeException, content); } + + public void Dispose() + { + _assemblyTestLog.Dispose(); + } } } From a2e63227210f702b68f74c6dfb26204f908e14c2 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Fri, 1 Mar 2019 11:43:03 -0800 Subject: [PATCH 06/15] Restore testassets during build to prevent timeouts (#8038) * Restore testassets during build to prevent timeouts Fixes https://github.com/aspnet/AspNetCore-Internal/issues/1695 --- .../Microsoft.AspNetCore.Razor.Design.Test.csproj | 4 ++++ .../RestoreTestProjects/RestoreTestProjects.csproj | 14 ++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 src/Razor/Razor.Design/test/testassets/RestoreTestProjects/RestoreTestProjects.csproj diff --git a/src/Razor/Razor.Design/test/IntegrationTests/Microsoft.AspNetCore.Razor.Design.Test.csproj b/src/Razor/Razor.Design/test/IntegrationTests/Microsoft.AspNetCore.Razor.Design.Test.csproj index 86bcbf5a9f..c1824cecd6 100644 --- a/src/Razor/Razor.Design/test/IntegrationTests/Microsoft.AspNetCore.Razor.Design.Test.csproj +++ b/src/Razor/Razor.Design/test/IntegrationTests/Microsoft.AspNetCore.Razor.Design.Test.csproj @@ -61,4 +61,8 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests + + + + diff --git a/src/Razor/Razor.Design/test/testassets/RestoreTestProjects/RestoreTestProjects.csproj b/src/Razor/Razor.Design/test/testassets/RestoreTestProjects/RestoreTestProjects.csproj new file mode 100644 index 0000000000..b2f0830594 --- /dev/null +++ b/src/Razor/Razor.Design/test/testassets/RestoreTestProjects/RestoreTestProjects.csproj @@ -0,0 +1,14 @@ + + + netcoreapp2.1 + + + + + + + + + + + From db3795b368242953bd2ea6f1ef67d4fd7fe23293 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Fri, 1 Mar 2019 17:52:50 -0800 Subject: [PATCH 07/15] Put MVC's functional tests in a separate test group (#8118) Possible fix to https://github.com/aspnet/AspNetCore/issues/7313 One of the characteristics of these failures were that the test took long to run. The build log has warnings for several long running tests. This might be a result of CPU contention since mondo-ification that make MVC's functional tests run with nearly every other test project in the solution --- .../Microsoft.AspNetCore.Mvc.FunctionalTests.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Mvc/test/Mvc.FunctionalTests/Microsoft.AspNetCore.Mvc.FunctionalTests.csproj b/src/Mvc/test/Mvc.FunctionalTests/Microsoft.AspNetCore.Mvc.FunctionalTests.csproj index a2190bb338..00e7e4be5a 100644 --- a/src/Mvc/test/Mvc.FunctionalTests/Microsoft.AspNetCore.Mvc.FunctionalTests.csproj +++ b/src/Mvc/test/Mvc.FunctionalTests/Microsoft.AspNetCore.Mvc.FunctionalTests.csproj @@ -8,6 +8,7 @@ $(DefineConstants);GENERATE_BASELINES $(DefineConstants);__RemoveThisBitTo__GENERATE_BASELINES $(DefineConstants);FUNCTIONAL_TESTS + Mvc.FunctionalTests From e497f4101f2a34a71e686a0c06243d3a4a8c9589 Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Wed, 6 Mar 2019 19:45:46 -0800 Subject: [PATCH 08/15] Update branding to 2.1.10 (#8265) --- build/dependencies.props | 4 ++-- eng/Baseline.Designer.props | 2 +- eng/Baseline.xml | 2 +- eng/PatchConfig.props | 5 +++++ .../Archive.CiServer.Patch.Compat/ArchiveBaseline.2.1.9.txt | 6 ++++++ .../Archive.CiServer.Patch/ArchiveBaseline.2.1.9.txt | 6 ++++++ version.props | 2 +- 7 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 src/PackageArchive/Archive.CiServer.Patch.Compat/ArchiveBaseline.2.1.9.txt create mode 100644 src/PackageArchive/Archive.CiServer.Patch/ArchiveBaseline.2.1.9.txt diff --git a/build/dependencies.props b/build/dependencies.props index 03f4300c27..2b335ab806 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -2,8 +2,8 @@ - 2.1.7 - 2.1.7 + 2.1.9 + 2.1.9 diff --git a/eng/Baseline.Designer.props b/eng/Baseline.Designer.props index 3c053b176e..190af91a42 100644 --- a/eng/Baseline.Designer.props +++ b/eng/Baseline.Designer.props @@ -2,7 +2,7 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 2.1.8 + 2.1.9 diff --git a/eng/Baseline.xml b/eng/Baseline.xml index b7f70b9b93..a15dae40ff 100644 --- a/eng/Baseline.xml +++ b/eng/Baseline.xml @@ -4,7 +4,7 @@ This file contains a list of all the packages and their versions which were rele build of ASP.NET Core 2.1.x. Update this list when preparing for a new patch. --> - + diff --git a/eng/PatchConfig.props b/eng/PatchConfig.props index 70a6297f74..187efa606a 100644 --- a/eng/PatchConfig.props +++ b/eng/PatchConfig.props @@ -23,4 +23,9 @@ Later on, this will be checked using this condition: + + + + + diff --git a/src/PackageArchive/Archive.CiServer.Patch.Compat/ArchiveBaseline.2.1.9.txt b/src/PackageArchive/Archive.CiServer.Patch.Compat/ArchiveBaseline.2.1.9.txt new file mode 100644 index 0000000000..6d918a778c --- /dev/null +++ b/src/PackageArchive/Archive.CiServer.Patch.Compat/ArchiveBaseline.2.1.9.txt @@ -0,0 +1,6 @@ +microsoft.netcore.targets\1.1.0\.signature.p7s +runtime.native.system.security.cryptography\4.0.0\.signature.p7s +system.composition.convention\1.0.31\.signature.p7s +system.composition.typedparts\1.0.31\.signature.p7s +system.globalization.extensions\4.0.1\.signature.p7s +system.threading.tasks.parallel\4.3.0\.signature.p7s diff --git a/src/PackageArchive/Archive.CiServer.Patch/ArchiveBaseline.2.1.9.txt b/src/PackageArchive/Archive.CiServer.Patch/ArchiveBaseline.2.1.9.txt new file mode 100644 index 0000000000..6d918a778c --- /dev/null +++ b/src/PackageArchive/Archive.CiServer.Patch/ArchiveBaseline.2.1.9.txt @@ -0,0 +1,6 @@ +microsoft.netcore.targets\1.1.0\.signature.p7s +runtime.native.system.security.cryptography\4.0.0\.signature.p7s +system.composition.convention\1.0.31\.signature.p7s +system.composition.typedparts\1.0.31\.signature.p7s +system.globalization.extensions\4.0.1\.signature.p7s +system.threading.tasks.parallel\4.3.0\.signature.p7s diff --git a/version.props b/version.props index c696d687f3..ec99366288 100644 --- a/version.props +++ b/version.props @@ -2,7 +2,7 @@ 2 1 - 9 + 10 servicing Servicing t000 From aef62d9ff8cc023e4148447ace3605456a685042 Mon Sep 17 00:00:00 2001 From: BrennanConroy Date: Fri, 8 Mar 2019 10:00:18 -0800 Subject: [PATCH 09/15] Backport SSR fix (#8174) --- .../ts/signalr/src/DefaultHttpClient.ts | 13 ++---------- .../ts/signalr/src/EmptyNodeHttpClient.ts | 18 ++++++++++++++++ .../clients/ts/signalr/src/NodeHttpClient.ts | 21 +++++++++++++++---- src/SignalR/clients/ts/webpack.config.base.js | 6 ++++-- 4 files changed, 41 insertions(+), 17 deletions(-) create mode 100644 src/SignalR/clients/ts/signalr/src/EmptyNodeHttpClient.ts diff --git a/src/SignalR/clients/ts/signalr/src/DefaultHttpClient.ts b/src/SignalR/clients/ts/signalr/src/DefaultHttpClient.ts index b1f19d401f..732705e76f 100644 --- a/src/SignalR/clients/ts/signalr/src/DefaultHttpClient.ts +++ b/src/SignalR/clients/ts/signalr/src/DefaultHttpClient.ts @@ -4,16 +4,9 @@ import { AbortError } from "./Errors"; import { HttpClient, HttpRequest, HttpResponse } from "./HttpClient"; import { ILogger } from "./ILogger"; +import { NodeHttpClient } from "./NodeHttpClient"; import { XhrHttpClient } from "./XhrHttpClient"; -let nodeHttpClientModule: any; -if (typeof XMLHttpRequest === "undefined") { - // In order to ignore the dynamic require in webpack builds we need to do this magic - // @ts-ignore: TS doesn't know about these names - const requireFunc = typeof __webpack_require__ === "function" ? __non_webpack_require__ : require; - nodeHttpClientModule = requireFunc("./NodeHttpClient"); -} - /** Default implementation of {@link @aspnet/signalr.HttpClient}. */ export class DefaultHttpClient extends HttpClient { private readonly httpClient: HttpClient; @@ -24,10 +17,8 @@ export class DefaultHttpClient extends HttpClient { if (typeof XMLHttpRequest !== "undefined") { this.httpClient = new XhrHttpClient(logger); - } else if (typeof nodeHttpClientModule !== "undefined") { - this.httpClient = new nodeHttpClientModule.NodeHttpClient(logger); } else { - throw new Error("No HttpClient could be created."); + this.httpClient = new NodeHttpClient(logger); } } diff --git a/src/SignalR/clients/ts/signalr/src/EmptyNodeHttpClient.ts b/src/SignalR/clients/ts/signalr/src/EmptyNodeHttpClient.ts new file mode 100644 index 0000000000..c756727cb0 --- /dev/null +++ b/src/SignalR/clients/ts/signalr/src/EmptyNodeHttpClient.ts @@ -0,0 +1,18 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +// This is an empty implementation of the NodeHttpClient that will be included in browser builds so the output file will be smaller + +import { HttpClient, HttpResponse } from "./HttpClient"; +import { ILogger } from "./ILogger"; + +export class NodeHttpClient extends HttpClient { + // @ts-ignore: Need ILogger to compile, but unused variables generate errors + public constructor(logger: ILogger) { + super(); + } + + public send(): Promise { + return Promise.reject(new Error("If using Node either provide an XmlHttpRequest polyfill or consume the cjs or esm script instead of the browser/signalr.js one.")); + } +} diff --git a/src/SignalR/clients/ts/signalr/src/NodeHttpClient.ts b/src/SignalR/clients/ts/signalr/src/NodeHttpClient.ts index bd9f1da86b..45750d4816 100644 --- a/src/SignalR/clients/ts/signalr/src/NodeHttpClient.ts +++ b/src/SignalR/clients/ts/signalr/src/NodeHttpClient.ts @@ -1,23 +1,36 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -import * as Request from "request"; +// @ts-ignore: This will be removed from built files and is here to make the types available during dev work +import * as Request from "@types/request"; import { AbortError, HttpError, TimeoutError } from "./Errors"; import { HttpClient, HttpRequest, HttpResponse } from "./HttpClient"; import { ILogger, LogLevel } from "./ILogger"; import { isArrayBuffer } from "./Utils"; +let requestModule: Request.RequestAPI; +if (typeof XMLHttpRequest === "undefined") { + // In order to ignore the dynamic require in webpack builds we need to do this magic + // @ts-ignore: TS doesn't know about these names + const requireFunc = typeof __webpack_require__ === "function" ? __non_webpack_require__ : require; + requestModule = requireFunc("request"); +} + export class NodeHttpClient extends HttpClient { private readonly logger: ILogger; - private readonly request: Request.RequestAPI; + private readonly request: typeof requestModule; private readonly cookieJar: Request.CookieJar; public constructor(logger: ILogger) { super(); + if (typeof requestModule === "undefined") { + throw new Error("The 'request' module could not be loaded."); + } + this.logger = logger; - this.cookieJar = Request.jar(); - this.request = Request.defaults({ jar: this.cookieJar }); + this.cookieJar = requestModule.jar(); + this.request = requestModule.defaults({ jar: this.cookieJar }); } public send(httpRequest: HttpRequest): Promise { diff --git a/src/SignalR/clients/ts/webpack.config.base.js b/src/SignalR/clients/ts/webpack.config.base.js index 6779afc2ff..f6720ffe04 100644 --- a/src/SignalR/clients/ts/webpack.config.base.js +++ b/src/SignalR/clients/ts/webpack.config.base.js @@ -39,7 +39,10 @@ module.exports = function (modulePath, browserBaseName, options) { }, resolve: { extensions: [".ts", ".js"], - alias: options.alias, + alias: { + "./NodeHttpClient": path.resolve(__dirname, "signalr/src/EmptyNodeHttpClient.ts"), + ...options.alias, + } }, output: { filename: `${browserBaseName}.js`, @@ -72,7 +75,6 @@ module.exports = function (modulePath, browserBaseName, options) { }), // ES6 Promise uses this module in certain circumstances but we don't need it. new webpack.IgnorePlugin(/vertx/), - new webpack.IgnorePlugin(/NodeHttpClient/), new webpack.IgnorePlugin(/eventsource/), ], externals: options.externals, From e7c5e09ad218aaa11b4a22118ce80c822448d021 Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Thu, 7 Mar 2019 17:24:40 -0800 Subject: [PATCH 10/15] Unpin our System.Net.Http package version - shipped in the past patch --- build/dependencies.props | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build/dependencies.props b/build/dependencies.props index 2b335ab806..8b90083c0d 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -4,6 +4,8 @@ 2.1.9 2.1.9 + + 4.3.4 @@ -194,7 +196,6 @@ 4.5.0 5.2.0 3.1.1 - 4.3.2 4.5.0 3.1.1 4.3.0 From 4941c7b90d60ced4304358748da24374f0f4f2ac Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Thu, 14 Mar 2019 09:52:43 -0700 Subject: [PATCH 11/15] Unpin the System.Net.Http.WinHttpHandler package version - CoreFx shipping a new version --- build/dependencies.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/dependencies.props b/build/dependencies.props index 8b90083c0d..0748ab7c90 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -6,6 +6,7 @@ 2.1.9 4.3.4 + 4.5.2 @@ -213,7 +214,6 @@ 4.5.0 4.5.3 4.5.2 - 4.5.2 4.5.3 4.5.2 1.3.7 From 7c732d55f6d1affff17f3f3180251a5d18d506b3 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Thu, 14 Mar 2019 21:44:21 -0700 Subject: [PATCH 12/15] Pin System.Net.Http package version --- build/dependencies.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/dependencies.props b/build/dependencies.props index 0748ab7c90..2cb40dfbb9 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -5,7 +5,6 @@ 2.1.9 2.1.9 - 4.3.4 4.5.2 @@ -197,6 +196,7 @@ 4.5.0 5.2.0 3.1.1 + 4.3.4 4.5.0 3.1.1 4.3.0 From 2835f85b6c84d93ac1557074c04d30047b6a8c81 Mon Sep 17 00:00:00 2001 From: BrennanConroy Date: Thu, 14 Mar 2019 08:54:20 -0700 Subject: [PATCH 13/15] Update PatchConfig.props --- eng/PatchConfig.props | 1 + 1 file changed, 1 insertion(+) diff --git a/eng/PatchConfig.props b/eng/PatchConfig.props index fcc05ede1d..e84b9d1860 100644 --- a/eng/PatchConfig.props +++ b/eng/PatchConfig.props @@ -45,6 +45,7 @@ Later on, this will be checked using this condition: + @aspnet/signalr; From 2a2809afe4a2c665c4bfe25ff816c542948c4ab5 Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Fri, 15 Mar 2019 12:04:12 -0700 Subject: [PATCH 14/15] Unpin Microsoft.Extensions.Configuration.Binder package - included in this release --- build/dependencies.props | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index 2cb40dfbb9..55ac87847c 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -6,7 +6,9 @@ 2.1.9 4.5.2 - + + 2.1.1 + @@ -33,7 +35,6 @@ 2.1.1 2.1.1 2.1.1 - 2.1.1 2.1.1 2.1.1 2.1.1 From 909d951caf79971b62ef1bc30fb41889a5d4190d Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Fri, 15 Mar 2019 14:50:56 -0700 Subject: [PATCH 15/15] Unpin 3 Microsoft.Extensions.Configuration packages - shipping in this release --- build/dependencies.props | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index fc6b4b091a..cfe9644e75 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -4,6 +4,10 @@ 2.2.3 2.2.3 + + 2.2.0 + 2.2.0 + 2.2.0 @@ -46,13 +50,10 @@ 2.2.0 2.2.0 2.2.0 - 2.2.0 2.2.0 - 2.2.0 2.2.0 2.2.0 2.2.0 - 2.2.0 2.2.0 2.2.0 2.2.0