Skip to content

Isolate playground builds from deployment credentials - #27839

Merged
zanieb merged 4 commits into
astral-sh:mainfrom
zaniebot:agent/isolate-playground-deployments
Aug 20, 2026
Merged

zanieb merged 4 commits into
astral-sh:mainfrom
zaniebot:agent/isolate-playground-deployments

Conversation

@zaniebot

@zaniebot zaniebot commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

The playground release jobs run npm run check and the builds on the runner that later receives CF_API_TOKEN. Move those commands into unprivileged jobs and pass named, digest-verified static artifacts to fresh release-playground jobs. The publishers reject symlinks, special files, and Pages server-code entrypoints before deployment. This isolates the playground build tools; it does not remove the publisher's Wrangler dependency. Locking that tooling is handled separately in #27838.

Related: astral-sh/ruff-vscode#1152 and astral-sh/ty-vscode#526 reduce the dependency trees installed by the marketplace publishers.

zanieb pushed a commit that referenced this pull request Aug 18, 2026
The WebAssembly test and npm publication jobs select `node-version: 24`,
so the Node.js and bundled `npm` versions can change between runs
without a workflow change. Pin both selectors to `24.19.0`, keeping the
existing Node major and publication permissions. The existing Renovate
GitHub Actions manager continues to track these inputs.

Related: #27838, #27839, and
#27844 pin the playground runtimes; #27842
covers the `prek`-managed runtime. astral-sh/packse#326 makes the
corresponding exact Node.js 24 pin for formatter CI.

Co-authored-by: zaniebot <[email protected]>
Comment on lines +78 to +85
test -f playground/ruff/dist/index.html
# Pages treats these paths as server-side code, not static assets.
test ! -e playground/ruff/dist/_worker.js
test ! -e functions
if [[ -n "$(find playground/ruff/dist ! -type f ! -type d -print -quit)" ]]; then
echo "Playground artifacts must contain only regular files and directories"
exit 1
fi

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These checks are a little goofy but I guess are inoffensive?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we add a comment explaining why they're there? Like, what's the motivation. It's otherwise very likely that someone will remove them in the future (or we make a change that breaks them but we'll never know because they still pass and we don't know what this thing is even supposed to do)

Comment on lines +89 to +100
test -f playground/ty/dist/index.html
test -f playground/ty/dist/assets/pyodide.asm.mjs
test -f playground/ty/dist/assets/pyodide.asm.wasm
test -f playground/ty/dist/assets/pyodide-lock.json
test -f playground/ty/dist/assets/python_stdlib.zip
# Pages treats these paths as server-side code, not static assets.
test ! -e playground/ty/dist/_worker.js
test ! -e functions
if [[ -n "$(find playground/ty/dist ! -type f ! -type d -print -quit)" ]]; then
echo "Playground artifacts must contain only regular files and directories"
exit 1
fi

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@zanieb
zanieb marked this pull request as ready for review August 18, 2026 20:46
@zanieb zanieb added the ci Related to internal CI tooling label Aug 18, 2026
Comment on lines +78 to +85
test -f playground/ruff/dist/index.html
# Pages treats these paths as server-side code, not static assets.
test ! -e playground/ruff/dist/_worker.js
test ! -e functions
if [[ -n "$(find playground/ruff/dist ! -type f ! -type d -print -quit)" ]]; then
echo "Playground artifacts must contain only regular files and directories"
exit 1
fi

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we add a comment explaining why they're there? Like, what's the motivation. It's otherwise very likely that someone will remove them in the future (or we make a change that breaks them but we'll never know because they still pass and we don't know what this thing is even supposed to do)

zanieb pushed a commit that referenced this pull request Aug 19, 2026
Pinning `cloudflare/wrangler-action` does not pin the `wrangler@4`
package it installs during deployment. Install Wrangler from a
dedicated, committed lockfile with lifecycle scripts disabled, then
invoke that local executable directly. Require `npm>=11.10.0` with
`engines.npm` and `engine-strict` so older clients cannot silently
ignore the seven-day `min-release-age` policy, and pin Node.js to
`24.19.0` at the install sites. Both playgrounds now use the reviewed
dependency tree already recorded for the playground API, and Cloudflare
credentials are passed only to the deployment command.

Related: #27839 isolates the playground builds from
deployment credentials, and #27844 enforces the
corresponding `npm` floor in the existing package roots.
astral-sh/ruff-vscode#1152 and astral-sh/ty-vscode#526 likewise give
credentialed publishers their own locked toolchains.

---------

Co-authored-by: zaniebot <[email protected]>
zanieb added a commit to astral-sh/ruff-vscode that referenced this pull request Aug 20, 2026
Marketplace publishing already consumes prebuilt VSIX files, but each
publisher installs the extension's complete development dependency tree.
Give `scripts/publish` an independent lockfile containing the existing
`@vscode/vsce` and `ovsx` versions, and install it with dependency
lifecycle scripts disabled. Require `npm>=11.10.0` with `engines.npm`
and `engine-strict`, and apply a seven-day `min-release-age` to new
resolutions. Invoke the locked binaries directly so publishing cannot
fall back to an unpinned `npx` download. The packaging jobs and
published VSIX artifacts are unchanged.

Related: astral-sh/ty-vscode#526 applies the same publisher split to ty,
while #1151 sets the install-script policy for the
full extension project. #1153 applies the matching
seven-day policy to the full extension project. astral-sh/ruff#27839
isolates playground builds from their publisher.

---------

Co-authored-by: Zanie Blue <[email protected]>
@zanieb
zanieb merged commit d53c8c5 into astral-sh:main Aug 20, 2026
47 checks passed
zanieb added a commit to astral-sh/ty-vscode that referenced this pull request Sep 3, 2026
Marketplace publishing already consumes prebuilt VSIX files, but each
publisher installs the extension's complete development dependency tree.
Give `scripts/publish` an independent lockfile containing the existing
`@vscode/vsce` and `ovsx` versions, and install it with dependency
lifecycle scripts disabled. Require `npm>=11.10.0` with `engines.npm`
and `engine-strict`, and apply a seven-day `min-release-age` to new
resolutions. Invoke the locked binaries directly so publishing cannot
fall back to an unpinned `npx` download. The packaging jobs and
published VSIX artifacts are unchanged.

Related: astral-sh/ruff-vscode#1152 applies the same publisher split to
Ruff, while #525 sets the install-script policy for
the full extension project. #527 applies the matching
seven-day policy to the full extension project. astral-sh/ruff#27839
isolates playground builds from their publisher.

---------

Co-authored-by: Zanie Blue <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Related to internal CI tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants