Repository navigation
Speed up CodeQL workflow - #405
Merged
Merged
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
NuGet caching lacks the required lockfiles, and the JavaScript category change leaves its previous scanning configuration without updates.
2 open issues
What changed in this PR
This PR aims to shorten CodeQL analysis time by parallelizing C# scanning across sample folders and enabling dependency caching.
Changes:
- Splits C# analysis into four source-root shards with separate result categories.
- Enables dependency caching and cancels superseded pull-request runs.
- Updates matrix job names and explicitly sets analysis categories.
| File | Description |
|---|---|
.github/workflows/codeql-analysis.yml |
Adds C# sharding, caching, concurrency controls, and explicit analysis categories. |
Review effort: Balanced
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…he shard Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

The C# CodeQL job was the critical path (~11-13 min), and ~7.5 min of that was the build-mode-none NuGet restore across every solution. Queries took only ~1 min.
Changes:
concurrencygroup that cancels superseded PR runssource-root:IdentityServer/v7,IdentityServer/v8,BFF,various. Each uploads under its own category (/language:csharp/<shard>).source-rootand would otherwise restore all 132 solutions in every shard..github/workflows/codeql-analysis.yml:analyze/language:javascript/).Measured on this PR: about 9 min wall clock, down from 11-17 min. The longest job is IdentityServer/v8 at about 8 min. Caching dependencies was tried and removed: it made runs slower and used 6.4 GB of cache.
Follow-up after merge:
.github/workflows/codeql-analysis.yml:analyze/language:csharp/configuration under Security > Code scanning > Tool status; otherwise its old alerts stay open.Analyze (csharp), update the required checks.build/build.csproj(repo build tooling) is no longer covered by C# analysis.