Skip to content

Commit c5fd14c

Browse files
authored
chore(e2e): pin transitive deps to trusted-publisher floor (#8522)
1 parent 4b44732 commit c5fd14c

5 files changed

Lines changed: 154 additions & 182 deletions

File tree

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

integration/constants.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,18 @@ export const constants = {
8888
INTEGRATION_INSTANCE_KEYS: process.env.INTEGRATION_INSTANCE_KEYS,
8989
INTEGRATION_STAGING_INSTANCE_KEYS: process.env.INTEGRATION_STAGING_INSTANCE_KEYS,
9090
} as const;
91+
92+
/**
93+
* Floor versions of transitive deps that carry pnpm "trustedPublisher" evidence.
94+
* Injected as `pnpm.overrides` into every fixture's tmp `package.json` so that
95+
* isolated installs satisfy pnpm 10's trust-downgrade check. Sourced from the
96+
* 2026-05-11 npm supply-chain incident response (mini Shai-Hulud worm).
97+
* Update when upstream packages publish newer versions via OIDC trusted publisher.
98+
*/
99+
export const TRUSTED_OVERRIDES: Record<string, string> = {
100+
'semver@<7.7.3': '7.7.4',
101+
'chokidar@<5.0.0': '5.0.0',
102+
'undici-types@<7.16.0': '7.24.8',
103+
'tailwind-merge@<3.4.0': '3.4.0',
104+
'vite@<7.1.3': '7.3.3',
105+
};

integration/models/applicationConfig.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as path from 'node:path';
22

33
import type { AccountlessApplication } from '@clerk/backend';
44

5-
import { constants } from '../constants';
5+
import { constants, TRUSTED_OVERRIDES } from '../constants';
66
import { PKGLAB } from '../presets/utils';
77
import { createLogger, fs } from '../scripts';
88
import { application } from './application';
@@ -125,13 +125,22 @@ export const applicationConfig = () => {
125125
? []
126126
: [...dependencies.entries()].filter(([, version]) => version === PKGLAB).map(([name]) => [name, 'latest']),
127127
);
128+
const packageJsonPath = path.resolve(appDirPath, 'package.json');
129+
const contents = await fs.readJSON(packageJsonPath);
128130
if (npmDeps.length > 0) {
129-
const packageJsonPath = path.resolve(appDirPath, 'package.json');
130131
logger.info(`Modifying dependencies in "${packageJsonPath}"`);
131-
const contents = await fs.readJSON(packageJsonPath);
132132
contents.dependencies = { ...contents.dependencies, ...Object.fromEntries(npmDeps) };
133-
await fs.writeJSON(packageJsonPath, contents, { spaces: 2 });
134133
}
134+
// Pin transitives to versions with pnpm "trustedPublisher" evidence so the
135+
// isolated tmp install passes pnpm 10's trust-downgrade check.
136+
contents.pnpm = {
137+
...(contents.pnpm ?? {}),
138+
overrides: {
139+
...(contents.pnpm?.overrides ?? {}),
140+
...TRUSTED_OVERRIDES,
141+
},
142+
};
143+
await fs.writeJSON(packageJsonPath, contents, { spaces: 2 });
135144

136145
return application(self, appDirPath, appDirName, serverUrl);
137146
},

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,15 @@
161161
"msw"
162162
],
163163
"overrides": {
164+
"chokidar@<5.0.0": "5.0.0",
164165
"react": "catalog:react",
165166
"react-dom": "catalog:react",
166167
"rolldown": "catalog:repo",
167-
"utf-8-validate": "5.0.10"
168+
"semver@<7.7.3": "7.7.4",
169+
"tailwind-merge@<3.4.0": "3.4.0",
170+
"undici-types@<7.16.0": "7.24.8",
171+
"utf-8-validate": "5.0.10",
172+
"vite@<7.1.3": "7.3.3"
168173
}
169174
}
170175
}

0 commit comments

Comments
 (0)