Skip to content

Enhance NuGet package push scripts to track failed packages by logging them to a file#25261

Merged
voloagent merged 2 commits into
rel-10.2from
skoc/nuget-push
Apr 14, 2026
Merged

Enhance NuGet package push scripts to track failed packages by logging them to a file#25261
voloagent merged 2 commits into
rel-10.2from
skoc/nuget-push

Conversation

@skoc10

@skoc10 skoc10 commented Apr 14, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@skoc10 skoc10 added this to the 10.2-patch milestone Apr 14, 2026
@skoc10 skoc10 requested review from Copilot and voloagent April 14, 2026 13:00
@skoc10 skoc10 added the devops label Apr 14, 2026
@voloagent voloagent merged commit 9b72dd5 into rel-10.2 Apr 14, 2026
6 checks passed
@voloagent voloagent deleted the skoc/nuget-push branch April 14, 2026 13:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR enhances the NuGet package push scripts under nupkg/ to persist the list of failed package pushes into a failed-packages.txt file, making it easier to identify which packages need re-publishing.

Changes:

  • Add failed-packages.txt output for failed package pushes in the main NuGet push script.
  • Add failed-packages.txt output for failed package pushes in the nightly MyGet push script.
  • Ensure any previous failed-packages.txt is removed at script start to avoid stale results.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
nupkg/push_packages.ps1 Writes failed package names to failed-packages.txt when the script exits with errors.
nupkg/push-nightly-packages-myget.ps1 Writes failed nightly package names to failed-packages.txt when pushes fail.

Comment thread nupkg/push_packages.ps1
Comment on lines 78 to +81
if ($errorCount > 0)
{
Write-Host ("******* $errorCount error(s) occured *******") -ForegroundColor red
$failedPackages | Set-Content -Path $failedPackagesFilePath

Copilot AI Apr 14, 2026

Copy link

Choose a reason for hiding this comment

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

$errorCount is incremented for missing packages ("ERROR PACKAGE NOT FOUND"), but those package names are never added to $failedPackages. As a result, failed-packages.txt can be empty even when the script fails. Consider adding $nugetPackageName (or a clearer identifier) to $failedPackages in the not-found branch so the file reliably captures all failures.

Copilot uses AI. Check for mistakes.
Comment thread nupkg/push_packages.ps1
if ($errorCount > 0)
{
Write-Host ("******* $errorCount error(s) occured *******") -ForegroundColor red
$failedPackages | Set-Content -Path $failedPackagesFilePath

Copilot AI Apr 14, 2026

Copy link

Choose a reason for hiding this comment

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

Set-Content uses different default encodings between Windows PowerShell (UTF-16LE) and PowerShell 7+ (UTF-8), which can make failed-packages.txt harder to consume in CI tools. Consider specifying an explicit encoding (e.g., UTF-8) when writing the file for consistent output across environments.

Suggested change
$failedPackages | Set-Content -Path $failedPackagesFilePath
$failedPackages | Set-Content -Path $failedPackagesFilePath -Encoding utf8

Copilot uses AI. Check for mistakes.
{
$errorCount = $failedPackages.Count
Write-Host ("******* $errorCount error(s) occured *******") -ForegroundColor red
$failedPackages | Set-Content -Path $failedPackagesFilePath

Copilot AI Apr 14, 2026

Copy link

Choose a reason for hiding this comment

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

Set-Content uses different default encodings between Windows PowerShell (UTF-16LE) and PowerShell 7+ (UTF-8), which can make failed-packages.txt harder to consume in CI tools. Consider specifying an explicit encoding (e.g., UTF-8) when writing the file for consistent output across environments.

Suggested change
$failedPackages | Set-Content -Path $failedPackagesFilePath
$failedPackages | Set-Content -Path $failedPackagesFilePath -Encoding utf8

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.

3 participants