Skip to content

Fix outdated command missing packages, improve output formatting#21

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/make-tool-production-ready
Draft

Fix outdated command missing packages, improve output formatting#21
Copilot wants to merge 3 commits intomainfrom
copilot/make-tool-production-ready

Conversation

Copy link
Contributor

Copilot AI commented Feb 28, 2026

The outdated command silently skipped packages due to several bugs in version resolution. Console and markdown table output had inconsistent formatting.

Bug fixes — missing packages

  • Premature prerelease fallback in NuGetMetadataService: A goto retry inside the version iteration loop switched to prerelease mode the moment a single stable version failed the framework check, skipping all older compatible stable versions entirely. Removed the inner goto; the existing post-loop fallback handles this correctly.

  • KeyNotFoundException in version lookup: Direct dictionary indexer on TargetFrameworkVersions threw when the exact NuGetFramework key wasn't present (e.g., framework normalization differences). Replaced with TryGetValue + fallback to highest available version.

  • Min() on empty sequence: When all package version strings were unparseable, currentMin computation crashed. Now guards with an early-out warning.

  • PackageInfoComparer null TargetFrameworks: Equality check short-circuited to false when either side had null TargetFrameworks, causing duplicate container entries and missed updates.

// Before: null on either side → always false → duplicates
(x.TargetFrameworks != null && y.TargetFrameworks != null &&
 x.TargetFrameworks.SequenceEqual(...))

// After: both-null is equal, mixed-null is not
((x.TargetFrameworks == null && y.TargetFrameworks == null) ||
 (x.TargetFrameworks != null && y.TargetFrameworks != null &&
  x.TargetFrameworks.SequenceEqual(...)))

Output improvements

  • Console tables: Consistent header capitalization (Current/Latest/Target/Reason)
  • Markdown tables: Column-aligned with padding, proper pipe spacing

bld outdated output

Cleanup

  • Removed misleading // no support for slnx comment (slnx was supported)
  • Removed unused imports (System.Net.NetworkInformation, System.Linq)
  • Added null-safety check for result.TargetFrameworkVersions

Tests

13 new tests covering PackageInfoComparer null handling, MarkdownTableFormatter alignment/escaping, and NuGetMetadataService stable-version preference. All 115 tests pass.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits February 28, 2026 20:54
…llback, fix version lookup, fix null TFM handling, improve output formatting

Co-authored-by: dlosch <318550+dlosch@users.noreply.github.com>
…test null handling

Co-authored-by: dlosch <318550+dlosch@users.noreply.github.com>
Copilot AI changed the title [WIP] Make tool production ready with improved outputs and performance Fix outdated command missing packages, improve output formatting Feb 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants