Skip to content

redo recursive directory matching with logging#15072

Merged
brettfo merged 2 commits into
mainfrom
dev/brettfo/nuget-global-json-log
May 19, 2026
Merged

redo recursive directory matching with logging#15072
brettfo merged 2 commits into
mainfrom
dev/brettfo/nuget-global-json-log

Conversation

@brettfo
Copy link
Copy Markdown
Contributor

@brettfo brettfo commented May 19, 2026

When a job starts a PowerShell script first scans for relevant global.json files to install the appropriate SDKs, but when this fails it's really difficult to diagnose.

This PR uses a regex-based approach to matching recursive subdirectories and logs absolutely everything it does so failures to find or install SDKs can be debugged.

@github-actions github-actions Bot added the L: dotnet:nuget NuGet packages via nuget or dotnet label May 19, 2026
@brettfo brettfo force-pushed the dev/brettfo/nuget-global-json-log branch 8 times, most recently from 13ddf3d to 8057f2a Compare May 19, 2026 18:25
@brettfo brettfo marked this pull request as ready for review May 19, 2026 18:43
@brettfo brettfo requested a review from a team as a code owner May 19, 2026 18:43
Copilot AI review requested due to automatic review settings May 19, 2026 18:43
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

This PR updates the NuGet updater’s PowerShell SDK discovery path to use regex-based recursive directory matching and add diagnostic logging around global.json discovery and SDK/targeting-pack installation.

Changes:

  • Adds gated PowerShell logging via DEPENDABOT_LOG_MESSAGES.
  • Reworks global.json discovery to enumerate repo directories and match configured update directories with generated regexes.
  • Adds test fixtures and cases for deep and recursive global.json discovery.
Show a summary per file
File Description
nuget/updater/common.ps1 Adds logging and regex-based directory discovery for SDK install decisions.
nuget/updater/main.ps1 Enables diagnostic logging during update execution.
nuget/updater/test.ps1 Adds test coverage for deep and recursive wildcard discovery cases.
nuget/updater/test-data/global-json-discovery-deep/src/client/global.json Fixture for a nested global.json.
nuget/updater/test-data/global-json-discovery-recursive-wildcard-skip-root/global.json Fixture for root-level SDK discovery during recursive matching.
nuget/updater/test-data/global-json-discovery-recursive-wildcard-skip-root/src/global.json Fixture for matched subdirectory SDK discovery.

Copilot's findings

  • Files reviewed: 6/6 changed files
  • Comments generated: 2

Comment thread nuget/updater/common.ps1 Outdated
Comment thread nuget/updater/common.ps1 Outdated
@brettfo brettfo force-pushed the dev/brettfo/nuget-global-json-log branch from dca933b to feb1e20 Compare May 19, 2026 20:03
@brettfo brettfo merged commit 28ffa28 into main May 19, 2026
89 checks passed
@brettfo brettfo deleted the dev/brettfo/nuget-global-json-log branch May 19, 2026 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

L: dotnet:nuget NuGet packages via nuget or dotnet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants