Skip to content
This repository was archived by the owner on Jan 23, 2026. It is now read-only.

Add support for transparent ZSTD compression#772

Merged
mangelajo merged 1 commit intojumpstarter-dev:mainfrom
NickCao:zstd
Dec 6, 2025
Merged

Add support for transparent ZSTD compression#772
mangelajo merged 1 commit intojumpstarter-dev:mainfrom
NickCao:zstd

Conversation

@NickCao
Copy link
Copy Markdown
Collaborator

@NickCao NickCao commented Dec 5, 2025

Summary by CodeRabbit

  • New Features

    • Added ZSTD compression as a supported content encoding option, with optional disabling via configuration.
  • Tests

    • Extended compression testing to cover ZSTD format.

✏️ Tip: You can customize this high-level summary in your review settings.

@netlify
Copy link
Copy Markdown

netlify Bot commented Dec 5, 2025

Deploy Preview for jumpstarter-docs ready!

Name Link
🔨 Latest commit 79b10a5
🔍 Latest deploy log https://app.netlify.com/projects/jumpstarter-docs/deploys/69330029207fe90008a6e7a8
😎 Deploy Preview https://deploy-preview-772--jumpstarter-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Dec 5, 2025

Walkthrough

This pull request adds Zstandard (ZSTD) compression support to the Jumpstarter compression framework. Changes include introducing a Compression.ZSTD enum member, implementing compress/decompress handling via zstd compressor and decompressor, registering ZSTD in supported encodings, extending test coverage, and adding the backports-zstd dependency for Python versions prior to 3.14.

Changes

Cohort / File(s) Summary
ZSTD Compression Implementation
packages/jumpstarter/jumpstarter/streams/encoding.py, packages/jumpstarter/jumpstarter/streams/encoding_test.py
Added Compression.ZSTD enum member with runtime conditional import for zstd. Extended compress_stream function to handle ZSTD compression and decompression. Added "zstd" to parameterized test coverage.
Driver Integration
packages/jumpstarter/jumpstarter/driver/base.py
Registered Compression.ZSTD in SUPPORTED_CONTENT_ENCODINGS, conditional on JMP_DISABLE_COMPRESSION environment variable.
Dependency Management
packages/jumpstarter/pyproject.toml
Added conditional dependency backports-zstd>=1.1.0 for Python versions below 3.14.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • The changes follow existing compression framework patterns consistently across multiple files.
  • Conditional Python version handling and dependency specification require verification of compatibility.

Possibly related PRs

Suggested reviewers

  • mangelajo

Poem

