Skip to content

Run the website's Yarn outside the compiler checkout when publishing - #9240

Closed
tsnobip wants to merge 1 commit into
masterfrom
publish-website-outside-tree
Closed

tsnobip wants to merge 1 commit into
masterfrom
publish-website-outside-tree

Conversation

@tsnobip

@tsnobip tsnobip commented Nov 5, 2026

Copy link
Copy Markdown
Member

The 13.0.0-alpha.7 publish run failed in "Use Node.js for website". The npm packages and the playground bundle went out, but the API docs, website build and website playground update did not.

Why it failed

The publish job checks out rescript-lang.org at rescript-lang.org/, inside the compiler checkout. Yarn reads every .yarnrc.yml from its working directory up to the root and merges them. So the website's Yarn 4.13.0 (its yarnPath on v13) also read this repository's .yarnrc.yml. Since #8890 that file sets approvedGitRepositories, a setting Yarn 4.13.0 doesn't know, and Yarn stops with:

Usage Error: Unrecognized or legacy configuration settings found: approvedGitRepositories
(in /home/runner/work/rescript/rescript/.yarnrc.yml, /home/runner/work/rescript/rescript/rescript-lang.org/.yarnrc.yml)

The previous publish run (September 16) predates #8890, which is why this didn't happen before. Dropping cache: yarn wouldn't help, because the build step runs yarn in the same directory.

The change

A new step right after the website checkout moves rescript-lang.org to $RUNNER_TEMP and links it back. Processes started through the link run in the real directory, outside the compiler checkout. So Yarn reads only the website's .yarnrc.yml, and every later step keeps its rescript-lang.org/... paths (download-artifact, setup-node's cache-dependency-path and node-version-file, working-directory).

This keeps the job working whenever this repository moves to a newer Yarn than the website. Bumping the website's Yarn would only fix it until the next such change.

For reviewers

  • Pushing the API docs still authenticates. actions/checkout stores the deploy key as core.sshCommand in the website's .git/config, which moves with the directory, and names the key by its absolute path in $RUNNER_TEMP. Only the HTTPS token is included through an includeIf.gitdir: path, and the website's remote uses SSH.
  • The checkout's post step still cleans up. It reaches the website's .git/config through the link.
  • Testing: the publish job can only run on a release. I reproduced it locally on macOS: this repository's .yarnrc.yml, with the website's committed Yarn 4.13.0 nested as in the job. Before the step, yarn config get cacheFolder fails with the CI error. After it, the command succeeds both from a shell cd through the link (the build step) and from a spawn with the link as its cwd and a logical PWD (setup-node). Linux resolves the link to the real directory the same way. No workflow linter is configured here, so the workflow wasn't run through actionlint.

Checklist

  • Added a changelog fragment (see changes/README.md), or no release notes are needed and a maintainer should apply changelog:skip. (CI-only change, so this needs changelog:skip.)
  • Added tests for the fix or feature. (No test is possible for the publish job; tested locally as described above.)
  • Gave every commit a description below its subject, saying why it is made (see "Commit messages" in CONTRIBUTING.md).
  • Signed off every commit for the DCO (git commit -s).

🤖 Generated with Claude Code

The publish job checks out rescript-lang.org inside this checkout. Yarn
reads every .yarnrc.yml from its working directory up to the root, so
the website's Yarn 4.13.0 also read ours, which since #8890 sets
approvedGitRepositories, a setting 4.13.0 doesn't know. It stopped with
a usage error in "Use Node.js for website", so 13.0.0-alpha.7 was
published without its API docs and website playground update.

The job now moves the website checkout to $RUNNER_TEMP and links it
back. Yarn starts in the directory the link points to, so it reads only
the website's .yarnrc.yml, and the later steps keep their paths.

Review: Does pushing the API docs still authenticate? The deploy key is
the core.sshCommand in the website's .git/config, which moves with it,
and names the key by its absolute path in $RUNNER_TEMP. Only the HTTPS
token is included by gitdir path, and the website's remote uses SSH.

Review: How was this tested? Locally, with this repository's
.yarnrc.yml and the website's Yarn 4.13.0 nested as in the job: before
the step, `yarn config get cacheFolder` fails with the CI error; after
it, the command succeeds both from a shell `cd` through the link and
from a spawn with the link as its cwd, which is how setup-node runs it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Paul Tsnobiladzé <2479216+tsnobip@users.noreply.github.com>
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown

Changelog

No changelog entry.

Semantic Diff

1 commit · Full page

Run the website's Yarn outside the compiler checkout when publishing

36050db · tsnobip + Claude · Nov 05, 2026, 18:23 UTC

The publish job checks out rescript-lang.org inside this checkout. Yarn reads every .yarnrc.yml from its working directory up to the root, so the website's Yarn 4.13.0 also read ours, which since #8890 sets approvedGitRepositories, a setting 4.13.0 doesn't know. It stopped with a usage error in "Use Node.js for website", so 13.0.0-alpha.7 was published without its API docs and website playground update.

The job now moves the website checkout to $RUNNER_TEMP and links it back. Yarn starts in the directory the link points to, so it reads only the website's .yarnrc.yml, and the later steps keep their paths.

Review

  • Does pushing the API docs still authenticate? The deploy key is the core.sshCommand in the website's .git/config, which moves with it, and names the key by its absolute path in $RUNNER_TEMP. Only the HTTPS token is included by gitdir path, and the website's remote uses SSH.
  • How was this tested? Locally, with this repository's .yarnrc.yml and the website's Yarn 4.13.0 nested as in the job: before the step, yarn config get cacheFolder fails with the CI error; after it, the command succeeds both from a shell cd through the link and from a spawn with the link as its cwd, which is how setup-node runs it.

@pkg-pr-new

pkg-pr-new Bot commented Nov 5, 2026

Copy link
Copy Markdown

Open in StackBlitz

rescript

npm i https://pkg.pr.new/rescript@9240

@rescript/belt

npm i https://pkg.pr.new/@rescript/belt@9240

@rescript/darwin-arm64

npm i https://pkg.pr.new/@rescript/darwin-arm64@9240

@rescript/linux-arm64

npm i https://pkg.pr.new/@rescript/linux-arm64@9240

@rescript/linux-x64

npm i https://pkg.pr.new/@rescript/linux-x64@9240

@rescript/runtime

npm i https://pkg.pr.new/@rescript/runtime@9240

@rescript/win32-x64

npm i https://pkg.pr.new/@rescript/win32-x64@9240

commit: 36050db

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown

@tsnobip

tsnobip commented Nov 5, 2026

Copy link
Copy Markdown
Member Author

Superseded by #9236, which fixes the same Publish failure on master by moving the compiler's .yarnrc.yml aside before the website steps.

@tsnobip tsnobip closed this Nov 5, 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.

2 participants