Skip to content

Fix repository-relative alert paths in CodeQL C# shards - #406

Merged
maartenba merged 1 commit into
mainfrom
dh/codeql-csharp-source-root-fix
Oct 27, 2026
Merged

maartenba merged 1 commit into
mainfrom
dh/codeql-csharp-source-root-fix

Conversation

@damianh

@damianh damianh commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Summary

Set CodeQL source-root to the repository root for every shard so C# SARIF locations include their sample-folder prefixes. For example, alert #1442 currently reports SessionMigration/Pages/Consent/Index.cshtml.cs instead of IdentityServer/v8/SessionMigration/Pages/Consent/Index.cshtml.cs.

Per-shard sparse checkout still limits C# buildless extraction to the selected sample folder. All analysis categories remain unchanged, including .github/workflows/codeql-analysis.yml:analyze/language:javascript/ for JavaScript. Updated the workflow comments to explain these separate responsibilities.

Validation

  • actionlint v1.7.7 passes with only the existing custom runner-label diagnostic suppressed (ubuntu-latest-x64-16core); shellcheck/pyflakes checks are disabled.
  • git diff --check passes.
  • The PR's various C# analysis completed successfully and uploaded under the unchanged /language:csharp/various category with no analysis error. Other shards were still running at the last check.
  • PR CodeQL runs are diff-informed (codeql-action/pr-diff-range), so this workflow-only change produces no C# findings to inspect. Repository-relative alert paths must be verified after merge in a full analysis on main; they have not yet been verified from uploaded findings.

Keep the source root at the repository root while retaining per-shard sparse checkout and existing analysis categories.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 27, 2026 08:13

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.

🟢 Approval recommended

The narrow configuration change addresses alert path prefixes without changing shard scope or analysis categories, and no blocking issues were identified.

No open issues 🎉

What changed in this PR

This PR makes CodeQL C# alert paths repository-relative so they include sample-folder prefixes, while preserving shard extraction scope and analysis categories.

Changes:

  • Sets source-root to the repository root for every shard.
  • Clarifies that sparse checkout controls C# extraction scope and cone mode retains root files.
File Description
.github/​workflows/​codeql-analysis.yml Uses repository-root path attribution and clarifies sparse-checkout responsibilities.

Review effort: Balanced

@maartenba
maartenba merged commit d836fef into main Oct 27, 2026
173 checks passed
@maartenba
maartenba deleted the dh/codeql-csharp-source-root-fix branch October 27, 2026 10:25
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.

3 participants