Skip to content

Conversation

@yanpzhan
Copy link
Contributor

Tracked in https://issues.redhat.com/browse/CONSOLE-4915
@yapei pls help to review, thanks!

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Nov 25, 2025
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Nov 25, 2025

@yanpzhan: This pull request references CONSOLE-4915 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 sub-task to target the "4.21.0" version, but no target version was set.

In response to this:

Tracked in https://issues.redhat.com/browse/CONSOLE-4915
@yapei pls help to review, thanks!

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.

@coderabbitai
Copy link

coderabbitai bot commented Nov 25, 2025

Walkthrough

Adds an OpenShift httpd application template, a Cypress integration test that exercises the template via the catalog, and a catalog view helper with keyword-filter and item-image verification methods.

Changes

Cohort / File(s) Summary
OpenShift Template
frontend/packages/integration-tests-cypress/fixtures/httpd-example-template.yaml
Adds a Template YAML defining Service, Route, ImageStream, BuildConfig, Deployment and related metadata; declares parameters (NAME, NAMESPACE, HTTPD_VERSION, MEMORY_LIMIT, SOURCE_REPOSITORY_URL, SOURCE_REPOSITORY_REF, CONTEXT_DIR, APPLICATION_DOMAIN, GITHUB_WEBHOOK_SECRET, GENERIC_WEBHOOK_SECRET), ImageChange and webhook triggers, annotations, labels, and parameter-based defaults.
Cypress Integration Test
frontend/packages/integration-tests-cypress/tests/app/template.cy.ts
Adds a test suite that creates the template before tests and deletes it after; logs in and closes guided tour; navigates to the catalog, waits for loading, filters by keyword, opens the Apache HTTP Server template, retrieves iconClass via oc get template ... -o jsonpath=... (logged), and verifies the displayed catalog item image using the catalog helper.
Catalog View Helpers
frontend/packages/integration-tests-cypress/views/catalogs.ts
Adds catalog helper exposing filterByKeyword(keyword: string) (types into input with placeholder containing "Filter by keyword") and checkItemImage(srcText) (asserts .img.catalog-item-header-pf-icon src contains provided text).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20–30 minutes

  • Inspect YAML parameter interpolation, BuildConfig Git/webhook trigger syntax, and image/imageChange references in ImageStream/Deployment.
  • Validate test setup/teardown commands (oc create / oc delete) and robustness of cy.exec('oc get ...') parsing.
  • Confirm selectors and placeholder text used by catalog helpers match current UI and are stable.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


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

@openshift-ci openshift-ci bot requested review from cajieh and spadgett November 25, 2025 09:17
@openshift-ci openshift-ci bot added the kind/cypress Related to Cypress e2e integration testing label Nov 25, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (1)
frontend/packages/integration-tests-cypress/views/catalogs.ts (1)

5-9: Consider adding type annotation for srcText parameter.

The checkItemImage method implementation is correct. However, adding a type annotation for the srcText parameter would improve type safety and consistency with the filteByKeyword method.

Apply this diff:

-  checkItemImage: (srcText) => {
+  checkItemImage: (srcText: string) => {
     cy.get('img.catalog-item-header-pf-icon')
       .should('have.attr', 'src')
       .and('contain', `${srcText}`);
   },
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between 2243c06 and 53b030f.

📒 Files selected for processing (3)
  • frontend/packages/integration-tests-cypress/fixtures/httpd-example-template.yaml (1 hunks)
  • frontend/packages/integration-tests-cypress/tests/app/template.cy.ts (1 hunks)
  • frontend/packages/integration-tests-cypress/views/catalogs.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**

⚙️ CodeRabbit configuration file

-Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.

Files:

  • frontend/packages/integration-tests-cypress/views/catalogs.ts
  • frontend/packages/integration-tests-cypress/tests/app/template.cy.ts
  • frontend/packages/integration-tests-cypress/fixtures/httpd-example-template.yaml
🧬 Code graph analysis (1)
frontend/packages/integration-tests-cypress/tests/app/template.cy.ts (1)
frontend/packages/integration-tests-cypress/views/catalogs.ts (1)
  • catalog (1-10)
🔇 Additional comments (3)
frontend/packages/integration-tests-cypress/fixtures/httpd-example-template.yaml (1)

1-182: LGTM! Test fixture is well-structured.

The OpenShift template fixture is properly configured for integration testing. The custom iconClass URL (line 14) and version string with test artifacts (line 22) are appropriate for test purposes.

frontend/packages/integration-tests-cypress/tests/app/template.cy.ts (2)

5-16: LGTM! Setup and teardown logic is correct.

The before/after hooks properly create and clean up the test template in the openshift namespace.


21-29: LGTM! Icon verification logic is correct.

The test properly retrieves the iconClass annotation and verifies the catalog item image. The use of failOnNonZeroExit: false provides graceful error handling.

@yanpzhan yanpzhan force-pushed the auto branch 2 times, most recently from 2abd6cc to afc151b Compare November 25, 2025 12:13
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between 53b030f and afc151b.

📒 Files selected for processing (3)
  • frontend/packages/integration-tests-cypress/fixtures/httpd-example-template.yaml (1 hunks)
  • frontend/packages/integration-tests-cypress/tests/app/template.cy.ts (1 hunks)
  • frontend/packages/integration-tests-cypress/views/catalogs.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • frontend/packages/integration-tests-cypress/tests/app/template.cy.ts
🧰 Additional context used
📓 Path-based instructions (1)
**

⚙️ CodeRabbit configuration file

-Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.

Files:

  • frontend/packages/integration-tests-cypress/fixtures/httpd-example-template.yaml
  • frontend/packages/integration-tests-cypress/views/catalogs.ts
🔇 Additional comments (1)
frontend/packages/integration-tests-cypress/views/catalogs.ts (1)

1-10: Catalog helper looks correct and minimal for the current tests

The keyword filter and image checks are straightforward, readable, and align with Cypress best practices for these flows. No changes needed.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
frontend/packages/integration-tests-cypress/tests/app/template.cy.ts (1)

20-20: Correct the search keyword spelling for clarity

The search term 'test apach' is misspelled; while it likely still matches via substring, it’s confusing next to the template display name “Test Apache HTTP Server”. Consider fixing the typo:

-    catalog.filterByKeyword('test apach');
+    catalog.filterByKeyword('test apache');
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between afc151b and a47934f.

📒 Files selected for processing (3)
  • frontend/packages/integration-tests-cypress/fixtures/httpd-example-template.yaml (1 hunks)
  • frontend/packages/integration-tests-cypress/tests/app/template.cy.ts (1 hunks)
  • frontend/packages/integration-tests-cypress/views/catalogs.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • frontend/packages/integration-tests-cypress/views/catalogs.ts
🧰 Additional context used
📓 Path-based instructions (1)
**

⚙️ CodeRabbit configuration file

-Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.

Files:

  • frontend/packages/integration-tests-cypress/tests/app/template.cy.ts
  • frontend/packages/integration-tests-cypress/fixtures/httpd-example-template.yaml
🔇 Additional comments (1)
frontend/packages/integration-tests-cypress/fixtures/httpd-example-template.yaml (1)

1-182: Fixture structure and annotations look appropriate

Template definition (objects, parameters, annotations) is consistent with a standard httpd example and suitable as an isolated test fixture. iconClass now uses a neutral example domain and webhook secrets are generated, so there are no obvious security or maintainability concerns here.

@yanpzhan yanpzhan force-pushed the auto branch 2 times, most recently from f5ffc9a to a717ddc Compare November 26, 2025 11:36
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

♻️ Duplicate comments (1)
frontend/packages/integration-tests-cypress/tests/app/template.cy.ts (1)

20-20: Fix typo in search keyword.

The search term 'test apach' is missing the 'e' from 'apache'. The template's display name is "Test Apache HTTP Server", so the keyword should be 'test apache' for correctness.

Apply this diff:

-    catalog.filterByKeyword('test apach');
+    catalog.filterByKeyword('test apache');
🧹 Nitpick comments (1)
frontend/packages/integration-tests-cypress/tests/app/template.cy.ts (1)

22-28: Consider trimming stdout for robustness.

The stdout from the oc get command might include extra whitespace or surrounding quotes from the jsonpath expression. While the test may work as-is, trimming ensures cleaner output for the image verification.

Apply this diff:

     cy.exec(
       `oc get template httpd-example-test -n openshift -o jsonpath='{.metadata.annotations.iconClass}'`,
     ).then((output) => {
-      const iconClass = output.stdout;
+      const iconClass = output.stdout.trim();
       cy.log(`1. icon url: ${iconClass}`);
-      catalog.checkItemImage(`${iconClass}`);
+      catalog.checkItemImage(iconClass);
     });

Note: The template literal on line 27 is also unnecessary since iconClass is already a string.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between a717ddc and e80666a.

📒 Files selected for processing (3)
  • frontend/packages/integration-tests-cypress/fixtures/httpd-example-template.yaml (1 hunks)
  • frontend/packages/integration-tests-cypress/tests/app/template.cy.ts (1 hunks)
  • frontend/packages/integration-tests-cypress/views/catalogs.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • frontend/packages/integration-tests-cypress/views/catalogs.ts
🧰 Additional context used
📓 Path-based instructions (1)
**

⚙️ CodeRabbit configuration file

-Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.

Files:

  • frontend/packages/integration-tests-cypress/fixtures/httpd-example-template.yaml
  • frontend/packages/integration-tests-cypress/tests/app/template.cy.ts
🧬 Code graph analysis (1)
frontend/packages/integration-tests-cypress/tests/app/template.cy.ts (1)
frontend/packages/integration-tests-cypress/views/catalogs.ts (1)
  • catalog (1-10)
🔇 Additional comments (4)
frontend/packages/integration-tests-cypress/fixtures/httpd-example-template.yaml (1)

1-182: LGTM! Well-structured OpenShift template fixture.

The template fixture is properly configured for testing purposes. The previous concern about the iconClass domain has been addressed by using example.com, which is an IANA-reserved domain suitable for examples and testing.

frontend/packages/integration-tests-cypress/tests/app/template.cy.ts (3)

1-3: LGTM! Clean imports.

The imports are appropriate for the test functionality.


5-12: LGTM! Proper test setup.

The before hook correctly creates the template, verifies creation, and initializes the test environment.


14-16: LGTM! Proper test cleanup.

The after hook ensures the template is deleted, maintaining a clean test environment.

@yanpzhan
Copy link
Contributor Author

All comments have been addressed.

Copy link
Member

@jhadvig jhadvig left a comment

Choose a reason for hiding this comment

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

/lgtm
/retest

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Dec 1, 2025
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 1, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jhadvig, yanpzhan

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

The pull request process is described here

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 approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 1, 2025
@yanpzhan
Copy link
Contributor Author

yanpzhan commented Dec 3, 2025

/test e2e-gcp-console

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 3, 2025

@yanpzhan: all tests passed!

Full PR test history. Your PR dashboard.

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.

@yapei
Copy link
Contributor

yapei commented Dec 4, 2025

/verified by CI

@openshift-ci-robot
Copy link
Contributor

@yapei: This PR has been marked as verified by CI.

In response to this:

/verified by CI

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-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Dec 4, 2025
@yanpzhan
Copy link
Contributor Author

yanpzhan commented Dec 5, 2025

/label acknowledge-critical-fixes-only
/label docs-approved
/label px-approved

@openshift-ci openshift-ci bot added acknowledge-critical-fixes-only Indicates if the issuer of the label is OK with the policy. docs-approved Signifies that Docs has signed off on this PR px-approved Signifies that Product Support has signed off on this PR labels Dec 5, 2025
@openshift-merge-bot openshift-merge-bot bot merged commit e5b609e into openshift:main Dec 6, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

acknowledge-critical-fixes-only Indicates if the issuer of the label is OK with the policy. approved Indicates a PR has been approved by an approver from all required OWNERS files. docs-approved Signifies that Docs has signed off on this PR jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. kind/cypress Related to Cypress e2e integration testing lgtm Indicates that a PR is ready to be merged. px-approved Signifies that Product Support has signed off on this PR verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants