Skip to content

tests: forward CELLO_ESBUILD through the hermetic harness - #89

Merged
ryuzdev merged 1 commit into
mainfrom
cello/test-harness-esbuild
Nov 20, 2026
Merged

ryuzdev merged 1 commit into
mainfrom
cello/test-harness-esbuild

Conversation

@ryuzdev

@ryuzdev ryuzdev commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Summary

The hermetic test harness (crates/cello/tests/common/mod.rs) runs
command.env_clear() and only forwards PATH, TMPDIR, and a
fixture-scoped HOME. A CELLO_ESBUILD set by the developer or CI never
reached the cello dev child, so on any box whose esbuild on PATH is
a wrapper script (mise shim), the bundling conformance targets failed with
run esbuild /usr/bin/mise: Permission denied.

apply_hermetic_env now forwards CELLO_ESBUILD when it is set — and
nothing else ambient. Hermeticity is unchanged: the CELLD_HERMETIC_CANARY
tripwire stays cleared, so a spawn that leaked the ambient environment
would still make cello refuse to start (CI runs the suite with
CELLD_HERMETIC_CANARY=1 for exactly this reason), and per-test
extra_env still wins because it is applied last.

Changes

  • crates/cello/tests/common/mod.rs: forward CELLO_ESBUILD when set;
    doc comment updated.
  • crates/cello/tests/hermetic_esbuild_env.rs (new): unit test asserting
    CELLO_ESBUILD reaches the built child command, CELLD_HERMETIC_CANARY
    / RUST_LOG do not, and an unset CELLO_ESBUILD leaves no key behind.
    Fails before the fix (left: None), passes after.
  • CONTRIBUTING.md: "Testing locally" section documenting the hermetic
    allowlist and the CELLO_ESBUILD knob.

Docker/CI

No change needed: the Dockerfile test stage installs the real esbuild at
/usr/local/bin/esbuild (found via PATH, as before) with
CELLO_ESBUILD unset; .github/workflows/ci.yml just builds the image.

Gates

  • cargo clippy --profile release --locked --all-targets -- -D warnings: clean.
  • Full cargo test --profile release --locked --no-fail-fast with a
    shim-first PATH (broken esbuild first) and CELLO_ESBUILD pointing
    at the real binary: green.
  • New hermetic_esbuild_env test: fails with the fix reverted, passes
    with it.

Summary by CodeRabbit

  • Documentation
    • Added guidance for configuring the esbuild binary when running local tests, including troubleshooting permission errors.
    • Clarified which environment settings are available to test processes and how unrelated inherited settings are handled.
  • Tests
    • Added checks that the configured esbuild path is forwarded when set, while unrelated environment variables remain excluded.

- apply_hermetic_env passes CELLO_ESBUILD through when set, so a wrapper-script esbuild on PATH (mise shim) no longer breaks bundling conformance targets.
- Nothing else ambient is forwarded; the CELLD_HERMETIC_CANARY tripwire stays cleared.
- announced/forward_announce gain the same allow(dead_code) the other helpers carry (new unit-test binary uses only cello_command).
- New hermetic_esbuild_env unit test: fails before the fix, passes after.
- CONTRIBUTING.md documents the hermetic allowlist and the knob.
@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The test harness now forwards CELLO_ESBUILD when it is set, while continuing to clear other ambient environment variables. A new test inspects the child command’s environment, and contributor guidance describes the hermetic environment and esbuild setup.

Changes: Hermetic esbuild environment

Layer / File(s) Summary
Forward and verify CELLO_ESBUILD
crates/cello/tests/common/mod.rs, crates/cello/tests/hermetic_esbuild_env.rs, CONTRIBUTING.md
The test helper forwards CELLO_ESBUILD when set. The new test checks that it is forwarded, that CELLD_HERMETIC_CANARY and RUST_LOG are excluded, and that CELLO_ESBUILD is absent when unset. Contributor guidance documents the allowlist, the canary, and the esbuild override. The test helper’s announced and forward_announce functions allow dead code in test binaries that do not use them.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Possibly related PRs

  • ryuzcorp/cello#81: Introduces the cello_command helper whose child-environment allowlist this change extends.
  • ryuzcorp/cello#85: Documents the prior CELLO_ESBUILD limitation in the same hermetic test environment.
Merge Risk: Minimal · up to 17e36

This change only affects the test harness and contributor documentation. It lets a CELLO_ESBUILD override reach the child process in tests and adds a focused regression test. It has no production impact and is low risk to merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "tests: forward CELLO_ESBUILD through the hermetic harness" names the main change. The PR changes the test harness in crates/cello/tests/common/mod.rs so that CELLO_ESBUILD reaches the cello…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "tests: forward CELLO_ESBUILD through the hermetic harness" names the main change. The PR changes the test harness in crates/cello/tests/common/mod.rs so that CELLO_ESBUILD reaches the cello dev child process when set. The title is specific, concise, and matches the objectives and the file-level summaries. It omits the supporting test and documentation changes, which the title does not need to cover.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 283dabb3-867f-4952-a167-0a7d800ac4b3
Commits

Reviewing files that changed from the base of the PR and between 21113df and 17e361d.

Files selected for processing: 3

  • CONTRIBUTING.md
  • crates/cello/tests/common/mod.rs
  • crates/cello/tests/hermetic_esbuild_env.rs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@ryuzdev
ryuzdev merged commit a22d88c into main Nov 20, 2026
3 checks passed
@ryuzdev
ryuzdev deleted the cello/test-harness-esbuild branch November 20, 2026 09:06
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