Skip to content

SFI: enable C# CodeQL coverage#608

Merged
haoliuu merged 7 commits into
mainfrom
haoliu/enable-codeql-in-ci
Jun 4, 2026
Merged

SFI: enable C# CodeQL coverage#608
haoliuu merged 7 commits into
mainfrom
haoliu/enable-codeql-in-ci

Conversation

@haoliuu

@haoliuu haoliuu commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

Restore C# CodeQL coverage for microsoft/ai-dev-gallery to clear the related SFI item.

CodeQL3000 had been silently failing to produce a C# database. After merge, CI run produces and uploads a fresh C# CodeQL database via 1ES PT, replacing the previously-broken external CCA autobuilder path.

Fix

  • .pipelines/templates/build.yaml — Wrap the build step with explicit CodeQL3000Init@0 / CodeQL3000Finalize@0 so the tracer actually attaches to our script: dotnet build (auto-injector ignores bare scripts).
  • .pipelines/ci.yml — Add sdl.codeql block: enable CodeQL, set compiled.enabled: false (avoid duplicating our explicit pair), and set buildIdentifier: 'Build_$(System.JobAttempt)' to keep cadence keys distinct across retries.
  • .pipelines/release.yml — Mirror the same sdl.codeql block. Also resolves the long-standing release attempt-1 CS0016 failure caused by tracer injection on the Official template.

Verification

End-to-end validation on a verify branch:

  • Build succeeded cleanly on the first attempt — no CS0016, no WMC9999.
  • CodeQL Finalize uploaded the C# database
  • Portal shows the row: branch codeql-verify, Language C#, BuildSource CodeQL3000_1ESPT.

@haoliuu haoliuu requested a review from a team as a code owner June 3, 2026 09:33
Copilot AI review requested due to automatic review settings June 3, 2026 09:33

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.

Pull request overview

Restores end-to-end C# CodeQL database generation for AI Dev Gallery’s Azure DevOps CI/release pipelines by switching to an explicit CodeQL3000 init/finalize wrapping of the dotnet build script and enabling CodeQL via 1ES pipeline template SDL configuration.

Changes:

  • Wraps the build script with CodeQL3000Init@0 / CodeQL3000Finalize@0 to ensure the tracer attaches to dotnet build.
  • Enables sdl.codeql in both CI and release pipelines (with compiled.enabled: false and a retry-unique buildIdentifier).
  • Updates the main app project file with EmitCompilerGeneratedFiles controls.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
AIDevGallery/AIDevGallery.csproj Adds project-level control over EmitCompilerGeneratedFiles behavior.
.pipelines/templates/build.yaml Wraps dotnet build with explicit CodeQL3000 init/finalize tasks.
.pipelines/ci.yml Enables CodeQL configuration via the 1ES SDL block for CI.
.pipelines/release.yml Mirrors the CodeQL configuration for official release builds.

Comment thread .pipelines/templates/build.yaml
Comment thread AIDevGallery/AIDevGallery.csproj
@haoliuu haoliuu merged commit b210a0f into main Jun 4, 2026
8 checks passed
@haoliuu haoliuu deleted the haoliu/enable-codeql-in-ci branch June 4, 2026 02:38
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