From 7ea6f9cb04b3b56bf6a0a6e487c84fa3fb609bb5 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Tue, 27 Feb 2024 15:44:32 -0700 Subject: [PATCH 01/17] Fail OptProf pipeline when profilingInputs can't be published --- azure-pipelines/microbuild.after.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/azure-pipelines/microbuild.after.yml b/azure-pipelines/microbuild.after.yml index 34bdb45..6ec0838 100644 --- a/azure-pipelines/microbuild.after.yml +++ b/azure-pipelines/microbuild.after.yml @@ -24,7 +24,6 @@ steps: usePat: true displayName: ๐Ÿ“ข Publish to Artifact Services - ProfilingInputs condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) - continueOnError: true - task: PublishBuildArtifacts@1 inputs: From 48d18208f3d24fd090680f7ed4e2e4abc3da1aaa Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Tue, 27 Feb 2024 16:08:44 -0700 Subject: [PATCH 02/17] Add missing OptProf.targets file --- azure-pipelines/build.yml | 6 ++++++ src/OptProf.targets | 17 +++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 src/OptProf.targets diff --git a/azure-pipelines/build.yml b/azure-pipelines/build.yml index 26b731c..237dd54 100644 --- a/azure-pipelines/build.yml +++ b/azure-pipelines/build.yml @@ -4,6 +4,12 @@ parameters: ##### Feel free to adjust their default value as needed. # Whether this repo uses OptProf to optimize the built binaries. +# When enabling this, be sure to update these files: +# - OptProf.targets: InstallationPath and match TestCase selection with what's in the VS repo. +# - The project file(s) for the libraries to optimize must import OptProf.targets. +# - OptProf.yml: Search for LibraryName (or your library's name) and verify that those names are appropriate. +# - OptProf_part2.yml: Search for LibraryName (or your library's name) and verify that those names are appropriate. +# and create pipelines for OptProf.yml, OptProf_part2.yml - name: EnableOptProf type: boolean default: false diff --git a/src/OptProf.targets b/src/OptProf.targets new file mode 100644 index 0000000..d0167d7 --- /dev/null +++ b/src/OptProf.targets @@ -0,0 +1,17 @@ + + + + IBC + Common7\IDE\PrivateAssemblies\$(TargetFileName) + /ExeConfig:"%VisualStudio.InstallationUnderTest.Path%\Common7\IDE\vsn.exe" + + + + + + + + + + + From 9dce0e27cd6a1014f350d22892c8a997bb1e8458 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Tue, 27 Feb 2024 16:18:51 -0700 Subject: [PATCH 03/17] Filter VSInsertionMetadata from default.config world --- azure-pipelines/variables/InsertConfigValues.ps1 | 3 ++- azure-pipelines/variables/InsertPropsValues.ps1 | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/azure-pipelines/variables/InsertConfigValues.ps1 b/azure-pipelines/variables/InsertConfigValues.ps1 index 3ae11de..ae84969 100644 --- a/azure-pipelines/variables/InsertConfigValues.ps1 +++ b/azure-pipelines/variables/InsertConfigValues.ps1 @@ -3,7 +3,8 @@ $InsertedPkgs = (& "$PSScriptRoot\..\artifacts\VSInsertion.ps1") $icv=@() foreach ($kvp in $InsertedPkgs.GetEnumerator()) { $kvp.Value |% { - if ($_.Name -match "^(.*?)\.(\d+\.\d+\.\d+(?:\.\d+)?(?:-.*?)?)(?:\.symbols)?\.nupkg$") { + # Skip VSInsertionMetadata packages for default.config world, which doesn't use it any more. + if (($_.Name -match "^(.*?)\.(\d+\.\d+\.\d+(?:\.\d+)?(?:-.*?)?)(?:\.symbols)?\.nupkg$") -and $_.Name -notmatch 'VSInsertionMetadata') { $id = $Matches[1] $version = $Matches[2] $icv += "$id=$version" diff --git a/azure-pipelines/variables/InsertPropsValues.ps1 b/azure-pipelines/variables/InsertPropsValues.ps1 index 8d1e70a..3ae11de 100644 --- a/azure-pipelines/variables/InsertPropsValues.ps1 +++ b/azure-pipelines/variables/InsertPropsValues.ps1 @@ -1,2 +1,14 @@ -# These values are commonly the same. -& "$PSScriptRoot/InsertConfigValues.ps1" +$InsertedPkgs = (& "$PSScriptRoot\..\artifacts\VSInsertion.ps1") + +$icv=@() +foreach ($kvp in $InsertedPkgs.GetEnumerator()) { + $kvp.Value |% { + if ($_.Name -match "^(.*?)\.(\d+\.\d+\.\d+(?:\.\d+)?(?:-.*?)?)(?:\.symbols)?\.nupkg$") { + $id = $Matches[1] + $version = $Matches[2] + $icv += "$id=$version" + } + } +} + +Write-Output ([string]::join(',',$icv)) From 990c095107389e5cc9f88defec36b3c1cc67bea0 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Thu, 29 Feb 2024 12:37:10 -0700 Subject: [PATCH 04/17] Add comment about multi-targeting projects --- azure-pipelines/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines/build.yml b/azure-pipelines/build.yml index 237dd54..27a4aed 100644 --- a/azure-pipelines/build.yml +++ b/azure-pipelines/build.yml @@ -6,7 +6,7 @@ parameters: # Whether this repo uses OptProf to optimize the built binaries. # When enabling this, be sure to update these files: # - OptProf.targets: InstallationPath and match TestCase selection with what's in the VS repo. -# - The project file(s) for the libraries to optimize must import OptProf.targets. +# - The project file(s) for the libraries to optimize must import OptProf.targets (for multi-targeted projects, only import it for ONE target). # - OptProf.yml: Search for LibraryName (or your library's name) and verify that those names are appropriate. # - OptProf_part2.yml: Search for LibraryName (or your library's name) and verify that those names are appropriate. # and create pipelines for OptProf.yml, OptProf_part2.yml From b230d93f0c0f6e2c9340fcc9e0ea6668863b8522 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Thu, 3 Oct 2024 21:30:51 -0600 Subject: [PATCH 05/17] Bump .NET SDK to 8.0.402 --- .devcontainer/Dockerfile | 2 +- global.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index b3336ca..9626b31 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,5 +1,5 @@ # Refer to https://hub.docker.com/_/microsoft-dotnet-sdk for available versions -FROM mcr.microsoft.com/dotnet/sdk:8.0.400-jammy +FROM mcr.microsoft.com/dotnet/sdk:8.0.402-jammy # Installing mono makes `dotnet test` work without errors even for net472. # But installing it takes a long time, so it's excluded by default. diff --git a/global.json b/global.json index c262ff1..1f0eafb 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.400", + "version": "8.0.402", "rollForward": "patch", "allowPrerelease": false } From 822a17acf87167064d892cb860526752341da2ed Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Fri, 4 Oct 2024 05:43:43 -0600 Subject: [PATCH 06/17] Fix linux agent on AzDO --- azure-pipelines/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines/build.yml b/azure-pipelines/build.yml index 2384952..dbf81b7 100644 --- a/azure-pipelines/build.yml +++ b/azure-pipelines/build.yml @@ -28,7 +28,7 @@ jobs: - job: Linux pool: - vmImage: Ubuntu 22.04 + vmImage: Ubuntu-22.04 steps: - checkout: self fetchDepth: 0 # avoid shallow clone so nbgv can do its work. From adc4a246070c3c6b9e92b3200050d8f2274a43b7 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Fri, 4 Oct 2024 05:46:54 -0600 Subject: [PATCH 07/17] Update build agent to macos-14 Also pin the Windows agent version. --- .github/workflows/build.yml | 4 ++-- azure-pipelines/build.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 015f421..6866289 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,8 +22,8 @@ jobs: matrix: os: - ubuntu-22.04 - - macos-latest - - windows-latest + - macos-14 + - windows-2022 steps: - uses: actions/checkout@v4 diff --git a/azure-pipelines/build.yml b/azure-pipelines/build.yml index dbf81b7..1082582 100644 --- a/azure-pipelines/build.yml +++ b/azure-pipelines/build.yml @@ -44,7 +44,7 @@ jobs: - job: macOS condition: ${{ parameters.includeMacOS }} pool: - vmImage: macOS-12 + vmImage: macOS-14 steps: - checkout: self fetchDepth: 0 # avoid shallow clone so nbgv can do its work. From 7a2cd46779bdd6d0a187e57b53367c8ceacf3969 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Wed, 9 Oct 2024 16:13:12 -0600 Subject: [PATCH 08/17] Notice errors from invocation of `git rev-parse HEAD` --- tools/MergeFrom-Template.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/MergeFrom-Template.ps1 b/tools/MergeFrom-Template.ps1 index c0d13dd..3f721c6 100644 --- a/tools/MergeFrom-Template.ps1 +++ b/tools/MergeFrom-Template.ps1 @@ -43,7 +43,7 @@ if ($LASTEXITCODE -ne 0) { $LibTemplateUrl = 'https://github.com/aarnott/Library.Template' Spawn-Tool 'git' ('fetch', $LibTemplateUrl, $remoteBranch) -$SourceCommit = git rev-parse FETCH_HEAD +$SourceCommit = Spawn-Tool 'git' ('rev-parse', 'FETCH_HEAD') $BaseBranch = Spawn-Tool 'git' ('branch', '--show-current') $SourceCommitUrl = "$LibTemplateUrl/commit/$SourceCommit" From 1c499648adc04c2df252914cb5dbe46cc7fc8367 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Fri, 11 Oct 2024 06:46:16 -0600 Subject: [PATCH 09/17] Ignore Rider cache files --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 3f1c5ed..cc2b124 100644 --- a/.gitignore +++ b/.gitignore @@ -37,6 +37,9 @@ bld/ # Uncomment if you have tasks that create the project's static files in wwwroot #wwwroot/ +# Jetbrains Rider cache directory +.idea/ + # Visual Studio 2017 auto generated files Generated\ Files/ From 214a2aad552fa1e64c7aadbe9763650a1bcd55e0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Oct 2024 17:54:43 -0600 Subject: [PATCH 10/17] Bump dotnet-coverage from 17.12.5 to 17.12.6 (#297) Bumps [dotnet-coverage](https://github.com/microsoft/codecoverage) from 17.12.5 to 17.12.6. - [Commits](https://github.com/microsoft/codecoverage/commits) --- updated-dependencies: - dependency-name: dotnet-coverage 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> --- .config/dotnet-tools.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index b57f73a..b668e6d 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -9,7 +9,7 @@ ] }, "dotnet-coverage": { - "version": "17.12.5", + "version": "17.12.6", "commands": [ "dotnet-coverage" ] From 698b73d825ae56dceb8fdbb56ce0579d505db7b3 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Fri, 18 Oct 2024 16:13:54 -0600 Subject: [PATCH 11/17] Do NOT fail a pipeline build due to nuget vulnerabilities They should remain as warnings. --- .github/workflows/build.yml | 2 +- azure-pipelines/dotnet.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6866289..00b3dd3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,7 +43,7 @@ jobs: run: azure-pipelines/variables/_pipelines.ps1 shell: pwsh - name: ๐Ÿ›  build - run: dotnet build -t:build,pack --no-restore -c ${{ env.BUILDCONFIGURATION }} -warnaserror /bl:"${{ runner.temp }}/_artifacts/build_logs/build.binlog" + run: dotnet build -t:build,pack --no-restore -c ${{ env.BUILDCONFIGURATION }} -warnAsError -warnNotAsError:NU1901,NU1902,NU1903,NU1904 /bl:"${{ runner.temp }}/_artifacts/build_logs/build.binlog" - name: ๐Ÿงช test run: azure-pipelines/dotnet-test-cloud.ps1 -Configuration ${{ env.BUILDCONFIGURATION }} -Agent ${{ runner.os }} shell: pwsh diff --git a/azure-pipelines/dotnet.yml b/azure-pipelines/dotnet.yml index 5124154..b422cfc 100644 --- a/azure-pipelines/dotnet.yml +++ b/azure-pipelines/dotnet.yml @@ -3,7 +3,7 @@ parameters: steps: -- script: dotnet build -t:build,pack --no-restore -c $(BuildConfiguration) -warnaserror /bl:"$(Build.ArtifactStagingDirectory)/build_logs/build.binlog" +- script: dotnet build -t:build,pack --no-restore -c $(BuildConfiguration) -warnAsError -warnNotAsError:NU1901,NU1902,NU1903,NU1904 /bl:"$(Build.ArtifactStagingDirectory)/build_logs/build.binlog" displayName: ๐Ÿ›  dotnet build - powershell: azure-pipelines/dotnet-test-cloud.ps1 -Configuration $(BuildConfiguration) -Agent $(Agent.JobName) -PublishResults From 93a31bb6e94358ae6ca110e5a892b6470db018a1 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Fri, 18 Oct 2024 16:46:58 -0600 Subject: [PATCH 12/17] Avoid running tests on mono for test project The mono runtime is obsolete for most applications. --- test/Library.Tests/Library.Tests.csproj | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/Library.Tests/Library.Tests.csproj b/test/Library.Tests/Library.Tests.csproj index 3a6cc04..134f066 100644 --- a/test/Library.Tests/Library.Tests.csproj +++ b/test/Library.Tests/Library.Tests.csproj @@ -1,7 +1,8 @@ - net6.0;net472 + net6.0 + $(TargetFrameworks);net472 From dee802a953c0df2d794d826aa9388f48fe673fe3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Oct 2024 09:13:43 -0600 Subject: [PATCH 13/17] Bump nbgv from 3.6.143 to 3.6.146 (#300) Bumps [nbgv](https://github.com/dotnet/Nerdbank.GitVersioning) from 3.6.143 to 3.6.146. - [Release notes](https://github.com/dotnet/Nerdbank.GitVersioning/releases) - [Commits](https://github.com/dotnet/Nerdbank.GitVersioning/commits) --- updated-dependencies: - dependency-name: nbgv 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> --- .config/dotnet-tools.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index b668e6d..2ccf4be 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "nbgv": { - "version": "3.6.143", + "version": "3.6.146", "commands": [ "nbgv" ] From 026011d97c44d91b5ecf7f57bdd4bd5e86cb3a3e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Oct 2024 09:13:53 -0600 Subject: [PATCH 14/17] Bump Nerdbank.GitVersioning from 3.6.143 to 3.6.146 (#299) Bumps [Nerdbank.GitVersioning](https://github.com/dotnet/Nerdbank.GitVersioning) from 3.6.143 to 3.6.146. - [Release notes](https://github.com/dotnet/Nerdbank.GitVersioning/releases) - [Commits](https://github.com/dotnet/Nerdbank.GitVersioning/commits) --- updated-dependencies: - dependency-name: Nerdbank.GitVersioning 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> --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index adb03b1..4baf6ec 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -13,7 +13,7 @@ - + From 5dc5cdf385e281221900be34e157eef94797709e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 29 Oct 2024 14:20:49 +0000 Subject: [PATCH 15/17] Bump powershell from 7.4.5 to 7.4.6 (#301) --- .config/dotnet-tools.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 2ccf4be..e60546c 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "powershell": { - "version": "7.4.5", + "version": "7.4.6", "commands": [ "pwsh" ] From a5f5da9a399ae83329385ac9de3068d81713b78b Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Tue, 29 Oct 2024 10:51:08 -0600 Subject: [PATCH 16/17] Touch-up optprof pipelines --- azure-pipelines/OptProf_part2.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/azure-pipelines/OptProf_part2.yml b/azure-pipelines/OptProf_part2.yml index 60ac39b..c59d699 100644 --- a/azure-pipelines/OptProf_part2.yml +++ b/azure-pipelines/OptProf_part2.yml @@ -14,6 +14,8 @@ resources: - pipeline: DartLab.OptProf source: DartLab.OptProf branch: main + tags: + - production repositories: - repository: DartLabTemplates type: git @@ -22,7 +24,7 @@ resources: - repository: DartLabOptProfTemplates type: git name: DartLab.OptProf - ref: refs/heads/main + ref: refs/tags/Production parameters: From 975d9f18afbd791f166d2a6a4a69d8c845bd039e Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Tue, 29 Oct 2024 20:10:18 -0600 Subject: [PATCH 17/17] Add github workflow to keep current with Library.Template --- .github/workflows/libtemplate-update.yml | 72 ++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 .github/workflows/libtemplate-update.yml diff --git a/.github/workflows/libtemplate-update.yml b/.github/workflows/libtemplate-update.yml new file mode 100644 index 0000000..564d4af --- /dev/null +++ b/.github/workflows/libtemplate-update.yml @@ -0,0 +1,72 @@ +name: Library.Template update + +# PREREQUISITE: This workflow requires the repo to be configured to allow workflows to push commits and create pull requests. +# Visit https://github.com/USER/REPO/settings/actions +# Under "Workflow permissions", select "Read and write permissions" and check "Allow GitHub Actions to create ...pull requests" +# Click Save. + +on: + schedule: + - cron: "0 3 * * Mon" # Sun @ 8 or 9 PM Mountain Time (depending on DST) + workflow_dispatch: + +jobs: + merge: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # avoid shallow clone so nbgv can do its work. + + - name: merge + shell: pwsh + run: | + $LibTemplateBranch = & ./azure-pipelines/Get-LibTemplateBasis.ps1 -ErrorIfNotRelated + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + + git fetch https://github.com/aarnott/Library.Template $LibTemplateBranch + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + $LibTemplateCommit = git rev-parse FETCH_HEAD + + if ((git rev-list FETCH_HEAD ^HEAD --count) -eq 0) { + Write-Host "There are no Library.Template updates to merge." + exit 0 + } + + git -c http.extraheader="AUTHORIZATION: bearer $env:GH_TOKEN" push origin -u FETCH_HEAD:refs/heads/auto/libtemplateUpdate + - name: pull request + shell: pwsh + run: | + # If there is already an active pull request, don't create a new one. + $existingPR = gh pr list -H auto/libtemplateUpdate --json url | ConvertFrom-Json + if ($existingPR) { + Write-Host "::warning::Skipping pull request creation because one already exists at $($existingPR[0].url)" + exit 0 + } + + $prTitle = "Merge latest Library.Template" + $prBody = "This merges the latest features and fixes from [Library.Template's branch](https://github.com/AArnott/Library.Template/tree/). + +
+ Merge conflicts? + Resolve merge conflicts locally by carrying out these steps: + + ``` + git fetch + git checkout auto/libtemplateUpdate + git merge origin/main + # resolve conflicts + git commit + git push + ``` +
+ + โš ๏ธ Do **not** squash this pull request when completing it. You must *merge* it." + + gh pr create -H auto/libtemplateUpdate -b $prBody -t $prTitle + env: + GH_TOKEN: ${{ github.token }}