Skip to content

S⚠️ ◾ Automated Package Update#823

Closed
neilr81 wants to merge 42 commits into
mainfrom
automation/package-update-21805933224
Closed

S⚠️ ◾ Automated Package Update#823
neilr81 wants to merge 42 commits into
mainfrom
automation/package-update-21805933224

Conversation

@neilr81
Copy link
Copy Markdown
Contributor

@neilr81 neilr81 commented Feb 8, 2026

This PR was created automatically by the workflow run 21805933224.

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:46
@neilr81 neilr81 added the automation Item has been created automatically. label Feb 8, 2026
@neilr81 neilr81 requested a review from a team as a code owner February 8, 2026 21:46
@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-21805933224 branch February 8, 2026 21:48
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

Adds GitHub-based automation to update centrally-managed NuGet package versions and open a PR with the changes.

Changes:

  • Bumps MSTest package versions in Directory.Packages.props (and normalizes XML formatting as a side effect of the updater).
  • Adds a GitHub Actions workflow to run a package-update script and open a PR.
  • Adds a PowerShell script to search for latest NuGet versions and update Directory.Packages.props for ItemGroups labeled AutoUpdate.

Reviewed changes

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

File Description
Directory.Packages.props Updates MSTest versions and applies formatter-normalized XML output from the updater.
.github/workflows/package-update.yml New scheduled workflow intended to run the updater and auto-create a PR.
.github/scripts/Update-NuGetPackageVersions.ps1 New updater script to locate and apply latest package versions in central package management file.

Comment on lines +147 to +150
# 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 = ""
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 script falls back to NuGet.config, but the repo root file is named NuGet.Config (capital C). On case-sensitive file systems this fallback will never be found, which can break package lookups when NuGet-GitHub.Config isn’t present. Update the fallback filename and related log/warning text to use the correct casing.

Copilot uses AI. Check for mistakes.
Comment on lines +173 to +174
Write-Host ("Searching for package: {0} {1}" -f $PackageId, ($MajorVersion ? ('(major version {0}.*)' -f $MajorVersion) : ''))

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.

This uses the PowerShell ternary operator (?:), which requires PowerShell 7+. If this script is intended to be usable in Windows PowerShell 5.1 (common in some Azure Pipelines tasks), it will fail to parse. Either add a #Requires -Version 7.0 (or equivalent) at the top, or rewrite this expression without the ternary operator.

Suggested change
Write-Host ("Searching for package: {0} {1}" -f $PackageId, ($MajorVersion ? ('(major version {0}.*)' -f $MajorVersion) : ''))
$majorVersionMessage = ''
if ($MajorVersion) {
$majorVersionMessage = '(major version {0}.*)' -f $MajorVersion
}
Write-Host ("Searching for package: {0} {1}" -f $PackageId, $majorVersionMessage)

Copilot uses AI. Check for mistakes.
Comment on lines +173 to +176
Write-Host ("Searching for package: {0} {1}" -f $PackageId, ($MajorVersion ? ('(major version {0}.*)' -f $MajorVersion) : ''))

$output = Invoke-Expression $searchCmd 2>&1 | Out-String

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.

Building a command string and running it with Invoke-Expression makes the execution harder to reason about and can become an injection vector if the package id or other inputs ever contain unexpected characters. Prefer invoking dotnet directly with an argument array/call operator and passing --configfile as a normal argument (no string evaluation).

Copilot uses AI. Check for mistakes.
Comment on lines +6 to +8
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.

This workflow both (1) triggers on pull_request to main and (2) creates/pushes a new branch and opens a PR. That combination can cause PR-recursion (the PR it creates will itself trigger the workflow) and also runs write-capable automation in a PR context. Remove the pull_request trigger and prefer schedule + workflow_dispatch (or otherwise add an explicit guard so it never runs on PR events / never runs on branches created by this workflow).

Suggested change
pull_request:
branches: [ "main" ]
workflow_dispatch:

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