Skip to content

Ruby: Use Zstandard compression by default - #23313

Merged
paldepind merged 1 commit into
mainfrom
ruby/zstd
Dec 3, 2026
Merged

paldepind merged 1 commit into
mainfrom
ruby/zstd

Conversation

@paldepind

@paldepind paldepind commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Use Zstandard instead of gzip as the Ruby extractor's default TRAP compression. This aligns the Rust extractor with the Rust extractor. Explicit gzip, zstd, and none settings remain supported.

To this end, the shared compression helper Compression::from_env now supports a custom default instead of only defaulting to gzip.

The DCA report looks good. Trap size is reduced by 40% (not that that's really the goal here).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: e9897f7d-b918-41e0-a2ab-e78d06744edb
@paldepind
paldepind marked this pull request as ready for review December 1, 2026 15:21
@paldepind
paldepind requested review from a team as code owners December 1, 2026 15:21
Copilot AI adaptive review requested due to automatic review settings December 1, 2026 15:21

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 active review issues are reported for the Ruby compression-default change.

No open issues 🎉

What changed in this PR

Switches the Ruby extractor’s default TRAP compression from gzip to Zstandard while preserving explicit gzip, zstd, and none settings.

Changes:

  • Makes the shared compression helper accept a caller-selected default, retaining gzip for QL and unified extractors.
  • Updates Ruby’s default and error fallback to Zstandard.
  • Adds default-compression test coverage and updates documentation.
File Description
unified/​extractor/​src/​extractor.rs Explicitly retains the gzip default.
shared/​tree-sitter-extractor/​src/​trap.rs Accepts a caller-selected default compression.
ruby/​ql/​lib/​change-notes/​2026-12-01-zstd-trap-compression.md Announces the new Ruby compression default.
ruby/​ql/​integration-tests/​compression/​test.py Tests the default with inherited compression settings cleared.
ruby/​extractor/​src/​extractor.rs Uses Zstandard by default and for configuration-error fallback.
ruby/​codeql-extractor.yml Documents Zstandard as the default.
ql/​extractor/​src/​extractor.rs Explicitly retains the gzip default.

Review effort: Balanced (adaptive)

@paldepind
paldepind requested a review from hvitved December 3, 2026 09:16

@hvitved hvitved 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.

LGTM; nice with the reduction in TRAP size. I wonder if we should just switch QL and Unified over now as well?

@paldepind

Copy link
Copy Markdown
Contributor Author

I wonder if we should just switch QL and Unified over now as well?

Yes, that makes sense. I'll do that in follow up.

@paldepind
paldepind merged commit 2ce996b into main Dec 3, 2026
39 checks passed
@paldepind
paldepind deleted the ruby/zstd branch December 3, 2026 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants