Skip to content

Commit 83006e6

Browse files
fix: pin all dependency versions to exact versions (#82)
* fix: pin all dependency versions to exact versions * fix: pin all dependency versions to exact versions
1 parent 112d36b commit 83006e6

File tree

8 files changed

+1213
-1375
lines changed

8 files changed

+1213
-1375
lines changed

.yarnrc.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1+
compressionLevel: mixed
2+
3+
enableGlobalCache: false
4+
15
nodeLinker: node-modules

docs/changelog.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,21 @@
22

33
All notable changes to this project will be documented in this file.
44

5-
## [1.1.28] - Current
5+
## [1.1.29] - Current
6+
7+
### Changed
8+
9+
- **Pin all dependency versions**: Removed `^` range prefixes from all `dependencies` and `devDependencies` to use exact versions, preventing unexpected breaking changes from transitive updates. `peerDependencies` retain ranges for consumer flexibility.
10+
- **Update all dependencies to latest versions**: Bumped all packages to their latest versions except `@keycloak/keycloak-admin-client` (pinned at 26.5.6 due to broken postinstall in newer versions). Notable major bumps: `eslint` 9→10, `@eslint/js` 9→10, `typescript` 5→6, `otplib` 12→13, `lint-staged` 15→16.
11+
- **Update Yarn to 4.12.0**: Bumped `packageManager` from `yarn@3.8.7` to `yarn@4.12.0`.
12+
13+
### Fixed
14+
15+
- **Migrate `otplib` v12→v13**: Replaced removed `authenticator.generate(secret)` API with `generateSync({ secret })` in `LoginHelper`.
16+
- **Preserve error cause in re-thrown errors**: Added `{ cause: error }` to wrapped errors in `RHDHDeployment` and `KubernetesClientHelper` for better error chain traceability.
17+
- **Use optional chaining in `APIHelper.deleteUserEntityFromAPI`**: Replaced verbose null check with optional chain (`r.metadata?.uid`).
18+
19+
## [1.1.28]
620

721
- **APIHelper.createGitHubRepoWithFile**: Ensure file creation happens after repository creation.
822

package.json

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@red-hat-developer-hub/e2e-test-utils",
3-
"version": "1.1.28",
3+
"version": "1.1.29",
44
"description": "Test utilities for RHDH E2E tests",
55
"license": "Apache-2.0",
66
"repository": {
@@ -89,37 +89,37 @@
8989
"@playwright/test": "^1.57.0"
9090
},
9191
"devDependencies": {
92-
"@backstage/catalog-model": "1.7.5",
93-
"@playwright/test": "^1.57.0",
94-
"@types/fs-extra": "^11.0.4",
95-
"@types/js-yaml": "^4.0.9",
96-
"@types/lodash.clonedeepwith": "^4.5.9",
97-
"@types/lodash.mergewith": "^4.6.9",
98-
"@types/node": "^24.10.1",
99-
"@types/proper-lockfile": "^4.1.4",
100-
"husky": "^9.1.7",
101-
"lint-staged": "^15.4.3",
102-
"markdown-link-check": "^3.13.6"
92+
"@backstage/catalog-model": "1.7.7",
93+
"@playwright/test": "1.59.1",
94+
"@types/fs-extra": "11.0.4",
95+
"@types/js-yaml": "4.0.9",
96+
"@types/lodash.clonedeepwith": "4.5.9",
97+
"@types/lodash.mergewith": "4.6.9",
98+
"@types/node": "25.5.2",
99+
"@types/proper-lockfile": "4.1.4",
100+
"husky": "9.1.7",
101+
"lint-staged": "16.4.0",
102+
"markdown-link-check": "3.14.2"
103103
},
104104
"dependencies": {
105-
"@axe-core/playwright": "^4.11.0",
106-
"@backstage-community/plugin-rbac-common": "1.23.0",
107-
"@eslint/js": "^9.39.1",
105+
"@axe-core/playwright": "4.11.1",
106+
"@backstage-community/plugin-rbac-common": "1.26.0",
107+
"@eslint/js": "10.0.1",
108108
"@keycloak/keycloak-admin-client": "26.5.6",
109-
"@kubernetes/client-node": "^1.4.0",
110-
"eslint": "^9.39.1",
111-
"eslint-plugin-check-file": "^3.3.1",
112-
"eslint-plugin-playwright": "^2.4.0",
113-
"fs-extra": "^11.3.2",
114-
"js-yaml": "^4.1.1",
115-
"lodash.clonedeepwith": "^4.5.0",
116-
"lodash.mergewith": "^4.6.2",
117-
"otplib": "12.0.1",
118-
"prettier": "^3.7.4",
119-
"proper-lockfile": "^4.1.2",
120-
"typescript": "^5.9.3",
121-
"typescript-eslint": "^8.48.1",
122-
"zx": "^8.8.5"
109+
"@kubernetes/client-node": "1.4.0",
110+
"eslint": "10.2.0",
111+
"eslint-plugin-check-file": "3.3.1",
112+
"eslint-plugin-playwright": "2.10.1",
113+
"fs-extra": "11.3.4",
114+
"js-yaml": "4.1.1",
115+
"lodash.clonedeepwith": "4.5.0",
116+
"lodash.mergewith": "4.6.2",
117+
"otplib": "13.4.0",
118+
"prettier": "3.8.1",
119+
"proper-lockfile": "4.1.2",
120+
"typescript": "6.0.2",
121+
"typescript-eslint": "8.58.1",
122+
"zx": "8.8.5"
123123
},
124-
"packageManager": "yarn@3.8.7"
124+
"packageManager": "yarn@4.12.0"
125125
}

src/deployment/rhdh/deployment.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,7 @@ export class RHDHDeployment {
386386
} catch (error) {
387387
throw new Error(
388388
`RHDH deployment failed in ${namespace}: ${error instanceof Error ? error.message : error}`,
389+
{ cause: error },
389390
);
390391
}
391392

src/playwright/helpers/api-helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ export class APIHelper {
297297

298298
async deleteUserEntityFromAPI(user: string) {
299299
const r: UserEntity = await this.getCatalogUserFromAPI(user);
300-
if (!r.metadata || !r.metadata.uid) {
300+
if (!r.metadata?.uid) {
301301
return;
302302
}
303303
const url = `${this.baseUrl}/api/catalog/entities/by-uid/${r.metadata.uid}`;

src/playwright/helpers/common.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { UIhelper } from "./ui-helper.js";
2-
import { authenticator } from "otplib";
2+
import { generateSync } from "otplib";
33
import { test, expect } from "@playwright/test";
44
import type { Browser, Page, TestInfo } from "@playwright/test";
55
import { SETTINGS_PAGE_COMPONENTS } from "../page-objects/page-obj.js";
@@ -222,12 +222,12 @@ export class LoginHelper {
222222
throw new Error("Invalid User ID");
223223
}
224224

225-
return authenticator.generate(secret);
225+
return generateSync({ secret });
226226
}
227227

228228
getGoogle2FAOTP(): string {
229229
const secret = process.env.GOOGLE_2FA_SECRET as string;
230-
return authenticator.generate(secret);
230+
return generateSync({ secret });
231231
}
232232

233233
async keycloakLogin(username: string, password: string) {
@@ -302,7 +302,7 @@ export class LoginHelper {
302302
.locator("[type='submit'][value='Sign in']:not(webauthn-status *)")
303303
.first()
304304
.click({ timeout: 5000 });
305-
const twofactorcode = authenticator.generate(twofactor);
305+
const twofactorcode = generateSync({ secret: twofactor });
306306
await popup.locator("#app_totp").click({ timeout: 5000 });
307307
await popup.locator("#app_totp").fill(twofactorcode, { timeout: 5000 });
308308

src/utils/kubernetes-client.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ class KubernetesClientHelper {
4343
`Kubeconfig locations checked:\n` +
4444
` - KUBECONFIG env: ${process.env.KUBECONFIG || "(not set)"}\n` +
4545
` - Default: ~/.kube/config`,
46+
{ cause: error },
4647
);
4748
}
4849
throw error;
@@ -478,6 +479,7 @@ class KubernetesClientHelper {
478479
} catch (error) {
479480
throw new Error(
480481
`Failed to get cluster ingress domain: ${error instanceof Error ? error.message : error}`,
482+
{ cause: error },
481483
);
482484
}
483485
}
@@ -503,6 +505,7 @@ class KubernetesClientHelper {
503505
} catch (error) {
504506
throw new Error(
505507
`Failed to get route ${name} in namespace ${namespace}: ${error instanceof Error ? error.message : error}`,
508+
{ cause: error },
506509
);
507510
}
508511
}

0 commit comments

Comments
 (0)