Repository navigation
Scaffold checks: install the workspace's locked versions, not the registry's newest - #108
Merged
Merged
Conversation
…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>
There was a problem hiding this comment.
🟢 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The flake
package(sdkcheck-pack.mjs) andbrowser (rest)(CLIstarter.spec.ts):npm installfails withETARGET No matching version found for playwright@1.65.1/playwright-core@1.65.1Cause
Both steps scaffold a custom renderer with
projections init --renderer customand runnpm installin 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/testresolved to 1.65.1, released Nov 13, but the registry proxy didn't list itsplaywright/playwright-core1.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.mjsandpackages/cli/browser/starter.tsnow pin each of the scaffold's registry dependencies to the version the workspace's lockfile installed (node_modules/<name>/package.json) beforenpm install. The check builds with what CI already installed and tested (today@playwright/test1.64.1,vite7.3.7,react19.3.1,typescript5.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 incheck-pack.mjsalready pinned this way.fetch-retriesfrom 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.