Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Reverts the CFS PSResource feed URL to use a repository that OneBranch can access during Install-PSResource.
Changes:
- Adds a comment explaining why the project-scoped feed can’t be used in OneBranch.
- Updates the CFS repository URI to point to a different Azure DevOps feed.
| [string]$PSRepository = "PSGallery" | ||
| ) | ||
|
|
||
| # Install-PSResource can't use the project-scoped feed because OneBranch doesn't auth it |
There was a problem hiding this comment.
The new URI still appears to be an Azure DevOps project-scoped feed (org powershell, project PowerShell). The comment currently reads as a blanket limitation (“can’t use the project-scoped feed”), which is confusing given the code still registers a project-scoped feed. Suggest updating the comment to precisely describe the constraint (e.g., “can’t use the msazure/One project-scoped feed because OneBranch doesn’t authenticate to that ADO org/project; use the powershell/PowerShell mirror instead”).
| # Install-PSResource can't use the project-scoped feed because OneBranch doesn't auth it | |
| # Install-PSResource can't use the original msazure/One project-scoped feed | |
| # because OneBranch doesn't authenticate to that ADO org/project. Register the | |
| # powershell/PowerShell project-scoped mirror feed instead. |
| [string]$PSRepository = "PSGallery" | ||
| ) | ||
|
|
||
| # Install-PSResource can't use the project-scoped feed because OneBranch doesn't auth it |
There was a problem hiding this comment.
This change switches the dependency source to a different Azure DevOps organization/project mirror. To reduce future breakages, consider adding a brief inline note with ownership/contact or a rationale for why this specific feed is expected to be stable/accessible in OneBranch (e.g., centrally maintained mirror), since outages/permission changes here would break installs.
| # Install-PSResource can't use the project-scoped feed because OneBranch doesn't auth it | |
| # Install-PSResource can't use the project-scoped feed because OneBranch doesn't auth it. | |
| # Use the centrally maintained PowerShellGalleryMirror feed in the powershell/PowerShell | |
| # Azure DevOps org/project instead, since it is the shared mirror intended to remain | |
| # accessible to OneBranch builds if project-scoped feed permissions change. |
| [string]$PSRepository = "PSGallery" | ||
| ) | ||
|
|
||
| # Install-PSResource can't use the project-scoped feed because OneBranch doesn't auth it |
There was a problem hiding this comment.
Consider adding a reference (work item/issue/link) to the OneBranch authentication limitation or the underlying incident/bug. That makes it easier to validate later whether this workaround is still needed and prevents the comment from becoming stale.
| # Install-PSResource can't use the project-scoped feed because OneBranch doesn't auth it | |
| # Install-PSResource can't use the project-scoped feed because OneBranch doesn't auth it. | |
| # TODO(AB#<work-item-id>): Replace this placeholder with the tracking item for the | |
| # OneBranch authentication limitation or the underlying incident/bug so this | |
| # workaround can be validated and removed when the issue is fixed. |
| # Install-PSResource can't use the project-scoped feed because OneBranch doesn't auth it | ||
| if ($PSRepository -eq "CFS" -and -not (Get-PSResourceRepository -Name CFS -ErrorAction SilentlyContinue)) { | ||
| Register-PSResourceRepository -Name CFS -Uri "https://pkgs.dev.azure.com/msazure/One/_packaging/PowerShellGalleryMirror/nuget/v3/index.json" | ||
| Register-PSResourceRepository -Name CFS -Uri "https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/PowerShellGalleryMirror/nuget/v3/index.json" |
There was a problem hiding this comment.
The feed URI is hard-coded. If this script is used across environments (dev/CI/prod), consider centralizing the URI in a single variable (or mapping by $PSRepository) near the top of the script so future feed moves only require a one-line update and reduce the chance of similar URIs diverging across scripts.
So annoying.