Repository navigation
Downgrade NU1901, NU1902, NU1903 to warnings and log them - #7922
Conversation
|
Azure Pipelines: Successfully started running 1 pipeline(s). 1 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
b5fd303 to
5055816
Compare
|
Azure Pipelines: Successfully started running 1 pipeline(s). 1 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.
Pull request overview
This PR adjusts VMR repo-build orchestration so NuGet audit warnings can be surfaced in repo build logs while preventing select NU190x audit warnings from failing the build.
Changes:
- Allow
/clp:arguments to pass through Roslyn and F# repo build scripts (bash + PowerShell). - Add a
warnnotaserrorconfiguration for NU1901–NU1903 and add/clp:NoSummaryto common repo-build arguments. - Teach the VMR
Execwrapper to recognize NuGet warning lines viaCustomWarningRegularExpressionso they are logged as MSBuild warnings.
Show a summary per file
| File | Description |
|---|---|
| src/roslyn/eng/build.sh | Accepts /clp: arguments and forwards them to MSBuild. |
| src/roslyn/eng/build.ps1 | Allows /clp: in forwarded “remaining arguments” validation. |
| src/fsharp/eng/build.sh | Accepts /clp: arguments and forwards them to MSBuild. |
| src/fsharp/eng/Build.ps1 | Allows /clp: in forwarded “remaining arguments” validation. |
| repo-projects/Directory.Build.targets | Adds an Exec warning-regex so NuGet warning output is recognized/logged as warnings. |
| repo-projects/Directory.Build.props | Adds common args to demote NU1901–NU1903 and suppress console logger summary output. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 6/6 changed files
- Comments generated: 2
The per-OS FlagParameterSemicolon used a backslash-escaped ';' on Unix, which MSBuild normalized to '/', producing a malformed "NU1901/;NU1902/;NU1903" list for the inner repo build and silently dropping the NU1901/NU1902 downgrades. Escaping is only needed on Windows (PowerShell Invoke-Expression in runtime's build.ps1); on other platforms the quoted value goes straight to the shell where ';' is literal. Condition the escaping to Windows and pass the raw list elsewhere. Co-authored-by: Copilot <[email protected]> Copilot-Session: 383ea2c0-59cf-4fd9-b024-4bb649e4a07e
|
Azure Pipelines: Successfully started running 1 pipeline(s). 1 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
left a comment
There was a problem hiding this comment.
Roslyn change seems fine. Did not review anything else.
|
Merging. Happy to respond to more feedback in a follow-up. |
|
/backport to release/10.0.4xx |
|
/backport to release/10.0.1xx |
|
Started backporting to |
|
Started backporting to |
|
@akoeplinger backporting to git am output$ git cherry-pick 0b5109c67228e2566ba35f47607106f97e62cc8a
Auto-merging Directory.Build.props
Auto-merging eng/tools/BinaryToolKit/BinaryToolKit.csproj
Auto-merging eng/tools/tasks/Microsoft.DotNet.UnifiedBuild.MSBuildSdkResolver/Microsoft.DotNet.UnifiedBuild.MSBuildSdkResolver.csproj
Auto-merging eng/tools/tasks/Microsoft.DotNet.UnifiedBuild.Tasks/Microsoft.DotNet.UnifiedBuild.Tasks.csproj
CONFLICT (content): Merge conflict in eng/tools/tasks/Microsoft.DotNet.UnifiedBuild.Tasks/Microsoft.DotNet.UnifiedBuild.Tasks.csproj
Auto-merging repo-projects/Directory.Build.props
Auto-merging repo-projects/Directory.Build.targets
Auto-merging src/fsharp/eng/Build.ps1
Auto-merging src/fsharp/eng/build.sh
Auto-merging src/roslyn/eng/build.ps1
Auto-merging src/roslyn/eng/build.sh
Auto-merging src/runtime/eng/build.ps1
error: could not apply 0b5109c6722... Downgrade NU1901, NU1902, NU1903 to warnings and log them (#7922)
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: Downgrade NU1901-4 to warnings and log them
Applying: Accept /clp msbuild arg in roslyn and fsharp scripts
Applying: Add warning suppression for specific NuGet warnings
Applying: Fix warn as error flag
Applying: Add empty D.B.rsp
Applying: Fix warning logging by using custom task to read warnings
.git/rebase-apply/patch:205: trailing whitespace.
warnings stay warnings instead of being promoted to errors by the blanket -warnAsError.
warning: 1 line adds whitespace errors.
Using index info to reconstruct a base tree...
M Directory.Build.props
M eng/tools/BinaryToolKit/BinaryToolKit.csproj
M eng/tools/tasks/Microsoft.DotNet.UnifiedBuild.MSBuildSdkResolver/Microsoft.DotNet.UnifiedBuild.MSBuildSdkResolver.csproj
M eng/tools/tasks/Microsoft.DotNet.UnifiedBuild.Tasks/Microsoft.DotNet.UnifiedBuild.Tasks.csproj
M repo-projects/Directory.Build.props
M repo-projects/Directory.Build.targets
M src/runtime/eng/build.ps1
Falling back to patching base and 3-way merge...
Auto-merging Directory.Build.props
Auto-merging eng/tools/BinaryToolKit/BinaryToolKit.csproj
Auto-merging eng/tools/tasks/Microsoft.DotNet.UnifiedBuild.MSBuildSdkResolver/Microsoft.DotNet.UnifiedBuild.MSBuildSdkResolver.csproj
Auto-merging eng/tools/tasks/Microsoft.DotNet.UnifiedBuild.Tasks/Microsoft.DotNet.UnifiedBuild.Tasks.csproj
CONFLICT (content): Merge conflict in eng/tools/tasks/Microsoft.DotNet.UnifiedBuild.Tasks/Microsoft.DotNet.UnifiedBuild.Tasks.csproj
Auto-merging repo-projects/Directory.Build.props
Auto-merging repo-projects/Directory.Build.targets
Auto-merging src/runtime/eng/build.ps1
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 0006 Fix warning logging by using custom task to read warnings
Error: The process '/usr/bin/git' failed with exit code 128 |
|
@akoeplinger backporting to git am output$ git cherry-pick 0b5109c67228e2566ba35f47607106f97e62cc8a
Auto-merging Directory.Build.props
Auto-merging eng/tools/BinaryToolKit/BinaryToolKit.csproj
Auto-merging eng/tools/tasks/Microsoft.DotNet.UnifiedBuild.MSBuildSdkResolver/Microsoft.DotNet.UnifiedBuild.MSBuildSdkResolver.csproj
Auto-merging eng/tools/tasks/Microsoft.DotNet.UnifiedBuild.Tasks/Microsoft.DotNet.UnifiedBuild.Tasks.csproj
CONFLICT (content): Merge conflict in eng/tools/tasks/Microsoft.DotNet.UnifiedBuild.Tasks/Microsoft.DotNet.UnifiedBuild.Tasks.csproj
Auto-merging repo-projects/Directory.Build.props
Auto-merging repo-projects/Directory.Build.targets
CONFLICT (modify/delete): src/runtime/eng/build.ps1 deleted in HEAD and modified in 0b5109c6722 (Downgrade NU1901, NU1902, NU1903 to warnings and log them (#7922)). Version 0b5109c6722 (Downgrade NU1901, NU1902, NU1903 to warnings and log them (#7922)) of src/runtime/eng/build.ps1 left in tree.
error: could not apply 0b5109c6722... Downgrade NU1901, NU1902, NU1903 to warnings and log them (#7922)
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: Downgrade NU1901-4 to warnings and log them
Applying: Accept /clp msbuild arg in roslyn and fsharp scripts
Applying: Add warning suppression for specific NuGet warnings
Applying: Fix warn as error flag
Applying: Add empty D.B.rsp
Applying: Fix warning logging by using custom task to read warnings
.git/rebase-apply/patch:205: trailing whitespace.
warnings stay warnings instead of being promoted to errors by the blanket -warnAsError.
warning: 1 line adds whitespace errors.
Using index info to reconstruct a base tree...
M Directory.Build.props
M eng/tools/BinaryToolKit/BinaryToolKit.csproj
M eng/tools/tasks/Microsoft.DotNet.UnifiedBuild.MSBuildSdkResolver/Microsoft.DotNet.UnifiedBuild.MSBuildSdkResolver.csproj
M eng/tools/tasks/Microsoft.DotNet.UnifiedBuild.Tasks/Microsoft.DotNet.UnifiedBuild.Tasks.csproj
M repo-projects/Directory.Build.props
M repo-projects/Directory.Build.targets
A src/runtime/eng/build.ps1
Falling back to patching base and 3-way merge...
Auto-merging Directory.Build.props
Auto-merging eng/tools/BinaryToolKit/BinaryToolKit.csproj
Auto-merging eng/tools/tasks/Microsoft.DotNet.UnifiedBuild.MSBuildSdkResolver/Microsoft.DotNet.UnifiedBuild.MSBuildSdkResolver.csproj
Auto-merging eng/tools/tasks/Microsoft.DotNet.UnifiedBuild.Tasks/Microsoft.DotNet.UnifiedBuild.Tasks.csproj
CONFLICT (content): Merge conflict in eng/tools/tasks/Microsoft.DotNet.UnifiedBuild.Tasks/Microsoft.DotNet.UnifiedBuild.Tasks.csproj
Auto-merging repo-projects/Directory.Build.props
Auto-merging repo-projects/Directory.Build.targets
CONFLICT (modify/delete): src/runtime/eng/build.ps1 deleted in HEAD and modified in Fix warning logging by using custom task to read warnings. Version Fix warning logging by using custom task to read warnings of src/runtime/eng/build.ps1 left in tree.
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 0006 Fix warning logging by using custom task to read warnings
Error: The process '/usr/bin/git' failed with exit code 128 |
Let warnings get recognized and logged and downgrade NU1901, NU1902 and NU1903 from error to warning.
Tested locally, works perfectly. You can see the roslyn warnings in the CI run. They currently don't get promoted to the timeline because of the Arcade logger that got removed which will soon be back again (with the next re-bootstrap).