Skip to content

fix: pin pillow + orjson in space/, bump base version to 0.4.0#19

Merged
JacobPEvans-personal merged 6 commits into
mainfrom
feat/pre-v05-fixes
Apr 26, 2026
Merged

fix: pin pillow + orjson in space/, bump base version to 0.4.0#19
JacobPEvans-personal merged 6 commits into
mainfrom
feat/pre-v05-fixes

Conversation

@JacobPEvans-personal
Copy link
Copy Markdown
Member

Summary

  • Pin pillow>=10.4.0 (3 CVEs in 9.5.0) and orjson>=3.11.6 (GHSA-hx9q-6w63-j58v) in space/requirements.txt — fixes the deploy-space CI Gate findings from PR feat: production polish — package layout, CI, viewer, docs #15.
  • Bump .release-please-manifest.json + pyproject.toml from 0.2.00.4.0 so the next feat: push opens a release-please PR for v0.5.0.
  • Drop a stale # type: ignore[no-untyped-call] on pq.write_table() (now flagged by warn_unused_ignores); reconfigure pre-commit's mypy to match local-venv behavior on pyarrow.
  • Document the secrets-sync flow in CONTRIBUTING.md so contributors know where HF_TOKEN / GH_APP_PRIVATE_KEY / GH_ACTION_JACOBPEVANS_APP_ID come from.

Why now

We brought the repo up to senior-reviewer-ready state in PR #15, but two CI workflows were still red:

  1. release-please — failing every push because the workflow needs GH_APP_PRIVATE_KEY and GH_ACTION_JACOBPEVANS_APP_ID secrets, which weren't synced to this repo. That's why no releases ever published.
  2. deploy-space — failing because HF_TOKEN was empty (Illegal header value b'Bearer ').

The secrets are now distributed via secrets-sync#71. Once that merges and the sync workflow runs, both release-please and deploy-space will work for the next push.

The pillow/orjson pins close the remaining open CI Gate security findings on this side.

Test plan

  • ruff check . && ruff format --check . — clean
  • mypy src/mlx_benchmarks — clean (strict mode)
  • pytest tests space/tests — 26 passed
  • python scripts/validate_schema.py — clean
  • pre-commit run --all-files — all hooks pass
  • After merge: verify release-please opens a v0.5.0 PR (depends on secrets-sync#71 landing first)
  • After merge: verify deploy-space pushes the viewer to the HF Space

Manual prerequisite

Before secrets-sync#71 can succeed, mlx-benchmarks must be added to the GH_PAT_SECRETS_SYNC_ACTION PAT's repository access list (the sync workflow validates PAT access at runtime and fails fast). This is a manual step in the PAT settings page.

Refs

Several small fixes required before cutting v0.5.0:

- **space/requirements.txt**: pin `pillow>=10.4.0` (3 CVEs in 9.5.0) and
  `orjson>=3.11.6` (GHSA-hx9q-6w63-j58v in 3.9.9). Both come in transitively
  through gradio. Resolves the deploy-space CI Gate failure.

- **release-please base version**: bump `.release-please-manifest.json` and
  `pyproject.toml` from `0.2.0` → `0.4.0`. release-please has been failing
  every push since being added in #15 (missing GH App secrets, fixed
  separately in secrets-sync), so no actual releases were published.
  Bumping the base now means the next release-please PR proposes `0.5.0`
  on top of the polish work.

- **publish.py**: drop a stale `# type: ignore[no-untyped-call]` on
  `pq.write_table()`. With pyarrow excluded from pre-commit's mypy
  additional_dependencies, both pre-commit and local mypy now use the
  pyproject `ignore_missing_imports = true` override and treat the call
  as Any-typed. The ignore was tripping `warn_unused_ignores` locally.

- **.pre-commit-config.yaml**: bump mypy 1.11.2 → 1.20.2 to match the
  project venv, and document why `pyarrow` is excluded from the hook's
  additional_dependencies.

- **CONTRIBUTING.md**: document the secret-sync flow so contributors
  understand where `HF_TOKEN`, `GH_APP_PRIVATE_KEY`, and
  `GH_ACTION_JACOBPEVANS_APP_ID` come from for forks vs upstream CI.

Companion: secrets-sync#71 distributes `HF_TOKEN` and the GH App secrets
to this repo's Actions secrets.

Refs: #18 (lm-eval transitive vulns — long-running tracker)
Copilot AI review requested due to automatic review settings April 25, 2026 21:42
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request bumps the project version to 0.4.0, adds documentation for CI secrets and external synchronization in CONTRIBUTING.md, and addresses security vulnerabilities by pinning pillow and orjson in space/requirements.txt. It also modifies the mypy configuration to improve type checking behavior with pyarrow. A review comment points out that the specified version for mirrors-mypy (v1.20.2) is likely invalid and should be corrected to a stable release to prevent CI failures.

Comment thread .pre-commit-config.yaml
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses CI security gate findings for the HF Space viewer, updates release/version metadata for the next release-please cycle, and aligns type-checking behavior/docs for contributors and pre-commit.

Changes:

  • Add minimum secure versions for pillow and orjson in space/requirements.txt to address known CVEs/advisories.
  • Bump project version metadata from 0.2.0 to 0.4.0 across release-please/packaging artifacts.
  • Remove a now-unused mypy ignore in publish.py and adjust the pre-commit mypy hook configuration; document CI secrets sourcing in CONTRIBUTING.md.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
uv.lock Updates the editable package version to 0.4.0 in the lockfile.
src/mlx_benchmarks/publish.py Drops an unused mypy suppression on pq.write_table().
space/requirements.txt Adds minimum versions for pillow/orjson to remediate security findings.
pyproject.toml Bumps the package version to 0.4.0.
CONTRIBUTING.md Documents how CI secrets are sourced/distributed via secrets-sync.
.release-please-manifest.json Bumps release-please manifest to 0.4.0.
.pre-commit-config.yaml Updates mypy hook rev and adjusts dependencies/notes for pyarrow typing behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pyproject.toml
Comment thread space/requirements.txt Outdated
Three categories of CI Gate findings from the prior commit's run:

1. **Markdown lint (98 errors)**: padded all compact-style table separator
   rows from `|---|` to `| --- |`, converted long badge URLs in `README.md`
   and architecture-doc table cells to link references, broke long shell
   commands across multiple lines, removed an extra H1 in `space/README.md`
   that conflicted with the HF-Spaces YAML `title:` field, and added
   language hints to two unmarked fenced code blocks. All 12 markdown files
   now pass org-wide markdownlint config.

2. **OSV / pip-audit (vllm + torch CVEs)**: removed the `[vllm]` optional
   extra from `pyproject.toml`. The vllm Python package is Linux/CUDA-only
   and isn't installable on the Apple-Silicon dev platform. The vllm
   converter only parses JSON output from an external `vllm benchmark_serving`
   run — it doesn't import vllm at runtime. With the extra removed,
   `uv lock` no longer pulls in vllm 0.5.0.post1 or torch 2.3.0, which
   eliminates 9+ CVEs from the lockfile. Documented the new install path
   in pyproject.toml comments.

3. **mypy `no-untyped-call` regression**: pyarrow ships no type stubs, so
   `pq.write_table()` reads as untyped under mypy 1.20.x in CI's `uv sync`
   environment but is treated as `Any` under the local devenv's stub
   resolution. Restored the `# type: ignore[unused-ignore,no-untyped-call]`
   so both environments converge — the `unused-ignore` clause silences
   `warn_unused_ignores` locally where the ignore isn't strictly needed.

Remaining lm-eval transitive vulnerabilities (sqlitedict, diskcache,
transformers 4.57.6) are tracked in #18; they have no fix on a stable
upstream line we can adopt today.
Final CI Gate fix: add documented per-CVE acknowledgement for
GHSA-g4r7-86gm-pgqc (sqlitedict 2.1.0 / CVE-2024-35515) — the unfixable
lm-eval transitive dep flagged on every CI run.

- `osv-scanner.toml`: local override config picked up by the central
  `_osv-scan.yml` reusable workflow. ignoreUntil set to 2026-10-25 to
  force a quarterly review. Reason links to tracking issue #18 and
  documents the exploitability surface.

- `ci-gate.yml`: pass `ignore-vulns: GHSA-g4r7-86gm-pgqc` to the
  `_python-security.yml` reusable workflow. Same documentation pattern
  — comment block above the ID lists the tracking issue, source dep,
  and exploitability assessment.

Both are narrow per-CVE acceptance, not blanket suppressions. New
findings still fail the build. The new `ignore-vulns` input is added
to the central workflow in JacobPEvans-personal/.github#233 — once that merges,
this PR's CI will go green.

Refs: #18 (lm-eval transitive vulns tracking issue),
JacobPEvans-personal/.github#233 (central workflow input).
- Bump `__version__` in `src/mlx_benchmarks/__init__.py` from "0.2.0" to
  "0.4.0" to match `pyproject.toml` and `.release-please-manifest.json`.
  release-please-config.json already tracks both files via `extra-files`,
  so this is just catching up the third anchor.

- Reword the comment block in `space/requirements.txt` from "Pin
  transitive deps" to "Minimum-version requirements" to accurately
  describe the lower-bound constraints. The CVE notes and version
  thresholds are unchanged.
The previous run failed with startup_failure because
`_python-security.yml@main` did not yet declare the `ignore-vulns`
input that ci-gate.yml passes. That input shipped in the merged
`feat: add ignore-vulns input` PR. No code changes here.
Replace the secrets-sync/Doppler-specific CI secrets section with a
generic "for forks" note covering only what an external contributor
actually needs to provide.

(claude)
@JacobPEvans-personal JacobPEvans-personal merged commit 5bf37d4 into main Apr 26, 2026
13 checks passed
@JacobPEvans-personal JacobPEvans-personal deleted the feat/pre-v05-fixes branch April 26, 2026 01:11
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.

2 participants