Skip to content

Fix null comparison semantics, restore API backward compat, fix PackageIconUrl#39

Closed
Copilot wants to merge 2 commits into
emgarten/fixes-0306from
copilot/sub-pr-38
Closed

Fix null comparison semantics, restore API backward compat, fix PackageIconUrl#39
Copilot wants to merge 2 commits into
emgarten/fixes-0306from
copilot/sub-pr-38

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 7, 2026

Addresses three issues flagged in review of the net10.0 support PR.

Changes

  • CompareTo null ordering (PackageEntry.cs, CatalogPageEntry.cs): Both methods returned -1 for a null other, meaning "this < null" — backwards from the conventional "null sorts before non-null." Changed to return 1. The relational operators derived from CompareTo now behave correctly:

    null < nonNull  → true   ✓
    nonNull < null  → false  ✓
    nonNull > null  → true   ✓
    
  • API backward compatibility (ProcessEntriesUtility.cs): Moving CancellationToken to last position (CA1068) broke existing callers using the original (token, entries) order. New CA1068-compliant signatures are the primary API; original-order overloads are preserved as [Obsolete] with #pragma warning disable CA1068:

    // Primary (new)
    public static Task<IReadOnlyList<FileInfo>> DownloadNuspecsAsync(..., IEnumerable<CatalogEntry> entries, CancellationToken token)
    
    // Backward compat
    [Obsolete("Use the overload with CancellationToken as the last parameter.")]
    public static Task<IReadOnlyList<FileInfo>> DownloadNuspecsAsync(..., CancellationToken token, IEnumerable<CatalogEntry> entries)
  • PackageIconUrl formatting (build/config.props): URL was split across lines with leading whitespace, which MSBuild preserves verbatim, producing a malformed URL in NuGet metadata. Collapsed to a single line.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…PI backward compatibility, fix PackageIconUrl

Co-authored-by: emgarten <[email protected]>
Copilot AI changed the title [WIP] Add support for net10.0 in project Fix null comparison semantics, restore API backward compat, fix PackageIconUrl Mar 7, 2026
@emgarten emgarten marked this pull request as ready for review March 7, 2026 20:35
@emgarten emgarten closed this Mar 7, 2026
@emgarten emgarten deleted the copilot/sub-pr-38 branch March 7, 2026 20:37
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