Skip to content

Restore trustworthy CodeQL scanning across all seven products - #387

Merged
damianh merged 1 commit into
mainfrom
dh/codeql-scanning-repair
Nov 2, 2026
Merged

damianh merged 1 commit into
mainfrom
dh/codeql-scanning-repair

Conversation

@damianh

@damianh damianh commented Nov 2, 2026

Copy link
Copy Markdown
Member

What issue does this PR address?

CodeQL's scheduled Ubuntu run fails with NETSDK1100 after autobuild selects a WPF sample, skipping analysis. The three open CodeQL log-forging alerts still reference an April 2025 commit, so they cannot establish the state of current production source.

Replace autobuild with explicit manual Release builds of all projects under each top-level product's src directory. This covers 12 projects across all seven products, including the RazorSlices source generator and both trimming harnesses, without building samples, clients, tests, or performance projects. Manual extraction retains compiler-generated code and dependency context that no-build extraction can miss; future production projects under src are included automatically.

Add pull-request-to-main and main-push scanning while retaining the weekly schedule. Install the SDK from global.json, pin checkout/setup-dotnet/CodeQL to verified immutable supported action references, and retain the existing job permissions and /language:csharp category. Document the scan boundary and acceptance checks.

Validation:

  • go run github.com/rhysd/actionlint/cmd/actionlint@latest .github\workflows\codeql.yml - passed.
  • Executed the exact Build production source workflow block locally on Windows with SDK 10.0.403 - all 12 projects passed with zero warnings or errors; repeated successfully with EmitCompilerGeneratedFiles=true and MvcBuildViews=true.
  • Compared selected projects with foss.slnx - all 12 source projects across seven products matched, with no samples/clients/tests/performance projects selected. Checked that failed builds and an empty source inventory fail explicitly.
  • git diff --check - passed.

GitHub verification is still required: confirm Ubuntu extraction/project and file coverage, successful analysis and SARIF processing without extraction errors at the intended SHA/ref/category, then a fresh main-branch analysis and refreshed alert state. This targets Scorecard code-scanning alerts #63 (SAST) and #75 (pinning), but does not claim either is resolved before a fresh Scorecard run. CodeQL alerts #96-98 must be reassessed after fresh analysis; no alerts are dismissed or logging fixes included here.

Replace failing sample autobuild with explicit source builds to retain
coverage across all seven products and compiler-generated code.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 2, 2026 17:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Windows-only build validation leaves Ubuntu CodeQL extraction coverage for all 12 projects, SARIF processing, and fresh main-branch analysis and alert state unverified.

No open issues 🎉

What changed in this PR

This PR replaces CodeQL autobuild with explicit production-source builds to avoid Windows-only samples on Ubuntu and restore scanning across all seven products. GitHub-side extraction, coverage, and refreshed alert verification remain pending.

Changes:

  • Manually builds all 12 current projects under product src directories in Release mode, automatically including future source projects.
  • Adds pull-request and main-push scanning, retains the weekly schedule, installs the configured .NET SDK, and pins actions to immutable references.
  • Documents scan boundaries and the checks required to verify analysis coverage and current alert state.
File Description
README.md Documents production scan scope, local reproduction, and post-run verification.
.github/​workflows/​codeql.yml Updates triggers and action pins; replaces autobuild with explicit production-source builds.

Review effort: Balanced

@damianh
damianh marked this pull request as ready for review November 2, 2026 17:27
@damianh damianh self-assigned this Nov 2, 2026
@damianh
damianh merged commit ddee5b9 into main Nov 2, 2026
3 checks passed
@damianh
damianh deleted the dh/codeql-scanning-repair branch November 2, 2026 17:28
damianh added a commit that referenced this pull request Nov 2, 2026
Keep scanning implementation and verification details out of the
repository overview. Remove the section introduced in #387 without
changing the CodeQL workflow.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants