From eed2e31372eab822b4b920e6f702491595f3c17e Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Thu, 2 Feb 2023 12:35:41 -0700 Subject: [PATCH 01/11] Skip generating the NOTICE file on PR builds NOTICE generation fails frequently due to throttling, so this will both help keep PRs going, and reduce the demand on the network resource. --- azure-pipelines/microbuild.before.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-pipelines/microbuild.before.yml b/azure-pipelines/microbuild.before.yml index a27cf36bd..9320b1c2d 100644 --- a/azure-pipelines/microbuild.before.yml +++ b/azure-pipelines/microbuild.before.yml @@ -7,6 +7,7 @@ steps: inputs: outputfile: $(System.DefaultWorkingDirectory)/obj/NOTICE outputformat: text + condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) - task: MicroBuildSigningPlugin@3 inputs: From dcd78387fdbb4176e69cf725bf51bea0cccfcadc Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Fri, 10 Feb 2023 12:45:25 -0700 Subject: [PATCH 02/11] Add emojis to insertion pipeline steps --- azure-pipelines/prepare-insertion-stages.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/azure-pipelines/prepare-insertion-stages.yml b/azure-pipelines/prepare-insertion-stages.yml index a707454c4..dcd1e6d8f 100644 --- a/azure-pipelines/prepare-insertion-stages.yml +++ b/azure-pipelines/prepare-insertion-stages.yml @@ -9,17 +9,17 @@ stages: - checkout: none - download: current artifact: Variables-Windows - displayName: Download Variables-Windows artifact + displayName: 🔻 Download Variables-Windows artifact - task: PowerShell@2 - displayName: Set pipeline variables based on artifacts + displayName: ⚙️ Set pipeline variables based on artifacts inputs: targetType: filePath filePath: $(Pipeline.Workspace)/Variables-Windows/_pipelines.ps1 - download: current artifact: symbols-legacy - displayName: Download symbols-legacy artifact + displayName: 🔻 Download symbols-legacy artifact - task: MicroBuildArchiveSymbols@1 - displayName: Archive symbols to Symweb + displayName: 🔣 Archive symbols to Symweb inputs: SymbolsFeatureName: $(SymbolsFeatureName) SymbolsSymwebProject: VS @@ -27,7 +27,7 @@ stages: SymbolsEmailContacts: vsidemicrobuild SymbolsAgentPath: $(Pipeline.Workspace)/symbols-legacy - task: MicroBuildCleanup@1 - displayName: Send Telemetry + displayName: ☎️ Send Telemetry # - stage: azure_public_vsimpl_feed # displayName: azure-public/vs-impl feed @@ -41,16 +41,16 @@ stages: # - checkout: none # - download: current # artifact: deployables-Windows -# displayName: Download deployables-Windows artifact +# displayName: 🔻 Download deployables-Windows artifact # - task: UseDotNet@2 -# displayName: Install .NET SDK +# displayName: ⚙️ Install .NET SDK # inputs: # packageType: sdk # version: 6.x # - task: NuGetAuthenticate@1 -# displayName: Authenticate NuGet feeds +# displayName: 🔏 Authenticate NuGet feeds # inputs: # nuGetServiceConnections: azure-public/vs-impl # forceReinstallCredentialProvider: true # - script: dotnet nuget push $(Pipeline.Workspace)/deployables-Windows/NuGet/*.nupkg -s https://pkgs.dev.azure.com/azure-public/vside/_packaging/vs-impl/nuget/v3/index.json --api-key azdo --skip-duplicate -# displayName: Push nuget packages +# displayName: 📦 Push nuget packages From c01126d8e995b239a17341ecec2e85bd0e02129b Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Mon, 13 Feb 2023 16:19:46 -0700 Subject: [PATCH 03/11] Simplify Version cast in ps1 script --- tools/Install-DotNetSdk.ps1 | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/Install-DotNetSdk.ps1 b/tools/Install-DotNetSdk.ps1 index 2bac3b9bc..a8635f497 100644 --- a/tools/Install-DotNetSdk.ps1 +++ b/tools/Install-DotNetSdk.ps1 @@ -92,19 +92,18 @@ Function Get-FileFromWeb([Uri]$Uri, $OutDir) { } Function Get-InstallerExe( - $Version, + [Version]$Version, $Architecture, [ValidateSet('Sdk','Runtime','WindowsDesktop')] [string]$sku ) { # Get the latest/actual version for the specified one - $TypedVersion = [Version]$Version - if ($TypedVersion.Build -eq -1) { + if ($Version.Build -eq -1) { $versionInfo = -Split (Invoke-WebRequest -Uri "https://dotnetcli.blob.core.windows.net/dotnet/$sku/$Version/latest.version" -UseBasicParsing) $Version = $versionInfo[-1] } - $majorMinor = "$($TypedVersion.Major).$($TypedVersion.Minor)" + $majorMinor = "$($Version.Major).$($Version.Minor)" $ReleasesFile = Join-Path $DotNetInstallScriptRoot "$majorMinor\releases.json" if (!(Test-Path $ReleasesFile)) { Get-FileFromWeb -Uri "https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/$majorMinor/releases.json" -OutDir (Split-Path $ReleasesFile) | Out-Null From 0fc6c4f57e3b180da230264669a3c24be17903e9 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Wed, 15 Feb 2023 09:49:03 -0700 Subject: [PATCH 04/11] Add more emojis and use simpler powershell task syntax --- azure-pipelines/prepare-insertion-stages.yml | 5 +---- azure-pipelines/release-deployment-prep.yml | 9 +++----- azure-pipelines/vs-insertion.yml | 16 +++++++------- azure-pipelines/vs-validation.yml | 23 +++++++++----------- 4 files changed, 22 insertions(+), 31 deletions(-) diff --git a/azure-pipelines/prepare-insertion-stages.yml b/azure-pipelines/prepare-insertion-stages.yml index dcd1e6d8f..bb955d688 100644 --- a/azure-pipelines/prepare-insertion-stages.yml +++ b/azure-pipelines/prepare-insertion-stages.yml @@ -10,11 +10,8 @@ stages: - download: current artifact: Variables-Windows displayName: 🔻 Download Variables-Windows artifact - - task: PowerShell@2 + - powershell: $(Pipeline.Workspace)/Variables-Windows/_pipelines.ps1 displayName: ⚙️ Set pipeline variables based on artifacts - inputs: - targetType: filePath - filePath: $(Pipeline.Workspace)/Variables-Windows/_pipelines.ps1 - download: current artifact: symbols-legacy displayName: 🔻 Download symbols-legacy artifact diff --git a/azure-pipelines/release-deployment-prep.yml b/azure-pipelines/release-deployment-prep.yml index 059fd1d0a..d9a9ffd39 100644 --- a/azure-pipelines/release-deployment-prep.yml +++ b/azure-pipelines/release-deployment-prep.yml @@ -1,9 +1,6 @@ steps: - download: CI artifact: Variables-Windows - displayName: Download Variables-Windows artifact -- task: PowerShell@2 - displayName: Set pipeline variables based on artifacts - inputs: - targetType: filePath - filePath: $(Pipeline.Workspace)/CI/Variables-Windows/_pipelines.ps1 + displayName: 🔻 Download Variables-Windows artifact +- powershell: $(Pipeline.Workspace)/CI/Variables-Windows/_pipelines.ps1 + displayName: ⚙️ Set pipeline variables based on artifacts diff --git a/azure-pipelines/vs-insertion.yml b/azure-pipelines/vs-insertion.yml index 112dd92f6..c75245594 100644 --- a/azure-pipelines/vs-insertion.yml +++ b/azure-pipelines/vs-insertion.yml @@ -19,24 +19,24 @@ jobs: steps: - checkout: none - powershell: Write-Host "##vso[build.updatebuildnumber]$(resources.pipeline.CI.runName)" - displayName: Set pipeline name + displayName: ⚙️ Set pipeline name - task: UseDotNet@2 - displayName: Install .NET SDK + displayName: ⚙️ Install .NET SDK inputs: packageType: sdk version: 6.x - task: NuGetAuthenticate@1 - displayName: Authenticate NuGet feeds + displayName: 🔏 Authenticate NuGet feeds inputs: forceReinstallCredentialProvider: true - template: release-deployment-prep.yml - download: CI artifact: VSInsertion-Windows - displayName: Download VSInsertion-Windows artifact + displayName: 🔻 Download VSInsertion-Windows artifact - script: dotnet nuget push $(Pipeline.Workspace)\CI\VSInsertion-windows\*.nupkg -s https://pkgs.dev.azure.com/devdiv/_packaging/VS/nuget/v3/index.json -k azdo --skip-duplicate - displayName: Push CoreXT packages to VS feed + displayName: 📦 Push CoreXT packages to VS feed - task: MicroBuildInsertVsPayload@4 - displayName: Insert VS Payload + displayName: 🏭 Insert VS Payload inputs: TeamName: $(TeamName) TeamEmail: $(TeamEmail) @@ -45,7 +45,7 @@ jobs: AutoCompletePR: true AutoCompleteMergeStrategy: Squash - task: MicroBuildCleanup@1 - displayName: Send Telemetry + displayName: ☎️ Send Telemetry - powershell: | $contentType = 'application/json'; $headers = @{ Authorization = 'Bearer $(System.AccessToken)' }; @@ -54,4 +54,4 @@ jobs: Write-Host $request $uri = "$(System.CollectionUri)$(System.TeamProject)/_apis/build/retention/leases?api-version=6.0-preview.1"; Invoke-RestMethod -uri $uri -method POST -Headers $headers -ContentType $contentType -Body $request; - displayName: Retain inserted builds + displayName: 🗻 Retain inserted builds diff --git a/azure-pipelines/vs-validation.yml b/azure-pipelines/vs-validation.yml index 3cbc196ed..82a82aa01 100644 --- a/azure-pipelines/vs-validation.yml +++ b/azure-pipelines/vs-validation.yml @@ -36,30 +36,27 @@ stages: clean: true fetchDepth: 1 - task: UseDotNet@2 - displayName: Install .NET SDK + displayName: ⚙️ Install .NET SDK inputs: packageType: sdk version: 6.x - task: NuGetAuthenticate@1 - displayName: Authenticate NuGet feeds + displayName: 🔏 Authenticate NuGet feeds inputs: forceReinstallCredentialProvider: true - download: current artifact: Variables-Windows - displayName: Download Variables-Windows artifact - - task: PowerShell@2 - displayName: Set pipeline variables based on artifacts - inputs: - targetType: filePath - filePath: $(Pipeline.Workspace)/Variables-Windows/_pipelines.ps1 + displayName: 🔻 Download Variables-Windows artifact + - powershell: $(Pipeline.Workspace)/Variables-Windows/_pipelines.ps1 + displayName: ⚙️ Set pipeline variables based on artifacts - download: current artifact: VSInsertion-Windows - displayName: Download VSInsertion-Windows artifact + displayName: 🔻 Download VSInsertion-Windows artifact - script: dotnet nuget push VSInsertion-windows\*.nupkg -s https://pkgs.dev.azure.com/devdiv/_packaging/VS/nuget/v3/index.json -k azdo --skip-duplicate - displayName: Push CoreXT packages to VS feed + displayName: 📦 Push CoreXT packages to VS feed workingDirectory: $(Pipeline.Workspace) - task: MicroBuildInsertVsPayload@4 - displayName: Insert VS Payload + displayName: 🏭 Insert VS Payload inputs: TeamName: $(TeamName) TeamEmail: $(TeamEmail) @@ -78,7 +75,7 @@ stages: Remember to Abandon and (if allowed) to Delete Source Branch on that insertion PR when validation is complete. "@ azure-pipelines/PostPRMessage.ps1 -AccessToken '$(System.AccessToken)' -Markdown $Markdown -Verbose - displayName: Comment on pull request + displayName: ✏️ Comment on pull request condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest')) - task: MicroBuildCleanup@1 - displayName: Send Telemetry + displayName: ☎️ Send Telemetry From b3a68a9e4a6c37996ef969a54ac059ab62eae3d2 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Thu, 16 Feb 2023 13:02:03 -0700 Subject: [PATCH 05/11] Use LF line endings for plist files The mac tools that read these files are sticklers for LF endings. --- .gitattributes | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitattributes b/.gitattributes index c22a129ef..1f35e683d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -7,6 +7,9 @@ *.sh eol=lf *.ps1 eol=lf +# The macOS codesign tool is extremely picky, and requires LF line endings. +*.plist eol=lf + ############################################################################### # Set default behavior for command prompt diff. # From b579c7cabdad15c7b0b86446309f5297bd71cbb4 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Thu, 16 Feb 2023 13:04:55 -0700 Subject: [PATCH 06/11] Add `-interactive` switch to init.ps1 --- init.ps1 | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/init.ps1 b/init.ps1 index 774ead583..ad3b4145c 100755 --- a/init.ps1 +++ b/init.ps1 @@ -30,6 +30,8 @@ Skips the package restore step. .PARAMETER AccessToken An optional access token for authenticating to Azure Artifacts authenticated feeds. +.PARAMETER Interactive + Runs NuGet restore in interactive mode. This can turn authentication failures into authentication challenges. #> [CmdletBinding(SupportsShouldProcess = $true)] Param ( @@ -44,7 +46,9 @@ Param ( [Parameter()] [switch]$NoRestore, [Parameter()] - [string]$AccessToken + [string]$AccessToken, + [Parameter()] + [switch]$Interactive ) $EnvVars = @{} @@ -76,8 +80,14 @@ try { $HeaderColor = 'Green' if (!$NoRestore -and $PSCmdlet.ShouldProcess("NuGet packages", "Restore")) { + $RestoreArguments = @() + if ($Interactive) + { + $RestoreArguments += '--interactive' + } + Write-Host "Restoring NuGet packages" -ForegroundColor $HeaderColor - dotnet restore + dotnet restore @RestoreArguments if ($lastexitcode -ne 0) { throw "Failure while restoring packages." } From c6b825e9e71cc57c7275e81f8281cb74a1d41f57 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Wed, 22 Feb 2023 07:54:46 -0700 Subject: [PATCH 07/11] Bump MicroBuild to 2.0.112 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index ae621d842..e1bd2e7d7 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -4,7 +4,7 @@ true true - 2.0.107 + 2.0.112 From 8b342da2060fe53954b1630d00a6c02a2b923383 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Thu, 23 Feb 2023 15:12:36 -0700 Subject: [PATCH 08/11] Remove certain tasks on non-Windows agents --- azure-pipelines/microbuild.after.yml | 3 ++- azure-pipelines/microbuild.before.yml | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/azure-pipelines/microbuild.after.yml b/azure-pipelines/microbuild.after.yml index 4c3554abd..3dbbad9cc 100644 --- a/azure-pipelines/microbuild.after.yml +++ b/azure-pipelines/microbuild.after.yml @@ -8,6 +8,7 @@ steps: inputs: TargetFolders: | $(Build.SourcesDirectory)/bin/Packages/$(BuildConfiguration)/NuGet + condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT')) - task: MicroBuildCleanup@1 condition: succeededOrFailed() @@ -23,7 +24,7 @@ steps: /repoName:$(Build.Repository.Name) /additionalCodexArguments:-bld /additionalCodexArguments:$(Build.ArtifactStagingDirectory)/build_logs - condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'), ne(variables['Build.Reason'], 'PullRequest')) + condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'), ne(variables['Build.Reason'], 'PullRequest'), eq(variables['Agent.OS'], 'Windows_NT')) continueOnError: true - ${{ if eq(parameters.EnableCompliance, 'true') }}: diff --git a/azure-pipelines/microbuild.before.yml b/azure-pipelines/microbuild.before.yml index 9320b1c2d..d048af4bb 100644 --- a/azure-pipelines/microbuild.before.yml +++ b/azure-pipelines/microbuild.before.yml @@ -14,6 +14,8 @@ steps: signType: $(SignType) zipSources: false displayName: 🔧 Install MicroBuild Signing Plugin + condition: and(succeeded(), or(eq(variables['Agent.OS'], 'Windows_NT'), eq(variables['SignType'], 'real'))) - task: MicroBuildSbomPlugin@1 displayName: 🔧 Install MicroBuild Sbom Plugin + condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT')) From 6415323a89947e6d5d2229cd606cb02d18c1c474 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Fri, 24 Feb 2023 13:07:15 -0700 Subject: [PATCH 09/11] Bump dependencies to 17.5.0 versions --- Directory.Packages.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index a46323fa9..b792f3f6b 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -5,8 +5,8 @@ true - - + + From 00d95df58e51bbee9500ff17fff9b41354978433 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Mon, 27 Feb 2023 15:32:56 -0700 Subject: [PATCH 10/11] Bump DNNE to 2.0.0 --- Directory.Packages.props | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 07493f646..ccead37bd 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -3,7 +3,6 @@ true true - 2.0.112 3.11.0 4.4.0 @@ -11,7 +10,7 @@ 2.3.405501 - + @@ -55,4 +54,4 @@ - + \ No newline at end of file From d4525181ccc5e6912945defe758ca92b9acfc23d Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Mon, 27 Feb 2023 15:58:49 -0700 Subject: [PATCH 11/11] Update more dependency versions --- Directory.Packages.props | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index ccead37bd..c5ce78128 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -3,7 +3,7 @@ true true - 2.0.112 + 2.0.113 3.11.0 4.4.0 1.1.1 @@ -30,11 +30,11 @@ - + - +