Skip to content

Conversation

@yapei
Copy link
Contributor

@yapei yapei commented Nov 24, 2025

  • Update machine-config.cy.ts to check exact content and more details

@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 24, 2025
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Nov 24, 2025

@yapei: This pull request references CONSOLE-4912 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:

  • Update machine-config.cy.ts to check exact content and more 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 openshift-eng/jira-lifecycle-plugin repository.

@coderabbitai
Copy link

coderabbitai bot commented Nov 24, 2025

Walkthrough

Added guided-tour cleanup and an afterEach error check to a Cypress machine-config test; introduced a helper to validate machine config file details and extended a test to fetch and verify machine config data via an oc JSONPath query. Also replaced a hardcoded Info ARIA label with a translated string and adjusted the English locale placement of the "Info" key.

Changes

Cohort / File(s) Summary
Cypress test enhancements
frontend/packages/integration-tests-cypress/tests/app/machine-config.cy.ts
Imported guidedTour and invoked guidedTour.close() in setup; added checkMachineConfigDetails(mode, overwrite, content) to open the info panel, assert mode and overwrite, and verify the first code block contains a truncated/decoded portion of content; added afterEach to call checkErrors(); updated MC_WITH_CONFIG_FILES test to run oc get mc ... -o jsonpath to read the first storage file's source, mode, and overwrite, validate them, and call the helper for UI verification.
UI i18n tweak
frontend/public/components/machine-config.tsx
Replaced a hardcoded ARIA label on the Info button with a translation call t('public~Info'), using the existing useTranslation hook.
Locale ordering change
frontend/public/locales/en/public.json
Moved the "Info": "Info" entry within the JSON (removed the earlier occurrence and added it after "Overwrite"), preserving the translation key but changing its position.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Check the oc get ... -o jsonpath expression and JSON parsing for edge cases (absent fields or unexpected shapes).
  • Verify checkMachineConfigDetails() decoding/truncation logic correctly matches UI-rendered content.
  • Ensure guided-tour close and afterEach checkErrors() integrate with existing test setup/teardown semantics.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

@openshift-ci openshift-ci bot requested review from cajieh and rhamilto November 24, 2025 08:47
@openshift-ci openshift-ci bot added the kind/cypress Related to Cypress e2e integration testing label Nov 24, 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: 2

📜 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 409d0c4 and 681df50.

