Skip to content

Revert CFS feed for PSResources#5461

Merged
andyleejordan merged 1 commit intomainfrom
nuget-auth
Apr 8, 2026
Merged

Revert CFS feed for PSResources#5461
andyleejordan merged 1 commit intomainfrom
nuget-auth

Conversation

@andyleejordan
Copy link
Copy Markdown
Member

So annoying.

Copilot AI review requested due to automatic review settings April 8, 2026 22:40
@andyleejordan andyleejordan merged commit 12c8737 into main Apr 8, 2026
8 checks passed
@andyleejordan andyleejordan deleted the nuget-auth branch April 8, 2026 22:40
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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”).

Suggested change
# 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.

Copilot uses AI. Check for mistakes.
[string]$PSRepository = "PSGallery"
)

# Install-PSResource can't use the project-scoped feed because OneBranch doesn't auth it
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
# 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.

Copilot uses AI. Check for mistakes.
[string]$PSRepository = "PSGallery"
)

# Install-PSResource can't use the project-scoped feed because OneBranch doesn't auth it
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
# 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.

Copilot uses AI. Check for mistakes.
# 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"
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants