Skip to content

Add yarn test-safe to run code from others in a sandbox - #3212

Open
mathiasrw wants to merge 5 commits into
mainfrom
devops/sandbox
Open

mathiasrw wants to merge 5 commits into
mainfrom
devops/sandbox

Conversation

@mathiasrw

@mathiasrw mathiasrw commented Dec 2, 2026 •

Copy link
Copy Markdown
Member

yarn test-safe runs the checks of code we did not write in a sandbox. Only Bun runs, it reads and writes only its own temporary folder, and it has no network. macOS only.

  • yarn test-safe checks the current checkout.
  • yarn test-safe 3184 shows the head of a pull request and the files to read, and runs nothing.
  • yarn test-safe 3184 8cae9b96 runs the pull request merged with main, only when its head is still the SHA you read. The pull request is never checked out, so its git hooks do not run.

It first checks that the sandbox refuses files, programs, writes and network, and ends with what the code tried that the sandbox refused. test2149 (starts the command line tool) and test418 (serves files over HTTP) are not run in the sandbox.

A pull request can change package.json, so for a checkout of code from others start main's copy with an alias on your own machine.

alias test-safe='git fetch -q origin main && bash -c "$(git show origin/main:test/sandbox/sandboxed.sh)" sandboxed'

This keeps the machine safe while the code runs. It does not say that the code is safe to merge, so the diff still needs reading.

@mathiasrw mathiasrw changed the title Add yarn sandbox and yarn test-safe to run code from others without access to the machine Add yarn test-safe to run code from others in a sandbox Dec 3, 2026
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