Skip to content

Conversation

Copy link

Copilot AI commented Nov 27, 2025

The .NET update workflow processed versions in API order, causing misleading display order in README (e.g., .NET 10 appearing before .NET 9).

Changes

  • Sort versions numerically before processing:

    $supportedVersions = $allVersions | Where-Object { $_.'support-phase' -eq 'active' } | Sort-Object { [int]($_.'channel-version' -split '\.')[0] }
  • Fix README insertion order: New entries now insert after the last existing .NET X.0 entry rather than always after .NET Framework 4.8.1, maintaining ascending order when multiple versions are added sequentially

Original prompt

Update the update .net ci pipeline to properly sort the .net versions supported in the readme document. As you can see in #5 the .net 10 release comes first before .net 9 but the version number is actually higher. This is misleading


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Summary by CodeRabbit

  • Chores
    • Enhanced automated .NET documentation updates with improved version sorting by major version number
    • Refined README entry insertion logic with fallback strategy for consistent documentation management

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Nov 27, 2025

Walkthrough

The GitHub Actions workflow for checking .NET updates now sorts active support-phase versions by major version number and implements a priority-based insertion strategy for new .NET entries in README.md, inserting after the latest ".NET X.0.Y" entry if present, otherwise after ".NET Framework 4.8.1".

Changes

Cohort / File(s) Summary
Workflow version management and README insertion
\.github/workflows/check-dotnet-updates\.yml
Added sorting of active support-phase .NET versions by major version number; enhanced README.md insertion logic with priority-based strategy (insert after latest ".NET X.0.Y" entry or fallback to ".NET Framework 4.8.1" anchor); updated insertion formatting and conditional flag handling

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Sorting logic verification: Confirm the major version extraction and sorting order are correct and produce expected results across varying version formats
  • String pattern matching and insertion logic: Validate regex patterns for locating ".NET X.0.Y" entries and Framework 4.8.1 fallback; verify edge cases (empty list, multiple matches, no matches)
  • Flag handling: Ensure the update-occurred flag is correctly set in all code paths

Poem

🐰 Sorting versions by their leading digit,
README entries find their perfect fit,
Fallback anchors guide the way,
When new .NET versions join the fray! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main changes: updating the CI pipeline to sort .NET versions. It aligns with the primary objective of fixing the version ordering issue in the workflow.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch copilot/update-ci-pipeline-net-versions

Comment @coderabbitai help to get the list of available commands and usage tips.

@sensslen
Copy link
Member

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Nov 27, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@sensslen sensslen marked this pull request as ready for review November 27, 2025 12:03
Copilot AI changed the title [WIP] Update .NET CI pipeline to sort supported versions Fix .NET version sorting in CI workflow README updates Nov 27, 2025
Copilot AI requested a review from sensslen November 27, 2025 12:04
Copilot finished work on behalf of sensslen November 27, 2025 12:04
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
.github/workflows/check-dotnet-updates.yml (1)

273-292: Well-designed README insertion strategy with proper fallback logic.

The two-tier insertion strategy correctly maintains ascending version order:

  1. Primary path (lines 275–282): Finds the last .NET X.0.Y entry and inserts after it. Using [regex]::Escape() on line 280 safely handles special characters if a version has been matched previously.
  2. Fallback path (lines 286–291): Inserts after .NET Framework 4.8.1 if no .NET X.0 entries exist yet.
  3. Conditional safety: Line 287 ensures the fallback only executes if the anchor line exists, preventing silent failures on unexpected README structures.

Combined with the sorted processing on line 52, entries will be added in ascending order.

One minor observation: the regex pattern on line 275 does not explicitly anchor to line boundaries or account for leading whitespace. For robustness in edge cases (e.g., if README formatting varies), consider aligning with the pattern on line 266, which uses (\r?\n)\s*\* to capture indentation. The current approach works fine if entries always begin with * without leading special characters, but being more explicit with whitespace boundaries would be more defensive.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between d826b2e and 02cc235.

📒 Files selected for processing (1)
  • .github/workflows/check-dotnet-updates.yml (2 hunks)
🔇 Additional comments (1)
.github/workflows/check-dotnet-updates.yml (1)

52-52: Correct numeric sorting of .NET versions.

The sorting logic properly extracts the major version number and sorts numerically, ensuring .NET 10 appears after .NET 9 (not before, as would happen with lexicographic sorting). This aligns with the PR objective.

@sensslen sensslen merged commit 11dca74 into master Nov 27, 2025
1 check passed
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