Skip to content

Commit d32bf2c

Browse files
authored
fix(ci): skip pkglab in latest SDK mode for e2e-staging (#8057)
1 parent a5aa803 commit d32bf2c

4 files changed

Lines changed: 15 additions & 4 deletions

File tree

.changeset/brave-dogs-wave.md

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

.github/workflows/e2e-staging.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ jobs:
187187
run: pnpm turbo test:integration:${{ matrix.test-name }} $TURBO_ARGS
188188
env:
189189
E2E_DEBUG: "1"
190+
E2E_SDK_SOURCE: ${{ steps.inputs.outputs.sdk-source }}
190191
E2E_APP_CLERK_JS_DIR: ${{ runner.temp }}
191192
E2E_APP_CLERK_UI_DIR: ${{ runner.temp }}
192193
E2E_CLERK_JS_VERSION: "latest"

integration/models/application.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,10 @@ export const application = (
7272
const nodeModulesExist = await fs.pathExists(path.resolve(appDirPath, 'node_modules'));
7373
if (force || !nodeModulesExist) {
7474
const log = logger.child({ prefix: 'setup' }).info;
75-
// Use pkglab add to install packages from the local registry
75+
// Use pkglab add to install packages from the local registry,
76+
// unless E2E_SDK_SOURCE=latest which installs from npm instead
7677
const pkglabDeps = config.pkglabDependencies;
77-
if (pkglabDeps.length > 0) {
78+
if (pkglabDeps.length > 0 && process.env.E2E_SDK_SOURCE !== 'latest') {
7879
await run(`pkglab add ${pkglabDeps.join(' ')}`, { cwd: appDirPath, log });
7980
} else {
8081
await run(scripts.setup, { cwd: appDirPath, log });

integration/models/applicationConfig.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,15 @@ export const applicationConfig = () => {
116116
}),
117117
);
118118

119-
// Adjust package.json dependencies (skip pkglab deps, those are handled by pkglab add)
120-
const npmDeps = [...dependencies.entries()].filter(([, version]) => version !== PKGLAB);
119+
// When E2E_SDK_SOURCE=latest, install pkglab deps from npm instead of local registry
120+
const usePkglab = process.env.E2E_SDK_SOURCE !== 'latest';
121+
const npmDeps = [...dependencies.entries()]
122+
.filter(([, version]) => version !== PKGLAB)
123+
.concat(
124+
usePkglab
125+
? []
126+
: [...dependencies.entries()].filter(([, version]) => version === PKGLAB).map(([name]) => [name, 'latest']),
127+
);
121128
if (npmDeps.length > 0) {
122129
const packageJsonPath = path.resolve(appDirPath, 'package.json');
123130
logger.info(`Modifying dependencies in "${packageJsonPath}"`);

0 commit comments

Comments
 (0)