CONSOLE-5235: Migrate basic app Cypress e2e tests to Playwright#16431
CONSOLE-5235: Migrate basic app Cypress e2e tests to Playwright#16431stefanonardo wants to merge 1 commit into
Conversation
|
@stefanonardo: This pull request references CONSOLE-5235 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughConverts Cypress-based E2E to Playwright: adds KubernetesClient readiness helpers, BasePage retry, six Playwright page-objects, many Playwright specs (with setup/teardown and WebSocket routing), config/selector updates, docs/skill edits, and removes legacy Cypress artifacts. ChangesPlaywright E2E migration
Sequence Diagram(s): none generated. Estimated code review effort: Possibly related PRs:
Suggested reviewers:
🚥 Pre-merge checks | ✅ 13 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (13 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 6
🧹 Nitpick comments (6)
frontend/e2e/pages/catalog-page.ts (1)
6-8: ⚡ Quick winUse the stable
data-testattribute for the keyword filter input.The underlying SearchInput component (CatalogToolbar.tsx) provides
data-test="search-catalog". Update the selector from'input[placeholder*="Filter by keyword"]'tothis.page.getByTestId('search-catalog')to avoid brittleness from placeholder text changes and i18n updates. Aligns with the existing pattern used incatalogItem(testId)on line 19.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@frontend/e2e/pages/catalog-page.ts` around lines 6 - 8, Replace the brittle placeholder-based locator for the keyword filter by updating the private field filterInput (type Locator) to use the stable test id selector: use this.page.getByTestId('search-catalog') instead of 'input[placeholder*="Filter by keyword"]' so the CatalogToolbar's data-test="search-catalog" is targeted like catalogItem(testId) does.frontend/e2e/tests/console/app/masthead.spec.ts (1)
58-67: ⚡ Quick winAdd a post-logout assertion to avoid false positives.
The test currently validates only clicks. Please assert an observable logout outcome (URL/login screen/auth redirect) after Line 67.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@frontend/e2e/tests/console/app/masthead.spec.ts` around lines 58 - 67, The test only performs clicks and can falsely pass; after calling MastheadPage.clickLogOut() add a concrete post-logout assertion: if using URL-based redirect, await page.waitForURL(...) or expect(page).toHaveURL(...) for the login or landing path; alternatively assert a login-related UI element via MastheadPage (e.g., expect(masthead.loginButton).toBeVisible() or expect(masthead.isAuthenticated()).resolves.toBe(false)). Use the existing MastheadPage helpers (isAuthDisabled, openUserDropdown, clickLogOut) and add the appropriate await/expect to verify the app reached the logged-out state.frontend/e2e/tests/console/app/filtering-and-searching.spec.ts (1)
27-55: ⚡ Quick winDrop
as anyfor the deployment body.Line 54 removes compile-time guarantees for your setup manifest. Prefer a typed value using
satisfiesagainstcreateDeploymentinput.Suggested fix
- await client.createDeployment(ns, { + const deployment = { apiVersion: 'apps/v1', kind: 'Deployment', metadata: { name: workloadName, labels: { 'lbl-filter': ns, app: 'name' }, }, spec: { replicas: 3, selector: { matchLabels: { app: 'name' } }, template: { metadata: { labels: { app: 'name' } }, spec: { securityContext: { runAsNonRoot: true, seccompProfile: { type: 'RuntimeDefault' } }, containers: [ { name: 'httpd', image: 'image-registry.openshift-image-registry.svc:5000/openshift/httpd:latest', securityContext: { allowPrivilegeEscalation: false, capabilities: { drop: ['ALL'] }, }, }, ], }, }, }, - } as any); + } satisfies Parameters<KubernetesClient['createDeployment']>[1]; + await client.createDeployment(ns, deployment);As per coding guidelines: “Avoid using
anytype; flag use ofanytype and suggest proper type definitions”.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@frontend/e2e/tests/console/app/filtering-and-searching.spec.ts` around lines 27 - 55, Remove the unsafe "as any" cast on the deployment manifest and instead satisfy the actual parameter type expected by client.createDeployment; replace the trailing "as any" with "satisfies Parameters<typeof client.createDeployment>[1]" (or the concrete input type for createDeployment) so the manifest literal (the object passed to client.createDeployment in the test) is type-checked, keeping the rest of the call to client.waitForDeploymentReady(workloadName, ns) unchanged.frontend/e2e/pages/masthead-page.ts (1)
33-35: ⚡ Quick winReplace
anyinisAuthDisabledwith a narrow window type.Line 34 can be fully typed without
any, keeping strict checks intact.Suggested fix
async isAuthDisabled(): Promise<boolean> { - return this.page.evaluate(() => !!(window as any).SERVER_FLAGS?.authDisabled); + return this.page.evaluate(() => { + const flags = (window as Window & { SERVER_FLAGS?: { authDisabled?: boolean } }).SERVER_FLAGS; + return Boolean(flags?.authDisabled); + }); }As per coding guidelines: “Avoid using
anytype; flag use ofanytype and suggest proper type definitions”.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@frontend/e2e/pages/masthead-page.ts` around lines 33 - 35, The isAuthDisabled method uses (window as any) which bypasses typings; replace it with a narrow Window interface that includes optional SERVER_FLAGS with authDisabled and use that type in the page.evaluate callback. Add a local type or interface like interface WindowWithServerFlags { SERVER_FLAGS?: { authDisabled?: boolean } } and then change the evaluate body to cast window to WindowWithServerFlags (or declare it in the callback signature) so the expression becomes !!(windowAsTyped.SERVER_FLAGS?.authDisabled) while removing any usage; update the function isAuthDisabled to use that typed window reference.frontend/e2e/pages/logs-page.ts (1)
16-18: ⚡ Quick winUse stable test IDs instead of placeholder/class-based locators
Line 16-18 rely on a localized placeholder and CSS classes, which are brittle for long-term e2e stability. Prefer
data-test-backed locators for these elements as well.As per coding guidelines:
**/*.{tsx,ts}: Preferdata-testattributes for Cypress selectors ... over brittle CSS or ARIA selectors.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@frontend/e2e/pages/logs-page.ts` around lines 16 - 18, Replace brittle locators in logs-page.ts with data-test-backed selectors: update the Locator definitions searchInput, searchMatches, and logText to use stable data-test attributes (e.g., page.locator('[data-test="logs-search"]'), page.locator('[data-test="logs-match"]'), page.locator('[data-test="log-text"]')) instead of the placeholder or class-based selectors, and ensure the corresponding components/templates include those data-test attributes so the tests can target them reliably.frontend/e2e/tests/console/app/resource-log.spec.ts (1)
92-92: ⚡ Quick winDrop
as anyfor Pod specs to preserve type safetyLine 92, 126, and 127 cast Pod specs to
any, which hides schema mistakes in test fixtures. Please use a concrete k8s resource type for these objects.As per coding guidelines:
**/*.{ts,tsx}: Avoid usinganytype; flag use ofanytype and suggest proper type definitions.Also applies to: 126-127
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@frontend/e2e/tests/console/app/resource-log.spec.ts` at line 92, The test is casting Pod fixtures to any (examplePodSpec) before calling k8sClient.createPod which loses type safety; replace the `as any` casts by typing the fixture objects with the concrete Kubernetes Pod type used by your k8s client (e.g., V1Pod or the client's PodManifest type), import that type at the top, update examplePodSpec (and the other pod spec variables used around createPod) to match that interface, and pass them directly to k8sClient.createPod so the compiler validates the Pod schema instead of using `any`.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.claude/skills/migrate-cypress/SKILL.md:
- Around line 79-81: Update the selector examples to match the Selector
Unification rule by replacing occurrences of the legacy attribute `data-test-id`
with the unified `data-test` in the SKILL.md examples; specifically change the
locator initialization referenced by the symbol detailsTab (the
this.page.locator('[data-test-id="horizontal-link-Details"]')) and the other
example block around the second occurrence (lines shown in the review) so both
examples use '[data-test="horizontal-link-Details"]' and analogous selectors to
keep the documentation consistent.
- Around line 24-28: Update the fenced code blocks in SKILL.md so they declare a
language (e.g., add "text" after the opening ```), specifically for the
migration command block containing the lines starting with "/migrate-cypress
..." and the corresponding output block showing "Migration complete:
<source-file> → <output-file>" (also apply the same change to the second
occurrence around lines 106-113); open each triple-backtick fence and change ```
to ```text so markdownlint MD040 warnings are resolved.
In `@frontend/e2e/clients/kubernetes-client.ts`:
- Around line 489-495: The waitForPodReady function currently only checks
pod.status.phase === 'Running' and can return before containers are actually
ready; update the poll predicate in waitForPodReady to fetch the pod via
this.k8sApi.readNamespacedPod and then verify readiness by (a) confirming
status.phase === 'Running' and (b) ensuring either all status.containerStatuses
exist and every containerStatus.ready === true OR that pod.status.conditions
contains a condition with type === 'Ready' and status === 'True'; handle missing
fields defensively (treat absent containerStatuses/conditions as not ready) and
keep the existing timeout/polling behavior so callers of waitForPodReady get a
true only when the pod is actually ready.
In `@frontend/e2e/pages/list-page.ts`:
- Around line 54-60: The clickFirstRowLinkMatching method can misbehave if
callers pass a RegExp with global or sticky flags because RegExp.lastIndex is
stateful; defensively create a fresh RegExp without the g or y flags from the
incoming pattern before the loop (use pattern.source and pattern.flags filtered
to remove 'g' and 'y') and then use that new RegExp for matching inside the
loop, keeping the rest of the logic (including robustClick) unchanged.
In `@frontend/e2e/tests/console/app/resource-log.spec.ts`:
- Line 65: The test uses absolute paths in page.goto (e.g.
page.goto('/k8s/ns/openshift-kube-apiserver/core~v1~Pod')) which breaks behind
non-root proxy; replace these calls with the base-path-safe routing helper used
elsewhere (for example a getConsoleRoute or buildConsoleUrl helper) so the path
is prefixed by the app's base path, and update each occurrence of
page.goto('/k8s/...') in resource-log.spec.ts to call that helper (e.g. await
page.goto(getConsoleRoute('k8s/ns/openshift-kube-apiserver/core~v1~Pod'))) so
tests work when Console is hosted under a non-root path.
In `@frontend/e2e/tests/console/app/template.spec.ts`:
- Line 4: The test uses a fixed constant TEMPLATE_NAME ('httpd-example-test')
causing collisions; update the spec (template.spec.ts) to generate a unique
template name at runtime (e.g., append a timestamp or UUID) and replace the
constant TEMPLATE_NAME with that dynamic value so each run uses a distinct name;
ensure the generated name is used wherever TEMPLATE_NAME is referenced in the
test so creation calls no longer clash with existing resources.
---
Nitpick comments:
In `@frontend/e2e/pages/catalog-page.ts`:
- Around line 6-8: Replace the brittle placeholder-based locator for the keyword
filter by updating the private field filterInput (type Locator) to use the
stable test id selector: use this.page.getByTestId('search-catalog') instead of
'input[placeholder*="Filter by keyword"]' so the CatalogToolbar's
data-test="search-catalog" is targeted like catalogItem(testId) does.
In `@frontend/e2e/pages/logs-page.ts`:
- Around line 16-18: Replace brittle locators in logs-page.ts with
data-test-backed selectors: update the Locator definitions searchInput,
searchMatches, and logText to use stable data-test attributes (e.g.,
page.locator('[data-test="logs-search"]'),
page.locator('[data-test="logs-match"]'),
page.locator('[data-test="log-text"]')) instead of the placeholder or
class-based selectors, and ensure the corresponding components/templates include
those data-test attributes so the tests can target them reliably.
In `@frontend/e2e/pages/masthead-page.ts`:
- Around line 33-35: The isAuthDisabled method uses (window as any) which
bypasses typings; replace it with a narrow Window interface that includes
optional SERVER_FLAGS with authDisabled and use that type in the page.evaluate
callback. Add a local type or interface like interface WindowWithServerFlags {
SERVER_FLAGS?: { authDisabled?: boolean } } and then change the evaluate body to
cast window to WindowWithServerFlags (or declare it in the callback signature)
so the expression becomes !!(windowAsTyped.SERVER_FLAGS?.authDisabled) while
removing any usage; update the function isAuthDisabled to use that typed window
reference.
In `@frontend/e2e/tests/console/app/filtering-and-searching.spec.ts`:
- Around line 27-55: Remove the unsafe "as any" cast on the deployment manifest
and instead satisfy the actual parameter type expected by
client.createDeployment; replace the trailing "as any" with "satisfies
Parameters<typeof client.createDeployment>[1]" (or the concrete input type for
createDeployment) so the manifest literal (the object passed to
client.createDeployment in the test) is type-checked, keeping the rest of the
call to client.waitForDeploymentReady(workloadName, ns) unchanged.
In `@frontend/e2e/tests/console/app/masthead.spec.ts`:
- Around line 58-67: The test only performs clicks and can falsely pass; after
calling MastheadPage.clickLogOut() add a concrete post-logout assertion: if
using URL-based redirect, await page.waitForURL(...) or
expect(page).toHaveURL(...) for the login or landing path; alternatively assert
a login-related UI element via MastheadPage (e.g.,
expect(masthead.loginButton).toBeVisible() or
expect(masthead.isAuthenticated()).resolves.toBe(false)). Use the existing
MastheadPage helpers (isAuthDisabled, openUserDropdown, clickLogOut) and add the
appropriate await/expect to verify the app reached the logged-out state.
In `@frontend/e2e/tests/console/app/resource-log.spec.ts`:
- Line 92: The test is casting Pod fixtures to any (examplePodSpec) before
calling k8sClient.createPod which loses type safety; replace the `as any` casts
by typing the fixture objects with the concrete Kubernetes Pod type used by your
k8s client (e.g., V1Pod or the client's PodManifest type), import that type at
the top, update examplePodSpec (and the other pod spec variables used around
createPod) to match that interface, and pass them directly to
k8sClient.createPod so the compiler validates the Pod schema instead of using
`any`.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: 863a79dc-002d-49da-ba01-806f799f3415
📒 Files selected for processing (30)
.claude/migration-context.md.claude/skills/debug-test/SKILL.md.claude/skills/migrate-cypress/SKILL.md.gitignoreAGENTS.mdfrontend/e2e/clients/kubernetes-client.tsfrontend/e2e/pages/catalog-page.tsfrontend/e2e/pages/details-page.tsfrontend/e2e/pages/list-page.tsfrontend/e2e/pages/logs-page.tsfrontend/e2e/pages/masthead-page.tsfrontend/e2e/pages/overview-page.tsfrontend/e2e/tests/console/app/filtering-and-searching.spec.tsfrontend/e2e/tests/console/app/masthead.spec.tsfrontend/e2e/tests/console/app/node-terminal.spec.tsfrontend/e2e/tests/console/app/overview.spec.tsfrontend/e2e/tests/console/app/resource-log.spec.tsfrontend/e2e/tests/console/app/template.spec.tsfrontend/packages/integration-tests/fixtures/httpd-example-template.yamlfrontend/packages/integration-tests/fixtures/pod-with-space.yamlfrontend/packages/integration-tests/fixtures/pod-with-wrap-annotation.yamlfrontend/packages/integration-tests/tests/app/filtering-and-searching.cy.tsfrontend/packages/integration-tests/tests/app/masthead.cy.tsfrontend/packages/integration-tests/tests/app/node-terminal.cy.tsfrontend/packages/integration-tests/tests/app/overview.cy.tsfrontend/packages/integration-tests/tests/app/resource-log.cy.tsfrontend/packages/integration-tests/tests/app/template.cy.tsfrontend/packages/integration-tests/views/catalogs.tsfrontend/packages/integration-tests/views/logs.tsfrontend/packages/integration-tests/views/overview.ts
💤 Files with no reviewable changes (12)
- frontend/packages/integration-tests/tests/app/resource-log.cy.ts
- frontend/packages/integration-tests/fixtures/pod-with-space.yaml
- frontend/packages/integration-tests/fixtures/pod-with-wrap-annotation.yaml
- frontend/packages/integration-tests/tests/app/overview.cy.ts
- frontend/packages/integration-tests/views/overview.ts
- frontend/packages/integration-tests/tests/app/node-terminal.cy.ts
- frontend/packages/integration-tests/tests/app/template.cy.ts
- frontend/packages/integration-tests/fixtures/httpd-example-template.yaml
- frontend/packages/integration-tests/tests/app/filtering-and-searching.cy.ts
- frontend/packages/integration-tests/views/catalogs.ts
- frontend/packages/integration-tests/views/logs.ts
- frontend/packages/integration-tests/tests/app/masthead.cy.ts
📜 Review details
🧰 Additional context used
📓 Path-based instructions (10)
**/*.{tsx,ts}
📄 CodeRabbit inference engine (TESTING.md)
Prefer
data-testattributes for Cypress selectors (e.g.,cy.get('[data-test="create-deployment"]')) over brittle CSS or ARIA selectors
Files:
frontend/e2e/tests/console/app/template.spec.tsfrontend/e2e/tests/console/app/node-terminal.spec.tsfrontend/e2e/tests/console/app/masthead.spec.tsfrontend/e2e/pages/catalog-page.tsfrontend/e2e/pages/list-page.tsfrontend/e2e/tests/console/app/overview.spec.tsfrontend/e2e/pages/logs-page.tsfrontend/e2e/pages/details-page.tsfrontend/e2e/pages/overview-page.tsfrontend/e2e/pages/masthead-page.tsfrontend/e2e/clients/kubernetes-client.tsfrontend/e2e/tests/console/app/filtering-and-searching.spec.tsfrontend/e2e/tests/console/app/resource-log.spec.ts
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (STYLEGUIDE.md)
Use lowercase dash-separated names for all files (to avoid git issues with case-insensitive file systems)
Files:
frontend/e2e/tests/console/app/template.spec.tsfrontend/e2e/tests/console/app/node-terminal.spec.tsfrontend/e2e/tests/console/app/masthead.spec.tsfrontend/e2e/pages/catalog-page.tsfrontend/e2e/pages/list-page.tsfrontend/e2e/tests/console/app/overview.spec.tsfrontend/e2e/pages/logs-page.tsfrontend/e2e/pages/details-page.tsfrontend/e2e/pages/overview-page.tsfrontend/e2e/pages/masthead-page.tsfrontend/e2e/clients/kubernetes-client.tsfrontend/e2e/tests/console/app/filtering-and-searching.spec.tsfrontend/e2e/tests/console/app/resource-log.spec.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (STYLEGUIDE.md)
**/*.{ts,tsx}: Prefer functional programming patterns and immutable data structures
Run the linter and follow all rules defined in .eslintrc
Use React hooks and Context API for state management, migrating away from legacy Redux/Immutable.js
Use existing hooks fromconsole-sharedwhen possible (useK8sWatchResource,useUserSettings, etc.)
Use k8s resource hooks for data fetching,consoleFetchJSONfor HTTP requests
Use console extension points for plugin integration
Check existing types inconsole-sharedbefore creating new types
UseuseTranslation('namespace')hook withkeyformat for translation keys
UseuseCallbackto memoize callbacks and prevent unnecessary re-renders
UseuseMemofor expensive filtering and computations to prevent re-renders
Avoid usinganytype; flag use ofanytype and suggest proper type definitions
Verify null/undefined are properly handled in type definitions (usestring | undefinedformat)
Verify exported types for reusable components are properly defined
UseusePluginInfohook for plugin data access
Avoid importing from deprecated component paths (check for/deprecatedin import paths and@deprecatedJSDoc tags)
Use direct imports to specific files instead of barrel exports from index.ts to avoid circular dependencies and improve build performance
Useimport typefor type-only imports to improve tree-shaking and build performance
Files:
frontend/e2e/tests/console/app/template.spec.tsfrontend/e2e/tests/console/app/node-terminal.spec.tsfrontend/e2e/tests/console/app/masthead.spec.tsfrontend/e2e/pages/catalog-page.tsfrontend/e2e/pages/list-page.tsfrontend/e2e/tests/console/app/overview.spec.tsfrontend/e2e/pages/logs-page.tsfrontend/e2e/pages/details-page.tsfrontend/e2e/pages/overview-page.tsfrontend/e2e/pages/masthead-page.tsfrontend/e2e/clients/kubernetes-client.tsfrontend/e2e/tests/console/app/filtering-and-searching.spec.tsfrontend/e2e/tests/console/app/resource-log.spec.ts
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (STYLEGUIDE.md)
Never use absolute paths in code; the app must be able to run behind a proxy under an arbitrary path
**/*.{ts,tsx,js,jsx}: Use i18next'sTFunctioninside functions or components, not in module scope
Don't use backticks inside of aTFunctioncall; use single quotes instead for template strings
For dynamic keys that cannot be interpolated by i18next-parser, specify possible static values in comments (e.g.,// t('key_1')) to aid key generation
Files:
frontend/e2e/tests/console/app/template.spec.tsfrontend/e2e/tests/console/app/node-terminal.spec.tsfrontend/e2e/tests/console/app/masthead.spec.tsfrontend/e2e/pages/catalog-page.tsfrontend/e2e/pages/list-page.tsfrontend/e2e/tests/console/app/overview.spec.tsfrontend/e2e/pages/logs-page.tsfrontend/e2e/pages/details-page.tsfrontend/e2e/pages/overview-page.tsfrontend/e2e/pages/masthead-page.tsfrontend/e2e/clients/kubernetes-client.tsfrontend/e2e/tests/console/app/filtering-and-searching.spec.tsfrontend/e2e/tests/console/app/resource-log.spec.ts
**/*.spec.{ts,tsx}
📄 CodeRabbit inference engine (STYLEGUIDE.md)
Tests should follow a table-driven tests convention similar to Go where applicable
Files:
frontend/e2e/tests/console/app/template.spec.tsfrontend/e2e/tests/console/app/node-terminal.spec.tsfrontend/e2e/tests/console/app/masthead.spec.tsfrontend/e2e/tests/console/app/overview.spec.tsfrontend/e2e/tests/console/app/filtering-and-searching.spec.tsfrontend/e2e/tests/console/app/resource-log.spec.ts
**/*.ts
📄 CodeRabbit inference engine (STYLEGUIDE.md)
Updates to
console-dynamic-plugin-sdkshould maintain backward compatibility as it's a public API; use theplugin-api-reviewskill to vet changes for public API impact
Files:
frontend/e2e/tests/console/app/template.spec.tsfrontend/e2e/tests/console/app/node-terminal.spec.tsfrontend/e2e/tests/console/app/masthead.spec.tsfrontend/e2e/pages/catalog-page.tsfrontend/e2e/pages/list-page.tsfrontend/e2e/tests/console/app/overview.spec.tsfrontend/e2e/pages/logs-page.tsfrontend/e2e/pages/details-page.tsfrontend/e2e/pages/overview-page.tsfrontend/e2e/pages/masthead-page.tsfrontend/e2e/clients/kubernetes-client.tsfrontend/e2e/tests/console/app/filtering-and-searching.spec.tsfrontend/e2e/tests/console/app/resource-log.spec.ts
**/*
📄 CodeRabbit inference engine (STYLEGUIDE.md)
Use lowercase dash-separated names for all files and directories, with exceptions for files with their own naming conventions (Dockerfile, Makefile, README, etc.)
Files:
frontend/e2e/tests/console/app/template.spec.tsfrontend/e2e/tests/console/app/node-terminal.spec.tsfrontend/e2e/tests/console/app/masthead.spec.tsfrontend/e2e/pages/catalog-page.tsfrontend/e2e/pages/list-page.tsfrontend/e2e/tests/console/app/overview.spec.tsAGENTS.mdfrontend/e2e/pages/logs-page.tsfrontend/e2e/pages/details-page.tsfrontend/e2e/pages/overview-page.tsfrontend/e2e/pages/masthead-page.tsfrontend/e2e/clients/kubernetes-client.tsfrontend/e2e/tests/console/app/filtering-and-searching.spec.tsfrontend/e2e/tests/console/app/resource-log.spec.ts
**/*.{ts,tsx,jsx}
📄 CodeRabbit inference engine (INTERNATIONALIZATION.md)
**/*.{ts,tsx,jsx}: Internationalizearia-label,aria-placeholder,aria-roledescription, andaria-valuetextattributes
When displaying a resource kind, use the predefinedmodel.labelPluralKeywrapped inTFunctionif available, otherwise fall back tomodel.labelPlural
Use the i18nKey property on react-i18next Trans component only as a last resort when the parser generates incorrect keys with HTML tags
Files:
frontend/e2e/tests/console/app/template.spec.tsfrontend/e2e/tests/console/app/node-terminal.spec.tsfrontend/e2e/tests/console/app/masthead.spec.tsfrontend/e2e/pages/catalog-page.tsfrontend/e2e/pages/list-page.tsfrontend/e2e/tests/console/app/overview.spec.tsfrontend/e2e/pages/logs-page.tsfrontend/e2e/pages/details-page.tsfrontend/e2e/pages/overview-page.tsfrontend/e2e/pages/masthead-page.tsfrontend/e2e/clients/kubernetes-client.tsfrontend/e2e/tests/console/app/filtering-and-searching.spec.tsfrontend/e2e/tests/console/app/resource-log.spec.ts
**/*.ts?(x)
📄 CodeRabbit inference engine (AGENTS.md)
Never import from package index files (e.g.,
@console/shared) in new code; import from specific file paths instead to avoid circular dependencies and slow buildsEnsure all
$codeRefin extension points ALWAYS reference the corresponding extension type from the dynamic plugin SDK package (@console/dynamic-plugin-sdk/src/extensions/) for type safetyNever use template literals (backticks) in
t()i18n calls; use single or double quotes instead as the i18n parser cannot extract keys from template literalsNever import from or use code with the
@deprecatedTSdoc tag in new codeNever use absolute URLs or paths; the console runs behind a proxy under an arbitrary path
After adding or modifying user-facing strings, run
yarn i18nto update i18n keys and commit updated keys alongside code changes that affect i18n
Files:
frontend/e2e/tests/console/app/template.spec.tsfrontend/e2e/tests/console/app/node-terminal.spec.tsfrontend/e2e/tests/console/app/masthead.spec.tsfrontend/e2e/pages/catalog-page.tsfrontend/e2e/pages/list-page.tsfrontend/e2e/tests/console/app/overview.spec.tsfrontend/e2e/pages/logs-page.tsfrontend/e2e/pages/details-page.tsfrontend/e2e/pages/overview-page.tsfrontend/e2e/pages/masthead-page.tsfrontend/e2e/clients/kubernetes-client.tsfrontend/e2e/tests/console/app/filtering-and-searching.spec.tsfrontend/e2e/tests/console/app/resource-log.spec.ts
AGENTS.md
📄 CodeRabbit inference engine (CLAUDE.md)
Document agent capabilities and behavior in AGENTS.md
Files:
AGENTS.md
🧠 Learnings (1)
📓 Common learnings
Learnt from: CR
Repo: openshift/console
Timestamp: 2026-05-12T07:24:22.768Z
Learning: Before starting ANY changes to the dynamic plugin SDK, ensure changes do not impact the public API by checking `frontend/packages/console-dynamic-plugin-sdk/src/api/internal-*.ts` files to avoid breakage of external plugins
Learnt from: CR
Repo: openshift/console
Timestamp: 2026-05-12T07:24:22.768Z
Learning: Always consider impact on external plugin developers when making changes to the dynamic plugin SDK, maintain backward compatibility, provide comprehensive documentation for all public APIs, and ensure changes to extension schemas include migration paths
Learnt from: CR
Repo: openshift/console
Timestamp: 2026-05-12T07:24:22.768Z
Learning: Use the `plugin-api-review` skill for all changes to the dynamic plugin SDK public API to ensure proper vetting and prevent breaking changes
Learnt from: CR
Repo: openshift/console
Timestamp: 2026-05-12T07:24:22.768Z
Learning: Backend dependency updates should be in separate commits from core logic changes to isolate vendor folder changes
Learnt from: CR
Repo: openshift/console
Timestamp: 2026-05-12T07:24:22.768Z
Learning: Bug fix commits should be prefixed with bug number or Jira key (e.g., `OCPBUGS-1234: Fix ...`); commit subject line answers 'what changed' and body answers 'why'
Learnt from: CR
Repo: openshift/console
Timestamp: 2026-05-12T07:24:22.768Z
Learning: When opening a PR, fill out the PR template located in `docs/pull_request_template.md` with all required sections and always link to the relevant JIRA issue in the PR title and description
Learnt from: CR
Repo: openshift/console
Timestamp: 2026-05-12T07:24:22.768Z
Learning: Feature work branches should be named with `CONSOLE-####` (Jira story number); bug fix branches should be named with `OCPBUGS-####` (Jira bug number); use `main` as base branch
Learnt from: CR
Repo: openshift/console
Timestamp: 2026-05-12T07:24:22.768Z
Learning: Use `/migrate-cypress` to convert Cypress e2e tests to Playwright and `/debug-test` to fix failing tests during the Cypress to Playwright migration
🪛 LanguageTool
.claude/skills/debug-test/SKILL.md
[style] ~100-~100: The adverb ‘sometimes’ is usually put before the verb ‘passes’.
Context: ...structure setup first. ### Flaky test (passes sometimes, fails sometimes) If a test passes on r...
(ADVERB_WORD_ORDER)
[style] ~100-~100: The adverb ‘sometimes’ is usually put before the verb ‘fails’.
Context: ...rst. ### Flaky test (passes sometimes, fails sometimes) If a test passes on re-run without any...
(ADVERB_WORD_ORDER)
🪛 markdownlint-cli2 (0.22.1)
.claude/skills/migrate-cypress/SKILL.md
[warning] 24-24: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
[warning] 106-106: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🔇 Additional comments (1)
frontend/e2e/tests/console/app/resource-log.spec.ts (1)
58-157: Solid migration test flow and cleanup disciplineGood use of
test.step, namespace isolation, readiness waits, and cleanup tracking. This is a strong Playwright translation pattern for cluster-backed e2e coverage.
42ef523 to
8810a34
Compare
8810a34 to
b1684ae
Compare
b1684ae to
0d04f9a
Compare
fddfc04 to
b2d42e0
Compare
|
@CodeRabbit review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
frontend/e2e/pages/masthead-page.ts (1)
19-24: ⚡ Quick winUse
robustClick()consistently for masthead interactions.Line 22, Line 33, Line 38, and Line 53 use direct
.click(). In these menu/dropdown flows, usingrobustClick()consistently will better absorb transient overlays/re-renders and reduce flake.As per coding guidelines
frontend/e2e/pages/**/*.ts: ExtendBasePagein Playwright page objects which providesrobustClick(),waitForLoadingComplete(), andgoTo().Also applies to: 26-35, 37-39, 48-54
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@frontend/e2e/pages/masthead-page.ts` around lines 19 - 24, The page object should extend BasePage and use its robustClick helper rather than direct .click() for masthead interactions: update the class declaration to extend BasePage, replace direct .click() calls (e.g. in async openQuickCreate() using quickCreateToggle and any other masthead locators referenced) with this.robustClick(locator), and ensure you rely on BasePage methods like waitForLoadingComplete() and goTo() where appropriate to follow the project e2e guidelines.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.claude/skills/debug-e2e/SKILL.md:
- Around line 2-10: Update the markdown heading to match the renamed skill by
replacing the existing "# Debug Test" heading with a heading that matches the
skill name "debug-e2e" (for example "# debug-e2e" or a more descriptive "# Debug
E2E (debug-e2e)") so the top-level heading aligns with the name: debug-e2e
declared in the file; locate the heading in the SKILL.md content and edit it
accordingly.
In `@frontend/e2e/pages/list-page.ts`:
- Around line 8-15: Replace the brittle class/OUIA locators with test-id-based
Playwright selectors: update dataViewCells, dataViewFilters, nameFilterInput,
and singleFilterGroup to use page.getByTestId('...') querying [data-test="..."]
(choose meaningful test ids like "data-view-cell", "data-view-filters",
"name-filter-input", "single-filter-group"); if any target element lacks a
data-test attribute, add data-test in the UI component (keep existing
legacy/class/OUIA attributes), and update any other similar locators in the file
(e.g., the ones noted around the rest of the file) to follow the same
page.getByTestId convention.
---
Nitpick comments:
In `@frontend/e2e/pages/masthead-page.ts`:
- Around line 19-24: The page object should extend BasePage and use its
robustClick helper rather than direct .click() for masthead interactions: update
the class declaration to extend BasePage, replace direct .click() calls (e.g. in
async openQuickCreate() using quickCreateToggle and any other masthead locators
referenced) with this.robustClick(locator), and ensure you rely on BasePage
methods like waitForLoadingComplete() and goTo() where appropriate to follow the
project e2e guidelines.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: e705fb20-6f31-4e42-939b-49c9a13120d5
📒 Files selected for processing (15)
.claude/skills/debug-e2e/SKILL.mdfrontend/e2e/clients/kubernetes-client.tsfrontend/e2e/pages/base-page.tsfrontend/e2e/pages/catalog-page.tsfrontend/e2e/pages/details-page.tsfrontend/e2e/pages/list-page.tsfrontend/e2e/pages/logs-page.tsfrontend/e2e/pages/masthead-page.tsfrontend/e2e/pages/overview-page.tsfrontend/e2e/tests/console/app/filtering-and-searching.spec.tsfrontend/e2e/tests/console/app/masthead.spec.tsfrontend/e2e/tests/console/app/node-terminal.spec.tsfrontend/e2e/tests/console/app/overview.spec.tsfrontend/e2e/tests/console/app/resource-log.spec.tsfrontend/e2e/tests/console/app/template.spec.ts
🚧 Files skipped from review as they are similar to previous changes (11)
- frontend/e2e/tests/console/app/overview.spec.ts
- frontend/e2e/pages/overview-page.ts
- frontend/e2e/tests/console/app/node-terminal.spec.ts
- frontend/e2e/clients/kubernetes-client.ts
- frontend/e2e/pages/details-page.ts
- frontend/e2e/tests/console/app/masthead.spec.ts
- frontend/e2e/pages/logs-page.ts
- frontend/e2e/tests/console/app/filtering-and-searching.spec.ts
- frontend/e2e/tests/console/app/resource-log.spec.ts
- frontend/e2e/pages/catalog-page.ts
- frontend/e2e/tests/console/app/template.spec.ts
📜 Review details
🧰 Additional context used
📓 Path-based instructions (11)
frontend/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
frontend/**/*.{ts,tsx,js,jsx}: Never import from package index files (e.g.,@console/shared) in new code, as they can create circular dependencies and slow builds. Import from specific file paths instead.
Do not use backticks int()calls for i18n strings, as the i18n parser cannot extract keys from template literals. Use single or double quotes instead.
Files:
frontend/e2e/pages/base-page.tsfrontend/e2e/pages/masthead-page.tsfrontend/e2e/pages/list-page.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Never import from deprecated packages or use code with the
@deprecatedTSdoc tag in new code.
**/*.{ts,tsx}: Use React functional components with hooks instead of class components
State Management: Use React hooks and Context API (migrating away from legacy Redux/Immutable.js)
Hooks: Use existing hooks fromconsole-sharedwhen possible (useK8sWatchResource,useUserSettings, etc.)
API calls: Use k8s resource hooks for data fetching,consoleFetchJSONfor HTTP requests
Extensions: Use console extension points for plugin integration
Types: Check existing types inconsole-sharedbefore creating new ones
Dynamic Plugins: Use console extension points for plugin integration
Styling: Use SCSS modules co-located with components, PatternFly design system components, avoid any SCSS/CSS if possible
Accessibility: Follow WCAG 2.1 AA standards, use semantic HTML, ARIA labels where needed, ensure keyboard navigation, test with screen readers
i18n: UseuseTranslation('namespace')hook withkeyformat for translation keys
Error Handling: Use ErrorBoundary components and graceful degradation patterns
Optimize re-renders: UseuseCallbackfor memoized callbacks to avoid function recreation every render
Optimize re-renders: UseuseMemofor expensive computations to avoid recalculating on every render
Lazy loading: UseReact.lazy()to lazy load heavy components
TypeScript type safety: Avoid usinganytype; suggest proper type definitions and verify null/undefined are handled properly
Type component props properly: Reuse existing component prop types instead of duplicating type definitions
Use proper hooks: Use specialized hooks likeusePluginInfofor plugin data instead of generic data fetching patterns
Avoid deprecated components: Check for JSDoc@deprecatedtags, import paths containing/deprecated, andDEPRECATED_file name prefix before using components
Importing from barrel files and circular dependencies: Import directly from specific files instead...
Files:
frontend/e2e/pages/base-page.tsfrontend/e2e/pages/masthead-page.tsfrontend/e2e/pages/list-page.ts
frontend/**/*.{ts,tsx,js,jsx,json}
📄 CodeRabbit inference engine (AGENTS.md)
Never use absolute URLs or paths in the console code. The console runs behind a proxy under an arbitrary path.
Files:
frontend/e2e/pages/base-page.tsfrontend/e2e/pages/masthead-page.tsfrontend/e2e/pages/list-page.ts
frontend/**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
When writing code for static plugins, ensure that all
$codeRefreference the corresponding extension type from the@console/dynamic-plugin-sdkpackage.
Files:
frontend/e2e/pages/base-page.tsfrontend/e2e/pages/masthead-page.tsfrontend/e2e/pages/list-page.ts
**/*.{tsx,ts}
📄 CodeRabbit inference engine (TESTING.md)
**/*.{tsx,ts}: Always usepage.getByTestId('x')for Playwright selectors which queries[data-test="x"]. If a React element only has a legacy test attribute, adddata-testto the element. Never remove legacy attributes
Preferdata-testattributes in Cypress selectors (e.g.,cy.get('[data-test="create-deployment"]')) over brittle CSS/ARIA selectorsFile Naming: PascalCase for components, kebab-case for utilities,
*.spec.ts(x)for tests
Files:
frontend/e2e/pages/base-page.tsfrontend/e2e/pages/masthead-page.tsfrontend/e2e/pages/list-page.ts
frontend/e2e/pages/**/*.ts
📄 CodeRabbit inference engine (TESTING.md)
Extend
BasePagein Playwright page objects which providesrobustClick(),waitForLoadingComplete(), andgoTo(). Locators areprivate readonlyproperties; actions areasyncmethods
Files:
frontend/e2e/pages/base-page.tsfrontend/e2e/pages/masthead-page.tsfrontend/e2e/pages/list-page.ts
**/*.{go,ts,tsx,js,jsx}
📄 CodeRabbit inference engine (STYLEGUIDE.md)
Use lowercase dash-separated names for all files to avoid git issues with case-insensitive file systems
Files:
frontend/e2e/pages/base-page.tsfrontend/e2e/pages/masthead-page.tsfrontend/e2e/pages/list-page.ts
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (STYLEGUIDE.md)
**/*.{ts,tsx,js,jsx}: New code MUST be written in TypeScript, not JavaScript
Prefer functional programming patterns and immutable data structures
Run the linter and follow all rules defined in .eslintrc
Never use absolute paths in code - the app should be able to run behind a proxy under an arbitrary path
Files:
frontend/e2e/pages/base-page.tsfrontend/e2e/pages/masthead-page.tsfrontend/e2e/pages/list-page.ts
**/*.ts
📄 CodeRabbit inference engine (STYLEGUIDE.md)
Plugin SDK Changes: Any updates to
console-dynamic-plugin-sdkshould aim to maintain backward compatibility as it's a public API - use theplugin-api-reviewskill to vet changes for public API impact and ensure proper documentation updates
Files:
frontend/e2e/pages/base-page.tsfrontend/e2e/pages/masthead-page.tsfrontend/e2e/pages/list-page.ts
frontend/**/*.{js,ts,tsx}
📄 CodeRabbit inference engine (README.md)
frontend/**/*.{js,ts,tsx}: Support only the latest versions of Edge, Chrome, Safari, and Firefox browsers; IE 11 and earlier are not supported
CSP violations should be automatically reported to telemetry by parsing dynamic plugin names from securitypolicyviolation events, with throttling to prevent duplicate reports within a day
Files:
frontend/e2e/pages/base-page.tsfrontend/e2e/pages/masthead-page.tsfrontend/e2e/pages/list-page.ts
**/*.{ts,tsx,js}
📄 CodeRabbit inference engine (INTERNATIONALIZATION.md)
For dynamic translation keys that cannot be parsed by i18next-parser (t(key), t('key' + id), t(
key${id})), specify possible static values in comments for the parser to extract
Files:
frontend/e2e/pages/base-page.tsfrontend/e2e/pages/masthead-page.tsfrontend/e2e/pages/list-page.ts
🪛 ast-grep (0.42.2)
frontend/e2e/pages/list-page.ts
[warning] 64-64: Regular expression constructed from variable input detected. This can lead to Regular Expression Denial of Service (ReDoS) attacks if the variable contains malicious patterns. Use libraries like 'recheck' to validate regex safety or use static patterns.
Context: new RegExp(pattern.source, safeFlags)
Note: [CWE-1333] Inefficient Regular Expression Complexity [REFERENCES]
- https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS
- https://cwe.mitre.org/data/definitions/1333.html
(regexp-from-variable)
🪛 LanguageTool
.claude/skills/debug-e2e/SKILL.md
[style] ~105-~105: The adverb ‘sometimes’ is usually put before the verb ‘passes’.
Context: ...structure setup first. ### Flaky test (passes sometimes, fails sometimes) If a test passes on ...
(ADVERB_WORD_ORDER)
🔇 Additional comments (3)
frontend/e2e/pages/base-page.ts (1)
36-39: LGTM!frontend/e2e/pages/masthead-page.ts (1)
5-18: LGTM!Also applies to: 41-47, 56-59
frontend/e2e/pages/list-page.ts (1)
63-76: LGTM!
|
/retest |
a4685f9 to
926c556
Compare
926c556 to
9645a8a
Compare
9645a8a to
305bb8d
Compare
6999b55 to
f7a5e3c
Compare
logonoff
left a comment
There was a problem hiding this comment.
/label px-approved
/label docs-approved
0b7e476 to
598324e
Compare
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: fsgreco, logonoff, stefanonardo The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/verified by CI |
|
@fsgreco: This PR has been marked as verified by DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/retest ci/prow-e2e-playwright |
|
/test e2e-playwright |
1 similar comment
|
/test e2e-playwright |
598324e to
7dbdc2e
Compare
|
New changes are detected. LGTM label has been removed. |
|
@stefanonardo: This pull request references CONSOLE-5235 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.claude/skills/debug-e2e/SKILL.md:
- Around line 2-8: Update all documentation references from the old command
"/debug-test" to the new "/debug-e2e": search AGENTS.md for the "/debug-test"
mention and replace it with "/debug-e2e", and likewise open
.claude/skills/migrate-cypress/SKILL.md and replace every "/debug-test"
occurrence (around the noted sections) with "/debug-e2e" so the user-facing
guidance matches the new command name used in .claude/skills/debug-e2e/SKILL.md;
run a quick repo-wide grep to confirm no remaining references.
In `@frontend/e2e/clients/kubernetes-client.ts`:
- Around line 479-487: The tests calling the old two-argument createPod API need
to be updated to build and pass a complete k8s.V1Pod with metadata.namespace set
and call createPod(pod: V1Pod). In
frontend/e2e/tests/console/app/resource-log.spec.ts replace calls like
k8sClient.createPod(ns, examplePodSpec) or k8sClient.createPod(ns, wrapPodSpec)
by ensuring examplePodSpec/wrapPodSpec are wrapped or extended into a V1Pod
object that has metadata = { name: ..., namespace: ns } (or at minimum
metadata.namespace = ns) and then call k8sClient.createPod(pod). Keep using the
existing createPod method name and ensure any helper that previously returned
only a PodSpec now returns or is wrapped into a full V1Pod with
metadata.namespace populated.
- Around line 391-393: The patchSecret method is missing the explicit JSON Patch
contentType causing possible 415 errors; update patchSecret to call
this.k8sApi.patchNamespacedSecret with an options object that sets contentType
to 'application/json-patch+json' (same style as patchConfigMap) and pass the
patch as the body, ensuring the method signature and returned Promise remain
unchanged; locate function patchSecret and the call to patchNamespacedSecret to
apply this change.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 134a532b-b1d5-450e-b6fd-a7256b0ff131
📒 Files selected for processing (22)
.claude/migration-context.md.claude/skills/debug-e2e/SKILL.mdfrontend/e2e/clients/kubernetes-client.tsfrontend/e2e/pages/base-page.tsfrontend/e2e/pages/catalog-page.tsfrontend/e2e/pages/details-page.tsfrontend/e2e/pages/list-page.tsfrontend/e2e/pages/logs-page.tsfrontend/e2e/pages/masthead-page.tsfrontend/e2e/pages/overview-page.tsfrontend/e2e/tests/console/app/filtering-and-searching.spec.tsfrontend/e2e/tests/console/app/masthead.spec.tsfrontend/e2e/tests/console/app/node-terminal.spec.tsfrontend/e2e/tests/console/app/overview.spec.tsfrontend/e2e/tests/console/app/resource-log.spec.tsfrontend/e2e/tests/console/app/template.spec.tsfrontend/e2e/tests/console/cluster-settings/channel-modal.spec.tsfrontend/e2e/tests/console/cluster-settings/update-in-progress.spec.tsfrontend/e2e/tests/console/cluster-settings/update-modal.spec.tsfrontend/e2e/tests/console/cluster-settings/updates-graph.spec.tsfrontend/e2e/tests/console/cluster-settings/upgradeable-false.spec.tsfrontend/e2e/tests/console/cluster-settings/worker-mcp-paused.spec.ts
✅ Files skipped from review due to trivial changes (2)
- frontend/e2e/tests/console/cluster-settings/update-in-progress.spec.ts
- frontend/e2e/tests/console/app/template.spec.ts
🚧 Files skipped from review as they are similar to previous changes (14)
- frontend/e2e/tests/console/cluster-settings/channel-modal.spec.ts
- frontend/e2e/tests/console/cluster-settings/worker-mcp-paused.spec.ts
- frontend/e2e/pages/base-page.ts
- frontend/e2e/tests/console/cluster-settings/upgradeable-false.spec.ts
- frontend/e2e/tests/console/cluster-settings/updates-graph.spec.ts
- frontend/e2e/pages/catalog-page.ts
- frontend/e2e/tests/console/app/node-terminal.spec.ts
- frontend/e2e/tests/console/app/masthead.spec.ts
- frontend/e2e/pages/logs-page.ts
- frontend/e2e/pages/masthead-page.ts
- frontend/e2e/tests/console/app/overview.spec.ts
- frontend/e2e/pages/overview-page.ts
- frontend/e2e/tests/console/app/resource-log.spec.ts
- frontend/e2e/tests/console/app/filtering-and-searching.spec.ts
There was a problem hiding this comment.
Caution
Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.claude/skills/debug-e2e/SKILL.md:
- Around line 2-8: Update all documentation references from the old command
"/debug-test" to the new "/debug-e2e": search AGENTS.md for the "/debug-test"
mention and replace it with "/debug-e2e", and likewise open
.claude/skills/migrate-cypress/SKILL.md and replace every "/debug-test"
occurrence (around the noted sections) with "/debug-e2e" so the user-facing
guidance matches the new command name used in .claude/skills/debug-e2e/SKILL.md;
run a quick repo-wide grep to confirm no remaining references.
In `@frontend/e2e/clients/kubernetes-client.ts`:
- Around line 479-487: The tests calling the old two-argument createPod API need
to be updated to build and pass a complete k8s.V1Pod with metadata.namespace set
and call createPod(pod: V1Pod). In
frontend/e2e/tests/console/app/resource-log.spec.ts replace calls like
k8sClient.createPod(ns, examplePodSpec) or k8sClient.createPod(ns, wrapPodSpec)
by ensuring examplePodSpec/wrapPodSpec are wrapped or extended into a V1Pod
object that has metadata = { name: ..., namespace: ns } (or at minimum
metadata.namespace = ns) and then call k8sClient.createPod(pod). Keep using the
existing createPod method name and ensure any helper that previously returned
only a PodSpec now returns or is wrapped into a full V1Pod with
metadata.namespace populated.
- Around line 391-393: The patchSecret method is missing the explicit JSON Patch
contentType causing possible 415 errors; update patchSecret to call
this.k8sApi.patchNamespacedSecret with an options object that sets contentType
to 'application/json-patch+json' (same style as patchConfigMap) and pass the
patch as the body, ensuring the method signature and returned Promise remain
unchanged; locate function patchSecret and the call to patchNamespacedSecret to
apply this change.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 134a532b-b1d5-450e-b6fd-a7256b0ff131
📒 Files selected for processing (22)
.claude/migration-context.md.claude/skills/debug-e2e/SKILL.mdfrontend/e2e/clients/kubernetes-client.tsfrontend/e2e/pages/base-page.tsfrontend/e2e/pages/catalog-page.tsfrontend/e2e/pages/details-page.tsfrontend/e2e/pages/list-page.tsfrontend/e2e/pages/logs-page.tsfrontend/e2e/pages/masthead-page.tsfrontend/e2e/pages/overview-page.tsfrontend/e2e/tests/console/app/filtering-and-searching.spec.tsfrontend/e2e/tests/console/app/masthead.spec.tsfrontend/e2e/tests/console/app/node-terminal.spec.tsfrontend/e2e/tests/console/app/overview.spec.tsfrontend/e2e/tests/console/app/resource-log.spec.tsfrontend/e2e/tests/console/app/template.spec.tsfrontend/e2e/tests/console/cluster-settings/channel-modal.spec.tsfrontend/e2e/tests/console/cluster-settings/update-in-progress.spec.tsfrontend/e2e/tests/console/cluster-settings/update-modal.spec.tsfrontend/e2e/tests/console/cluster-settings/updates-graph.spec.tsfrontend/e2e/tests/console/cluster-settings/upgradeable-false.spec.tsfrontend/e2e/tests/console/cluster-settings/worker-mcp-paused.spec.ts
✅ Files skipped from review due to trivial changes (2)
- frontend/e2e/tests/console/cluster-settings/update-in-progress.spec.ts
- frontend/e2e/tests/console/app/template.spec.ts
🚧 Files skipped from review as they are similar to previous changes (14)
- frontend/e2e/tests/console/cluster-settings/channel-modal.spec.ts
- frontend/e2e/tests/console/cluster-settings/worker-mcp-paused.spec.ts
- frontend/e2e/pages/base-page.ts
- frontend/e2e/tests/console/cluster-settings/upgradeable-false.spec.ts
- frontend/e2e/tests/console/cluster-settings/updates-graph.spec.ts
- frontend/e2e/pages/catalog-page.ts
- frontend/e2e/tests/console/app/node-terminal.spec.ts
- frontend/e2e/tests/console/app/masthead.spec.ts
- frontend/e2e/pages/logs-page.ts
- frontend/e2e/pages/masthead-page.ts
- frontend/e2e/tests/console/app/overview.spec.ts
- frontend/e2e/pages/overview-page.ts
- frontend/e2e/tests/console/app/resource-log.spec.ts
- frontend/e2e/tests/console/app/filtering-and-searching.spec.ts
🛑 Comments failed to post (3)
.claude/skills/debug-e2e/SKILL.md (1)
2-8:
⚠️ Potential issue | 🟡 Minor🧩 Analysis chain
🏁 Script executed:
#!/bin/bash # Description: Find all references to /debug-test or debug-test in documentation echo "=== Searching for /debug-test command references ===" rg -n --type=md '/debug-test' -g '!.claude/skills/debug-e2e/*' echo "" echo "=== Searching for debug-test skill references (excluding this file) ===" rg -n --type=md 'debug-test' -g '!.claude/skills/debug-e2e/*' -g '.claude/**' -g 'AGENTS.md'Repository: openshift/console
Length of output: 711
🏁 Script executed:
#!/bin/bash set -euo pipefail echo "=== Locate migrate-cypress SKILL.md ===" fd -a "migrate-cypress" .claude/skills --type f || true fd -a "migrate-cypress/SKILL.md" .claude/skills --type f || true echo echo "=== Search for /debug-test and debug-test in .claude/skills (excluding debug-e2e skill) ===" rg -n --type=md '(/)?debug-test' -g '!.claude/skills/debug-e2e/*' .claude/skills || true echo echo "=== Search for /debug-e2e and debug-e2e in .claude/skills ===" rg -n --type=md '(/)?debug-e2e' .claude/skills || true echo echo "=== Search for /debug-test and debug-test in the repo (md only, excluding debug-e2e skill file) ===" rg -n --type=md '(/)?debug-test' -g '!.claude/skills/debug-e2e/*' . || trueRepository: openshift/console
Length of output: 2636
Update docs to use
/debug-e2einstead of/debug-test.References to the old command still exist in:
AGENTS.md:136(/debug-test).claude/skills/migrate-cypress/SKILL.md:6, 75, 155(multiple/debug-testmentions)This will break the user-facing guidance after the rename.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.claude/skills/debug-e2e/SKILL.md around lines 2 - 8, Update all documentation references from the old command "/debug-test" to the new "/debug-e2e": search AGENTS.md for the "/debug-test" mention and replace it with "/debug-e2e", and likewise open .claude/skills/migrate-cypress/SKILL.md and replace every "/debug-test" occurrence (around the noted sections) with "/debug-e2e" so the user-facing guidance matches the new command name used in .claude/skills/debug-e2e/SKILL.md; run a quick repo-wide grep to confirm no remaining references.frontend/e2e/clients/kubernetes-client.ts (2)
391-393:
⚠️ Potential issue | 🟠 Major🧩 Analysis chain
🏁 Script executed:
#!/bin/bash set -euo pipefail # Locate the file in question ls -la frontend/e2e/clients/kubernetes-client.ts # Show the patchSecret implementation and nearby context sed -n '340,430p' frontend/e2e/clients/kubernetes-client.ts # Find all call sites of patchSecret rg -n "patchSecret\(" -S frontend | head -n 50 # Find all uses of patchNamespacedSecret in the repo rg -n "patchNamespacedSecret" -S frontend | head -n 50 # Show any imports of k8s/PatchStrategy in this file rg -n "from .*k8s|PatchStrategy|PatchType|contentType|JsonPatch" frontend/e2e/clients/kubernetes-client.tsRepository: openshift/console
Length of output: 3285
🏁 Script executed:
#!/bin/bash set -euo pipefail # Inspect imports / k8sApi setup in the kubernetes-client sed -n '1,140p' frontend/e2e/clients/kubernetes-client.ts rg -n "new (Kubernetes|CoreV1Api)|CoreV1Api|k8s\\.PatchStrategy|PatchStrategy" frontend/e2e/clients/kubernetes-client.ts # Inspect patchSecret call sites to see what patch payload is actually passed sed -n '1,140p' frontend/e2e/tests/console/cluster-settings/alertmanager/receivers/email.spec.ts sed -n '1,120p' frontend/e2e/tests/console/cluster-settings/alertmanager/alertmanager-test-utils.ts # Find any other patchSecret uses rg -n "patchSecret\(" frontend/e2e/tests frontend/e2e/clients -S # Try to locate the TypeScript signature for patchNamespacedSecret (may exist in installed deps) # If node_modules is present, this helps settle whether contentType is required/expected. if [ -d frontend/node_modules ]; then rg -n "patchNamespacedSecret\\(" frontend/node_modules -S --glob='*.d.ts' --glob='*.ts' | head -n 50 || true fiRepository: openshift/console
Length of output: 11080
🏁 Script executed:
#!/bin/bash set -euo pipefail # Show more context around patchSecret and any other patch helpers sed -n '220,420p' frontend/e2e/clients/kubernetes-client.ts # Check if node_modules exists and contains type defs for `@kubernetes/client-node` if [ -d frontend/node_modules ]; then echo "node_modules exists" ls -la frontend/node_modules/@kubernetes 2>/dev/null || true # Find installed client-node version cat frontend/node_modules/@kubernetes/client-node/package.json 2>/dev/null | rg -n '"version"' || true # Search type declarations for patchNamespacedSecret rg -n "patchNamespacedSecret" frontend/node_modules/@kubernetes/client-node -S --glob='*.d.ts' --glob='*.ts' | head -n 50 || true else echo "node_modules missing" fi # Determine client-node version from lockfile/package.json rg -n "`@kubernetes/client-node`" frontend/package.json frontend/yarn.lock frontend/**/package.json | head -n 50Repository: openshift/console
Length of output: 6034
🌐 Web query:
@kubernetes/client-node@1.4.0 patchNamespacedSecret contentType default PatchStrategy JsonPatch💡 Result:
In the
@kubernetes/client-nodelibrary (version 1.4.0), there is no single default Content-Type for patch operations that automatically satisfies all Kubernetes API requirements [1][2][3]. When using the patchNamespacedSecret method (or other patch methods), you must explicitly set the Content-Type header to match the format of the patch body you are providing, or you may encounter an HTTP 415 (Unsupported Media Type) error [1][4][5][6]. To avoid errors, you should pass the appropriate header in the options parameter of the method call [2][7][6]. The library provides constants for these patch strategies, which should be used to ensure the correct string is passed [2][7]: import { PatchUtils } from '@kubernetes/client-node'; // Example: Using JSON Patch const options = { headers: { 'Content-Type': PatchUtils.PATCH_FORMAT_JSON_PATCH } }; await k8sApi.patchNamespacedSecret( name, namespace, patchBody, undefined, undefined, undefined, undefined, undefined, options); The supported patch formats typically include [2][7]: 1. JSON Patch (RFC 6902): PatchUtils.PATCH_FORMAT_JSON_PATCH ('application/json-patch+json') 2. JSON Merge Patch (RFC 7396): PatchUtils.PATCH_FORMAT_JSON_MERGE_PATCH ('application/merge-patch+json') 3. Strategic Merge Patch: PatchUtils.PATCH_FORMAT_STRATEGIC_MERGE_PATCH ('application/strategic-merge-patch+json') 4. Server-Side Apply: PatchUtils.PATCH_FORMAT_APPLY_YAML ('application/apply-patch+yaml') If you do not specify the header, the request may default to an incorrect or generic type, which frequently causes the server to reject the request [1][4][6]. Because the library's signature for patch methods involves multiple optional parameters, ensure your options object is passed at the correct position (the final argument) [1][2][6].Citations:
- 1: kubernetes-client/javascript#862
- 2: https://stackoverflow.com/questions/67520468/patch-k8s-custom-resource-with-kubernetes-client-node
- 3: kubernetes-client/javascript#2160
- 4: kubernetes-client/javascript#370
- 5: kubernetes-client/javascript#893
- 6: kubernetes-client/javascript#995
- 7: https://tessl.io/registry/tessl/npm-kubernetes--client-node/1.3.0/files/docs/utilities.md
🏁 Script executed:
#!/bin/bash set -euo pipefail rg -n "patchNamespaced.*\(" frontend -S | head -n 200 rg -n "patchNamespaced.*contentType|k8s\\.PatchStrategy\\.(JsonPatch|MergePatch|Strategic)" frontend -S rg -n "PatchStrategy\\.JsonPatch|PatchStrategy\\.MergePatch|contentType:" frontend/e2e/clients/kubernetes-client.ts frontend -SRepository: openshift/console
Length of output: 2166
🏁 Script executed:
#!/bin/bash set -euo pipefail rg -n "PatchStrategy\\.JsonPatch|PATCH_FORMAT_JSON_PATCH|PatchUtils\\.PATCH_FORMAT_JSON_PATCH" frontend -S || true rg -n "PatchStrategy\\." frontend/e2e/clients/kubernetes-client.tsRepository: openshift/console
Length of output: 114
🌐 Web query:
@kubernetes/client-node 1.4.0 PatchStrategy JsonPatch value PatchStrategy💡 Result:
In
@kubernetes/client-nodeversion 1.4.0, PatchStrategy is a constant object used to define the appropriate Content-Type header value for Kubernetes patch operations [1]. The PatchStrategy object includes the following mapping for patch types [1]: * JsonPatch: 'application/json-patch+json' (RFC 6902) * MergePatch: 'application/merge-patch+json' (RFC 7396) * StrategicMergePatch: 'application/strategic-merge-patch+json' (Kubernetes-specific) * ServerSideApply: 'application/apply-patch+yaml' When performing patch requests (e.g., using methods like patchNamespacedDeployment), the Content-Type header must be correctly set to one of these values to match the payload format, as omitting or misconfiguring it often results in a 415 Unsupported Media Type error [1][2][3]. In practice, this is typically passed via the options parameter in the API call [1][4]. For example: await k8sApi.patchNamespacedDeployment( 'my-deployment', 'default', patch, undefined, undefined, undefined, undefined, undefined, { headers: { 'Content-Type': PatchStrategy.JsonPatch } }); The library also exports the PatchStrategy type, defined as typeof PatchStrategy[keyof typeof PatchStrategy], allowing for strict typing of patch operations within the client [1].Citations:
- 1: https://tessl.io/registry/tessl/npm-kubernetes--client-node/1.3.0/files/docs/utilities.md
- 2: kubernetes-client/javascript#995
- 3: kubernetes-client/javascript#862
- 4: https://stackoverflow.com/questions/67520468/patch-k8s-custom-resource-with-kubernetes-client-node
Set explicit JSON Patch strategy for
patchSecret.
patchSecretis called with RFC6902-style JSON Patch operations ({ op, path, value }), but thepatchNamespacedSecretrequest omitscontentType, which can cause 415 Unsupported Media Type failures at runtime (notepatchConfigMapalready setscontentType).Proposed fix
async patchSecret(name: string, namespace: string, patch: object[]): Promise<void> { - await this.k8sApi.patchNamespacedSecret({ name, namespace, body: patch }); + await this.k8sApi.patchNamespacedSecret({ + name, + namespace, + body: patch, + contentType: k8s.PatchStrategy.JsonPatch, + } as any); }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@frontend/e2e/clients/kubernetes-client.ts` around lines 391 - 393, The patchSecret method is missing the explicit JSON Patch contentType causing possible 415 errors; update patchSecret to call this.k8sApi.patchNamespacedSecret with an options object that sets contentType to 'application/json-patch+json' (same style as patchConfigMap) and pass the patch as the body, ensuring the method signature and returned Promise remain unchanged; locate function patchSecret and the call to patchNamespacedSecret to apply this change.
479-487:
⚠️ Potential issue | 🔴 Critical🧩 Analysis chain
🏁 Script executed:
#!/bin/bash # Verify createPod signature and all callsites. rg -n -C2 --type=ts 'async createPod\s*\(' frontend/e2e/clients/kubernetes-client.ts rg -n -C3 --type=ts '\bcreatePod\s*\(' frontend/e2eRepository: openshift/console
Length of output: 2756
Fix remaining
createPodcallsites to use the new single-argumentV1Podcontract
frontend/e2e/clients/kubernetes-client.tsnow expectscreatePod(pod: k8s.V1Pod)and throws unlesspod.metadata?.namespaceis present.frontend/e2e/tests/console/app/resource-log.spec.tsstill calls the old two-argument form (k8sClient.createPod(ns, examplePodSpec)/k8sClient.createPod(ns, wrapPodSpec)), so those tests will hit the error path at runtime. Update those callsites to pass a fullV1Podobject (withmetadata.namespace).🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@frontend/e2e/clients/kubernetes-client.ts` around lines 479 - 487, The tests calling the old two-argument createPod API need to be updated to build and pass a complete k8s.V1Pod with metadata.namespace set and call createPod(pod: V1Pod). In frontend/e2e/tests/console/app/resource-log.spec.ts replace calls like k8sClient.createPod(ns, examplePodSpec) or k8sClient.createPod(ns, wrapPodSpec) by ensuring examplePodSpec/wrapPodSpec are wrapped or extended into a V1Pod object that has metadata = { name: ..., namespace: ns } (or at minimum metadata.namespace = ns) and then call k8sClient.createPod(pod). Keep using the existing createPod method name and ensure any helper that previously returned only a PodSpec now returns or is wrapped into a full V1Pod with metadata.namespace populated.
Migrate 6 Cypress test files (21 tests) from packages/integration-tests/tests/app/ to Playwright: - masthead (6 tests) - overview (2 tests) - node-terminal (1 test) - resource-log (3 tests) - template (1 test) - filtering-and-searching (8 tests) New page objects: list-page, details-page, logs-page, catalog-page, masthead-page, overview-page. Extended KubernetesClient with createPod, deletePod, waitForPodReady, createDeployment, waitForDeploymentReady. Deleted Cypress files and their exclusive dependencies (views/logs.ts, views/catalogs.ts, views/overview.ts, fixture YAMLs) after validation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
7dbdc2e to
a0f2d7e
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.claude/skills/debug-e2e/SKILL.md:
- Around line 19-31: Replace stale `/debug-test` references with `/debug-e2e` in
documentation: open AGENTS.md and .claude/migration-context.md and change any
occurrences of the literal command string "/debug-test" to "/debug-e2e"
(matching the examples in .claude/skills/debug-e2e/SKILL.md), and update any
example usages or command flags so they mirror the current `/debug-e2e`
invocation format (including project/workers examples) to keep docs consistent.
In `@frontend/e2e/pages/list-page.ts`:
- Line 53: The locator currently uses hasText: 'Name' which does substring
matching and may match "Namespace"; change the selector passed to robustClick to
use exact text matching — e.g., replace
this.page.locator('.pf-v6-c-menu__list-item', { hasText: 'Name' }) with an
exact-text locator such as this.page.getByText('Name', { exact: true }) or
this.page.locator('.pf-v6-c-menu__list-item', { hasText: /^Name$/ }) so
robustClick targets only the "Name" menu item.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: c946e48f-e5f6-4a73-9447-957a3533d06e
📒 Files selected for processing (37)
.claude/migration-context.md.claude/skills/debug-e2e/SKILL.mdfrontend/e2e/clients/kubernetes-client.tsfrontend/e2e/pages/base-page.tsfrontend/e2e/pages/catalog-page.tsfrontend/e2e/pages/details-page.tsfrontend/e2e/pages/list-page.tsfrontend/e2e/pages/logs-page.tsfrontend/e2e/pages/masthead-page.tsfrontend/e2e/pages/overview-page.tsfrontend/e2e/tests/console/app/filtering-and-searching.spec.tsfrontend/e2e/tests/console/app/masthead.spec.tsfrontend/e2e/tests/console/app/node-terminal.spec.tsfrontend/e2e/tests/console/app/overview.spec.tsfrontend/e2e/tests/console/app/resource-log.spec.tsfrontend/e2e/tests/console/app/template.spec.tsfrontend/e2e/tests/console/cluster-settings/channel-modal.spec.tsfrontend/e2e/tests/console/cluster-settings/update-in-progress.spec.tsfrontend/e2e/tests/console/cluster-settings/update-modal.spec.tsfrontend/e2e/tests/console/cluster-settings/updates-graph.spec.tsfrontend/e2e/tests/console/cluster-settings/upgradeable-false.spec.tsfrontend/e2e/tests/console/cluster-settings/worker-mcp-paused.spec.tsfrontend/packages/integration-tests/fixtures/httpd-example-template.yamlfrontend/packages/integration-tests/fixtures/pod-with-space.yamlfrontend/packages/integration-tests/fixtures/pod-with-wrap-annotation.yamlfrontend/packages/integration-tests/tests/app/filtering-and-searching.cy.tsfrontend/packages/integration-tests/tests/app/masthead.cy.tsfrontend/packages/integration-tests/tests/app/node-terminal.cy.tsfrontend/packages/integration-tests/tests/app/overview.cy.tsfrontend/packages/integration-tests/tests/app/resource-log.cy.tsfrontend/packages/integration-tests/tests/app/template.cy.tsfrontend/packages/integration-tests/views/catalogs.tsfrontend/packages/integration-tests/views/logs.tsfrontend/packages/integration-tests/views/overview.tsfrontend/playwright.config.tsfrontend/public/components/utils/container-select.tsxfrontend/public/components/utils/resource-log.tsx
💤 Files with no reviewable changes (13)
- frontend/packages/integration-tests/fixtures/pod-with-space.yaml
- frontend/packages/integration-tests/tests/app/node-terminal.cy.ts
- frontend/packages/integration-tests/tests/app/template.cy.ts
- frontend/packages/integration-tests/tests/app/resource-log.cy.ts
- frontend/packages/integration-tests/tests/app/overview.cy.ts
- frontend/packages/integration-tests/fixtures/pod-with-wrap-annotation.yaml
- frontend/packages/integration-tests/fixtures/httpd-example-template.yaml
- frontend/packages/integration-tests/views/catalogs.ts
- frontend/packages/integration-tests/tests/app/masthead.cy.ts
- frontend/packages/integration-tests/tests/app/filtering-and-searching.cy.ts
- frontend/packages/integration-tests/views/overview.ts
- frontend/packages/integration-tests/views/logs.ts
- frontend/playwright.config.ts
✅ Files skipped from review due to trivial changes (1)
- frontend/public/components/utils/resource-log.tsx
🚧 Files skipped from review as they are similar to previous changes (20)
- frontend/e2e/tests/console/cluster-settings/channel-modal.spec.ts
- frontend/e2e/tests/console/cluster-settings/updates-graph.spec.ts
- frontend/e2e/tests/console/app/node-terminal.spec.ts
- frontend/e2e/pages/base-page.ts
- frontend/e2e/pages/catalog-page.ts
- frontend/e2e/tests/console/cluster-settings/update-modal.spec.ts
- frontend/e2e/tests/console/cluster-settings/worker-mcp-paused.spec.ts
- frontend/e2e/tests/console/cluster-settings/update-in-progress.spec.ts
- frontend/e2e/pages/masthead-page.ts
- frontend/e2e/pages/logs-page.ts
- frontend/e2e/clients/kubernetes-client.ts
- frontend/e2e/tests/console/app/resource-log.spec.ts
- frontend/e2e/tests/console/app/masthead.spec.ts
- frontend/e2e/tests/console/app/template.spec.ts
- frontend/e2e/tests/console/cluster-settings/upgradeable-false.spec.ts
- frontend/e2e/pages/overview-page.ts
- .claude/migration-context.md
- frontend/e2e/pages/details-page.ts
- frontend/e2e/tests/console/app/overview.spec.ts
- frontend/e2e/tests/console/app/filtering-and-searching.spec.ts
| - **Spec file**: `/debug-e2e e2e/tests/console/cluster-settings/upstream-modal.spec.ts` | ||
| - **Test name**: `/debug-e2e "Verify console login"` | ||
| - **Directory**: `/debug-e2e e2e/tests/helm/` | ||
| - **Project**: `/debug-e2e --project=helm` | ||
| - **Optional workers**: append `--workers=N` (default: 4) | ||
|
|
||
| Examples: | ||
|
|
||
| ```text | ||
| /debug-test e2e/tests/console/cluster-settings/upstream-modal.spec.ts | ||
| /debug-test e2e/tests/helm/ --workers=2 | ||
| /debug-test --project=topology | ||
| /debug-e2e e2e/tests/console/cluster-settings/upstream-modal.spec.ts | ||
| /debug-e2e e2e/tests/helm/ --workers=2 | ||
| /debug-e2e --project=topology | ||
| ``` |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Read-only check for stale command references after skill rename
rg -n --fixed-strings '/debug-test' AGENTS.md .claude/migration-context.md .claude/skills/debug-e2e/SKILL.md
rg -n --fixed-strings '/debug-e2e' AGENTS.md .claude/migration-context.md .claude/skills/debug-e2e/SKILL.mdRepository: openshift/console
Length of output: 1732
Update stale /debug-test references to /debug-e2e in workflow/context docs.
/debug-test is still referenced in AGENTS.md:136 and .claude/migration-context.md:3, while .claude/skills/debug-e2e/SKILL.md documents /debug-e2e. Update those docs so users don’t run the old command.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.claude/skills/debug-e2e/SKILL.md around lines 19 - 31, Replace stale
`/debug-test` references with `/debug-e2e` in documentation: open AGENTS.md and
.claude/migration-context.md and change any occurrences of the literal command
string "/debug-test" to "/debug-e2e" (matching the examples in
.claude/skills/debug-e2e/SKILL.md), and update any example usages or command
flags so they mirror the current `/debug-e2e` invocation format (including
project/workers examples) to keep docs consistent.
| async filterByName(name: string): Promise<void> { | ||
| const filterToggle = this.dataViewFilters.locator('.pf-v6-c-menu-toggle').first(); | ||
| await this.robustClick(filterToggle); | ||
| await this.robustClick(this.page.locator('.pf-v6-c-menu__list-item', { hasText: 'Name' })); |
There was a problem hiding this comment.
Use exact text matching for the filter option.
Line 53 uses hasText: 'Name', which is a substring match and can click the wrong option when another item also contains “Name” (for example, “Namespace”). Use an exact matcher.
Suggested fix
- await this.robustClick(this.page.locator('.pf-v6-c-menu__list-item', { hasText: 'Name' }));
+ await this.robustClick(
+ this.page.locator('.pf-v6-c-menu__list-item', { hasText: /^Name$/ }),
+ );🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@frontend/e2e/pages/list-page.ts` at line 53, The locator currently uses
hasText: 'Name' which does substring matching and may match "Namespace"; change
the selector passed to robustClick to use exact text matching — e.g., replace
this.page.locator('.pf-v6-c-menu__list-item', { hasText: 'Name' }) with an
exact-text locator such as this.page.getByText('Name', { exact: true }) or
this.page.locator('.pf-v6-c-menu__list-item', { hasText: /^Name$/ }) so
robustClick targets only the "Name" menu item.
|
@stefanonardo: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Analysis / Root cause:
CONSOLE-5235 — Migrate 6 Cypress test files (21 tests) from
packages/integration-tests/tests/app/to Playwright as part of the OCP 5.0 Playwright migration effort (CONSOLE-5196).Solution description:
Migrated all 6 basic app Cypress test files to idiomatic Playwright:
masthead.cy.tsmasthead.spec.tsoverview.cy.tsoverview.spec.tsnode-terminal.cy.tsnode-terminal.spec.tsresource-log.cy.tsresource-log.spec.tstemplate.cy.tstemplate.spec.tsfiltering-and-searching.cy.tsfiltering-and-searching.spec.tsNew page objects (reusable across future migrations):
ListPage— DataView table, filtering by name, row assertionsDetailsPage— resource details loading, tab navigation, kebab actions (merged with upstream additions)LogsPage— log viewer options, wrap toggle, container select, searchCatalogPage— catalog filtering, item/icon assertionsMastheadPage— logo, quick create, user dropdownOverviewPage— cluster overview + topology list view, sidebar (merged with upstream additions)KubernetesClient extensions:
createPod,deletePod,waitForPodReady(with container readiness check),createDeployment,waitForDeploymentReadyKey translation decisions:
cy.exec('oc ...')withKubernetesClientAPI callscy.login()/cy.initAdmin()withstorageStateauthcy.wait(ms)with condition-based assertionscleanup.trackNamespace()Partial<V1Pod>/Partial<V1Deployment>types to avoid unsafeas anycastsDate.now()) to prevent collisionsFixes to existing cluster-settings tests:
Tests that use
page.route()to mock Kubernetes API responses (e.g. ClusterVersion, MachineConfigPool) were failing because the console'swatchK8sObjectmakes two requests per watched resource: an HTTP GET (intercepted bypage.route()) and a WebSocket watch (not intercepted). The WebSocket delivered real cluster data that overwrote the mocked GET response in the Redux store.Fix: Added
page.routeWebSocket(pattern, () => {})calls alongside the existingpage.route()mocks. When the handler doesn't callconnectToServer(), Playwright creates a mock WebSocket that appears open to the page but never delivers server messages. The URL patterns are specific (e.g./apis\/config\.openshift\.io\/v1\/clusterversions/), so only matching WebSocket connections are intercepted — all other WebSockets pass through normally.In
update-modal.spec.ts, the previous 45-linestubMachineConfigPoolWebSocket()function usedpage.addInitScript()to monkey-patch the globalWebSocketconstructor. This was replaced with two idiomatic one-liners usingpage.routeWebSocket()(available since Playwright 1.48; project uses 1.59+), which provides the same selective interception behavior without modifying global browser state.Affected files:
channel-modal.spec.ts,update-in-progress.spec.ts,upgradeable-false.spec.ts,updates-graph.spec.ts,update-modal.spec.ts,worker-mcp-paused.spec.ts.Additional page object fixes:
overview-page.ts: FixedlabelCell()— the.odc-topology-list-view__label-cellelement contains both the kind badge prefix (e.g. "DaemonSetD") and the resource name, so the regex^name$never matched. Changed to substring match.catalog-page.ts: FixedcatalogItemIcon()— PatternFly's CatalogTile renders<img alt="">, which per ARIA spec hasrole="presentation", sogetByRole('img')correctly skips it. Changed to CSS selectorimg.catalog-tile-pf-icon.Screenshots / screen recording:
Test setup:
Requires a running OpenShift cluster. Configure
frontend/e2e/.envwith cluster credentials, then run:Test cases:
--retries=0npx tsc --noEmit)eslint-plugin-playwrightrulesBrowser conformance:
Additional info:
details-page.ts,list-page.ts,modal.ts,yaml-editor.ts) are still used by other unmigrated tests and were intentionally kept🤖 Generated with Claude Code
Summary by CodeRabbit
Tests
Chores
Documentation