Support GitHub Actions annotations for project-level NuGet warnings without line numbers (e.g. NU1506)
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 57/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- github-actions, typescript
调研方向
Start by reading the existing .github/csc.json problem matcher and compare its patterns with the NU1506 log examples in this issue. Check how the matcher is registered in the GitHub Actions workflow and inspect related changes from issue #717. Done means a project-level NuGet warning without line or column information produces an annotation associated with its project file.
由索引模型根据 Issue 内容生成。
描述
Description
actions/setup-dotnet@v5 registers a problem matcher for .NET diagnostics, but some NuGet warnings, such as NU1506, are not recognized and therefore do not appear as GitHub Actions annotations.
For example, the following warnings appear in the build output:
D:\a\WinGetJet\WinGetJet\WinGetJet\WindowsPackageManager.Tests\WindowsPackageManager.Tests.csproj : warning NU1506: Duplicate 'PackageVersion' items found. Remove the duplicate items or use the Update functionality to ensure a consistent restore behavior. The duplicate 'PackageVersion' items are: Microsoft.WindowsPackageManager.ComInterop 1.29.380, Microsoft.WindowsPackageManager.ComInterop 1.29.380.
D:\a\WinGetJet\WinGetJet\WinGetJet\WindowsPackageManager\WindowsPackageManager.csproj : warning NU1506: Duplicate 'PackageVersion' items found. Remove the duplicate items or use the Update functionality to ensure a consistent restore behavior. The duplicate 'PackageVersion' items are: Microsoft.WindowsPackageManager.ComInterop 1.29.380, Microsoft.WindowsPackageManager.ComInterop 1.29.380.
D:\a\WinGetJet\WinGetJet\WinGetJet\WinGetJet\WinGetJet.csproj : warning NU1506: Duplicate 'PackageVersion' items found. Remove the duplicate items or use the Update functionality to ensure a consistent restore behavior. The duplicate 'PackageVersion' items are: Microsoft.WindowsPackageManager.ComInterop 1.29.380, Microsoft.WindowsPackageManager.ComInterop 1.29.380.
These are valid NuGet warnings, but they do not produce annotations in GitHub Actions.
Steps to reproduce
- Configure central package management with duplicate
PackageVersionentries. - Use
actions/setup-dotnet@v5in a GitHub Actions workflow. - Run
dotnet restoreordotnet build. - Observe the
NU1506warnings in the workflow logs.
Expected behavior
NuGet warnings that reference a project file should produce GitHub Actions warning annotations, even when no source line or column information is available.
Actual behavior
The warnings are visible in the workflow logs but are not reported as GitHub Actions annotations.
Possible cause
The existing csc.json problem matcher requires:
- A line number, optionally followed by a column number.
- A trailing project path enclosed in square brackets.
However, project-level NuGet warnings such as NU1506 do not necessarily provide either.
Suggested improvement
Extend the existing problem matcher or register an additional matcher to support .NET/NuGet diagnostics without line and column information.
These diagnostics should still be associated with the referenced project file.
Related issues
- #603 — Add problem matcher for NuGetAudit (closed as not planned)
- #605 — Add msbuild.json as problem matcher (closed without merging)
- #717 — Expand the CSC problem matcher (merged)
Although these address related diagnostic-matching problems, the NU1506 output format is still not supported by the matcher included in setup-dotnet@v5.
Justification
Missing annotations make NuGet warnings harder to discover, especially in large projects where build logs can contain extensive output.
Supporting project-level NuGet diagnostics would improve warning visibility in GitHub Actions job summaries and pull requests without requiring each repository to maintain a custom problem matcher.
- 主要语言
- TypeScript
- 星标
- 1.2k
- 派生
- 579
- 平均合并
- 6 天 4 小时
- 30 天内合并 PR
- 1
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
actions/setup-dotnet 的其他 Issue
-
rollForward: latestMajor installs the latest LTS SDK even when it is older than sdk.version可能已有人在做 @kamronbatman 于 8 天前认领。 未关闭bug
难度 4/5 3-5 天 新手友好度 35/100
actions/setup-dotnet#802 · 1 条评论 · 6 个 reaction ·
-
feature request
难度 3/5 1-2 天 新手友好度 68/100
actions/setup-dotnet#801 · 1 条评论 · 1 个 reaction ·
-
feature request
难度 5/5 一周以上 新手友好度 45/100
actions/setup-dotnet#778 · 3 条评论 · 1 个 reaction ·
-
feature request
难度 5/5 一周以上 新手友好度 25/100
actions/setup-dotnet#701 · 3 条评论 ·
-
feature request
难度 1/5 1 小时以内 新手友好度 55/100
actions/setup-dotnet#659 · 1 条评论 · 2 个 reaction ·
查看 actions/setup-dotnet 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
solidjs/solid-docs#1716 ·
维护者通常 1 天内回复
-
bug needs-triage
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
Progress indicated by console logs is off by one可能已有人在做 @marceliwac 今天认领。 未关闭bug needs-triage
难度 2/5 1-3 小时 新手友好度 76/100
aws-samples/aws-cdk-examples#1336 ·
-
难度 2/5 1-3 小时 新手友好度 74/100
melgarafael/DeskcommCRM#4999 · 1 条评论 ·
维护者通常 1 天内回复
-
type: bug
难度 2/5 1-3 小时 新手友好度 78/100
nrwl/nx#37955 · 1 个 reaction ·
维护者通常 2 天内回复