Skip to content

CONSOLE-5241: Migrate knative-ci.feature Cypress tests to Playwright#16658

Open
mvinkler wants to merge 1 commit into
openshift:mainfrom
mvinkler:CONSOLE-5241
Open

CONSOLE-5241: Migrate knative-ci.feature Cypress tests to Playwright#16658
mvinkler wants to merge 1 commit into
openshift:mainfrom
mvinkler:CONSOLE-5241

Conversation

@mvinkler

@mvinkler mvinkler commented Jun 22, 2026

Copy link
Copy Markdown

Summary

Migrates the knative CI smoke test (knative-ci.feature) from Cypress Gherkin to Playwright and removes the original Cypress file. This is the per-PR CI test that runs via e2e-gcp-console — the remaining 30 knative feature files (nightly only) will follow in separate PRs.

Changes

Test Migration (16 tests)

  • Migrated 16 automatable scenarios from knative-ci.feature to knative-ci.spec.ts
  • 8 @manual / @broken-test scenarios dropped (not migrated)
  • Tests run in serial mode (test.describe.configure({ mode: 'serial' })) — matching the Cypress testIsolation: false sequential workflow
  • Created page objects: TopologyKnativePage, AddFlowPage, AdminEventingPage
  • Created knative.setup.ts — installs Serverless operator, creates KnativeServing/KnativeEventing CRs

Cypress Removal

  • Deleted features/e2e/knative-ci.feature
  • Removed test-cypress-knative-headless script from package.json and test-cypress.sh
  • Nightly scripts (test-cypress-headless-all, test-cypress-knative-nightly) and local dev runner kept for remaining 30 feature files

Selector Migration (backward compatible)

  • Added data-test alongside existing legacy attributes (data-test-action, data-test-id, data-test-dropdown-menu) in shared React components
  • Components updated: ActionMenuItem, ActionMenuContent, MultiTabListPage, list-page, actions-menu, kebab, AppSection, ImportSampleForm, FormFooter, ActionGroupWithIcons, ApplicationSelector, EditApplicationModal, TopologyPageToolbar, GitSection, filter-toolbar, labels-modal, tags, delete-modal
  • All Playwright page objects use getByTestId() with fallback to legacy selectors

Test Results

16/16 tests passing (serial mode, 4.6 min)

  • KN-05-TC04: Create knative workload from Git
  • KN-02-TC02: Edit labels modal details
  • KN-02-TC17: Edit Annotation modal details
  • KA-01-TC01: Create new Event Source via Ping Source
  • KA-01-TC02: Create new Channel via default channel type
  • KE-05-TC01: Create Broker using Form view
  • Add Subscription to channel
  • KN-02-TC08: Update service to new application group
  • KN-01-TC12: Delete Revision not possible for single revision
  • Create Revision for existing knative Service
  • KN-02-TC10: Set traffic distribution >100%
  • KN-02-TC11: Set traffic distribution <100%
  • KE-05-TC11: Delete Broker
  • KE-06-TC16: Delete Channel
  • KE-01-TC03: Delete event source
  • KN-02-TC16: Delete service

Screenshots / screen recording

Test setup

Requires OpenShift cluster with Serverless operator (installed automatically by knative.setup.ts).

Browser conformance

  • Chrome

Related

Summary by CodeRabbit

  • New Features

    • Added broader Knative end-to-end coverage for creating, editing, navigating, and deleting serverless and eventing resources.
    • Added Knative setup support so the required serverless components are prepared automatically for test runs.
  • Bug Fixes

    • Improved UI selector coverage across forms, modals, menus, and topology controls for more reliable interaction.
    • Added clearer handling for Knative flow creation and topology navigation during automated checks.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jun 22, 2026
@openshift-ci-robot

openshift-ci-robot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

@mvinkler: This pull request references CONSOLE-5241 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.

Details

In response to this:

Summary

Migrates the knative CI smoke test (knative-ci.feature) from Cypress Gherkin to Playwright and removes the original Cypress file. This is the per-PR CI test that runs via e2e-gcp-console — the remaining 30 knative feature files (nightly only) will follow in separate PRs.

Changes

Test Migration (16 tests)

  • Migrated 16 automatable scenarios from knative-ci.feature to knative-ci.spec.ts
  • 8 @manual / @broken-test scenarios dropped (not migrated)
  • Tests run in serial mode (test.describe.configure({ mode: 'serial' })) — matching the Cypress testIsolation: false sequential workflow
  • Created page objects: TopologyKnativePage, AddFlowPage, AdminEventingPage
  • Created knative.setup.ts — installs Serverless operator, creates KnativeServing/KnativeEventing CRs

Cypress Removal

  • Deleted features/e2e/knative-ci.feature
  • Removed test-cypress-knative-headless script from package.json and test-cypress.sh
  • Nightly scripts (test-cypress-headless-all, test-cypress-knative-nightly) and local dev runner kept for remaining 30 feature files

Selector Migration (backward compatible)

  • Added data-test alongside existing legacy attributes (data-test-action, data-test-id, data-test-dropdown-menu) in shared React components
  • Components updated: ActionMenuItem, ActionMenuContent, MultiTabListPage, list-page, actions-menu, kebab, AppSection, ImportSampleForm, FormFooter, ActionGroupWithIcons, ApplicationSelector, EditApplicationModal, TopologyPageToolbar, GitSection, filter-toolbar, labels-modal, tags, delete-modal
  • All Playwright page objects use getByTestId() with fallback to legacy selectors

Test Results

16/16 tests passing (serial mode, 4.6 min)

  • KN-05-TC04: Create knative workload from Git
  • KN-02-TC02: Edit labels modal details
  • KN-02-TC17: Edit Annotation modal details
  • KA-01-TC01: Create new Event Source via Ping Source
  • KA-01-TC02: Create new Channel via default channel type
  • KE-05-TC01: Create Broker using Form view
  • Add Subscription to channel
  • KN-02-TC08: Update service to new application group
  • KN-01-TC12: Delete Revision not possible for single revision
  • Create Revision for existing knative Service
  • KN-02-TC10: Set traffic distribution >100%
  • KN-02-TC11: Set traffic distribution <100%
  • KE-05-TC11: Delete Broker
  • KE-06-TC16: Delete Channel
  • KE-01-TC03: Delete event source
  • KN-02-TC16: Delete service

Screenshots / screen recording

Test setup

Requires OpenShift cluster with Serverless operator (installed automatically by knative.setup.ts).

Browser conformance

  • Chrome

Related

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.

@openshift-ci openshift-ci Bot requested review from fsgreco and spadgett June 22, 2026 09:32
@openshift-ci openshift-ci Bot added the component/core Related to console core functionality label Jun 22, 2026
@openshift-ci

openshift-ci Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: mvinkler
Once this PR has been reviewed and has the lgtm label, please assign vojtechszocs for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the component/dev-console Related to dev-console label Jun 22, 2026
@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Migrates Knative CI smoke tests from Cypress to Playwright by adding data-test selectors to UI components, introducing a Knative cluster provisioning setup stage, implementing three Playwright page objects (AddFlowPage, AdminEventingPage, TopologyKnativePage), adding a full CI spec covering serving/eventing flows, and removing the old Cypress Knative feature file and headless scripts.

Changes

Knative Playwright E2E migration

Layer / File(s) Summary
data-test selector additions across UI components
frontend/packages/dev-console/src/components/import/git/GitSection.tsx, frontend/packages/dev-console/src/components/import/app/AppSection.tsx, frontend/packages/dev-console/src/components/import/ImportSampleForm.tsx, frontend/packages/topology/src/components/dropdowns/ApplicationSelector.tsx, frontend/packages/topology/src/components/modals/EditApplicationModal.tsx, frontend/packages/topology/src/components/page/TopologyPageToolbar.tsx, frontend/public/components/modals/delete-modal.tsx, frontend/public/components/modals/labels-modal.tsx, frontend/public/components/modals/tags.tsx, frontend/public/components/utils/kebab.tsx, frontend/public/components/filter-toolbar.tsx, frontend/packages/console-shared/src/components/multi-tab-list/MultiTabListPage.tsx, frontend/packages/console-shared/src/components/form-utils/ActionGroupWithIcons.tsx, frontend/packages/console-shared/src/components/form-utils/FormFooter.tsx
Adds data-test attributes alongside existing data-test-id attributes to modal titles, cancel buttons, form inputs, toolbar controls, dropdowns, and kebab menu items to expose consistent selectors for the new Playwright tests.
Playwright config and Knative cluster setup
frontend/playwright.config.ts, frontend/e2e/setup/knative.setup.ts
Registers a knative-setup project in playwright.config.ts dependent on cluster-setup and injects it for the knative package. knative.setup.ts conditionally installs the OpenShift Serverless operator by checking existing CSVs and applying subscription manifests, then applies KnativeServing/KnativeEventing CRs and polls each for Ready status.
Knative page objects
frontend/e2e/pages/knative/add-flow-page.ts, frontend/e2e/pages/knative/admin-eventing-page.ts, frontend/e2e/pages/knative/topology-knative-page.ts
Introduces AddFlowPage (add-flow navigation, git URL entry with Validated/Rate-limit waiting, Knative deployment selection, create polling, Dockerfile strategy helpers), AdminEventingPage (eventing namespace navigation, tab-click helpers), and TopologyKnativePage (graph view, viewport, search, right-click/context-menu, side pane, sidebar actions).
Knative CI smoke spec
frontend/e2e/tests/knative/serverless/knative-ci.spec.ts
Serial Playwright suite covering: Git-import workload creation with optional Builder Image fallback; Edit labels/annotations modal cancel flows; Eventing resource creation (Ping Source, Channel, Broker); Subscription add and sidebar verification; application grouping edit; last-revision deletion block; second-revision creation via Kubernetes API; traffic distribution validation errors; and deletion of all created resources with absence verification.
Old Cypress Knative test removal
frontend/packages/knative-plugin/integration-tests/package.json, frontend/package.json, frontend/integration-tests/test-cypress.sh
Removes knative-ci.feature, the test-cypress-knative-headless npm scripts, and the Knative headless invocation from the CI shell script.

Sequence Diagram(s)

sequenceDiagram
  participant Test as knative-ci.spec
  participant AddFlow as AddFlowPage
  participant Topology as TopologyKnativePage
  participant Eventing as AdminEventingPage
  participant K8s as Kubernetes API

  Test->>AddFlow: navigateToAddPage(namespace)
  AddFlow->>AddFlow: clickImportFromGitCard()
  AddFlow->>AddFlow: enterGitUrl(url) — wait for "Validated"/"Rate limit"
  AddFlow->>AddFlow: selectServerlessDeployment()
  AddFlow->>AddFlow: clickCreate() — poll until button enabled
  AddFlow-->>Test: done
  Test->>Topology: navigateToTopology(namespace)
  Topology->>Topology: switchToGraphView() + fitScreen()
  Topology->>Topology: verifyWorkloadVisible(serviceName)

  Test->>Eventing: navigateToEventing(namespace)
  Eventing->>Eventing: clickTab("Event Sources") → create Ping Source
  Eventing->>Eventing: clickTab("Channels") → create Channel
  Eventing->>Eventing: clickTab("Brokers") → create Broker
  Eventing-->>Test: topology redirect confirmed

  Test->>K8s: replace KnativeService to produce second revision
  K8s-->>Test: updated resource
  Test->>Topology: verifySidePaneOpen() + selectSidePaneTab("Revisions")
  Topology-->>Test: two revisions visible

  Test->>Topology: rightClickAndSelectAction(serviceName, "Delete Service?")
  Topology-->>Test: service node absent after reload
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Suggested labels

kind/cypress

Suggested reviewers

  • jhadvig
  • cajieh
🚥 Pre-merge checks | ✅ 13 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Microshift Test Compatibility ⚠️ Warning The new Knative setup hits OLM APIs (ClusterServiceVersion, Subscription, OperatorGroup) and lacks any MicroShift skip/tag guard. Add a [Skipped:MicroShift] or [apigroup:operators.coreos.com] guard, or avoid OLM/CSV setup on MicroShift by using a compatible path.
Ipv6 And Disconnected Network Test Compatibility ⚠️ Warning knative-ci.spec.ts hardcodes https://github.com/sclorg/nodejs-ex.git for the import-from-git flow, so it requires public internet in disconnected CI. Use an internal mirror or cluster-local source for the Git import, or mark the test [Skipped:Disconnected] / run it only on connected jobs.
✅ Passed checks (13 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: migrating Knative CI smoke tests from Cypress to Playwright.
Description check ✅ Passed The description is mostly complete and covers summary, changes, test setup, results, and browser conformance, with only minor template gaps.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed All 16 Playwright test titles in knative-ci.spec.ts are hardcoded static strings; no template literals, generated IDs, dates, or namespaces appear.
Test Structure And Quality ✅ Passed Not applicable: the PR migrates Knative tests to Playwright; the new spec uses beforeAll/afterAll cleanup and explicit timeouts.
Single Node Openshift (Sno) Test Compatibility ✅ Passed New Knative Playwright tests use only namespace-level UI/API flows; no multi-node/HA assumptions or SNO skips are present.
Topology-Aware Scheduling Compatibility ✅ Passed No added/modified deployment manifests, controllers, or scheduling fields; the Knative setup applies plain Namespace/CR YAML with no affinity, nodeSelector, or spread constraints.
Ote Binary Stdout Contract ✅ Passed The only stdout writes are console.log calls inside Playwright setup tests; no main/top-level/TestMain/BeforeSuite writes were added.
No-Weak-Crypto ✅ Passed Diff scan of added lines found no MD5/SHA1/DES/RC4/3DES/Blowfish/ECB, no crypto APIs, and no secret/token comparisons; changes are UI/e2e only.
Container-Privileges ✅ Passed PASS: The PR-touched Knative files and referenced YAML manifests contain no privileged/hostPID/hostNetwork/hostIPC/SYS_ADMIN/root/allowPrivilegeEscalation:true settings.
No-Sensitive-Data-In-Logs ✅ Passed The only new logs are generic setup status messages; no passwords, tokens, PII, hostnames, or customer data are logged in the changed Knative files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@openshift-ci openshift-ci Bot added component/knative Related to knative-plugin component/shared Related to console-shared component/topology Related to topology labels Jun 22, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (3)
frontend/e2e/pages/knative/add-flow-page.ts (1)

56-69: 🧹 Nitpick | 🔵 Trivial | ⚖️ Poor tradeoff

Consider consolidating rate-limit fallback logic.

The page object's conditional rate-limit fallback (lines 56-69) duplicates similar logic in the test file (knative-ci.spec.ts lines 35-43). The test always forces Builder Image strategy, while the page object only applies it when rate-limited.

Consider centralizing this logic:

  • If the fallback is a general UI concern (GitHub rate limits affect any test), keep it only in enterGitUrl() and remove the duplicate from the test.
  • If the test needs explicit control, document why both are necessary.

This will reduce maintenance burden and ensure consistent behavior across tests.

🤖 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/knative/add-flow-page.ts` around lines 56 - 69, The
rate-limit fallback logic that selects Builder Image strategy and Node.js is
duplicated between the enterGitUrl() method in the page object
(add-flow-page.ts) and similar logic in the test file (knative-ci.spec.ts).
Consolidate this logic by keeping it only in the enterGitUrl() method as a
general UI concern for handling GitHub rate limits, then remove the duplicate
fallback logic from the test file. This ensures consistent behavior across all
tests that use enterGitUrl() and reduces maintenance burden.
frontend/e2e/pages/knative/topology-knative-page.ts (1)

167-175: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Use robustClick for sidebar action interactions.

Line 171 and Line 175 use direct clicks in a dynamic pane; this is more prone to transient visibility/intercept failures than the rest of this page object.

Suggested update
   async selectSidebarAction(actionName: string): Promise<void> {
     const actionsButton = this.sidePane.locator(
       '[data-test="actions-menu-button"], [data-test-id="actions-menu-button"]',
     );
-    await actionsButton.first().click({ timeout: 10_000 });
+    await this.robustClick(actionsButton.first(), { timeout: 10_000 });
     const actionItem = this.page.locator(
       `[data-test="${actionName}"], [data-test-action="${actionName}"]`,
     );
-    await actionItem.first().click({ timeout: 10_000 });
+    await this.robustClick(actionItem.first(), { timeout: 10_000 });
+    await this.waitForLoadingComplete();
   }

As per coding guidelines, frontend/e2e/pages/**/*.ts should use robustClick() and waitForLoadingComplete() in page-object actions.

🤖 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/knative/topology-knative-page.ts` around lines 167 - 175,
In the selectSidebarAction method, replace the two direct click() calls on the
actionsButton and actionItem locators with robustClick() calls instead. The
first click() call that selects the actions menu button (using the actionsButton
locator) and the second click() call that selects the action item (using the
actionItem locator) should both be changed to robustClick() to ensure better
reliability when interacting with the dynamic sidebar pane, following the page
object coding guidelines.

Source: Coding guidelines

frontend/e2e/tests/knative/serverless/knative-ci.spec.ts (1)

29-444: 🧹 Nitpick | 🔵 Trivial | 🏗️ Heavy lift

Refactor repeated scenario blocks into test-table driven cases.

This spec duplicates the same setup/action/assert scaffolding across many cases. Converting the repeated flows to table entries (scenario metadata + executor) would reduce maintenance churn and align with the repo’s spec-test convention.

As per coding guidelines, **/*.spec.{ts,tsx} tests should follow a test-tables convention similar to Go.

🤖 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/knative/serverless/knative-ci.spec.ts` around lines 29 -
444, The knative-ci.spec.ts file contains many test cases with duplicated
scaffolding patterns, such as repeated navigation steps, similar action
sequences, and comparable assertion structures. Refactor this into a
table-driven test pattern by defining a test data interface that captures the
test parameters (test name, test identifier, actions to perform, and expected
outcomes), then create an array of test case objects containing these
parameters. Implement a single parameterized test function that iterates through
this test table and executes the common test flow using the data from each row,
similar to Go's table-driven testing convention. This approach will eliminate
the repetitive test.step blocks and setup/teardown logic that appear across
cases like the KN-02-TC02, KN-02-TC17, KA-01-TC01, and KE-05-TC01 tests, making
the test suite more maintainable and easier to extend with new cases.

Source: Coding 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 `@frontend/e2e/setup/knative.setup.ts`:
- Around line 101-125: The while loop that waits for the Serverless operator CSV
to reach the Succeeded phase exits silently after the csvTimeout (300_000
milliseconds) without verifying that the CSV actually succeeded. Add a check
after the while loop completes to throw an error if the CSV never reached the
Succeeded phase. Track whether the CSV succeeded (for example, using a boolean
flag inside the try block when csv.status?.phase === 'Succeeded' is found) and
after the loop, verify this flag was set to true; if not, throw an error with a
descriptive message so that the setup fails immediately rather than allowing the
test to continue and fail later.

---

Nitpick comments:
In `@frontend/e2e/pages/knative/add-flow-page.ts`:
- Around line 56-69: The rate-limit fallback logic that selects Builder Image
strategy and Node.js is duplicated between the enterGitUrl() method in the page
object (add-flow-page.ts) and similar logic in the test file
(knative-ci.spec.ts). Consolidate this logic by keeping it only in the
enterGitUrl() method as a general UI concern for handling GitHub rate limits,
then remove the duplicate fallback logic from the test file. This ensures
consistent behavior across all tests that use enterGitUrl() and reduces
maintenance burden.

In `@frontend/e2e/pages/knative/topology-knative-page.ts`:
- Around line 167-175: In the selectSidebarAction method, replace the two direct
click() calls on the actionsButton and actionItem locators with robustClick()
calls instead. The first click() call that selects the actions menu button
(using the actionsButton locator) and the second click() call that selects the
action item (using the actionItem locator) should both be changed to
robustClick() to ensure better reliability when interacting with the dynamic
sidebar pane, following the page object coding guidelines.

In `@frontend/e2e/tests/knative/serverless/knative-ci.spec.ts`:
- Around line 29-444: The knative-ci.spec.ts file contains many test cases with
duplicated scaffolding patterns, such as repeated navigation steps, similar
action sequences, and comparable assertion structures. Refactor this into a
table-driven test pattern by defining a test data interface that captures the
test parameters (test name, test identifier, actions to perform, and expected
outcomes), then create an array of test case objects containing these
parameters. Implement a single parameterized test function that iterates through
this test table and executes the common test flow using the data from each row,
similar to Go's table-driven testing convention. This approach will eliminate
the repetitive test.step blocks and setup/teardown logic that appear across
cases like the KN-02-TC02, KN-02-TC17, KA-01-TC01, and KE-05-TC01 tests, making
the test suite more maintainable and easier to extend with new cases.
🪄 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: c4d14c8b-4d6f-492c-8fc5-fac234f8fdb3

📥 Commits

Reviewing files that changed from the base of the PR and between f01f965 and 2210b8c.

📒 Files selected for processing (28)
  • frontend/e2e/pages/knative/add-flow-page.ts
  • frontend/e2e/pages/knative/admin-eventing-page.ts
  • frontend/e2e/pages/knative/topology-knative-page.ts
  • frontend/e2e/setup/knative.setup.ts
  • frontend/e2e/tests/knative/serverless/knative-ci.spec.ts
  • frontend/integration-tests/test-cypress.sh
  • frontend/package.json
  • frontend/packages/console-shared/src/components/actions/menu/ActionMenuContent.tsx
  • frontend/packages/console-shared/src/components/actions/menu/ActionMenuItem.tsx
  • frontend/packages/console-shared/src/components/form-utils/ActionGroupWithIcons.tsx
  • frontend/packages/console-shared/src/components/form-utils/FormFooter.tsx
  • frontend/packages/console-shared/src/components/multi-tab-list/MultiTabListPage.tsx
  • frontend/packages/dev-console/src/components/import/ImportSampleForm.tsx
  • frontend/packages/dev-console/src/components/import/app/AppSection.tsx
  • frontend/packages/dev-console/src/components/import/git/GitSection.tsx
  • frontend/packages/knative-plugin/integration-tests/features/e2e/knative-ci.feature
  • frontend/packages/knative-plugin/integration-tests/package.json
  • frontend/packages/topology/src/components/dropdowns/ApplicationSelector.tsx
  • frontend/packages/topology/src/components/modals/EditApplicationModal.tsx
  • frontend/packages/topology/src/components/page/TopologyPageToolbar.tsx
  • frontend/playwright.config.ts
  • frontend/public/components/factory/list-page.tsx
  • frontend/public/components/filter-toolbar.tsx
  • frontend/public/components/modals/delete-modal.tsx
  • frontend/public/components/modals/labels-modal.tsx
  • frontend/public/components/modals/tags.tsx
  • frontend/public/components/utils/actions-menu.tsx
  • frontend/public/components/utils/kebab.tsx
💤 Files with no reviewable changes (4)
  • frontend/packages/knative-plugin/integration-tests/package.json
  • frontend/integration-tests/test-cypress.sh
  • frontend/packages/knative-plugin/integration-tests/features/e2e/knative-ci.feature
  • frontend/package.json

Comment thread frontend/e2e/setup/knative.setup.ts
@mvinkler mvinkler force-pushed the CONSOLE-5241 branch 2 times, most recently from f39cfac to dbcc42a Compare June 23, 2026 12:09

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 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/setup/knative.setup.ts`:
- Around line 53-55: The empty catch blocks at lines 53-55, 122-124, and 231-237
in the knative.setup.ts file are suppressing all Kubernetes API errors
indiscriminately, masking authentication, RBAC, and API failures as simple
readiness timeouts. Replace these broad exception handlers by checking the error
type or status code and only suppressing expected "not found" or "not ready yet"
errors (such as 404 Not Found or specific error messages). For unexpected
errors, either re-throw them to fail fast or capture the error details and
include them in the timeout message so that actual API/auth/RBAC failures are
visible instead of being silently swallowed.
🪄 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: 47837dcf-1670-4a78-8d4d-bb9497c7dc0a

📥 Commits

Reviewing files that changed from the base of the PR and between f39cfac and dbcc42a.

📒 Files selected for processing (28)
  • frontend/e2e/pages/knative/add-flow-page.ts
  • frontend/e2e/pages/knative/admin-eventing-page.ts
  • frontend/e2e/pages/knative/topology-knative-page.ts
  • frontend/e2e/setup/knative.setup.ts
  • frontend/e2e/tests/knative/serverless/knative-ci.spec.ts
  • frontend/integration-tests/test-cypress.sh
  • frontend/package.json
  • frontend/packages/console-shared/src/components/actions/menu/ActionMenuContent.tsx
  • frontend/packages/console-shared/src/components/actions/menu/ActionMenuItem.tsx
  • frontend/packages/console-shared/src/components/form-utils/ActionGroupWithIcons.tsx
  • frontend/packages/console-shared/src/components/form-utils/FormFooter.tsx
  • frontend/packages/console-shared/src/components/multi-tab-list/MultiTabListPage.tsx
  • frontend/packages/dev-console/src/components/import/ImportSampleForm.tsx
  • frontend/packages/dev-console/src/components/import/app/AppSection.tsx
  • frontend/packages/dev-console/src/components/import/git/GitSection.tsx
  • frontend/packages/knative-plugin/integration-tests/features/e2e/knative-ci.feature
  • frontend/packages/knative-plugin/integration-tests/package.json
  • frontend/packages/topology/src/components/dropdowns/ApplicationSelector.tsx
  • frontend/packages/topology/src/components/modals/EditApplicationModal.tsx
  • frontend/packages/topology/src/components/page/TopologyPageToolbar.tsx
  • frontend/playwright.config.ts
  • frontend/public/components/factory/list-page.tsx
  • frontend/public/components/filter-toolbar.tsx
  • frontend/public/components/modals/delete-modal.tsx
  • frontend/public/components/modals/labels-modal.tsx
  • frontend/public/components/modals/tags.tsx
  • frontend/public/components/utils/actions-menu.tsx
  • frontend/public/components/utils/kebab.tsx
💤 Files with no reviewable changes (4)
  • frontend/packages/knative-plugin/integration-tests/package.json
  • frontend/packages/knative-plugin/integration-tests/features/e2e/knative-ci.feature
  • frontend/integration-tests/test-cypress.sh
  • frontend/package.json
✅ Files skipped from review due to trivial changes (15)
  • frontend/packages/console-shared/src/components/form-utils/FormFooter.tsx
  • frontend/public/components/utils/actions-menu.tsx
  • frontend/packages/console-shared/src/components/form-utils/ActionGroupWithIcons.tsx
  • frontend/public/components/utils/kebab.tsx
  • frontend/public/components/filter-toolbar.tsx
  • frontend/packages/dev-console/src/components/import/app/AppSection.tsx
  • frontend/packages/console-shared/src/components/actions/menu/ActionMenuContent.tsx
  • frontend/packages/topology/src/components/page/TopologyPageToolbar.tsx
  • frontend/public/components/modals/delete-modal.tsx
  • frontend/packages/dev-console/src/components/import/git/GitSection.tsx
  • frontend/packages/topology/src/components/dropdowns/ApplicationSelector.tsx
  • frontend/packages/console-shared/src/components/actions/menu/ActionMenuItem.tsx
  • frontend/public/components/modals/tags.tsx
  • frontend/packages/topology/src/components/modals/EditApplicationModal.tsx
  • frontend/public/components/modals/labels-modal.tsx
🚧 Files skipped from review as they are similar to previous changes (8)
  • frontend/public/components/factory/list-page.tsx
  • frontend/packages/dev-console/src/components/import/ImportSampleForm.tsx
  • frontend/playwright.config.ts
  • frontend/packages/console-shared/src/components/multi-tab-list/MultiTabListPage.tsx
  • frontend/e2e/pages/knative/add-flow-page.ts
  • frontend/e2e/pages/knative/topology-knative-page.ts
  • frontend/e2e/pages/knative/admin-eventing-page.ts
  • frontend/e2e/tests/knative/serverless/knative-ci.spec.ts

Comment on lines +53 to +55
} catch {
// Namespace may not exist yet — proceed with installation
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Don’t suppress all Kubernetes API errors during probe/poll loops.

Line 53, Line 122, and Line 231 currently swallow every exception, so auth/RBAC/API failures can be misreported as readiness timeouts after several minutes. Only ignore expected “not found / not ready yet” cases and fail fast (or at least include the last non-retryable error in the timeout message).

Suggested fix
+const isExpectedTransientError = (err: unknown): boolean => {
+  const msg = err instanceof Error ? err.message : String(err);
+  return /not[\s-]?found|404/i.test(msg);
+};

@@
-  } catch {
+  } catch (err) {
+    if (!isExpectedTransientError(err)) {
+      throw err;
+    }
     // Namespace may not exist yet — proceed with installation
   }

@@
   let csvSucceeded = false;
+  let lastCsvError: string | undefined;
   while (Date.now() - startTime < csvTimeout) {
@@
-    } catch {
+    } catch (err) {
+      const msg = err instanceof Error ? err.message : String(err);
+      lastCsvError = msg;
+      if (!isExpectedTransientError(err)) {
+        throw err;
+      }
       // CSV not ready yet
     }
@@
   if (!csvSucceeded) {
-    throw new Error('Serverless operator CSV did not reach Succeeded phase');
+    throw new Error(
+      `Serverless operator CSV did not reach Succeeded phase within ${csvTimeout}ms${
+        lastCsvError ? `. Last API error: ${lastCsvError}` : ''
+      }`,
+    );
   }

@@
   const waitForReady = async (
@@
   ) => {
     const start = Date.now();
+    let lastReadyError: string | undefined;
     while (Date.now() - start < timeoutMs) {
@@
-      } catch {
+      } catch (err) {
+        const msg = err instanceof Error ? err.message : String(err);
+        lastReadyError = msg;
+        if (!isExpectedTransientError(err)) {
+          throw err;
+        }
         // Not ready yet
       }
@@
-    throw new Error(`${name} in ${namespace} not ready after ${timeoutMs}ms`);
+    throw new Error(
+      `${name} in ${namespace} not ready after ${timeoutMs}ms${
+        lastReadyError ? `. Last API error: ${lastReadyError}` : ''
+      }`,
+    );
   };

Also applies to: 122-124, 231-237

🤖 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/setup/knative.setup.ts` around lines 53 - 55, The empty catch
blocks at lines 53-55, 122-124, and 231-237 in the knative.setup.ts file are
suppressing all Kubernetes API errors indiscriminately, masking authentication,
RBAC, and API failures as simple readiness timeouts. Replace these broad
exception handlers by checking the error type or status code and only
suppressing expected "not found" or "not ready yet" errors (such as 404 Not
Found or specific error messages). For unexpected errors, either re-throw them
to fail fast or capture the error details and include them in the timeout
message so that actual API/auth/RBAC failures are visible instead of being
silently swallowed.

@mvinkler

Copy link
Copy Markdown
Author

/retest

1 similar comment
@mvinkler

Copy link
Copy Markdown
Author

/retest

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

♻️ Duplicate comments (1)
frontend/e2e/setup/knative.setup.ts (1)

53-55: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Don’t swallow all Kubernetes API errors in readiness loops.

Line 53, Line 122, and Line 231 catch and ignore every exception, so auth/RBAC/API failures can be misreported as “not ready yet” until timeout. Only retry expected transient errors (for example, not-found) and rethrow others immediately.

Suggested fix
+const isTransientK8sError = (err: unknown): boolean => {
+  const msg = err instanceof Error ? err.message : String(err);
+  return /not[\s-]?found|404/i.test(msg);
+};

@@
-  } catch {
+  } catch (err) {
+    if (!isTransientK8sError(err)) {
+      throw err;
+    }
     // Namespace may not exist yet — proceed with installation
   }

@@
-    } catch {
+    } catch (err) {
+      if (!isTransientK8sError(err)) {
+        throw err;
+      }
       // CSV not ready yet
     }

@@
-      } catch {
+      } catch (err) {
+        if (!isTransientK8sError(err)) {
+          throw err;
+        }
         // Not ready yet
       }

Also applies to: 122-124, 231-233

🤖 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/setup/knative.setup.ts` around lines 53 - 55, The readiness
checks are catching every exception and treating all failures as transient,
which can hide auth/RBAC/API problems until timeout. Update the catch blocks in
the namespace setup and the two readiness polling paths in knative.setup.ts to
only ignore expected transient Kubernetes errors such as not-found, and
immediately rethrow any other error types so real failures surface right away.
🤖 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/packages/console-shared/src/components/actions/menu/ActionMenuItem.tsx`:
- Around line 68-70: The ActionMenuItem props object contains a duplicate
data-test key, so one assignment is overwritten and the extra entry is dead
code. Update the object in ActionMenuItem to keep only a single data-test
property alongside data-test-action, and remove the redundant duplicate so the
intent is clear and the props remain unambiguous.

In `@frontend/public/components/factory/list-page.tsx`:
- Around line 297-299: The dropdown menu props in list-page.tsx define data-test
twice, and the later value overwrites the Playwright selector set in the menu
item builder. Update the object in the dropdown menu rendering logic to keep the
intended data-test value from the first assignment and remove the duplicate
data-test entry so the selector remains in the dropdown-menu-${item} format. Use
the dropdown menu/item code in the list-page component to locate the duplicate
key.

---

Duplicate comments:
In `@frontend/e2e/setup/knative.setup.ts`:
- Around line 53-55: The readiness checks are catching every exception and
treating all failures as transient, which can hide auth/RBAC/API problems until
timeout. Update the catch blocks in the namespace setup and the two readiness
polling paths in knative.setup.ts to only ignore expected transient Kubernetes
errors such as not-found, and immediately rethrow any other error types so real
failures surface right away.
🪄 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: ec57f155-e96d-47d8-ad5d-379cd20c75c2

📥 Commits

Reviewing files that changed from the base of the PR and between dbcc42a and af19c7a.

📒 Files selected for processing (27)
  • frontend/e2e/pages/knative/add-flow-page.ts
  • frontend/e2e/pages/knative/admin-eventing-page.ts
  • frontend/e2e/pages/knative/topology-knative-page.ts
  • frontend/e2e/setup/knative.setup.ts
  • frontend/e2e/tests/knative/serverless/knative-ci.spec.ts
  • frontend/integration-tests/test-cypress.sh
  • frontend/package.json
  • frontend/packages/console-shared/src/components/actions/menu/ActionMenuContent.tsx
  • frontend/packages/console-shared/src/components/actions/menu/ActionMenuItem.tsx
  • frontend/packages/console-shared/src/components/form-utils/ActionGroupWithIcons.tsx
  • frontend/packages/console-shared/src/components/form-utils/FormFooter.tsx
  • frontend/packages/console-shared/src/components/multi-tab-list/MultiTabListPage.tsx
  • frontend/packages/dev-console/src/components/import/ImportSampleForm.tsx
  • frontend/packages/dev-console/src/components/import/app/AppSection.tsx
  • frontend/packages/dev-console/src/components/import/git/GitSection.tsx
  • frontend/packages/knative-plugin/integration-tests/features/e2e/knative-ci.feature
  • frontend/packages/knative-plugin/integration-tests/package.json
  • frontend/packages/topology/src/components/dropdowns/ApplicationSelector.tsx
  • frontend/packages/topology/src/components/modals/EditApplicationModal.tsx
  • frontend/packages/topology/src/components/page/TopologyPageToolbar.tsx
  • frontend/playwright.config.ts
  • frontend/public/components/factory/list-page.tsx
  • frontend/public/components/filter-toolbar.tsx
  • frontend/public/components/modals/delete-modal.tsx
  • frontend/public/components/modals/labels-modal.tsx
  • frontend/public/components/modals/tags.tsx
  • frontend/public/components/utils/kebab.tsx
💤 Files with no reviewable changes (3)
  • frontend/packages/knative-plugin/integration-tests/package.json
  • frontend/packages/knative-plugin/integration-tests/features/e2e/knative-ci.feature
  • frontend/integration-tests/test-cypress.sh
✅ Files skipped from review due to trivial changes (13)
  • frontend/packages/console-shared/src/components/form-utils/FormFooter.tsx
  • frontend/packages/dev-console/src/components/import/ImportSampleForm.tsx
  • frontend/packages/console-shared/src/components/form-utils/ActionGroupWithIcons.tsx
  • frontend/packages/dev-console/src/components/import/app/AppSection.tsx
  • frontend/packages/console-shared/src/components/multi-tab-list/MultiTabListPage.tsx
  • frontend/packages/topology/src/components/dropdowns/ApplicationSelector.tsx
  • frontend/packages/topology/src/components/modals/EditApplicationModal.tsx
  • frontend/public/components/modals/delete-modal.tsx
  • frontend/public/components/modals/tags.tsx
  • frontend/public/components/modals/labels-modal.tsx
  • frontend/public/components/filter-toolbar.tsx
  • frontend/public/components/utils/kebab.tsx
  • frontend/packages/topology/src/components/page/TopologyPageToolbar.tsx
🚧 Files skipped from review as they are similar to previous changes (8)
  • frontend/packages/console-shared/src/components/actions/menu/ActionMenuContent.tsx
  • frontend/e2e/pages/knative/add-flow-page.ts
  • frontend/playwright.config.ts
  • frontend/packages/dev-console/src/components/import/git/GitSection.tsx
  • frontend/e2e/pages/knative/admin-eventing-page.ts
  • frontend/package.json
  • frontend/e2e/pages/knative/topology-knative-page.ts
  • frontend/e2e/tests/knative/serverless/knative-ci.spec.ts

Comment on lines +68 to +70
'data-test': label,
'data-test-action': label,
'data-test': label,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

cat -n frontend/packages/console-shared/src/components/actions/menu/ActionMenuItem.tsx | sed -n '60,80p'

Repository: openshift/console

Length of output: 766


🏁 Script executed:

cd frontend && rg "no-dupe-keys|duplicate.*key" . --type json --type ts --type js | head -20

Repository: openshift/console

Length of output: 636


🏁 Script executed:

cat -n frontend/packages/eslint-plugin-console/lib/config/rules/typescript.js | grep -A 5 -B 5 "no-dupe-keys"

Repository: openshift/console

Length of output: 588


🏁 Script executed:

cd frontend && yarn tsc --noEmit packages/console-shared/src/components/actions/menu/ActionMenuItem.tsx 2>&1 | head -30

Repository: openshift/console

Length of output: 374


🏁 Script executed:

node --version && tsc --version 2>/dev/null || echo "TypeScript not available"

Repository: openshift/console

Length of output: 178


🏁 Script executed:

cd frontend/packages/console-shared && npx tsc --noEmit src/components/actions/menu/ActionMenuItem.tsx 2>&1 | grep -i "dupe\|duplicate\|2378\|1117" || echo "No duplicate key errors detected by TypeScript"

Repository: openshift/console

Length of output: 202


🏁 Script executed:

cd frontend && rg "ActionMenuItem" packages/console-shared --type ts -A 3 -B 3 | head -40

Repository: openshift/console

Length of output: 3849


Remove the duplicate data-test object key.

Line 68 is overwritten by Line 70, resulting in dead code that should be removed for clarity.

Suggested fix
   const props = {
     icon,
     autoFocus,
     isDisabled,
     className: classes,
     onClick: handleClick,
-    'data-test': label,
     'data-test-action': label,
     'data-test': label,
     translate: 'no' as 'no',
   };
🧰 Tools
🪛 Biome (2.5.0)

[error] 68-68: This property is later overwritten by an object member with the same name.

(lint/suspicious/noDuplicateObjectKeys)

🤖 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/packages/console-shared/src/components/actions/menu/ActionMenuItem.tsx`
around lines 68 - 70, The ActionMenuItem props object contains a duplicate
data-test key, so one assignment is overwritten and the extra entry is dead
code. Update the object in ActionMenuItem to keep only a single data-test
property alongside data-test-action, and remove the redundant duplicate so the
intent is clear and the props remain unambiguous.

Source: Linters/SAST tools

Comment on lines +297 to +299
'data-test': `dropdown-menu-${item}`,
'data-test-dropdown-menu': item,
'data-test': item,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

cat -n frontend/public/components/factory/list-page.tsx | sed -n '290,310p'

Repository: openshift/console

Length of output: 1027


🏁 Script executed:

rg 'dropdown-menu-' frontend --type ts --type tsx -A 2 -B 2

Repository: openshift/console

Length of output: 183


🏁 Script executed:

rg 'dropdown-menu-' frontend -A 2 -B 2

Repository: openshift/console

Length of output: 12208


🏁 Script executed:

git log --oneline frontend/public/components/factory/list-page.tsx | head -5

Repository: openshift/console

Length of output: 235


🏁 Script executed:

git show af19c7ad23 frontend/public/components/factory/list-page.tsx | head -100

Repository: openshift/console

Length of output: 4421


🏁 Script executed:

cat -n frontend/e2e/pages/list-page.ts | sed -n '1,30p'

Repository: openshift/console

Length of output: 1671


🏁 Script executed:

git show af19c7ad23 frontend/public/components/factory/list-page.tsx | grep -A 20 -B 5 "dropdown-menu"

Repository: openshift/console

Length of output: 2386


🏁 Script executed:

cd frontend && yarn eslint public/components/factory/list-page.tsx 2>&1 | head -50

Repository: openshift/console

Length of output: 374


🏁 Script executed:

cat -n frontend/e2e/pages/list-page.ts | sed -n '20,45p'

Repository: openshift/console

Length of output: 1077


🏁 Script executed:

grep -r "dropdown-menu-" frontend/e2e --include="*.ts"

Repository: openshift/console

Length of output: 257


Remove duplicate data-test key that overwrites Playwright test selector.

Line 299 overwrites the data-test value from line 297, breaking the Playwright e2e test that expects dropdown-menu-${item} format (e.g., dropdown-menu-yaml). Remove the duplicate key at line 299 to preserve the intended selector.

Suggested fix
           initialItems={Object.keys(createProps.items).map((item) => ({
             value: item,
             content: createProps.items[item],
             'data-test': `dropdown-menu-${item}`,
             'data-test-dropdown-menu': item,
-            'data-test': item,
           }))}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
'data-test': `dropdown-menu-${item}`,
'data-test-dropdown-menu': item,
'data-test': item,
'data-test': `dropdown-menu-${item}`,
'data-test-dropdown-menu': item,
🧰 Tools
🪛 Biome (2.5.0)

[error] 297-297: This property is later overwritten by an object member with the same name.

(lint/suspicious/noDuplicateObjectKeys)

🤖 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/public/components/factory/list-page.tsx` around lines 297 - 299, The
dropdown menu props in list-page.tsx define data-test twice, and the later value
overwrites the Playwright selector set in the menu item builder. Update the
object in the dropdown menu rendering logic to keep the intended data-test value
from the first assignment and remove the duplicate data-test entry so the
selector remains in the dropdown-menu-${item} format. Use the dropdown menu/item
code in the list-page component to locate the duplicate key.

Source: Linters/SAST tools

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
frontend/e2e/setup/knative.setup.ts (1)

57-202: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚖️ Poor tradeoff

Optional: extract the repeated YAML-apply logic.

The subscription (Lines 61-99), serving (151-172), and eventing (176-202) blocks repeat the same parse → iterate → create → "already exists" swallow pattern, and KubernetesClient is instantiated identically in both setup steps (Lines 29-36 and 135-142). A shared applyDocs(client, yamlPath, handlers) helper plus a client factory would cut the duplication.

🤖 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/setup/knative.setup.ts` around lines 57 - 202, The YAML apply
flow is duplicated across the subscription, KnativeServing, and KnativeEventing
setup blocks, and the same KubernetesClient construction is repeated in both
setup steps. Extract the common parse → iterate → create → ignore “already
exists” behavior into a shared helper such as applyDocs, and centralize the
KubernetesClient creation in a small factory/helper so the setup steps only pass
the YAML path and resource-specific create logic.
🤖 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.

Nitpick comments:
In `@frontend/e2e/setup/knative.setup.ts`:
- Around line 57-202: The YAML apply flow is duplicated across the subscription,
KnativeServing, and KnativeEventing setup blocks, and the same KubernetesClient
construction is repeated in both setup steps. Extract the common parse → iterate
→ create → ignore “already exists” behavior into a shared helper such as
applyDocs, and centralize the KubernetesClient creation in a small
factory/helper so the setup steps only pass the YAML path and resource-specific
create logic.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: b3f7874b-6040-4c3c-8809-96b181ea295c

📥 Commits

Reviewing files that changed from the base of the PR and between af19c7a and 19a7955.

📒 Files selected for processing (24)
  • frontend/e2e/pages/knative/add-flow-page.ts
  • frontend/e2e/pages/knative/admin-eventing-page.ts
  • frontend/e2e/pages/knative/topology-knative-page.ts
  • frontend/e2e/setup/knative.setup.ts
  • frontend/e2e/tests/knative/serverless/knative-ci.spec.ts
  • frontend/integration-tests/test-cypress.sh
  • frontend/package.json
  • frontend/packages/console-shared/src/components/form-utils/ActionGroupWithIcons.tsx
  • frontend/packages/console-shared/src/components/form-utils/FormFooter.tsx
  • frontend/packages/console-shared/src/components/multi-tab-list/MultiTabListPage.tsx
  • frontend/packages/dev-console/src/components/import/ImportSampleForm.tsx
  • frontend/packages/dev-console/src/components/import/app/AppSection.tsx
  • frontend/packages/dev-console/src/components/import/git/GitSection.tsx
  • frontend/packages/knative-plugin/integration-tests/features/e2e/knative-ci.feature
  • frontend/packages/knative-plugin/integration-tests/package.json
  • frontend/packages/topology/src/components/dropdowns/ApplicationSelector.tsx
  • frontend/packages/topology/src/components/modals/EditApplicationModal.tsx
  • frontend/packages/topology/src/components/page/TopologyPageToolbar.tsx
  • frontend/playwright.config.ts
  • frontend/public/components/filter-toolbar.tsx
  • frontend/public/components/modals/delete-modal.tsx
  • frontend/public/components/modals/labels-modal.tsx
  • frontend/public/components/modals/tags.tsx
  • frontend/public/components/utils/kebab.tsx
💤 Files with no reviewable changes (4)
  • frontend/packages/knative-plugin/integration-tests/package.json
  • frontend/package.json
  • frontend/packages/knative-plugin/integration-tests/features/e2e/knative-ci.feature
  • frontend/integration-tests/test-cypress.sh
✅ Files skipped from review due to trivial changes (10)
  • frontend/packages/dev-console/src/components/import/ImportSampleForm.tsx
  • frontend/packages/console-shared/src/components/form-utils/FormFooter.tsx
  • frontend/public/components/filter-toolbar.tsx
  • frontend/packages/topology/src/components/page/TopologyPageToolbar.tsx
  • frontend/packages/console-shared/src/components/form-utils/ActionGroupWithIcons.tsx
  • frontend/public/components/modals/delete-modal.tsx
  • frontend/packages/console-shared/src/components/multi-tab-list/MultiTabListPage.tsx
  • frontend/public/components/modals/tags.tsx
  • frontend/packages/dev-console/src/components/import/git/GitSection.tsx
  • frontend/packages/topology/src/components/dropdowns/ApplicationSelector.tsx
🚧 Files skipped from review as they are similar to previous changes (9)
  • frontend/packages/topology/src/components/modals/EditApplicationModal.tsx
  • frontend/public/components/modals/labels-modal.tsx
  • frontend/packages/dev-console/src/components/import/app/AppSection.tsx
  • frontend/public/components/utils/kebab.tsx
  • frontend/playwright.config.ts
  • frontend/e2e/tests/knative/serverless/knative-ci.spec.ts
  • frontend/e2e/pages/knative/admin-eventing-page.ts
  • frontend/e2e/pages/knative/add-flow-page.ts
  • frontend/e2e/pages/knative/topology-knative-page.ts

@mvinkler

Copy link
Copy Markdown
Author

/retest

1 similar comment
@mvinkler

Copy link
Copy Markdown
Author

/retest

@mvinkler

Copy link
Copy Markdown
Author

/retest ci/prow/e2e-playwright

@mvinkler

Copy link
Copy Markdown
Author

/retest

2 similar comments
@mvinkler

Copy link
Copy Markdown
Author

/retest

@mvinkler

Copy link
Copy Markdown
Author

/retest

@mvinkler

Copy link
Copy Markdown
Author

/retest ci/prow/e2e-playwright
/retest ci/prow/e2e-gcp-console

Migrate the knative CI smoke test (knative-ci.feature) from Cypress
Gherkin to Playwright and remove the original Cypress file.

16 automatable scenarios migrated using serial test mode. 8 manual/
broken-test scenarios dropped (not migrated).

New files:
- e2e/tests/knative/serverless/knative-ci.spec.ts (16 serial tests)
- e2e/pages/knative/topology-knative-page.ts (topology interactions)
- e2e/pages/knative/add-flow-page.ts (git import flow)
- e2e/pages/knative/admin-eventing-page.ts (admin eventing page)
- e2e/setup/knative.setup.ts (Serverless operator install + CR setup)

Removed:
- features/e2e/knative-ci.feature (replaced by Playwright spec)
- test-cypress-knative-headless script and CI references

React components modified to add data-test attributes alongside
existing legacy test attributes (data-test-id, data-test-action,
data-test-dropdown-menu) for Playwright getByTestId() usage.

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Michal Vinkler <mvinkler@redhat.com>
@mvinkler

Copy link
Copy Markdown
Author

/retest ci/prow/e2e-playwright

@mvinkler

Copy link
Copy Markdown
Author

/retest

@openshift-ci

openshift-ci Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

@mvinkler: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-playwright eeae24a link false /test e2e-playwright
ci/prow/e2e-gcp-console eeae24a link true /test e2e-gcp-console

Full PR test history. Your PR dashboard.

Details

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 kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/core Related to console core functionality component/dev-console Related to dev-console component/knative Related to knative-plugin component/shared Related to console-shared component/topology Related to topology jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants