Skip to content

S⚠️ ◾ Automated Package Update#820

Closed
neilr81 wants to merge 40 commits into
mainfrom
automation/package-update-21805900574
Closed

S⚠️ ◾ Automated Package Update#820
neilr81 wants to merge 40 commits into
mainfrom
automation/package-update-21805900574

Conversation

@neilr81
Copy link
Copy Markdown
Contributor

@neilr81 neilr81 commented Feb 8, 2026

This PR was created automatically by the workflow run 21805900574.

neilr81 and others added 30 commits February 7, 2026 14:08
This script updates NuGet package versions in the Directory.Packages.props file by querying the latest available versions and updating the Version attributes accordingly, while respecting the PreserveMajor attribute and pre-release version detection.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Changed the trigger for package updates to a scheduled cron job.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Initial plan

* Gate PR creation on changes detection flag

Co-authored-by: neilr81 <49037171+neilr81@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: neilr81 <49037171+neilr81@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Removed GitHub CLI installation step from workflow.
Removed the 'powershell' label from the automated package update PR.
Copilot AI review requested due to automatic review settings February 8, 2026 21:44
@neilr81 neilr81 requested a review from a team as a code owner February 8, 2026 21:44
@neilr81 neilr81 added the automation Item has been created automatically. label Feb 8, 2026
@neilr81 neilr81 self-assigned this Feb 8, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 8, 2026

PR Metrics

Thanks for keeping your pull request small.
⚠️ Consider adding additional tests.

Lines
Product Code 350
Test Code -
Subtotal 350
Ignored Code 68
Total 418

Metrics computed by PR Metrics. Add it to your Azure DevOps and GitHub PRs!

@github-actions github-actions Bot changed the title Automated Package Update S⚠️ ◾ Automated Package Update Feb 8, 2026
@neilr81 neilr81 closed this Feb 8, 2026
@neilr81 neilr81 deleted the automation/package-update-21805900574 branch February 8, 2026 21:47
Copy link
Copy Markdown
Contributor

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

Automates NuGet package version updates by adding a scheduled GitHub Actions workflow and a PowerShell updater script, and applies an initial MSTest package bump via central package management.

Changes:

  • Update MSTest package versions in Directory.Packages.props (and reformat PackageVersion entries).
  • Add .github/scripts/Update-NuGetPackageVersions.ps1 to update Directory.Packages.props by querying latest package versions.
  • Add .github/workflows/package-update.yml to run the script on a schedule and open a PR automatically.

Reviewed changes

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

File Description
Directory.Packages.props Bumps MSTest versions and normalizes XML formatting for PackageVersion entries.
.github/workflows/package-update.yml Adds scheduled automation to run the updater script and create a PR.
.github/scripts/Update-NuGetPackageVersions.ps1 Implements package version discovery and updates for Directory.Packages.props.

echo "has-changes=true" >> $env:GITHUB_OUTPUT

- name: Open PR with gh
if: steps.commit.outputs.has-changes == 'true'
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

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

has-changes output key contains a hyphen, but the if: expression uses dot-notation (steps.commit.outputs.has-changes). In GitHub Actions expressions, keys with - should be accessed via bracket notation (e.g., steps.commit.outputs['has-changes']) or renamed to an identifier-safe key (e.g., has_changes), otherwise the condition may not evaluate as intended.

Suggested change
if: steps.commit.outputs.has-changes == 'true'
if: steps.commit.outputs['has-changes'] == 'true'

Copilot uses AI. Check for mistakes.
Comment on lines +147 to +165
# Prefer NuGet-GitHub.Config (used on GitHub runners) when present, otherwise fall back to NuGet.config
$nugetGithubConfigPath = Join-Path $SourcesDirectory "NuGet-GitHub.Config"
$nugetConfigPath = Join-Path $SourcesDirectory "NuGet.config"
$configSourceFlag = ""
if (Test-Path $nugetGithubConfigPath) {
$configSourceFlag = "--configfile `"$nugetGithubConfigPath`""
if ($EnableVerboseLogging) {
Write-Host " [VERBOSE] Using NuGet-GitHub.Config from: $nugetGithubConfigPath"
}
}
elseif (Test-Path $nugetConfigPath) {
$configSourceFlag = "--configfile `"$nugetConfigPath`""
if ($EnableVerboseLogging) {
Write-Host " [VERBOSE] Using NuGet.config from: $nugetConfigPath"
}
}
else {
Write-Warning "NuGet-GitHub.Config or NuGet.config not found at: $SourcesDirectory - search may not find required feeds"
}
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

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

The repo contains NuGet.Config (capital C), but the script falls back to NuGet.config. On case-sensitive filesystems this will fail to locate the config and may search the wrong feeds. Use the correct filename casing (NuGet.Config) in both the path and log messages.

Copilot uses AI. Check for mistakes.
Comment on lines +121 to +129
if ($firstVersionObject.Version -eq $secondVersionObject.Version) {
if (-not $firstVersionObject.Suffix) { return $First }
if (-not $secondVersionObject.Suffix) { return $Second }
if ($firstVersionObject.Suffix -lt $secondVersionObject.Suffix) { return $Second }
return $First
}

if ($firstVersionObject.Version -lt $secondVersionObject.Version) { return $Second }
return $First
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

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

Pre-release comparison uses a plain string compare on the suffix ($firstVersionObject.Suffix -lt $secondVersionObject.Suffix). This can select the wrong “latest” version for common SemVer patterns (e.g., -preview.10 vs -preview.9). Use a SemVer-aware comparison for prerelease identifiers (or a NuGet version parser) so updates don’t regress to an older prerelease.

Copilot uses AI. Check for mistakes.
Comment on lines +3 to +8
on:
schedule:
- cron: "0 6 * * 1"
pull_request:
branches: [ "main" ]

Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

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

The workflow is configured to run on pull_request events, but this job creates and pushes a new branch and opens a PR. That can create unexpected PRs/branches for every incoming PR, and will also fail for forked PRs where secrets (and often write permissions) aren’t available. Consider removing the pull_request trigger and using only schedule/workflow_dispatch (or gate the PR-creation steps to run only on scheduled/manual runs).

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

automation Item has been created automatically.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants