Repository navigation
C#: Add support for zstd compression and default to it - #23346
Merged
Merged
Conversation
Allow the trap.compression extractor option to select zstd while preserving the Brotli default. Emit .trap.zst files and test option parsing and compression round trips. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: b72d8e74-03a1-42af-a982-5659fcb53469
Use zstd by default for both traced and standalone extraction, keeping Brotli available as an explicit option. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: b72d8e74-03a1-42af-a982-5659fcb53469
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Changing the default C# TRAP codec requires human confirmation of packaged .NET 11 Zstandard compatibility with CodeQL ingestion across supported platforms, beyond the local round-trip evidence.
No open issues 🎉
What changed in this PR
Adds Zstandard compression and makes it the C# extractor’s default TRAP format, aligning it with other extractors.
Changes:
- Writes Zstandard-compressed TRAP files with the
.trap.zstextension. - Updates the default compression and accepted configuration values.
- Adds round-trip and option-parsing tests.
| File | Description |
|---|---|
| csharp/extractor/Semmle.Extraction.Tests/TrapWriter.cs | Tests Zstandard round trips for empty and Unicode content. |
| csharp/extractor/Semmle.Extraction.Tests/Options.cs | Tests the new default and explicit Zstandard options. |
| csharp/extractor/Semmle.Extraction.CSharp/Extractor/TrapWriter.cs | Adds Zstandard compression and filename support. |
| csharp/extractor/Semmle.Extraction.CSharp/Extractor/CommonOptions.cs | Defaults TRAP compression to Zstandard. |
| csharp/codeql-extractor.yml | Documents and accepts the zstd option. |
Review effort: Balanced (adaptive)
michaelnebel
reviewed
Dec 4, 2026
michaelnebel
left a comment
Contributor
There was a problem hiding this comment.
Excellent work! Should we consider adding a change-note?
Contributor
Author
Good point. Yes. |
Contributor
Author
Added in 60469f7 |
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.
This makes things more uniform across extractors. The C# extractor is the last one defaulting to Brotli at the moment.
This is possible because .NET 11 now comes with Zstandard compression build in.
DCA shows about a 10% reduction in the disk spaces needed for TRAP files.