🐰 A whisker-twitch of joy, I say,
New ZSTD compressing all the way,
Zstandard zips with Python grace,
Smaller streams at faster pace!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding ZSTD compression support. It accurately reflects the modifications across multiple files including the new Compression.ZSTD enum, implementation in compress_stream, test coverage, and dependency addition.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5300757 and 79b10a5.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • packages/jumpstarter/jumpstarter/driver/base.py (1 hunks)
  • packages/jumpstarter/jumpstarter/streams/encoding.py (3 hunks)
  • packages/jumpstarter/jumpstarter/streams/encoding_test.py (1 hunks)
  • packages/jumpstarter/pyproject.toml (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.py

📄 CodeRabbit inference engine (.cursor/rules/project-structure.mdc)

Ruff should be used for code formatting and linting, excluding jumpstarter-protocol package

Files:

  • packages/jumpstarter/jumpstarter/driver/base.py
  • packages/jumpstarter/jumpstarter/streams/encoding_test.py
  • packages/jumpstarter/jumpstarter/streams/encoding.py
packages/*/pyproject.toml

📄 CodeRabbit inference engine (.cursor/rules/project-structure.mdc)

Each package's pyproject.toml must include project metadata with Apache-2.0 license only

Files:

  • packages/jumpstarter/pyproject.toml
🧠 Learnings (5)
📚 Learning: 2025-11-27T09:58:55.346Z
Learnt from: CR
Repo: jumpstarter-dev/jumpstarter PR: 0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-11-27T09:58:55.346Z
Learning: Applies to packages/jumpstarter-cli-*/pyproject.toml : CLI packages must depend on `jumpstarter` and `jumpstarter-cli-common` in their `pyproject.toml`

Applied to files:

  • packages/jumpstarter/pyproject.toml
📚 Learning: 2025-11-27T09:58:55.346Z
Learnt from: CR
Repo: jumpstarter-dev/jumpstarter PR: 0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-11-27T09:58:55.346Z
Learning: Applies to packages/jumpstarter-driver-*/pyproject.toml : Driver packages must depend on `jumpstarter` and specific hardware libraries in their `pyproject.toml`

Applied to files:

  • packages/jumpstarter/pyproject.toml
📚 Learning: 2025-11-27T09:58:55.346Z
Learnt from: CR
Repo: jumpstarter-dev/jumpstarter PR: 0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-11-27T09:58:55.346Z
Learning: Applies to packages/jumpstarter-driver-*/pyproject.toml : Driver packages must register via the `jumpstarter.drivers` entry point in `pyproject.toml`

Applied to files:

  • packages/jumpstarter/pyproject.toml
📚 Learning: 2025-11-27T09:58:55.346Z
Learnt from: CR
Repo: jumpstarter-dev/jumpstarter PR: 0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-11-27T09:58:55.346Z
Learning: Core packages must depend on `jumpstarter-protocol`

Applied to files:

  • packages/jumpstarter/pyproject.toml
📚 Learning: 2025-11-27T09:58:55.346Z
Learnt from: CR
Repo: jumpstarter-dev/jumpstarter PR: 0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-11-27T09:58:55.346Z
Learning: Applies to packages/jumpstarter-driver-*/pyproject.toml : Driver packages must follow the naming pattern `jumpstarter-driver-<name>`

Applied to files:

  • packages/jumpstarter/pyproject.toml
🧬 Code graph analysis (1)
packages/jumpstarter/jumpstarter/driver/base.py (1)
packages/jumpstarter/jumpstarter/streams/encoding.py (1)
  • Compression (18-22)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
  • GitHub Check: Redirect rules - jumpstarter-docs
  • GitHub Check: Header rules - jumpstarter-docs
  • GitHub Check: Pages changed - jumpstarter-docs
  • GitHub Check: build
  • GitHub Check: pytest-matrix (macos-15, 3.11)
  • GitHub Check: pytest-matrix (macos-15, 3.12)
  • GitHub Check: pytest-matrix (ubuntu-24.04, 3.13)
  • GitHub Check: e2e
  • GitHub Check: pytest-matrix (ubuntu-24.04, 3.11)
  • GitHub Check: pytest-matrix (macos-15, 3.13)
  • GitHub Check: pytest-matrix (ubuntu-24.04, 3.12)
🔇 Additional comments (5)
packages/jumpstarter/jumpstarter/streams/encoding_test.py (1)

17-17: LGTM!

Test coverage appropriately extended to include the new ZSTD compression format.

packages/jumpstarter/jumpstarter/driver/base.py (1)

51-51: LGTM!

ZSTD correctly registered as a supported content encoding when compression is enabled, consistent with other compression formats.

packages/jumpstarter/jumpstarter/streams/encoding.py (2)

96-101: API compatibility verified between standard library and backports zstd.

Both compression.zstd (Python 3.14+) and backports.zstd are compatible implementations. backports.zstd is an upstream-derived backport of CPython 3.14's compression.zstd, so both provide ZstdCompressor and ZstdDecompressor classes with the same API, including the required .compress(), .decompress(), and .flush() methods.


12-15: The Python 3.14 import path is correct.

The import statement from compression import zstd is the correct path for Python 3.14's standard library implementation, as specified in PEP 784. The conditional import logic is sound and no changes are needed.

packages/jumpstarter/pyproject.toml (1)

23-23: Python 3.14 zstd support and backports-zstd availability are confirmed.

Python 3.14 includes zstd in the standard library via compression.zstd (PEP 784), and backports-zstd>=1.1.0 is available on PyPI (released November 23, 2025). The conditional dependency specification is appropriate. However, verify that the conditional import pattern in encoding.py correctly imports from compression.zstd for Python 3.14+.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mangelajo mangelajo merged commit 8ef8ada into jumpstarter-dev:main Dec 6, 2025
18 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants