CONSOLE-5281: Migrate Cypress E2E tests to Playwright (batch 2)#16454
CONSOLE-5281: Migrate Cypress E2E tests to Playwright (batch 2)#16454rhamilto wants to merge 1 commit into
Conversation
|
@rhamilto: This pull request references CONSOLE-5281 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. |
|
Skipping CI for Draft Pull Request. |
074fbfd to
0b4f078
Compare
|
/unhold |
|
tech debt |
|
@rhamilto: 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 |
|
@rhamilto: This pull request references CONSOLE-5281 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. |
📝 WalkthroughWalkthroughThis PR achieves a comprehensive migration of end-to-end tests from Cypress to Playwright across multiple console features. It establishes new Playwright infrastructure (Kubernetes client extensions, page objects, test utilities), implements 20+ new Playwright test specs covering Alertmanager receivers, CRD extensions, Events, Favorites, Pseudolocalization, and OLM flows, removes the corresponding Cypress implementations, and polishes components with data-test selectors and a null-safety fix in the CRD printer columns hook. Suggested reviewers
🚥 Pre-merge checks | ✅ 12✅ Passed checks (12 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: 14
🧹 Nitpick comments (2)
frontend/e2e/tests/console/crd-extensions/crd-test-utils.ts (1)
13-23: ⚡ Quick winStandardize these Playwright locators on
getByTestId.Placeholder/role/regex selectors here are fragile compared to the repo’s required test-id strategy. Please migrate these selectors and add missing
data-testhooks where needed.As per coding guidelines: "
**/*.{tsx,ts}: Always usepage.getByTestId('x')for Playwright selectors ... If a React element only has a legacy test attribute, adddata-testto the element."Also applies to: 34-45, 147-148
🤖 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/crd-extensions/crd-test-utils.ts` around lines 13 - 23, Replace fragile placeholder/role/regex selectors with test-id based selectors: use page.getByTestId(...) instead of page.locator('input[placeholder="Filter by name"]') for searchInput, replace the row match (crdRow) that uses getByRole with a test-id on the row element and fetch it via getByTestId, and swap the kebabButton lookup to getByTestId('kebab-button'); update the menu action lookup to use a test-id on the "View instances" menu item (or use getByTestId for the menu) and click via that selector. Add the corresponding data-test/data-test-id attributes to the React components rendering the search input, CRD row, kebab button, and "View instances" menu item so tests can use page.getByTestId consistently, and apply the same replacements to the other similar selectors elsewhere in this file.frontend/e2e/pages/alertmanager-page.ts (1)
39-39: ⚡ Quick winUse
getByTestIdselectors instead of role/text selectors in Playwright helpers.These locators are currently role/name-based and are more brittle than the repo standard. Please switch to
page.getByTestId(...)and add missingdata-testhooks where needed.As per coding guidelines: "
**/*.{tsx,ts}: Always usepage.getByTestId('x')for Playwright selectors ... If a React element only has a legacy test attribute, adddata-testto the element."Also applies to: 116-131
🤖 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/alertmanager-page.ts` at line 39, Replace brittle role/name-based Playwright locators that call this.page.getByRole('button', { name: 'Copy code to clipboard' }) (and similar occurrences around the other locators) with page.getByTestId('...') calls; add matching data-test attributes (e.g., data-test="copy-code-button") to the corresponding React elements where those buttons/texts are rendered so the new selectors can target them, update the helper(s) in alertmanager-page.ts to use page.getByTestId for all detections referenced (including the occurrences around the other block noted), and ensure test IDs follow the repo convention.
🤖 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 `@frontend/e2e/clients/kubernetes-client.ts`:
- Around line 492-496: createPod uses non-null assertions on
pod.metadata!.namespace! and can throw unclear runtime errors when callers omit
namespace; add an explicit guard at the start of createPod (in
frontend/e2e/clients/kubernetes-client.ts) that checks pod.metadata and
pod.metadata.namespace and throws a clear Error (e.g., "createPod: missing
pod.metadata.namespace") if absent, before calling
this.k8sApi.createNamespacedPod, so callers get a deterministic validation error
instead of an exception from the K8s client.
In `@frontend/e2e/pages/alertmanager-page.ts`:
- Around line 150-157: yaml.load(yamlContent) can return
undefined/null/primitives so asserting to AlertmanagerConfig is unsafe; add a
runtime guard after calling yaml.load to ensure config is an object before
accessing config.receivers or config.global. Specifically, in the function using
AlertmanagerConfig, check that the result of yaml.load(yamlContent) is a
non-null object (e.g., typeof === "object" && result !== null) and only then
cast to AlertmanagerConfig; fallback to an empty object for config so that the
lookup for receiver (using receiverName and configName) and the returned
globals/receiverConfig are safe (return {} or appropriate defaults when config
is invalid). Ensure the receiver variable lookup (config.receivers?.find(...))
and the return of globals and receiverConfig use this guarded config.
In `@frontend/e2e/pages/navigation.ts`:
- Around line 6-23: Update the Navigation class to extend BasePage and call
super(page) in the constructor, convert ephemeral role-based queries into
private readonly locator properties using this.page.getByTestId(...) (e.g.
private readonly sectionButton = this.page.getByTestId('nav-section-{name}') and
private readonly navLink = this.page.getByTestId('nav-link-{name}') — choose the
app's existing test-id patterns), and refactor navigateViaNav to use those
private locators (lookup the specific section/link test-id using the section and
link parameters, click them, and await load state) so the page object follows
the shared contract (BasePage + private readonly test-id locators + async action
methods).
- Around line 20-21: Replace the unconditional toggle of sectionButton with a
conditional check of its expansion state: locate the code using sectionButton
and this.page.getByRole({ name: link }).click() and instead inspect the
sectionButton's expansion attribute (e.g., getAttribute('aria-expanded') or
evaluate to check a CSS/class state) and only invoke sectionButton.click() if it
is not already expanded; after ensuring the section is open, proceed to await
this.page.getByRole('link', { name: link }).click() and optionally wait for the
link to be visible/enabled before clicking.
In `@frontend/e2e/tests/console/crd-extensions/console-cli-download.spec.ts`:
- Around line 39-52: Replace the manual test.afterEach deletion with the test
cleanup fixture: when creating the ConsoleCLIDownload resource, register it with
the cleanup fixture (e.g., cleanup.add or equivalent) instead of relying on
test.afterEach; remove the try/catch that swallows all errors around
k8sClient.deleteCustomResource and let the cleanup fixture handle removal, and
if you must call k8sClient.deleteCustomResource directly only ignore explicit
not-found errors (check error.code/message) for the resource identified by name
and namespace when invoking
k8sClient.deleteCustomResource('console.openshift.io','v1','',
'consoleclidownloads', name).
In `@frontend/e2e/tests/console/crd-extensions/console-external-log-link.spec.ts`:
- Around line 82-109: Replace the broad try/catch cleanup in test.afterEach by
registering created resources with the provided cleanup fixture instead of
swallowing errors: when creating the Pod (podName), the ConsoleExternalLogLink
instance (resource kind 'consoleexternalloglinks' / variable name), and the
Project (projectName) call the cleanup registration helper (cleanup.register or
similar) immediately after creation so the fixture handles deletion and surfaces
unexpected failures; remove the k8sClient.deletePod,
k8sClient.deleteCustomResource and k8sClient.deleteProject try/catch blocks and
rely on the cleanup fixture to perform and report teardown.
In `@frontend/e2e/tests/console/crd-extensions/console-link.spec.ts`:
- Around line 107-120: The test currently deletes the ConsoleLink in a finally
block which swallows errors; instead register the resource deletion with the
shared cleanup fixture when you create the ConsoleLink so teardown is
deterministic and observable: remove the finally/try-catch block and,
immediately after creating the CR (where name is assigned), call
cleanup.add(async () => await
k8sClient.deleteCustomResource('console.openshift.io','v1','', 'consolelinks',
name)); ensure the cleanup callback does not silently swallow errors (let
Playwright surface failures or log them) and keep the test assertions
independent of cleanup.
In `@frontend/e2e/tests/console/crd-extensions/console-notification.spec.ts`:
- Around line 37-139: Replace the ad-hoc try/finally deletion with the shared
cleanup fixture: after creating the ConsoleNotification via
createCustomResourceViaYaml (inside the "Create ConsoleNotification instance via
YAML editor" step) call the cleanup fixture to register the resource for
teardown (e.g., cleanup.registerResource or similar cleanup API) using the same
identifiers (console.openshift.io, v1, '', 'consolenotifications', and name);
remove the explicit deletion step that calls k8sClient.deleteCustomResource and
delete the finally block that also calls k8sClient.deleteCustomResource so
teardown is handled solely by cleanup.
In `@frontend/e2e/tests/console/crd-extensions/console-yaml-sample.spec.ts`:
- Around line 59-139: The test currently creates resources with
k8sClient.createProject(projectName) and performs manual teardown in a
try/finally using k8sClient.deleteCustomResource(...) and
k8sClient.deleteProject(...); move those teardown calls into the shared cleanup
fixture instead of the try/finally: after creating the project and after
creating the ConsoleYAMLSample/Job, register cleanup tasks with the suite's
cleanup fixture (e.g., call the fixture's register/add method to delete the
ConsoleYAMLSample via k8sClient.deleteCustomResource and to delete the project
via k8sClient.deleteProject) and then remove the surrounding try/finally block
and duplicate deletes so the test body only creates/asserts and cleanup handles
all deletions.
In `@frontend/e2e/tests/console/crd-extensions/crd-test-utils.ts`:
- Around line 80-82: jsYaml.load(existingContent) can return undefined or null
so guard before spreading: ensure existingObj is a plain object (fallback to {})
after calling jsYaml.load, then create mergedObj from that safe object and obj;
similarly apply the same guard where jsYaml.load is used at the other location
(lines referenced) so that functions/operations using existingObj, mergedObj, or
passing the value to modifier never receive null/undefined.
In `@frontend/e2e/tests/console/events/events.spec.ts`:
- Around line 44-55: Replace the manual afterEach teardown that calls
k8sClient.deletePod/deleteProject with the test cleanup fixture: when you create
resources (podName/projectName) in the test or its setup, call the cleanup
fixture registration method (e.g., cleanup.registerPod(podName, projectName) or
cleanup.registerProject(projectName) depending on your cleanup API) so the
global cleanup handles deletion; remove the try/catch block in test.afterEach
and ensure all places that call k8sClient.createPod/createProject register those
names with the cleanup fixture instead.
- Around line 79-80: Replace the flaky exact-count assertion on the
'event-warning' test locator with a presence check plus a content check: instead
of asserting toHaveCount(1) on page.getByTestId('event-warning'), assert the
locator's count is >= 1 (e.g., expect(await
page.getByTestId('event-warning').count()).toBeGreaterThanOrEqual(1)) and
additionally assert the warning text contains the expected ImagePullBackOff
message using page.getByTestId('event-warning').toContainText(...) or by
locating the specific text within that locator, referencing the existing
page.getByTestId('event-warning') and page.getByTestId('event-totals') locators.
In `@frontend/e2e/tests/console/favorites/favorites.spec.ts`:
- Around line 55-85: The test "Disable add to favorite button when limit
reached" fills favorites up and never cleans them; update the test to remove the
created entries in a teardown/cleanup block (e.g., finally or an afterEach for
this step) so later specs are not polluted: identify the created favorites by
the names you filled (`test-favorite-${i}`) or by using the same UI controls
(navigate to the pages used in the pages array, open the favorite menu via the
`favorite-button`, locate the created entry in the `dialog`/list and
delete/unfavorite it) or call the app's API to clear those favorites; ensure the
cleanup uses the same selectors (`getByTestId('favorite-button')`,
`getByTestId('input-name')`) and runs even on failures.
In `@frontend/e2e/tests/olm/create-namespace.spec.ts`:
- Around line 15-53: Replace the manual teardown in test.afterEach by
registering the same cleanup steps with the shared cleanup fixture: remove the
test.afterEach block and instead call cleanup.register(...) passing async
callbacks that invoke k8sClient.deleteCustomResource for 'subscriptions' and for
each name returned by k8sClient.listCustomResources('clusterserviceversions'),
and k8sClient.deleteProject(nsName); preserve the existing try/catch semantics
by catching errors inside each registered callback so failures are ignored
during cleanup; ensure you reference the same nsName variable and methods
(k8sClient.deleteCustomResource, k8sClient.listCustomResources,
k8sClient.deleteProject) when adding the cleanup registrations.
---
Nitpick comments:
In `@frontend/e2e/pages/alertmanager-page.ts`:
- Line 39: Replace brittle role/name-based Playwright locators that call
this.page.getByRole('button', { name: 'Copy code to clipboard' }) (and similar
occurrences around the other locators) with page.getByTestId('...') calls; add
matching data-test attributes (e.g., data-test="copy-code-button") to the
corresponding React elements where those buttons/texts are rendered so the new
selectors can target them, update the helper(s) in alertmanager-page.ts to use
page.getByTestId for all detections referenced (including the occurrences around
the other block noted), and ensure test IDs follow the repo convention.
In `@frontend/e2e/tests/console/crd-extensions/crd-test-utils.ts`:
- Around line 13-23: Replace fragile placeholder/role/regex selectors with
test-id based selectors: use page.getByTestId(...) instead of
page.locator('input[placeholder="Filter by name"]') for searchInput, replace the
row match (crdRow) that uses getByRole with a test-id on the row element and
fetch it via getByTestId, and swap the kebabButton lookup to
getByTestId('kebab-button'); update the menu action lookup to use a test-id on
the "View instances" menu item (or use getByTestId for the menu) and click via
that selector. Add the corresponding data-test/data-test-id attributes to the
React components rendering the search input, CRD row, kebab button, and "View
instances" menu item so tests can use page.getByTestId consistently, and apply
the same replacements to the other similar selectors elsewhere in this file.
🪄 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: 2358759e-78c9-49db-af52-824237894660
📒 Files selected for processing (40)
frontend/e2e/clients/kubernetes-client.tsfrontend/e2e/pages/alertmanager-page.tsfrontend/e2e/pages/navigation.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/alertmanager-test-utils.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/alertmanager.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/email.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/pagerduty.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/slack.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/webhook.spec.tsfrontend/e2e/tests/console/crd-extensions/console-cli-download.spec.tsfrontend/e2e/tests/console/crd-extensions/console-external-log-link.spec.tsfrontend/e2e/tests/console/crd-extensions/console-link.spec.tsfrontend/e2e/tests/console/crd-extensions/console-notification.spec.tsfrontend/e2e/tests/console/crd-extensions/console-yaml-sample.spec.tsfrontend/e2e/tests/console/crd-extensions/crd-test-utils.tsfrontend/e2e/tests/console/events/events.spec.tsfrontend/e2e/tests/console/favorites/favorites.spec.tsfrontend/e2e/tests/console/i18n/pseudolocalization.spec.tsfrontend/e2e/tests/olm/create-namespace.spec.tsfrontend/packages/console-app/src/components/nodes/node-dashboard/UtilizationCard.tsxfrontend/packages/console-shared/src/components/links/ExternalLink.tsxfrontend/packages/console-shared/src/hooks/useCRDAdditionalPrinterColumns.tsfrontend/packages/integration-tests/tests/cluster-settings/alertmanager/alertmanager.cy.tsfrontend/packages/integration-tests/tests/cluster-settings/alertmanager/receivers/email.cy.tsfrontend/packages/integration-tests/tests/cluster-settings/alertmanager/receivers/pagerduty.cy.tsfrontend/packages/integration-tests/tests/cluster-settings/alertmanager/receivers/slack.cy.tsfrontend/packages/integration-tests/tests/cluster-settings/alertmanager/receivers/webhook.cy.tsfrontend/packages/integration-tests/tests/crd-extensions/console-cli-download.cy.tsfrontend/packages/integration-tests/tests/crd-extensions/console-external-log-link.cy.tsfrontend/packages/integration-tests/tests/crd-extensions/console-link.cy.tsfrontend/packages/integration-tests/tests/crd-extensions/console-notification.cy.tsfrontend/packages/integration-tests/tests/crd-extensions/console-yaml-sample.cy.tsfrontend/packages/integration-tests/tests/events/events.cy.tsfrontend/packages/integration-tests/tests/favorite/favorite-option.cy.tsfrontend/packages/integration-tests/tests/i18n/pseudolocalization.cy.tsfrontend/packages/integration-tests/views/alertmanager.tsfrontend/packages/operator-lifecycle-manager/integration-tests/tests/create-namespace.cy.tsfrontend/public/components/dashboard/dashboards-page/cluster-dashboard/utilization-card.tsxfrontend/public/components/dashboard/project-dashboard/utilization-card.tsxfrontend/public/components/factory/text-filter.tsx
💤 Files with no reviewable changes (15)
- frontend/packages/operator-lifecycle-manager/integration-tests/tests/create-namespace.cy.ts
- frontend/packages/integration-tests/tests/cluster-settings/alertmanager/receivers/webhook.cy.ts
- frontend/packages/integration-tests/tests/cluster-settings/alertmanager/alertmanager.cy.ts
- frontend/packages/integration-tests/tests/crd-extensions/console-notification.cy.ts
- frontend/packages/integration-tests/tests/crd-extensions/console-cli-download.cy.ts
- frontend/packages/integration-tests/tests/events/events.cy.ts
- frontend/packages/integration-tests/tests/crd-extensions/console-link.cy.ts
- frontend/packages/integration-tests/tests/i18n/pseudolocalization.cy.ts
- frontend/packages/integration-tests/tests/cluster-settings/alertmanager/receivers/slack.cy.ts
- frontend/packages/integration-tests/tests/cluster-settings/alertmanager/receivers/email.cy.ts
- frontend/packages/integration-tests/views/alertmanager.ts
- frontend/packages/integration-tests/tests/crd-extensions/console-yaml-sample.cy.ts
- frontend/packages/integration-tests/tests/crd-extensions/console-external-log-link.cy.ts
- frontend/packages/integration-tests/tests/favorite/favorite-option.cy.ts
- frontend/packages/integration-tests/tests/cluster-settings/alertmanager/receivers/pagerduty.cy.ts
📜 Review details
🧰 Additional context used
📓 Path-based instructions (13)
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/packages/console-app/src/components/nodes/node-dashboard/UtilizationCard.tsxfrontend/public/components/dashboard/project-dashboard/utilization-card.tsxfrontend/e2e/tests/console/crd-extensions/console-cli-download.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/alertmanager-test-utils.tsfrontend/public/components/factory/text-filter.tsxfrontend/public/components/dashboard/dashboards-page/cluster-dashboard/utilization-card.tsxfrontend/packages/console-shared/src/components/links/ExternalLink.tsxfrontend/e2e/tests/olm/create-namespace.spec.tsfrontend/packages/console-shared/src/hooks/useCRDAdditionalPrinterColumns.tsfrontend/e2e/pages/alertmanager-page.tsfrontend/e2e/tests/console/events/events.spec.tsfrontend/e2e/tests/console/crd-extensions/console-link.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/webhook.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/email.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/slack.spec.tsfrontend/e2e/tests/console/crd-extensions/console-notification.spec.tsfrontend/e2e/clients/kubernetes-client.tsfrontend/e2e/tests/console/i18n/pseudolocalization.spec.tsfrontend/e2e/tests/console/crd-extensions/crd-test-utils.tsfrontend/e2e/tests/console/crd-extensions/console-yaml-sample.spec.tsfrontend/e2e/tests/console/favorites/favorites.spec.tsfrontend/e2e/pages/navigation.tsfrontend/e2e/tests/console/crd-extensions/console-external-log-link.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/alertmanager.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/pagerduty.spec.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/packages/console-app/src/components/nodes/node-dashboard/UtilizationCard.tsxfrontend/public/components/dashboard/project-dashboard/utilization-card.tsxfrontend/e2e/tests/console/crd-extensions/console-cli-download.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/alertmanager-test-utils.tsfrontend/public/components/factory/text-filter.tsxfrontend/public/components/dashboard/dashboards-page/cluster-dashboard/utilization-card.tsxfrontend/packages/console-shared/src/components/links/ExternalLink.tsxfrontend/e2e/tests/olm/create-namespace.spec.tsfrontend/packages/console-shared/src/hooks/useCRDAdditionalPrinterColumns.tsfrontend/e2e/pages/alertmanager-page.tsfrontend/e2e/tests/console/events/events.spec.tsfrontend/e2e/tests/console/crd-extensions/console-link.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/webhook.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/email.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/slack.spec.tsfrontend/e2e/tests/console/crd-extensions/console-notification.spec.tsfrontend/e2e/clients/kubernetes-client.tsfrontend/e2e/tests/console/i18n/pseudolocalization.spec.tsfrontend/e2e/tests/console/crd-extensions/crd-test-utils.tsfrontend/e2e/tests/console/crd-extensions/console-yaml-sample.spec.tsfrontend/e2e/tests/console/favorites/favorites.spec.tsfrontend/e2e/pages/navigation.tsfrontend/e2e/tests/console/crd-extensions/console-external-log-link.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/alertmanager.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/pagerduty.spec.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/packages/console-app/src/components/nodes/node-dashboard/UtilizationCard.tsxfrontend/public/components/dashboard/project-dashboard/utilization-card.tsxfrontend/e2e/tests/console/crd-extensions/console-cli-download.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/alertmanager-test-utils.tsfrontend/public/components/factory/text-filter.tsxfrontend/public/components/dashboard/dashboards-page/cluster-dashboard/utilization-card.tsxfrontend/packages/console-shared/src/components/links/ExternalLink.tsxfrontend/e2e/tests/olm/create-namespace.spec.tsfrontend/packages/console-shared/src/hooks/useCRDAdditionalPrinterColumns.tsfrontend/e2e/pages/alertmanager-page.tsfrontend/e2e/tests/console/events/events.spec.tsfrontend/e2e/tests/console/crd-extensions/console-link.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/webhook.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/email.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/slack.spec.tsfrontend/e2e/tests/console/crd-extensions/console-notification.spec.tsfrontend/e2e/clients/kubernetes-client.tsfrontend/e2e/tests/console/i18n/pseudolocalization.spec.tsfrontend/e2e/tests/console/crd-extensions/crd-test-utils.tsfrontend/e2e/tests/console/crd-extensions/console-yaml-sample.spec.tsfrontend/e2e/tests/console/favorites/favorites.spec.tsfrontend/e2e/pages/navigation.tsfrontend/e2e/tests/console/crd-extensions/console-external-log-link.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/alertmanager.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/pagerduty.spec.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/packages/console-app/src/components/nodes/node-dashboard/UtilizationCard.tsxfrontend/public/components/dashboard/project-dashboard/utilization-card.tsxfrontend/e2e/tests/console/crd-extensions/console-cli-download.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/alertmanager-test-utils.tsfrontend/public/components/factory/text-filter.tsxfrontend/public/components/dashboard/dashboards-page/cluster-dashboard/utilization-card.tsxfrontend/packages/console-shared/src/components/links/ExternalLink.tsxfrontend/e2e/tests/olm/create-namespace.spec.tsfrontend/packages/console-shared/src/hooks/useCRDAdditionalPrinterColumns.tsfrontend/e2e/pages/alertmanager-page.tsfrontend/e2e/tests/console/events/events.spec.tsfrontend/e2e/tests/console/crd-extensions/console-link.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/webhook.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/email.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/slack.spec.tsfrontend/e2e/tests/console/crd-extensions/console-notification.spec.tsfrontend/e2e/clients/kubernetes-client.tsfrontend/e2e/tests/console/i18n/pseudolocalization.spec.tsfrontend/e2e/tests/console/crd-extensions/crd-test-utils.tsfrontend/e2e/tests/console/crd-extensions/console-yaml-sample.spec.tsfrontend/e2e/tests/console/favorites/favorites.spec.tsfrontend/e2e/pages/navigation.tsfrontend/e2e/tests/console/crd-extensions/console-external-log-link.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/alertmanager.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/pagerduty.spec.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/packages/console-app/src/components/nodes/node-dashboard/UtilizationCard.tsxfrontend/public/components/dashboard/project-dashboard/utilization-card.tsxfrontend/e2e/tests/console/crd-extensions/console-cli-download.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/alertmanager-test-utils.tsfrontend/public/components/factory/text-filter.tsxfrontend/public/components/dashboard/dashboards-page/cluster-dashboard/utilization-card.tsxfrontend/packages/console-shared/src/components/links/ExternalLink.tsxfrontend/e2e/tests/olm/create-namespace.spec.tsfrontend/packages/console-shared/src/hooks/useCRDAdditionalPrinterColumns.tsfrontend/e2e/pages/alertmanager-page.tsfrontend/e2e/tests/console/events/events.spec.tsfrontend/e2e/tests/console/crd-extensions/console-link.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/webhook.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/email.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/slack.spec.tsfrontend/e2e/tests/console/crd-extensions/console-notification.spec.tsfrontend/e2e/clients/kubernetes-client.tsfrontend/e2e/tests/console/i18n/pseudolocalization.spec.tsfrontend/e2e/tests/console/crd-extensions/crd-test-utils.tsfrontend/e2e/tests/console/crd-extensions/console-yaml-sample.spec.tsfrontend/e2e/tests/console/favorites/favorites.spec.tsfrontend/e2e/pages/navigation.tsfrontend/e2e/tests/console/crd-extensions/console-external-log-link.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/alertmanager.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/pagerduty.spec.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/packages/console-app/src/components/nodes/node-dashboard/UtilizationCard.tsxfrontend/public/components/dashboard/project-dashboard/utilization-card.tsxfrontend/e2e/tests/console/crd-extensions/console-cli-download.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/alertmanager-test-utils.tsfrontend/public/components/factory/text-filter.tsxfrontend/public/components/dashboard/dashboards-page/cluster-dashboard/utilization-card.tsxfrontend/packages/console-shared/src/components/links/ExternalLink.tsxfrontend/e2e/tests/olm/create-namespace.spec.tsfrontend/packages/console-shared/src/hooks/useCRDAdditionalPrinterColumns.tsfrontend/e2e/pages/alertmanager-page.tsfrontend/e2e/tests/console/events/events.spec.tsfrontend/e2e/tests/console/crd-extensions/console-link.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/webhook.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/email.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/slack.spec.tsfrontend/e2e/tests/console/crd-extensions/console-notification.spec.tsfrontend/e2e/clients/kubernetes-client.tsfrontend/e2e/tests/console/i18n/pseudolocalization.spec.tsfrontend/e2e/tests/console/crd-extensions/crd-test-utils.tsfrontend/e2e/tests/console/crd-extensions/console-yaml-sample.spec.tsfrontend/e2e/tests/console/favorites/favorites.spec.tsfrontend/e2e/pages/navigation.tsfrontend/e2e/tests/console/crd-extensions/console-external-log-link.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/alertmanager.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/pagerduty.spec.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/packages/console-app/src/components/nodes/node-dashboard/UtilizationCard.tsxfrontend/public/components/dashboard/project-dashboard/utilization-card.tsxfrontend/e2e/tests/console/crd-extensions/console-cli-download.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/alertmanager-test-utils.tsfrontend/public/components/factory/text-filter.tsxfrontend/public/components/dashboard/dashboards-page/cluster-dashboard/utilization-card.tsxfrontend/packages/console-shared/src/components/links/ExternalLink.tsxfrontend/e2e/tests/olm/create-namespace.spec.tsfrontend/packages/console-shared/src/hooks/useCRDAdditionalPrinterColumns.tsfrontend/e2e/pages/alertmanager-page.tsfrontend/e2e/tests/console/events/events.spec.tsfrontend/e2e/tests/console/crd-extensions/console-link.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/webhook.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/email.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/slack.spec.tsfrontend/e2e/tests/console/crd-extensions/console-notification.spec.tsfrontend/e2e/clients/kubernetes-client.tsfrontend/e2e/tests/console/i18n/pseudolocalization.spec.tsfrontend/e2e/tests/console/crd-extensions/crd-test-utils.tsfrontend/e2e/tests/console/crd-extensions/console-yaml-sample.spec.tsfrontend/e2e/tests/console/favorites/favorites.spec.tsfrontend/e2e/pages/navigation.tsfrontend/e2e/tests/console/crd-extensions/console-external-log-link.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/alertmanager.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/pagerduty.spec.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/packages/console-app/src/components/nodes/node-dashboard/UtilizationCard.tsxfrontend/public/components/dashboard/project-dashboard/utilization-card.tsxfrontend/e2e/tests/console/crd-extensions/console-cli-download.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/alertmanager-test-utils.tsfrontend/public/components/factory/text-filter.tsxfrontend/public/components/dashboard/dashboards-page/cluster-dashboard/utilization-card.tsxfrontend/packages/console-shared/src/components/links/ExternalLink.tsxfrontend/e2e/tests/olm/create-namespace.spec.tsfrontend/packages/console-shared/src/hooks/useCRDAdditionalPrinterColumns.tsfrontend/e2e/pages/alertmanager-page.tsfrontend/e2e/tests/console/events/events.spec.tsfrontend/e2e/tests/console/crd-extensions/console-link.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/webhook.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/email.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/slack.spec.tsfrontend/e2e/tests/console/crd-extensions/console-notification.spec.tsfrontend/e2e/clients/kubernetes-client.tsfrontend/e2e/tests/console/i18n/pseudolocalization.spec.tsfrontend/e2e/tests/console/crd-extensions/crd-test-utils.tsfrontend/e2e/tests/console/crd-extensions/console-yaml-sample.spec.tsfrontend/e2e/tests/console/favorites/favorites.spec.tsfrontend/e2e/pages/navigation.tsfrontend/e2e/tests/console/crd-extensions/console-external-log-link.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/alertmanager.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/pagerduty.spec.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/packages/console-app/src/components/nodes/node-dashboard/UtilizationCard.tsxfrontend/public/components/dashboard/project-dashboard/utilization-card.tsxfrontend/e2e/tests/console/crd-extensions/console-cli-download.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/alertmanager-test-utils.tsfrontend/public/components/factory/text-filter.tsxfrontend/public/components/dashboard/dashboards-page/cluster-dashboard/utilization-card.tsxfrontend/packages/console-shared/src/components/links/ExternalLink.tsxfrontend/e2e/tests/olm/create-namespace.spec.tsfrontend/packages/console-shared/src/hooks/useCRDAdditionalPrinterColumns.tsfrontend/e2e/pages/alertmanager-page.tsfrontend/e2e/tests/console/events/events.spec.tsfrontend/e2e/tests/console/crd-extensions/console-link.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/webhook.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/email.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/slack.spec.tsfrontend/e2e/tests/console/crd-extensions/console-notification.spec.tsfrontend/e2e/clients/kubernetes-client.tsfrontend/e2e/tests/console/i18n/pseudolocalization.spec.tsfrontend/e2e/tests/console/crd-extensions/crd-test-utils.tsfrontend/e2e/tests/console/crd-extensions/console-yaml-sample.spec.tsfrontend/e2e/tests/console/favorites/favorites.spec.tsfrontend/e2e/pages/navigation.tsfrontend/e2e/tests/console/crd-extensions/console-external-log-link.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/alertmanager.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/pagerduty.spec.ts
frontend/e2e/tests/**/*.spec.ts
📄 CodeRabbit inference engine (TESTING.md)
frontend/e2e/tests/**/*.spec.ts: E2E tests must validate full user workflows against a real OpenShift cluster using Playwright, located infrontend/e2e/tests/<package>/
Each Playwright E2E test block must create its own resources, assert independently, and clean up via thecleanupfixture
UseKubernetesClientfor cluster interactions in Playwright tests - never use shell commands in tests
Importtestandexpectfrome2e/fixtures, not from@playwright/test. Custom fixtures providecleanup,testConfig, andk8sClient
Files:
frontend/e2e/tests/console/crd-extensions/console-cli-download.spec.tsfrontend/e2e/tests/olm/create-namespace.spec.tsfrontend/e2e/tests/console/events/events.spec.tsfrontend/e2e/tests/console/crd-extensions/console-link.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/webhook.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/email.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/slack.spec.tsfrontend/e2e/tests/console/crd-extensions/console-notification.spec.tsfrontend/e2e/tests/console/i18n/pseudolocalization.spec.tsfrontend/e2e/tests/console/crd-extensions/console-yaml-sample.spec.tsfrontend/e2e/tests/console/favorites/favorites.spec.tsfrontend/e2e/tests/console/crd-extensions/console-external-log-link.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/alertmanager.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/pagerduty.spec.ts
**/*.spec.{ts,tsx}
📄 CodeRabbit inference engine (STYLEGUIDE.md)
Tests should follow a similar 'test tables' convention as used in Go where applicable
Files:
frontend/e2e/tests/console/crd-extensions/console-cli-download.spec.tsfrontend/e2e/tests/olm/create-namespace.spec.tsfrontend/e2e/tests/console/events/events.spec.tsfrontend/e2e/tests/console/crd-extensions/console-link.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/webhook.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/email.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/slack.spec.tsfrontend/e2e/tests/console/crd-extensions/console-notification.spec.tsfrontend/e2e/tests/console/i18n/pseudolocalization.spec.tsfrontend/e2e/tests/console/crd-extensions/console-yaml-sample.spec.tsfrontend/e2e/tests/console/favorites/favorites.spec.tsfrontend/e2e/tests/console/crd-extensions/console-external-log-link.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/alertmanager.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/pagerduty.spec.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/tests/console/crd-extensions/console-cli-download.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/alertmanager-test-utils.tsfrontend/e2e/tests/olm/create-namespace.spec.tsfrontend/packages/console-shared/src/hooks/useCRDAdditionalPrinterColumns.tsfrontend/e2e/pages/alertmanager-page.tsfrontend/e2e/tests/console/events/events.spec.tsfrontend/e2e/tests/console/crd-extensions/console-link.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/webhook.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/email.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/slack.spec.tsfrontend/e2e/tests/console/crd-extensions/console-notification.spec.tsfrontend/e2e/clients/kubernetes-client.tsfrontend/e2e/tests/console/i18n/pseudolocalization.spec.tsfrontend/e2e/tests/console/crd-extensions/crd-test-utils.tsfrontend/e2e/tests/console/crd-extensions/console-yaml-sample.spec.tsfrontend/e2e/tests/console/favorites/favorites.spec.tsfrontend/e2e/pages/navigation.tsfrontend/e2e/tests/console/crd-extensions/console-external-log-link.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/alertmanager.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/pagerduty.spec.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/alertmanager-page.tsfrontend/e2e/pages/navigation.ts
🧠 Learnings (2)
📚 Learning: 2026-05-18T11:35:14.316Z
Learnt from: stefanonardo
Repo: openshift/console PR: 16431
File: frontend/e2e/tests/console/app/resource-log.spec.ts:65-65
Timestamp: 2026-05-18T11:35:14.316Z
Learning: In OpenShift Console Playwright e2e tests, when navigating to in-console routes use `page.goto('/k8s/...')` with a leading-slash absolute path (e.g., `/k8s/...`). `WEB_CONSOLE_URL` (default `http://localhost:9000`) must be treated as an origin only (no path component), so Playwright’s `baseURL` correctly resolves absolute paths. This convention should be followed consistently in console e2e specs when calling `page.goto()`, rather than passing full URLs or including path segments in `WEB_CONSOLE_URL`.
Applied to files:
frontend/e2e/tests/console/crd-extensions/console-cli-download.spec.tsfrontend/e2e/tests/console/events/events.spec.tsfrontend/e2e/tests/console/crd-extensions/console-link.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/webhook.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/email.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/slack.spec.tsfrontend/e2e/tests/console/crd-extensions/console-notification.spec.tsfrontend/e2e/tests/console/i18n/pseudolocalization.spec.tsfrontend/e2e/tests/console/crd-extensions/console-yaml-sample.spec.tsfrontend/e2e/tests/console/favorites/favorites.spec.tsfrontend/e2e/tests/console/crd-extensions/console-external-log-link.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/alertmanager.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/pagerduty.spec.ts
📚 Learning: 2026-05-19T17:15:42.558Z
Learnt from: fsgreco
Repo: openshift/console PR: 16461
File: frontend/e2e/pages/web-terminal-config-page.ts:18-18
Timestamp: 2026-05-19T17:15:42.558Z
Learning: In the openshift/console repo, the guideline “Never use absolute URLs or paths in the console code” should be treated as an application-source-only rule. Do not flag absolute-root paths/URLs (e.g., strings starting with `/` like `/k8s/cluster/...`) in Playwright E2E code under `frontend/e2e/`, including page objects (e.g., `page.goto()` / `goTo()` calls). These absolute paths are considered correct and intentional because Playwright resolves them against the `baseURL` configured in `frontend/e2e/playwright.config.ts`. Only enforce the no-absolute-paths rule in application code under `frontend/public` and `frontend/packages`.
Applied to files:
frontend/e2e/tests/console/crd-extensions/console-cli-download.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/alertmanager-test-utils.tsfrontend/e2e/tests/olm/create-namespace.spec.tsfrontend/e2e/pages/alertmanager-page.tsfrontend/e2e/tests/console/events/events.spec.tsfrontend/e2e/tests/console/crd-extensions/console-link.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/webhook.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/email.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/slack.spec.tsfrontend/e2e/tests/console/crd-extensions/console-notification.spec.tsfrontend/e2e/clients/kubernetes-client.tsfrontend/e2e/tests/console/i18n/pseudolocalization.spec.tsfrontend/e2e/tests/console/crd-extensions/crd-test-utils.tsfrontend/e2e/tests/console/crd-extensions/console-yaml-sample.spec.tsfrontend/e2e/tests/console/favorites/favorites.spec.tsfrontend/e2e/pages/navigation.tsfrontend/e2e/tests/console/crd-extensions/console-external-log-link.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/alertmanager.spec.tsfrontend/e2e/tests/console/cluster-settings/alertmanager/receivers/pagerduty.spec.ts
🪛 ast-grep (0.42.2)
frontend/e2e/pages/alertmanager-page.ts
[warning] 115-115: 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(receiverName)
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)
frontend/e2e/tests/console/crd-extensions/console-link.spec.ts
[warning] 91-91: 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(name)
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)
frontend/e2e/tests/console/crd-extensions/console-notification.spec.ts
[warning] 56-56: 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(name)
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)
[warning] 72-72: 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(name)
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)
frontend/e2e/tests/console/crd-extensions/crd-test-utils.ts
[warning] 16-16: 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(crd, 'i')
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)
[warning] 37-37: 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(crd, 'i')
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)
[warning] 40-40: 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(crd, 'i')
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)
[warning] 146-146: 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(name)
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)
frontend/e2e/tests/console/crd-extensions/console-yaml-sample.spec.ts
[warning] 84-84: 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(name)
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)
frontend/e2e/tests/console/crd-extensions/console-external-log-link.spec.ts
[warning] 173-173: 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(podName)
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)
frontend/e2e/tests/console/cluster-settings/alertmanager/alertmanager.spec.ts
[warning] 110-110: 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(receiverName)
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)
🔇 Additional comments (14)
frontend/packages/console-app/src/components/nodes/node-dashboard/UtilizationCard.tsx (1)
54-54: LGTM!frontend/packages/console-shared/src/components/links/ExternalLink.tsx (1)
51-51: LGTM!frontend/packages/console-shared/src/hooks/useCRDAdditionalPrinterColumns.ts (1)
16-19: LGTM!Also applies to: 30-30, 32-32
frontend/public/components/dashboard/dashboards-page/cluster-dashboard/utilization-card.tsx (1)
295-295: LGTM!frontend/public/components/dashboard/project-dashboard/utilization-card.tsx (1)
53-53: LGTM!frontend/public/components/factory/text-filter.tsx (1)
22-22: LGTM!frontend/e2e/clients/kubernetes-client.ts (1)
391-398: LGTM!Also applies to: 484-490, 499-507
frontend/e2e/tests/console/cluster-settings/alertmanager/alertmanager-test-utils.ts (1)
39-47: LGTM!frontend/e2e/tests/console/cluster-settings/alertmanager/alertmanager.spec.ts (1)
1-255: LGTM!frontend/e2e/tests/console/cluster-settings/alertmanager/receivers/email.spec.ts (1)
1-223: LGTM!frontend/e2e/tests/console/cluster-settings/alertmanager/receivers/pagerduty.spec.ts (1)
1-207: LGTM!frontend/e2e/tests/console/cluster-settings/alertmanager/receivers/slack.spec.ts (1)
1-139: LGTM!frontend/e2e/tests/console/cluster-settings/alertmanager/receivers/webhook.spec.ts (1)
1-87: LGTM!frontend/e2e/tests/console/i18n/pseudolocalization.spec.ts (1)
1-77: LGTM!
CodeRabbit review — triageFixed (3)
Skipped
|
|
/label tide/merge-method-squash |
…anager, and OLM Cypress tests to Playwright Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Comments addressed. Thanks, @stefanonardo. |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rhamilto, stefanonardo The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Includes changes from #16444
Summary
alertmanager.tsview filedata-testattributes alongside existingdata-test-idattributes on utilization cards, text filter, and external links to enablegetByTestIdusagecreatePodanddeletePodmethods toKubernetesClientAlertmanagerPagepage object and navigation helperswaitForTimeoutornetworkidleanti-patterns)K8sModel | undefinedinuseCRDAdditionalPrinterColumnshook signatureTests migrated (19 Cypress → 19 Playwright)
integration-tests/tests/crd-extensions/console-cli-download.cy.tse2e/tests/console/crd-extensions/console-cli-download.spec.tsintegration-tests/tests/crd-extensions/console-external-log-link.cy.tse2e/tests/console/crd-extensions/console-external-log-link.spec.tsintegration-tests/tests/crd-extensions/console-link.cy.tse2e/tests/console/crd-extensions/console-link.spec.tsintegration-tests/tests/crd-extensions/console-notification.cy.tse2e/tests/console/crd-extensions/console-notification.spec.tsintegration-tests/tests/crd-extensions/console-yaml-sample.cy.tse2e/tests/console/crd-extensions/console-yaml-sample.spec.tsintegration-tests/tests/events/events.cy.tse2e/tests/console/events/events.spec.tsintegration-tests/tests/favorite/favorite-option.cy.tse2e/tests/console/favorites/favorites.spec.tsintegration-tests/tests/i18n/pseudolocalization.cy.tse2e/tests/console/i18n/pseudolocalization.spec.tsolm/integration-tests/tests/create-namespace.cy.tse2e/tests/olm/create-namespace.spec.tsintegration-tests/tests/cluster-settings/alertmanager/alertmanager.cy.tse2e/tests/console/cluster-settings/alertmanager/alertmanager.spec.tsintegration-tests/tests/cluster-settings/alertmanager/receivers/email.cy.tse2e/tests/console/cluster-settings/alertmanager/receivers/email.spec.tsintegration-tests/tests/cluster-settings/alertmanager/receivers/pagerduty.cy.tse2e/tests/console/cluster-settings/alertmanager/receivers/pagerduty.spec.tsintegration-tests/tests/cluster-settings/alertmanager/receivers/slack.cy.tse2e/tests/console/cluster-settings/alertmanager/receivers/slack.spec.tsintegration-tests/tests/cluster-settings/alertmanager/receivers/webhook.cy.tse2e/tests/console/cluster-settings/alertmanager/receivers/webhook.spec.tsCypress cleanup
integration-tests/views/alertmanager.ts(only consumed by the migrated alertmanager tests)Source component changes
text-filter.tsx: Addeddata-test="item-filter"alongsidedata-test-idutilization-card.tsx(3 files): Addeddata-test="utilization-card"alongsidedata-test-iduseCRDAdditionalPrinterColumns.ts: Fixedreact-hooks/exhaustive-depslint warning; updatedmodelparam to acceptK8sModel | undefinedExternalLink.tsx: Addeddata-testattributeScreenshots / Screen recordings
Automated test migration — no visual changes
Test plan
cy.wait(10000))🤖 Generated with Claude Code