From 978957315b967ba390188121e4e46bb138d8b644 Mon Sep 17 00:00:00 2001 From: Livar Cunha Date: Mon, 29 Jan 2018 21:20:07 -0800 Subject: [PATCH 1/2] Fixing update dependency by using the new APIs. We broke this when we updated the version of VersionTools. --- build/DependencyVersions.props | 2 +- build_projects/update-dependencies/Program.cs | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/build/DependencyVersions.props b/build/DependencyVersions.props index 41f4e29a8..054779e42 100644 --- a/build/DependencyVersions.props +++ b/build/DependencyVersions.props @@ -75,7 +75,7 @@ - 1.0.27-prerelease-01723-01 + 2.1.0-prerelease-02430-04 2.0.0-preview2-25331-01 2.1.0-prerelease-02221-02 diff --git a/build_projects/update-dependencies/Program.cs b/build_projects/update-dependencies/Program.cs index 27926a77c..ae39b89aa 100644 --- a/build_projects/update-dependencies/Program.cs +++ b/build_projects/update-dependencies/Program.cs @@ -4,6 +4,7 @@ using Microsoft.DotNet.VersionTools; using Microsoft.DotNet.VersionTools.Automation; using Microsoft.DotNet.VersionTools.Dependencies; +using Microsoft.DotNet.VersionTools.Dependencies.BuildOutput; using System; using System.Collections.Generic; using System.Diagnostics; @@ -29,7 +30,7 @@ namespace Microsoft.DotNet.Scripts IEnumerable updaters = GetUpdaters(); var dependencyBuildInfos = buildInfos.Select(buildInfo => - new DependencyBuildInfo( + new BuildDependencyInfo( buildInfo, upgradeStableVersions: true, disabledPackages: Enumerable.Empty())); @@ -50,11 +51,14 @@ namespace Microsoft.DotNet.Scripts body += PullRequestCreator.NotificationString(s_config.GitHubPullRequestNotifications); } - new PullRequestCreator(gitHubAuth, origin, upstreamBranch) + new PullRequestCreator(gitHubAuth) .CreateOrUpdateAsync( suggestedMessage, suggestedMessage + $" ({upstreamBranch.Name})", - body) + body, + upstreamBranch, + origin, + new PullRequestOptions()) .Wait(); } } From 43b84cf1e2d5db045b69510d1080bce3d6c61044 Mon Sep 17 00:00:00 2001 From: Livar Cunha Date: Tue, 30 Jan 2018 15:43:41 -0800 Subject: [PATCH 2/2] Adding roslyn to automatic dependency flow through maestro. --- build_projects/update-dependencies/Config.cs | 5 +++++ build_projects/update-dependencies/Program.cs | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/build_projects/update-dependencies/Config.cs b/build_projects/update-dependencies/Config.cs index 0bd5a0c6a..75c0d0c81 100644 --- a/build_projects/update-dependencies/Config.cs +++ b/build_projects/update-dependencies/Config.cs @@ -39,12 +39,15 @@ namespace Microsoft.DotNet.Scripts private Lazy _dotNetVersionUrl = new Lazy(() => GetEnvironmentVariable("DOTNET_VERSION_URL", "https://raw.githubusercontent.com/dotnet/versions/master/build-info")); private Lazy _coreSetupVersionFragment = new Lazy(() => GetEnvironmentVariable("CORESETUP_VERSION_FRAGMENT", GetDefaultCoreSetupVersionFragment())); + + private Lazy _roslynVersionFragment = new Lazy(() => GetEnvironmentVariable("ROSLYN_VERSION_FRAGMENT")); private Lazy _gitHubUpstreamOwner = new Lazy(() => GetEnvironmentVariable("GITHUB_UPSTREAM_OWNER", "dotnet")); private Lazy _gitHubProject = new Lazy(() => GetEnvironmentVariable("GITHUB_PROJECT", "cli")); private Lazy _gitHubUpstreamBranch = new Lazy(() => GetEnvironmentVariable("GITHUB_UPSTREAM_BRANCH", GetDefaultUpstreamBranch())); private Lazy _gitHubPullRequestNotifications = new Lazy(() => GetEnvironmentVariable("GITHUB_PULL_REQUEST_NOTIFICATIONS", "") .Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries)); + private Config() { } @@ -54,6 +57,8 @@ namespace Microsoft.DotNet.Scripts public string Password => _password.Value; public string DotNetVersionUrl => _dotNetVersionUrl.Value; public string CoreSetupVersionFragment => _coreSetupVersionFragment.Value; + public string RoslynVersionFragment => _roslynVersionFragment.Value; + public bool HasRoslynVersionFragment => !string.IsNullOrEmpty(RoslynVersionFragment); public string GitHubUpstreamOwner => _gitHubUpstreamOwner.Value; public string GitHubProject => _gitHubProject.Value; public string GitHubUpstreamBranch => _gitHubUpstreamBranch.Value; diff --git a/build_projects/update-dependencies/Program.cs b/build_projects/update-dependencies/Program.cs index ae39b89aa..99b77691e 100644 --- a/build_projects/update-dependencies/Program.cs +++ b/build_projects/update-dependencies/Program.cs @@ -28,6 +28,11 @@ namespace Microsoft.DotNet.Scripts buildInfos.Add(GetBuildInfo("CoreSetup", s_config.CoreSetupVersionFragment, fetchLatestReleaseFile: false)); + if (s_config.HasRoslynVersionFragment) + { + buildInfos.Add(GetBuildInfo("Roslyn", s_config.RoslynVersionFragment, fetchLatestReleaseFile: false)); + } + IEnumerable updaters = GetUpdaters(); var dependencyBuildInfos = buildInfos.Select(buildInfo => new BuildDependencyInfo( @@ -88,6 +93,11 @@ namespace Microsoft.DotNet.Scripts yield return CreateRegexUpdater(dependencyVersionsPath, "MicrosoftNETCoreAppPackageVersion", "Microsoft.NETCore.App"); yield return CreateRegexUpdater(dependencyVersionsPath, "MicrosoftDotNetPlatformAbstractionsPackageVersion", "Microsoft.DotNet.PlatformAbstractions"); yield return CreateRegexUpdater(dependencyVersionsPath, "MicrosoftExtensionsDependencyModelPackageVersion", "Microsoft.Extensions.DependencyModel"); + + if (s_config.HasRoslynVersionFragment) + { + yield return CreateRegexUpdater(dependencyVersionsPath, "MicrosoftCodeAnalysisCSharpPackageVersion", "Microsoft.CodeAnalysis.CSharp"); + } } private static IDependencyUpdater CreateRegexUpdater(string repoRelativePath, string propertyName, string packageId)