Skip to content

Mrva powershell pack split - #389

Open
Chanel (chanel-y) wants to merge 1 commit into
mainfrom
mrva-powershell-pack-split
Open

Mrva powershell pack split#389
Chanel (chanel-y) wants to merge 1 commit into
mainfrom
mrva-powershell-pack-split

Conversation

@chanel-y

@chanel-y Chanel (chanel-y) commented Aug 10, 2026

Copy link
Copy Markdown

MRVA PowerShell pack split — summary

The original issue

Submitting an MRVA (multi-repository variant analysis) run for PowerShell queries timed out at the "Sending request" step.

Root cause: The microsoft/powershell-all library shipped 3283 generated .NET framework data-extension files (~15.4 MB, 89% of the compiled pack). Because every PowerShell query depends on powershell-all, all these models were bundled into the MRVA query pack and base64-inlined into the JSON body of the POST .../variant-analyses request:

value
uncompressed pack 17.36 MB
tgz 1.85 MB
base64 submit body 2.47 MB

The GitHub endpoint processes the pack synchronously, so the oversized body pushed it past the gateway timeout (a time limit — the body was under the ~10 MB hard limit). Other languages don't hit this because they don't ship a 15 MB generated model set.

The changes (branch mrva-powershell-pack-split, commit 8ee980d48c6)

  1. New opt-in model pack microsoft/powershell-frameworks-generated at powershell/ql/extensions/frameworks-generated/, declaring extensionTargets: microsoft/powershell-all. It holds 2424 moved typemodels (~12.2 MB) — the UI/desktop/WCF and long-tail framework models.
  2. Core stays in powershell-all: 850 security-relevant models (System base, Management.Automation, IO, Net, Data/SqlClient, Security, Diagnostics.Process, plus hand-authored/internal cmdlet/alias models).
  3. codeql-workspace.yml: registered powershell/ql/extensions/**/qlpack.yml so the new pack resolves.

How it resolves the issue

The VS Code setting codeQL.runningQueries.useExtensionPacks defaults to none, so the new opt-in pack is not bundled into MRVA by default. The default submit body shrinks:

before after (default)
base64 body 2.47 MB ~1.44 MB (-42%)
tgz 1.85 MB 1.08 MB
uncompressed 17.36 MB 5.49 MB
data-ext files 3283 859

No coverage lost for anyone who wants it: setting useExtensionPacks: all re-applies the opt-in pack (validated — restores the full 3283-file model set), so full framework modeling remains available for local analysis on demand.

Notes / follow-ups

  • Result is ~1.44 MB (not "well under 1 MB") because Data/SqlClient + Crypto were deliberately kept in core; further trimming is possible if needed.
  • Recommended before merge: run codeql test run powershell/ql/test to confirm no expected-output regressions, and add a change-note if powershell-all requires one.
  • The branch is pushed; PR link: https://github.com/microsoft/codeql/pull/new/mrva-powershell-pack-split

…A payload

The microsoft/powershell-all library shipped 3283 generated framework
data-extension files (~15.4 MB, 89% of the compiled pack), which inflated the
MRVA query-pack submission body to ~2.47 MB base64 and caused variant-analysis
submit timeouts for PowerShell queries.

Move the bulk of the generated typemodels into a new opt-in model pack
microsoft/powershell-frameworks-generated (extensionTargets: microsoft/powershell-all).
The security-relevant core (System base, Management.Automation, IO, Net, Data/SqlClient,
Security, Diagnostics.Process, plus hand-authored/internal models) stays in
powershell-all. Since codeQL.runningQueries.useExtensionPacks defaults to none, the
opt-in pack is not bundled into MRVA by default, cutting the default submit body to
~1.44 MB base64. Full coverage is still available via useExtensionPacks: all.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@chanel-y
Chanel (chanel-y) force-pushed the mrva-powershell-pack-split branch from 8ee980d to d0c9bad Compare August 10, 2026 18:29
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.

1 participant