-
-
Notifications
You must be signed in to change notification settings - Fork 640
test: apply the supply-chain age gate to npm and pnpm in Verdaccio tests #4347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
6f55d7a
e84b714
2ceba33
253b3a9
ef05bef
2dd6666
8e5e55c
268c2ad
e32241c
c8091d6
ccfc3c5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -174,9 +174,20 @@ export class BaseTemplate implements ForgeTemplate { | |
| const pm = await resolvePackageManager(); | ||
|
|
||
| if (pm.executable === 'pnpm') { | ||
| // Ensures we're using the same `pnpm` version that we use in CI. | ||
| // Records the pnpm version this template is known to work with, which is | ||
| // the one CI installs. Anything older than 11.18 is known not to: adding a | ||
| // dependency to a project that already had some could drop a package that | ||
| // another one it kept still depends on, which left `forge.config.ts` | ||
| // unable to load on Windows, where the platform-specific makers' | ||
| // dependencies are skipped and `rimraf` is the only thing left asking for | ||
| // `glob`. | ||
| // | ||
| // It is a record and not a floor. pnpm ignores `devEngines.packageManager` | ||
| // unless it is written in the object form the spec describes, and | ||
| // `create-electron-app` then has Corepack write a `packageManager` field, | ||
| // which takes precedence over this one either way. | ||
| packageJSON.devEngines = { | ||
| packageManager: 'pnpm@11.10.0', | ||
| packageManager: 'pnpm@11.21.0', | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This does not do what the comment says. pnpm ignores
In CI the tests run This predates the PR, but do not claim a floor we do not enforce. Simplest real fix is test only: have
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Comment fixed: it now documents the field as a record of the pnpm version CI installs rather than a floor, and says outright that pnpm ignores the string form and that Corepack's |
||
| }; | ||
|
|
||
| // Ensures all transitive dependencies for `electron-winstaller` are | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two things about this step, neither blocking, both for a follow up:
This installs a lot more than node-gyp. The
cdputs us inside@npmcli/run-script, which has its ownpackage.json, so npm installs that package's full devDependency tree as well. The new Windows logs showadded 880 packagesfor this step, including tap, eslint bits and a pile of deprecated stuff. It is gated now, which is the important part, but it is a much bigger surface than the step name suggests.npm install --no-save node-gyp@9.4.0or installing node-gyp somewhere else and linking it would shrink it to node-gyp and its deps only.Your note about this being inert in slow-tests is probably right.
npm install -g npm@11.19.0runs after this step and puts a different npm first on PATH, so the node-gyp we patch into$PROGRAMFILES/nodejs/node_modules/npmis not the npm that runs the tests. I have not verified it either. If it is inert we should either drop the step from slow-tests or moveInstall npmbefore it so the patch lands in the npm that actually runs.