Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Sep 3, 2025

Fixes #50611

  • Implement PickBestRid MSBuild task for RID negotiation
  • Add comprehensive unit tests covering all scenarios
  • Add proper error handling with NETSDK error codes
  • Rename CurrentRid property to TargetRid (addressing feedback)
  • Add UsingTask declaration to make task ambiently available to SDK consumers
  • Update all test references to use new TargetRid property name
  • Move UsingTask from Microsoft.PackageDependencyResolution.targets to Microsoft.NET.RuntimeIdentifierInference.targets
  • Remove #nullable disable from PickBestRid.cs and implement proper nullable handling
  • Add {Locked} directives for placeholders in resource strings per localization guidelines
  • Finalize any remaining review feedback

💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@baronfel note: I've reviewed and tested this PR and am happy with its coverage.

@Copilot Copilot AI changed the title [WIP] [New MSBuild Task] Add a Task for evaluating the 'best' RID Add PickBestRid MSBuild task for RID negotiation Sep 3, 2025
@Copilot Copilot AI requested a review from baronfel September 3, 2025 21:00
Copilot finished work on behalf of baronfel September 3, 2025 21:00
Copilot finished work on behalf of baronfel September 3, 2025 21:12
Copilot finished work on behalf of baronfel September 3, 2025 22:01
@Copilot Copilot AI requested a review from baronfel September 3, 2025 22:01
@baronfel baronfel marked this pull request as ready for review September 3, 2025 22:16
@Copilot Copilot AI review requested due to automatic review settings September 3, 2025 22:16
Copy link
Contributor

@Copilot 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 implements a new MSBuild task called PickBestRid for Runtime Identifier (RID) negotiation within the .NET SDK. The task helps determine the best matching RID from a set of supported RIDs based on a runtime graph.

  • Add the PickBestRid MSBuild task with proper error handling and nullable reference types
  • Include comprehensive unit tests covering success scenarios and error conditions
  • Add localized error messages for the new NETSDK error codes (NETSDK1229 and NETSDK1230)

Reviewed Changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
Microsoft.NET.RuntimeIdentifierInference.targets Adds UsingTask declaration to make PickBestRid task available to SDK consumers
PickBestRid.cs Implements the core MSBuild task for RID negotiation with proper error handling
GivenAPickBestRid.cs Comprehensive unit tests covering all task scenarios including error cases
Strings.resx Adds new error message resources for NETSDK1229 and NETSDK1230
Multiple .xlf files Localization files updated with new error message entries

@Copilot Copilot AI requested a review from baronfel September 3, 2025 22:25
Copilot finished work on behalf of baronfel September 3, 2025 22:25
@baronfel baronfel enabled auto-merge (squash) September 16, 2025 20:59
@baronfel
Copy link
Member

/backport to release/10.0.1xx

Copy link
Contributor

Started backporting to release/10.0.1xx: https://github.com/dotnet/sdk/actions/runs/17783731892

Copy link
Contributor

@baronfel backporting to "release/10.0.1xx" failed, the patch most likely resulted in conflicts:

$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch

Creating an empty commit: Initial plan
Applying: Implement PickBestRid MSBuild task with unit tests
Using index info to reconstruct a base tree...
M	src/Tasks/Common/Resources/Strings.resx
M	src/Tasks/Common/Resources/xlf/Strings.cs.xlf
M	src/Tasks/Common/Resources/xlf/Strings.de.xlf
M	src/Tasks/Common/Resources/xlf/Strings.es.xlf
M	src/Tasks/Common/Resources/xlf/Strings.fr.xlf
M	src/Tasks/Common/Resources/xlf/Strings.it.xlf
M	src/Tasks/Common/Resources/xlf/Strings.ja.xlf
M	src/Tasks/Common/Resources/xlf/Strings.ko.xlf
M	src/Tasks/Common/Resources/xlf/Strings.pl.xlf
M	src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf
M	src/Tasks/Common/Resources/xlf/Strings.ru.xlf
M	src/Tasks/Common/Resources/xlf/Strings.tr.xlf
M	src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf
M	src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf
Falling back to patching base and 3-way merge...
Auto-merging src/Tasks/Common/Resources/Strings.resx
CONFLICT (content): Merge conflict in src/Tasks/Common/Resources/Strings.resx
Auto-merging src/Tasks/Common/Resources/xlf/Strings.cs.xlf
Auto-merging src/Tasks/Common/Resources/xlf/Strings.de.xlf
Auto-merging src/Tasks/Common/Resources/xlf/Strings.es.xlf
Auto-merging src/Tasks/Common/Resources/xlf/Strings.fr.xlf
Auto-merging src/Tasks/Common/Resources/xlf/Strings.it.xlf
Auto-merging src/Tasks/Common/Resources/xlf/Strings.ja.xlf
Auto-merging src/Tasks/Common/Resources/xlf/Strings.ko.xlf
Auto-merging src/Tasks/Common/Resources/xlf/Strings.pl.xlf
Auto-merging src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf
Auto-merging src/Tasks/Common/Resources/xlf/Strings.ru.xlf
Auto-merging src/Tasks/Common/Resources/xlf/Strings.tr.xlf
Auto-merging src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf
Auto-merging src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0002 Implement PickBestRid MSBuild task with unit tests
Error: The process '/usr/bin/git' failed with exit code 128

Please backport manually!

@baronfel baronfel merged commit f83ad23 into main Sep 17, 2025
27 checks passed
@baronfel baronfel deleted the copilot/fix-50611 branch September 17, 2025 14:25
baronfel added a commit that referenced this pull request Sep 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[New MSBuild Task] Add a Task for evaluating the 'best' RID

4 participants