File-based apps: improve legacy artifact support - #56160
Conversation
|
Azure Pipelines: Successfully started running 1 pipeline(s). 2 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
🟡 Changes recommended
The test overrides the capability in every case, leaving the newly declared SDK capability contract untested.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Improves file-based app artifact compatibility when hosts evaluate projects with older SDKs.
Changes:
- Adds an SDK capability marker for file-based artifact paths.
- Uses capability detection to select modern or legacy artifact output.
- Updates compatibility tests for both paths.
File summaries
| File | Description |
|---|---|
Microsoft.NET.DefaultArtifactsPath.props |
Declares artifact-path capability. |
VirtualProjectBuilder.cs |
Selects output behavior from capability. |
RunFileTests_CscOnlyAndApi.cs |
Tests capability-based selection. |
Review details
Suppressed comments (1)
src/Cli/Microsoft.DotNet.FileBasedPrograms/VirtualProjectBuilder.cs:512
- The preceding comment still describes the removed “props imported but no layout selected” condition. The new logic deliberately chooses legacy output whenever the evaluated SDK lacks the capability, including when an older SDK selected an explicit artifacts layout, so the comment now contradicts the behavior it explains.
_useLegacyArtifactsPath = !string.Equals(defaultArtifactsPathPropsImported, bool.TrueString, StringComparison.OrdinalIgnoreCase);
- Files reviewed: 3/3 changed files
- Comments generated: 2
- Review effort level: Balanced
|
Azure Pipelines: Successfully started running 1 pipeline(s). 2 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
|
@333fred @RikkiGibson for reviews, thanks |
|
/backport to release/11.0.1xx |
|
Started backporting to |
|
@jjonescz backporting to git am output$ git cherry-pick b0c84929bad3f1c10d5b9888b46f3ac2dc1db02a
Auto-merging src/Cli/Microsoft.DotNet.FileBasedPrograms/VirtualProjectBuilder.cs
CONFLICT (content): Merge conflict in src/Cli/Microsoft.DotNet.FileBasedPrograms/VirtualProjectBuilder.cs
Auto-merging test/dotnet.Tests/CommandTests/Run/RunFileTests_CscOnlyAndApi.cs
CONFLICT (content): Merge conflict in test/dotnet.Tests/CommandTests/Run/RunFileTests_CscOnlyAndApi.cs
error: could not apply b0c84929ba... File-based apps: improve legacy artifact support (#56160)
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch
Applying: File-based apps: improve legacy artifact support
Using index info to reconstruct a base tree...
M src/Cli/Microsoft.DotNet.FileBasedPrograms/VirtualProjectBuilder.cs
M test/dotnet.Tests/CommandTests/Run/RunFileTests_CscOnlyAndApi.cs
Falling back to patching base and 3-way merge...
Auto-merging src/Cli/Microsoft.DotNet.FileBasedPrograms/VirtualProjectBuilder.cs
CONFLICT (content): Merge conflict in src/Cli/Microsoft.DotNet.FileBasedPrograms/VirtualProjectBuilder.cs
Auto-merging test/dotnet.Tests/CommandTests/Run/RunFileTests_CscOnlyAndApi.cs
CONFLICT (content): Merge conflict in test/dotnet.Tests/CommandTests/Run/RunFileTests_CscOnlyAndApi.cs
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 0001 File-based apps: improve legacy artifact support
Error: The process '/usr/bin/git' failed with exit code 128 |
|
/backport to release/11.0.1xx |
|
Started backporting to |
A better version of #55970.
Should fix the issue reported in dotnet/vscode-csharp#9734 (comment).
See roslyn counterpart for more details: dotnet/roslyn#85204