Repository navigation
Enable CFSClean policies and use dotnet-public feed for winget CLI - #15442
Conversation
- Add networkIsolationPolicy: Permissive, CFSClean, CFSClean2 to the 1ES official pipeline template parameters - Switch winget CLI installation from PSGallery to dotnet-public Azure Artifacts feed to comply with CFSClean network restrictions Co-authored-by: Copilot <[email protected]>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15442Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 15442" |
There was a problem hiding this comment.
Pull request overview
Updates the official Azure Pipelines configuration to support CFSClean network isolation policies and adjusts WinGet CLI prep to install the required PowerShell WinGet client module from the dotnet-public Azure Artifacts feed instead of PSGallery, aligning with CFSClean restrictions.
Changes:
- Adds
networkIsolationPolicysettings to the 1ES official pipeline template parameters. - Switches
Microsoft.WinGet.Clientinstallation to use thedotnet-publicfeed by registering it as a PSResource repository.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| eng/pipelines/templates/prepare-winget-manifest.yml | Registers dotnet-public as a PSResource repository and installs Microsoft.WinGet.Client from it before running WinGet manifest generation/validation. |
| eng/pipelines/azure-pipelines.yml | Adds 1ES settings.networkIsolationPolicy to enable CFSClean/CFSClean2 policies alongside Permissive. |
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
| if ($null -eq $existingRepo) { | ||
| Register-PSResourceRepository -Name $repoName -Uri $repoUri -Trusted | ||
| } else { | ||
| Write-Host "PSResource repository '$repoName' is already registered. Skipping registration." |
There was a problem hiding this comment.
The repository registration is idempotent by name, but it doesn't verify the existing repository's Uri. If an agent already has a dotnet-public repo registered with a different URI, this step will silently keep the wrong feed and Install-PSResource may fail or pull from an unexpected source. Consider validating the URI (and updating/re-registering when it differs) rather than unconditionally skipping when the name exists.
| Write-Host "PSResource repository '$repoName' is already registered. Skipping registration." | |
| # Validate that the existing repository points to the expected URI. | |
| if ($existingRepo.Uri -ne $repoUri) { | |
| Write-Host "PSResource repository '$repoName' is registered with URI '$($existingRepo.Uri)', expected '$repoUri'. Updating repository configuration..." | |
| Set-PSResourceRepository -Name $repoName -Uri $repoUri -Trusted | |
| } else { | |
| Write-Host "PSResource repository '$repoName' is already registered with the expected URI. Skipping registration." | |
| } |
| @@ -42,9 +42,19 @@ steps: | |||
| displayName: 🟣Set version ${{ parameters.version }} | |||
|
|
|||
| - pwsh: | | |||
There was a problem hiding this comment.
This pwsh step doesn't set $ErrorActionPreference = 'Stop' (unlike other steps in this template). If Register-PSResourceRepository/Install-PSResource emits non-terminating errors, the script could continue and later steps will fail in harder-to-diagnose ways. Set ErrorActionPreference to Stop for this block (or add explicit error handling) to ensure failures stop the job immediately.
| - pwsh: | | |
| - pwsh: | | |
| $ErrorActionPreference = 'Stop' |
|
/backport to release/13.2 |
|
Started backporting to |
|
No documentation PR is required for this change. PR #15442 modifies only internal CI/build pipeline files (
|
Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change.
Fixes # (issue)
Checklist
<remarks />and<code />elements on your triple slash comments?aspire.devissue: