Skip to content

Speed up CodeQL workflow - #405

Merged
damianh merged 4 commits into
mainfrom
dh/speed-up-codeql-workflow
Oct 27, 2026
Merged

damianh merged 4 commits into
mainfrom
dh/speed-up-codeql-workflow

Conversation

@damianh

@damianh damianh commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

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:

  • concurrency group that cancels superseded PR runs
  • C# split into parallel jobs by source-root: IdentityServer/v7, IdentityServer/v8, BFF, various. Each uploads under its own category (/language:csharp/<shard>).
  • C# shards sparse-checkout only their folder (plus root files). The buildless extractor ignores source-root and would otherwise restore all 132 solutions in every shard.
  • JavaScript is unchanged and explicitly keeps its previous category (.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:

  • Delete the stale .github/workflows/codeql-analysis.yml:analyze/language:csharp/ configuration under Security > Code scanning > Tool status; otherwise its old alerts stay open.
  • Job names changed. If branch protection requires Analyze (csharp), update the required checks.
  • build/build.csproj (repo build tooling) is no longer covered by C# analysis.

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

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.

🟡 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

Comment thread .github/workflows/codeql-analysis.yml Resolved
Comment thread .github/workflows/codeql-analysis.yml Resolved
@github-advanced-security

Copy link
Copy Markdown

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:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

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

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

No unresolved blocking issues remain, prior feedback is addressed, and migration steps and coverage changes are documented.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

…he shard

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

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

The scanning coverage changes and category migration need human validation against completed workflow results.

No open issues 🎉

Review effort: Balanced

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

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

No blocking issues remain, and the description documents the required post-merge cleanup and coverage tradeoff.

No open issues 🎉

Review effort: Balanced

@damianh
damianh merged commit 3615067 into main Oct 27, 2026
173 checks passed
@damianh
damianh deleted the dh/speed-up-codeql-workflow branch October 27, 2026 07:48
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