📒 Files selected for processing (1)
  • frontend/packages/integration-tests-cypress/tests/app/machine-config.cy.ts (2 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/tests/app/machine-config.cy.ts
🔇 Additional comments (2)
frontend/packages/integration-tests-cypress/tests/app/machine-config.cy.ts (2)

3-3: LGTM: Guided tour cleanup import added.

The import is correctly used in the test setup to ensure guided tours don't interfere with test execution.


31-31: LGTM: Guided tour cleanup in test setup.

Properly dismissing the guided tour before test execution prevents potential interference with UI interactions.

@yapei
Copy link
Contributor Author

yapei commented Nov 25, 2025

@rhamilto could you help give a review? Thanks!
e2e-gcp-console is failing at other tests, app/machine-config.cy.ts are passing though
Screenshot 2025-11-25 at 2 24 20 PM

const MC_C2C = '.co-copy-to-clipboard__text';
const checkMachineConfigDetails = (mode, overwrite, content) => {
cy.byTestID(MC_CONFIG_FILE_PATH_ID).scrollIntoView();
cy.get('button[aria-label="public~Info"]').first().click();
Copy link
Member

Choose a reason for hiding this comment

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

the i18n namespace in the aria-label is a bug and should be fixed. it should be aria-label={t('public~Info')}. If that is not specific enough we can add a test id for this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks! wasn't aware that we have a bug here, will fix

@openshift-ci openshift-ci bot added component/core Related to console core functionality kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated labels Nov 27, 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: 0

🧹 Nitpick comments (1)
frontend/packages/integration-tests-cypress/tests/app/machine-config.cy.ts (1)

11-26: Scope assertions to the config-file section to avoid accidental matches

checkMachineConfigDetails does the right logical checks, but the selectors are fairly broad:

  • cy.contains(mode) / cy.contains(overwrite.toString()) search the entire page, so another element showing the same text could make the test pass even if the popover content is wrong.
  • cy.get('code').first() will grab the first <code> element anywhere, not necessarily the one associated with MC_CONFIG_FILE_PATH_ID.

Consider scoping these assertions to the configuration-file row (for example by using cy.byTestID(MC_CONFIG_FILE_PATH_ID).parent().within(...) or a similar container) so the mode/overwrite and code checks are guaranteed to apply to the targeted file entry.

📜 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 65ed3b9 and 1427c04.

📒 Files selected for processing (3)
  • frontend/packages/integration-tests-cypress/tests/app/machine-config.cy.ts (2 hunks)
  • frontend/public/components/machine-config.tsx (1 hunks)
  • frontend/public/locales/en/public.json (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/tests/app/machine-config.cy.ts
  • frontend/public/components/machine-config.tsx
  • frontend/public/locales/en/public.json
🧬 Code graph analysis (1)
frontend/public/components/machine-config.tsx (1)
frontend/__mocks__/i18next.ts (1)
  • t (8-14)
🔇 Additional comments (4)
frontend/public/components/machine-config.tsx (1)

80-107: Localized ARIA label correctly wired to i18n

Switching the Info button aria-label to t('public~Info') aligns with existing i18n usage and keeps the control accessible without changing behavior. Looks good.

frontend/public/locales/en/public.json (1)

724-736: Info translation entry is consistent with usage

Adding "Info": "Info" under the public namespace correctly supports t('public~Info') in the UI; no issues seen.

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

3-37: Guided tour cleanup and global error check improve test stability

Closing the guided tour in before and running checkErrors() in afterEach should reduce flakiness from overlays and surface console issues early. This setup looks solid.


46-59: Server-side file data verification is wired correctly

Using oc get mc ... -o jsonpath='{.spec.config.storage.files[0]}', parsing the result, asserting presence of contents, mode, and overwrite, then delegating to checkMachineConfigDetails gives a good end-to-end check that the UI reflects the MachineConfig’s underlying data. This looks good and fits the PR’s goal of checking more details.

@yapei
Copy link
Contributor Author

yapei commented Nov 27, 2025

@logonoff comments resolved ~ PTAL, thanks!

Copy link
Member

@logonoff logonoff left a comment

Choose a reason for hiding this comment

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

/lgtm

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

openshift-ci bot commented Nov 27, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: logonoff, yapei

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 Nov 27, 2025
@yapei
Copy link
Contributor Author

yapei commented Nov 28, 2025

flaky test

Enable dev perspective: P-01-TC04: Enable dev perspective Enable dev perspective: P-01-TC04 

/retest-required

@yapei
Copy link
Contributor Author

yapei commented Dec 1, 2025

/retest-required

@yapei
Copy link
Contributor Author

yapei commented Dec 1, 2025

/verified by CI

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Dec 1, 2025
@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.

@yapei
Copy link
Contributor Author

yapei commented Dec 3, 2025

/retest-required

1 similar comment
@yapei
Copy link
Contributor Author

yapei commented Dec 5, 2025

/retest-required

@yapei
Copy link
Contributor Author

yapei commented Dec 8, 2025

/label acknowledge-critical-fixes-only
/label docs-apporved

@openshift-ci openshift-ci bot added the acknowledge-critical-fixes-only Indicates if the issuer of the label is OK with the policy. label Dec 8, 2025
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 8, 2025

@yapei: The label(s) /label docs-apporved cannot be applied. These labels are supported: acknowledge-critical-fixes-only, platform/aws, platform/azure, platform/baremetal, platform/google, platform/libvirt, platform/openstack, ga, tide/merge-method-merge, tide/merge-method-rebase, tide/merge-method-squash, px-approved, docs-approved, qe-approved, ux-approved, no-qe, downstream-change-needed, rebase/manual, cluster-config-api-changed, run-integration-tests, approved, backport-risk-assessed, bugzilla/valid-bug, cherry-pick-approved, jira/valid-bug, ok-to-test, plugin-api-approved, plugin-api-changed, stability-fix-approved, staff-eng-approved. Is this label configured under labels -> additional_labels or labels -> restricted_labels in plugin.yaml?

In response to this:

/label acknowledge-critical-fixes-only
/label docs-apporved

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.

@logonoff
Copy link
Member

logonoff commented Dec 8, 2025

/label px-approved
/label docs-approved

@openshift-ci openshift-ci bot added px-approved Signifies that Product Support has signed off on this PR docs-approved Signifies that Docs has signed off on this PR labels Dec 8, 2025
@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD 370e6b0 and 2 for PR HEAD 1427c04 in total

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 8, 2025

@yapei: The following test 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-gcp-console 1427c04 link true /test e2e-gcp-console

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.

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. component/core Related to console core functionality 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 kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated 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.

3 participants