Skip to content

Scaffold checks: install the workspace's locked versions, not the registry's newest - #108

Merged
agorischek merged 2 commits into
mainfrom
fresh-installs-pinned
Nov 20, 2026
Merged

agorischek merged 2 commits into
mainfrom
fresh-installs-pinned

Conversation

@agorischek

Copy link
Copy Markdown
Collaborator

The flake

Failure (Nov 20) Jobs PRs
package (sdk check-pack.mjs) and browser (rest) (CLI starter.spec.ts): npm install fails with ETARGET No matching version found for playwright@1.65.1 / playwright-core@1.65.1 ≥5 #91, #92, #99, #101, #103

Cause

Both steps scaffold a custom renderer with projections init --renderer custom and run npm install in a fresh directory outside the workspace. That install ignores the lockfile and resolves the template's ranges (@playwright/test: ^1.55.0, vite: ^7.1.0, …) against the live registry. @playwright/test resolved to 1.65.1, released Nov 13, but the registry proxy didn't list its playwright/playwright-core 1.65.1 yet, so the install failed. Every new upstream release opens the same window, and the failure has nothing to do with the change under test.

Fix

  • check-pack.mjs and packages/cli/browser/starter.ts now pin each of the scaffold's registry dependencies to the version the workspace's lockfile installed (node_modules/<name>/package.json) before npm install. The check builds with what CI already installed and tested (today @playwright/test 1.64.1, vite 7.3.7, react 19.3.1, typescript 5.9.3). A range whose major version disagrees with the installed version fails loudly, because then the template and the workspace have drifted apart. Dependencies that aren't registry ranges (the SDK tarball URL or path) are left alone. The consumer installs earlier in check-pack.mjs already pinned this way.
  • For genuine registry trouble, these scratch installs raise npm's own fetch-retries from 2 to 5. npm retries only network errors and 408/429/5xx responses, never a missing version, so this is a bounded retry for an external dependency, not a mask for real failures.

…istry's newest

check-pack.mjs (the package job) and the CLI's starter browser specs (browser
rest) npm-install a freshly scaffolded renderer, whose package.json asks for
ranges such as @playwright/test ^1.55.0. Resolved against the live registry,
that took 1.65.1, released Nov 13, whose playwright-core the registry mirror
didn't list yet: ETARGET No matching version found for playwright-core@1.65.1,
on #91, #92, #99, #101 and #103 on Nov 20. Every new release could do the same.

Both now pin the scaffold's registry dependencies to the versions this
workspace's lockfile installed (failing if a range and the installed version
disagree on the major version), so they build with what CI already tested.
npm also retries a request that fails on the network or with a 5xx five times
rather than twice; it never retries a missing version.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are recorded for the workspace dependency-pinning and npm retry changes.

No open issues 🎉

What changed in this PR

This PR reduces registry-related flakes in SDK packaging checks and CLI browser tests by using workspace-installed dependency versions for temporary custom-renderer scaffolds.

Changes:

  • Pin eligible scaffold dependencies to workspace-installed versions before installation, rejecting major-version mismatches.
  • Leave non-registry dependencies, such as SDK tarball paths, unchanged.
  • Default npm fetch retries to five for scratch installs while preserving explicit overrides.
File Description
packages/​sdk/​scripts/​check-pack.mjs Pins scaffold dependencies before the packaging check’s install and increases default fetch retries.
packages/​cli/​browser/​starter.ts Applies the same dependency pinning and retry settings to the CLI browser-test scaffold.

Review effort: Balanced

…k's complexity

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@agorischek
agorischek merged commit f70cdb7 into main Nov 20, 2026
62 checks passed
@agorischek
agorischek deleted the fresh-installs-pinned branch November 20, 2026 23:35
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