diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index f88bae603..2ddce27dc 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "powershell": { - "version": "7.6.2", + "version": "7.6.3", "commands": [ "pwsh" ], @@ -17,7 +17,7 @@ "rollForward": false }, "nbgv": { - "version": "3.9.50", + "version": "3.10.85", "commands": [ "nbgv" ], diff --git a/.github/skills/bundle-dependency-prs/SKILL.md b/.github/skills/bundle-dependency-prs/SKILL.md index a147e81e0..48dedbe9b 100644 --- a/.github/skills/bundle-dependency-prs/SKILL.md +++ b/.github/skills/bundle-dependency-prs/SKILL.md @@ -27,6 +27,7 @@ Before aggregating PRs, first try to fix any individual dependency update PRs wi 1. For the dependency PRs with failing build or test PR checks, check out their source branch and fix any issues. 2. Push your fixes as fresh commits to the individual dependency PRs. + If pushing to a repo in the `microsoft` org when the PR is authord by `renovate`, follow-up the push with a PR comment that says exactly this: "/azp run" which triggers PR checks to re-run. 3. If you can't fix a particular PR, add a comment to the PR describing your attempt and outcome. ## Group dependency PRs that are ready to go diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index d933871a5..c0436e855 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -26,7 +26,7 @@ jobs: # You can define any steps you want, and they will run before the agent starts. # If you do not check out your code, Copilot will do this for you. steps: - - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: fetch-depth: 0 # avoid shallow clone so nbgv can do its work. - name: ⚙ Install prerequisites diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 99b3c0583..9729dc34b 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -24,7 +24,7 @@ jobs: url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest steps: - - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: fetch-depth: 0 # avoid shallow clone so nbgv can do its work. - name: ⚙ Install prerequisites diff --git a/.github/workflows/docs_validate.yml b/.github/workflows/docs_validate.yml index 73b0da3bc..7676cce1a 100644 --- a/.github/workflows/docs_validate.yml +++ b/.github/workflows/docs_validate.yml @@ -5,21 +5,21 @@ on: workflow_dispatch: push: branches: - - main - - microbuild + - main + - microbuild jobs: build: name: 📚 Doc validation runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: fetch-depth: 0 # avoid shallow clone so nbgv can do its work. - name: 🔗 Markup Link Checker (mlc) uses: becheran/mlc@7ec24825cefe0c9c8c6bac48430e1f69e3ec356e # v1.2.0 with: - args: --do-not-warn-for-redirect-to https://learn.microsoft.com*,https://dotnet.microsoft.com/*,https://dev.azure.com/*,https://app.codecov.io/*,https://badges.gitter.im/*,https://github.com/*,https://app.gitter.im/* -p docfx -i https://aka.ms/onboardsupport,https://aka.ms/spot,https://msrc.microsoft.com/*,https://www.microsoft.com/msrc*,https://microsoft.com/msrc*,https://www.npmjs.com/package/*,https://get.dot.net/,https://microsoft.sharepoint.com/* + args: --do-not-warn-for-redirect-to https://learn.microsoft.com*,https://dotnet.microsoft.com/*,https://dev.azure.com/*,https://app.codecov.io/* -p docfx -i https://aka.ms/onboardsupport,https://aka.ms/spot,https://msrc.microsoft.com/*,https://www.microsoft.com/msrc*,https://microsoft.com/msrc*,https://www.npmjs.com/package/*,https://get.dot.net/ - name: ⚙ Install prerequisites run: | ./init.ps1 -UpgradePrerequisites diff --git a/.github/workflows/libtemplate-update.yml b/.github/workflows/libtemplate-update.yml index fc8a631f6..dfd3f578b 100644 --- a/.github/workflows/libtemplate-update.yml +++ b/.github/workflows/libtemplate-update.yml @@ -17,7 +17,7 @@ jobs: contents: write pull-requests: write steps: - - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: fetch-depth: 0 # avoid shallow clone so nbgv can do its work. diff --git a/Directory.Packages.props b/Directory.Packages.props index cf75ac677..8bdb08c77 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -4,7 +4,7 @@ true true - 2.2.3 + 2.3.0 2.0.226 3.11.0 1.1.4 @@ -41,9 +41,10 @@ - + + @@ -56,7 +57,7 @@ - + diff --git a/azure-pipelines/archive-sourcecode.yml b/azure-pipelines/archive-sourcecode.yml index 211881fa7..cb8d68e9c 100644 --- a/azure-pipelines/archive-sourcecode.yml +++ b/azure-pipelines/archive-sourcecode.yml @@ -35,6 +35,8 @@ variables: extends: template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate parameters: + settings: + networkIsolationPolicy: Permissive,CFSClean2 sdl: sourceAnalysisPool: VSEng-MicroBuildVSStable @@ -45,7 +47,7 @@ extends: pool: name: AzurePipelines-EO demands: - - ImageOverride -equals 1ESPT-Ubuntu22.04 + - ImageOverride -equals 1ESPT-Ubuntu24.04 os: Linux steps: diff --git a/azure-pipelines/libtemplate-update.yml b/azure-pipelines/libtemplate-update.yml index 384be7cfc..acbfbacef 100644 --- a/azure-pipelines/libtemplate-update.yml +++ b/azure-pipelines/libtemplate-update.yml @@ -30,6 +30,8 @@ variables: extends: template: azure-pipelines/MicroBuild.1ES.Unofficial.yml@MicroBuildTemplate parameters: + settings: + networkIsolationPolicy: Permissive,CFSClean2 sdl: sourceAnalysisPool: name: AzurePipelines-EO @@ -45,7 +47,7 @@ extends: pool: name: AzurePipelines-EO demands: - - ImageOverride -equals 1ESPT-Ubuntu22.04 + - ImageOverride -equals 1ESPT-Ubuntu24.04 os: Linux steps: - checkout: self diff --git a/azure-pipelines/official.yml b/azure-pipelines/official.yml index 56f395e2b..a63588e31 100644 --- a/azure-pipelines/official.yml +++ b/azure-pipelines/official.yml @@ -45,6 +45,8 @@ variables: extends: template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate parameters: + settings: + networkIsolationPolicy: Permissive,CFSClean2 sdl: sourceAnalysisPool: VSEng-MicroBuildVSStable codeSignValidation: @@ -74,7 +76,7 @@ extends: linuxPool: name: AzurePipelines-EO demands: - - ImageOverride -equals 1ESPT-Ubuntu22.04 + - ImageOverride -equals 1ESPT-Ubuntu24.04 os: Linux macOSPool: name: Azure Pipelines diff --git a/azure-pipelines/prepare-insertion-stages.yml b/azure-pipelines/prepare-insertion-stages.yml index 3744cabce..42a1ef6df 100644 --- a/azure-pipelines/prepare-insertion-stages.yml +++ b/azure-pipelines/prepare-insertion-stages.yml @@ -51,7 +51,7 @@ stages: pool: name: AzurePipelines-EO demands: - - ImageOverride -equals 1ESPT-Ubuntu22.04 + - ImageOverride -equals 1ESPT-Ubuntu24.04 os: Linux templateContext: outputs: diff --git a/azure-pipelines/release.yml b/azure-pipelines/release.yml index 83c768723..845d080ca 100644 --- a/azure-pipelines/release.yml +++ b/azure-pipelines/release.yml @@ -20,6 +20,8 @@ variables: extends: template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate parameters: + settings: + networkIsolationPolicy: Permissive,CFSClean2 sdl: sourceAnalysisPool: VSEng-MicroBuildVSStable @@ -31,7 +33,7 @@ extends: pool: name: AzurePipelines-EO demands: - - ImageOverride -equals 1ESPT-Ubuntu22.04 + - ImageOverride -equals 1ESPT-Ubuntu24.04 os: Linux templateContext: outputs: @@ -54,7 +56,7 @@ extends: pool: name: AzurePipelines-EO demands: - - ImageOverride -equals 1ESPT-Ubuntu22.04 + - ImageOverride -equals 1ESPT-Ubuntu24.04 os: Linux templateContext: type: releaseJob diff --git a/azure-pipelines/unofficial.yml b/azure-pipelines/unofficial.yml index 11b751f0e..7a968fd15 100644 --- a/azure-pipelines/unofficial.yml +++ b/azure-pipelines/unofficial.yml @@ -56,6 +56,8 @@ variables: extends: template: azure-pipelines/MicroBuild.1ES.Unofficial.yml@MicroBuildTemplate parameters: + settings: + networkIsolationPolicy: Permissive,CFSClean2 sdl: sourceAnalysisPool: VSEng-MicroBuildVSStable credscan: @@ -88,7 +90,7 @@ extends: linuxPool: name: AzurePipelines-EO demands: - - ImageOverride -equals 1ESPT-Ubuntu22.04 + - ImageOverride -equals 1ESPT-Ubuntu24.04 os: Linux macOSPool: name: Azure Pipelines diff --git a/azure-pipelines/vs-insertion.yml b/azure-pipelines/vs-insertion.yml index 3a8402c01..7c593c64c 100644 --- a/azure-pipelines/vs-insertion.yml +++ b/azure-pipelines/vs-insertion.yml @@ -22,6 +22,8 @@ variables: extends: template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate parameters: + settings: + networkIsolationPolicy: Permissive,CFSClean2 sdl: sourceAnalysisPool: VSEng-MicroBuildVSStable sbom: @@ -30,8 +32,8 @@ extends: stages: - stage: insertion jobs: - - job: insertion - displayName: VS insertion + - job: upload + displayName: Upload VS payload pool: VSEng-MicroBuildVSStable templateContext: outputParentDirectory: $(Pipeline.Workspace)/CI @@ -57,6 +59,16 @@ extends: packageParentPath: $(Pipeline.Workspace)/CI/VSInsertion-Windows allowPackageConflicts: true publishVstsFeed: VS + + - job: insert + dependsOn: upload + displayName: VS insertion + pool: VSEngSS-MicroBuild2022-1ES + templateContext: + outputParentDirectory: $(Pipeline.Workspace)/CI + steps: + - checkout: none + - template: azure-pipelines/release-deployment-prep.yml@self - task: MicroBuildInsertVsPayload@5 displayName: 🏭 Insert VS Payload inputs: diff --git a/azure-pipelines/vs-validation.yml b/azure-pipelines/vs-validation.yml index 6a2b246a8..f8c51c75d 100644 --- a/azure-pipelines/vs-validation.yml +++ b/azure-pipelines/vs-validation.yml @@ -26,6 +26,8 @@ variables: extends: template: azure-pipelines/MicroBuild.1ES.Unofficial.yml@MicroBuildTemplate parameters: + settings: + networkIsolationPolicy: Permissive,CFSClean2 sdl: sourceAnalysisPool: VSEng-MicroBuildVSStable credscan: @@ -48,7 +50,7 @@ extends: linuxPool: name: AzurePipelines-EO demands: - - ImageOverride -equals 1ESPT-Ubuntu22.04 + - ImageOverride -equals 1ESPT-Ubuntu24.04 os: Linux macOSPool: name: Azure Pipelines @@ -66,8 +68,8 @@ extends: - stage: insertion displayName: VS insertion jobs: - - job: insertion - displayName: VS insertion + - job: upload + displayName: Upload VS payload pool: VSEng-MicroBuildVSStable steps: - checkout: self @@ -95,6 +97,20 @@ extends: packageParentPath: $(Pipeline.Workspace)/VSInsertion-Windows allowPackageConflicts: true publishVstsFeed: VS + + - job: insertion + displayName: VS insertion + dependsOn: upload + pool: VSEngSS-MicroBuild2022-1ES + steps: + - checkout: self + clean: true + fetchDepth: 1 + - download: current + artifact: Variables-Windows + displayName: 🔻 Download Variables-Windows artifact + - powershell: $(Pipeline.Workspace)/Variables-Windows/_define.ps1 + displayName: ⚙️ Set pipeline variables based on artifacts - task: MicroBuildInsertVsPayload@5 displayName: 🏭 Insert VS Payload inputs: diff --git a/tools/GitHubActions.ps1 b/tools/GitHubActions.ps1 new file mode 100644 index 000000000..c742a5888 --- /dev/null +++ b/tools/GitHubActions.ps1 @@ -0,0 +1,18 @@ +function Add-GitHubActionsEnvVariable { + param( + [string]$Path = $env:GITHUB_ENV, + [Parameter(Mandatory = $true)] + [string]$Name, + [Parameter(Mandatory = $true)] + [AllowEmptyString()] + [string]$Value + ) + + if ([string]::IsNullOrWhiteSpace($Name)) { + throw "GitHub Actions environment variable names must not be empty." + } + + $utf8NoBom = [System.Text.UTF8Encoding]::new($false) + $delimiter = [guid]::NewGuid().ToString('N') + [System.IO.File]::AppendAllText($Path, "$Name<<$delimiter`n$Value`n$delimiter`n", $utf8NoBom) +} diff --git a/tools/Set-EnvVars.ps1 b/tools/Set-EnvVars.ps1 index 2bd3ca4db..0816c0e2c 100644 --- a/tools/Set-EnvVars.ps1 +++ b/tools/Set-EnvVars.ps1 @@ -12,13 +12,15 @@ The CmdEnvScriptPath environment variable may be optionally set to a path to a cmd shell script to be created (or appended to if it already exists) that will set the environment variables in cmd.exe that are set within the PowerShell environment. This is used by init.cmd in order to reapply any new environment variables to the parent cmd.exe process that were set in the powershell child process. #> -[CmdletBinding(SupportsShouldProcess=$true)] +[CmdletBinding(SupportsShouldProcess = $true)] Param( - [Parameter(Mandatory=$true, Position=1)] + [Parameter(Mandatory = $true, Position = 1)] $Variables, [string[]]$PrependPath ) +. "$PSScriptRoot\GitHubActions.ps1" + if ($Variables.Count -eq 0) { return $true } @@ -27,7 +29,8 @@ $cmdInstructions = !$env:TF_BUILD -and !$env:GITHUB_ACTIONS -and !$env:CmdEnvScr if ($cmdInstructions) { Write-Warning "Environment variables have been set that will be lost because you're running under cmd.exe" Write-Host "Environment variables that must be set manually:" -ForegroundColor Blue -} else { +} +else { Write-Host "Environment variables set:" -ForegroundColor Blue Write-Host ($Variables | Out-String) if ($PrependPath) { @@ -44,7 +47,7 @@ if ($env:GITHUB_ACTIONS) { } $CmdEnvScript = '' -$Variables.GetEnumerator() |% { +$Variables.GetEnumerator() | % { Set-Item -LiteralPath env:$($_.Key) -Value $_.Value # If we're running in a cloud CI, set these environment variables so they propagate. @@ -52,7 +55,7 @@ $Variables.GetEnumerator() |% { Write-Host "##vso[task.setvariable variable=$($_.Key);]$($_.Value)" } if ($env:GITHUB_ACTIONS) { - Add-Content -LiteralPath $env:GITHUB_ENV -Value "$($_.Key)=$($_.Value)" + Add-GitHubActionsEnvVariable -Name $_.Key -Value ([string]$_.Value) } if ($cmdInstructions) { @@ -68,7 +71,7 @@ if ($IsMacOS -or $IsLinux) { } if ($PrependPath) { - $PrependPath |% { + $PrependPath | % { $newPathValue = "$_$pathDelimiter$env:PATH" Set-Item -LiteralPath env:PATH -Value $newPathValue if ($cmdInstructions) { @@ -79,7 +82,7 @@ if ($PrependPath) { Write-Host "##vso[task.prependpath]$_" } if ($env:GITHUB_ACTIONS) { - Add-Content -LiteralPath $env:GITHUB_PATH -Value $_ + Add-GitHubActionsEnvVariable -Name PATH -Value $newPathValue } $CmdEnvScript += "SET PATH=$_$pathDelimiter%PATH%" diff --git a/tools/variables/_define.ps1 b/tools/variables/_define.ps1 index d40e5cf14..dfa9cba42 100644 --- a/tools/variables/_define.ps1 +++ b/tools/variables/_define.ps1 @@ -11,6 +11,8 @@ param ( ) +. "$PSScriptRoot\..\GitHubActions.ps1" + (& "$PSScriptRoot\_all.ps1").GetEnumerator() |% { # Always use ALL CAPS for env var names since Azure Pipelines converts variable names to all caps and on non-Windows OS, env vars are case sensitive. $keyCaps = $_.Key.ToUpper() @@ -24,7 +26,7 @@ param ( # and the second that works across jobs and stages but must be fully qualified when referenced. Write-Host "##vso[task.setvariable variable=$keyCaps;isOutput=true]$($_.Value)" } elseif ($env:GITHUB_ACTIONS) { - Add-Content -LiteralPath $env:GITHUB_ENV -Value "$keyCaps=$($_.Value)" + Add-GitHubActionsEnvVariable -Name $keyCaps -Value ([string]$_.Value) } Set-Item -LiteralPath "env:$keyCaps" -Value $_.Value }