Skip to content

CI: build-pre-release SARIF post-processing fails on multi-targeted projects #129

Closed

Description

@dnyw4l3n13

Summary

The build-pre-release required check has failed independently on both main and PR #128 with corrupted/missing SARIF output during the "Merge Roslyn analyzer SARIF files" / "Summarise Roslyn analyzer findings" steps (.github/actions/sarif-merge, .github/actions/sarif-summary). The dotnet build/dotnet test steps themselves pass (0 Error(s)); only the CI's own SARIF post-processing fails.

Evidence

Both failures point at the same file: Credfeto.Enumeration.Source.Generation.Attributes.sarif, produced by src/Credfeto.Enumeration.Source.Generation.Attributes/Credfeto.Enumeration.Source.Generation.Attributes.csproj, which multi-targets netstandard2.0;net8.0;net10.0. A second project, Credfeto.Enumeration.Source.Generation.Generics, also multi-targets and shares the same risk profile.

Root cause candidates (not yet confirmed which, or both)

  1. Same-path write race across TFMs. src/Packaging.props:6 sets <ErrorLog>$(SolutionDir)\..\results\$(MSBuildProjectName).sarif,version=2.1</ErrorLog> keyed only on $(MSBuildProjectName), not $(TargetFramework). For a multi-targeted project, MSBuild's inner builds per TFM can run concurrently and all three would write to the same results/Credfeto.Enumeration.Source.Generation.Attributes.sarif path, which would produce exactly this kind of interleaved/corrupted JSON.
  2. Oversized SARIF from ReportAnalyzer=true. The same property block (src/Packaging.props:10-12) also enables ReportAnalyzer, and the project pulls in ~16 analyzer packages. The second failure's corruption position (~1,073,078 bytes, just over 1 MiB) is close enough to a buffer/size boundary that a single oversized/truncated write is also plausible, independent of any race.

The two observed failures differ in shape (an interleaved token in attempt 1 vs. a truncation-like error near a ~1 MiB boundary in attempt 2), so this issue is filed with both hypotheses open rather than assuming one.

Suggested next step

Whoever picks this up should first determine which hypothesis is correct (e.g. by reproducing locally with dotnet build -m on this project and inspecting results/*.sarif sizes/contents per TFM), then apply the appropriate fix in its own PR:

  • If it's the path race: disambiguate ErrorLog per TFM, e.g. $(MSBuildProjectName).$(TargetFramework).sarif, in src/Packaging.props. The sarif-merge action already merges arbitrary numbers of *.sarif files by glob, so this should be transparent downstream.
  • If it's a size/serialization issue: investigate the SARIF writer/ReportAnalyzer output for excessive size, independent of any TFM-path change.

This is CI/build-tooling scope (src/Packaging.props, plus verifying .github/actions/sarif-merge -- note the latter carries a "Maintain in repo: funfair-server-template" header, so a fix touching it belongs upstream) and should not be bundled into an unrelated dependency-update PR.

Impact

Blocks the build-pre-release required check from going green on any branch/PR that builds one of the affected multi-targeted projects, including PR #128, until fixed.

Activity

  1. added
    AI-Work
    Blocked
    on Aug 22, 2026
  2. self-assigned this
    on Aug 22, 2026
  3. github-actions commented on Aug 22, 2026

    @github-actions

    Thanks for opening your first issue here! Please make sure you have read the contributing guidelines.

  4. removed
    Blocked
    on Nov 12, 2026
  5. dnyw4l3n13 commented on Nov 15, 2026

    @dnyw4l3n13
    CollaboratorAuthor

    Implementation Plan

    Files to change

    • src/Packaging.props - verify/adjust the SARIF ErrorLog and ReportAnalyzer settings
    • .github/actions/sarif-merge - read-only check only (upstream-maintained: funfair-server-template); no change here

    Approach

    On current main, src/Packaging.props already sets ErrorLog to <ProjectName>.<TargetFramework>.sarif inside a _SetSarifErrorLog target that runs before CoreCompile, so hypothesis 1 (same-path write race across TFMs) appears already addressed; the failing runs may predate that change. First, confirm by checking git history of Packaging.props against the failing run dates and by running dotnet build -m locally, inspecting results/*.sarif per TFM for validity and size. If per-TFM files are valid and small, close the issue as already fixed with the evidence. If corruption or oversized output (~1 MiB) persists, set ReportAnalyzer to false (or restrict it) for multi-targeted projects in src/Packaging.props, so the SARIF is smaller and less likely to be truncated. Any fix needed in sarif-merge/sarif-summary is raised upstream rather than patched here.

    Test strategy

    Local dotnet build -m of the solution; validate every results/*.sarif parses as JSON (e.g. jq .) with distinct per-TFM filenames; confirm the build-pre-release CI check passes on the PR.

    Assumptions

    a. The Packaging.props ErrorLog change was made after the failing runs listed in the issue.
    b. The sarif-merge action's glob picks up the per-TFM files transparently, as the issue states.

    Open questions

    Q1. If the per-TFM path already fixes the failures, should the issue simply be closed with evidence rather than a PR being raised?

  6. added
    Blocked
    on Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

AI-WorkBlocked

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions