feat(manifest): socket manifest dotnet + centralized config-name globs (REA-627, REA-628)#1404
Conversation
…s (REA-627, REA-628) Bring .NET/NuGet to the Socket facts pipeline, at parity with the JVM tools. socket manifest dotnet (REA-627): - New command + auto-manifest detection (top-level .sln/.slnx/.csproj/.fsproj/ .vbproj) and setup-wizard entry; socket.json defaults.manifest.dotnet.*. - Bundled C# tool (socket-facts-dotnet): one MSBuild session — evaluate, in-process restore, read project.assets.json via NuGet.ProjectModel — emitting the shared records TSV. Ships no NuGet/MSBuild runtime assemblies (compile-low/run-high against the locator-selected SDK; net6 floor, RollForward LatestMajor), so it works across installed SDK versions. Restore forces TreatWarningsAsErrors=false so NU19xx security advisories don't abort the run. packages.config supported (flat closure + HintPath DLLs, with pinned-artifact download via the project's configured feeds). Fail-closed: emits failure records that raise the CLI exit code; every emitted artifact path is guaranteed to exist. - --target-frameworks / --exclude-target-frameworks (TFM globs; RID targets match under their base TFM); --dotnet-opts (MSBuild -p: props applied to the whole session). Reachability sidecar emits nuget-tagged ResolvedComponents. - Resolution summary reports scanned target frameworks across N projects, with per-project attribution under --verbose. Centralized config-name glob compilation (REA-628): - Compile --include-configs/--exclude-configs globs to anchored regex sources once in config-glob.mts; the gradle/sbt/maven scripts and the dotnet tool consume the compiled patterns. Removes the per-language globToRegex (Groovy/Scala/Java) and adds a cross-language vector test suite. Gated on coana REA-626 (nuget sidecar consumer): the coana version pin is bumped and this is un-drafted once coana releases.
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub. |
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub. |
|
Caution Review the following alerts detected in dependencies. According to your organization's Security Policy, you must resolve all "Block" alerts before proceeding. It is recommended to resolve "Warn" alerts too. Learn more about Socket for GitHub.
|
|
Jeppe Fredsgaard Blaabjerg (@jfblaa) Would this live better in the coana cli? |
|
Six verified issues, most severe first. Each one is traced to the exact lines on this branch and checked against the v1.x base (and the pinned coana builds where that mattered). Two things that looked like bugs turned out fine — they're at the bottom so nobody re-chases them. 🔴 1. Windows line endings corrupt the last field of every record the C# tool emits
🟠 2. The sidecar schema break is wider than the draft warning says — every reachability scan fails, not just polyglot ones
🟠 3. A tool crash after partial output still exits 0 — a truncated SBOM is reported as success
🟠 4. A failed restore can report success with stale data
🟠 5. A leftover packages.config silently wins over the real PackageReference graph
🟠 6. Polyglot repos overwrite one ecosystem's facts with another's
🟡 Smaller items
🟢 Verified fine: two things that looked like bugs but aren't
Items 1 (Windows line endings) and 3–5 (the fail-closed trio) are the ones to settle before un-drafting — item 1 (Windows line endings) because it's a one-line fix for a whole platform, and items 3 (crash exits 0), 4 (stale-restore success) and 5 (packages.config precedence) because they all break the same promise the tool's design leans on: a wrong scan never exits green. Item 2 (sidecar scope) just needs the PR body corrected so branch testers know what to expect. |
Closes REA-627. Closes REA-628.
Warning
Draft — do not merge until coana PR (REA-626) is released and the pinned coana version is bumped in this PR. The reachability sidecar emits nuget-tagged entries that the currently-released coana rejects (strict schema); a polyglot .NET+JVM
--reachscan would break until coana ships REA-626. The SBOM-only path (no--reach) is coana-independent.What
Brings .NET/NuGet to the Socket facts pipeline, at parity with the JVM tools (the .NET analog of REA-613). Previously
nugetwas only a package-scoring ecosystem — no manifest generation, no auto-detection, no reachability; the only path was a manualsocket manifest cdxgen -t dotnet.socket manifest dotnet(REA-627).sln/.slnx/.csproj/.fsproj/.vbproj) + setup-wizard entry;socket.jsondefaults.manifest.dotnet.*.scripts/dotnet-tool/): one MSBuild session — evaluate → in-process restore → readproject.assets.jsonviaNuGet.ProjectModel— emitting the shared records TSV.RollForward LatestMajor), so it works across installed SDKs and avoids the ref/def assembly clash that breaks multi-SDK hosts.TreatWarningsAsErrors=falsesoNU19xxsecurity-advisory warnings don't abort the run.developmentDependency→dev + HintPath DLLs; downloads missing pinned artifacts via the project's configured feeds/credential providers).failure/unscannablerecords that raise the CLI exit code; every emitted artifact path is guaranteed to exist.--target-frameworks/--exclude-target-frameworks(TFM globs; RID targets match under their base TFM);--dotnet-opts(MSBuild-p:props applied to the whole session).ResolvedComponents (consumed by coana REA-626).--verbose).Centralized config-name glob compilation (REA-628)
--include-configs/--exclude-configsglobs → anchored regex sources once inconfig-glob.mts; the gradle/sbt/maven scripts and the dotnet tool all consume the compiled patterns. Removes the per-languageglobToRegex(Groovy/Scala/Java) and adds a cross-language vector test suite. Rides in this PR because the .NET tool is a fourth consumer of the shared patterns.Testing
Unit tests (config-glob vectors, dotnet records→assemble, detection, auto-manifest branch, command snapshots); accuracy sweep vs. native-restore ground truth across 17 real .NET repos (~99.6% avg recall, exact real-package versions, packages.config 100%).
pnpm checkclean.Follow-ups before un-drafting