OCPBUGS-82511: re-enable helm-release.feature#16274
OCPBUGS-82511: re-enable helm-release.feature#16274rhamilto wants to merge 1 commit intoopenshift:mainfrom
Conversation
|
@rhamilto: This pull request references Jira Issue OCPBUGS-82511, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this: Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rhamilto The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
WalkthroughThis PR updates integration test support code and feature files across multiple packages. Changes include removing feature disablement comment and Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes 🚥 Pre-merge checks | ✅ 10✅ Passed checks (10 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
/test e2e-gcp-console |
1 similar comment
|
/test e2e-gcp-console |
|
/retest |
e73ffe2 to
c2b3050
Compare
|
/retest |
2 similar comments
|
/retest |
|
/retest |
|
/cherry-pick release-4.22 |
|
@rhamilto: once the present PR merges, I will cherry-pick it on top of DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/jira refresh |
|
@rhamilto: once the present PR merges, I will cherry-pick it on top of DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
@rhamilto: This pull request references Jira Issue OCPBUGS-82511, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
@rhamilto: This pull request references Jira Issue OCPBUGS-82511, which is valid. 3 validation(s) were run on this bug
DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
frontend/packages/dev-console/integration-tests/support/pages/app.ts (1)
313-360: Project-create flow is duplicated in two branches.Consider extracting a helper (e.g.,
createProjectIfAllowed(projectName)) to keep permission check, creation, andNAMESPACESupdate in one place.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@frontend/packages/dev-console/integration-tests/support/pages/app.ts` around lines 313 - 360, The project-create logic is duplicated; extract it into a helper named createProjectIfAllowed(projectName) that encapsulates the permission check (presence of '[data-test-dropdown-menu="#CREATE_RESOURCE_ACTION#"]'), clicking cy.byTestDropDownMenu('#CREATE_RESOURCE_ACTION#'), calling projectNameSpace.enterProjectName(projectName), confirming via cy.byTestID('confirm-action'), updating the shared Cypress.expose('NAMESPACES') array to include projectName if missing, and invoking app.waitForLoad(); replace both duplicated blocks with a single call to createProjectIfAllowed(projectName) and leave the existing error throw in caller paths only when the helper determines creation is not allowed.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@frontend/packages/dev-console/integration-tests/support/pages/app.ts`:
- Around line 334-360: The current code calls .contains(projectName).click()
which throws when the project isn't present, making the create-permission
fallback unreachable; change the selection logic in the namespace dropdown (the
cy.get('[data-test="namespace-dropdown-menu"]').find('[data-test="dropdown-menu-item-link"]')
block) to first query the items and check for an element whose text includes
projectName (e.g., using a .then($items => { if ($items.filter(...) or
Array.from($items).some(...) }) ) and only call .click() when found; otherwise
proceed into the existing fallback that checks for the create action, calls
cy.byTestDropDownMenu('#CREATE_RESOURCE_ACTION#').click(), uses
projectNameSpace.enterProjectName(projectName), clicks
cy.byTestID('confirm-action'), updates Cypress.expose('NAMESPACES'), and calls
app.waitForLoad(); ensure you reference and update the same variables/commands
(projectNameSpaceDropdown alias, projectNameSpace.enterProjectName,
cy.byTestDropDownMenu, cy.byTestID, Cypress.expose, app.waitForLoad) so the
fallback can execute when the project item is absent.
---
Nitpick comments:
In `@frontend/packages/dev-console/integration-tests/support/pages/app.ts`:
- Around line 313-360: The project-create logic is duplicated; extract it into a
helper named createProjectIfAllowed(projectName) that encapsulates the
permission check (presence of
'[data-test-dropdown-menu="#CREATE_RESOURCE_ACTION#"]'), clicking
cy.byTestDropDownMenu('#CREATE_RESOURCE_ACTION#'), calling
projectNameSpace.enterProjectName(projectName), confirming via
cy.byTestID('confirm-action'), updating the shared Cypress.expose('NAMESPACES')
array to include projectName if missing, and invoking app.waitForLoad(); replace
both duplicated blocks with a single call to createProjectIfAllowed(projectName)
and leave the existing error throw in caller paths only when the helper
determines creation is not allowed.
🪄 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: Pro Plus
Run ID: c6710cba-648b-4604-b088-2a3580c5b0bc
📒 Files selected for processing (4)
frontend/packages/dev-console/integration-tests/support/pages/add-flow/catalog-page.tsfrontend/packages/dev-console/integration-tests/support/pages/app.tsfrontend/packages/helm-plugin/integration-tests/features/helm-release.featurefrontend/packages/integration-tests/views/details-page.ts
✅ Files skipped from review due to trivial changes (2)
- frontend/packages/integration-tests/views/details-page.ts
- frontend/packages/helm-plugin/integration-tests/features/helm-release.feature
| cy.get('[data-test="namespace-dropdown-menu"]') | ||
| .find('[data-test="dropdown-menu-item-link"]') | ||
| .contains(projectName) | ||
| .click(); | ||
| cy.get('@projectNameSpaceDropdown').then(($el1) => { | ||
| if ($el1.text().includes(projectName)) { | ||
| cy.get('@projectNameSpaceDropdown').should('contain.text', projectName); | ||
| } else { | ||
| // Check if Create Project button exists | ||
| cy.get('body').then(($body) => { | ||
| if ($body.find('[data-test-dropdown-menu="#CREATE_RESOURCE_ACTION#"]').length > 0) { | ||
| cy.byTestDropDownMenu('#CREATE_RESOURCE_ACTION#').click(); | ||
| projectNameSpace.enterProjectName(projectName); | ||
| cy.byTestID('confirm-action').click(); | ||
| const namespaces: string[] = Cypress.expose('NAMESPACES') || []; | ||
| if (!namespaces.includes(projectName)) { | ||
| namespaces.push(projectName); | ||
| } | ||
| Cypress.expose('NAMESPACES', namespaces); | ||
| app.waitForLoad(); | ||
| } else { | ||
| throw new Error( | ||
| `Failed to select project "${projectName}" and user lacks permission to create it. ` + | ||
| `Please pre-create the project or grant self-provisioner role.`, | ||
| ); | ||
| } | ||
| }); |
There was a problem hiding this comment.
Fallback path is unreachable when project is missing from a non-empty dropdown.
At Line 336, .contains(projectName).click() hard-fails if no matching project exists, so the create-permission fallback below never runs.
Suggested fix
- cy.get('[data-test="namespace-dropdown-menu"]')
- .find('[data-test="dropdown-menu-item-link"]')
- .contains(projectName)
- .click();
- cy.get('@projectNameSpaceDropdown').then(($el1) => {
- if ($el1.text().includes(projectName)) {
- cy.get('@projectNameSpaceDropdown').should('contain.text', projectName);
- } else {
+ cy.get('[data-test="namespace-dropdown-menu"]')
+ .find('[data-test="dropdown-menu-item-link"]')
+ .then(($items) => {
+ const match = [...$items].find(
+ (el) => el.textContent?.trim() === projectName,
+ );
+ if (match) {
+ cy.wrap(match).click();
+ cy.get('@projectNameSpaceDropdown').should('contain.text', projectName);
+ } else {
// Check if Create Project button exists
cy.get('body').then(($body) => {
if ($body.find('[data-test-dropdown-menu="#CREATE_RESOURCE_ACTION#"]').length > 0) {
cy.byTestDropDownMenu('#CREATE_RESOURCE_ACTION#').click();
projectNameSpace.enterProjectName(projectName);
cy.byTestID('confirm-action').click();
const namespaces: string[] = Cypress.expose('NAMESPACES') || [];
if (!namespaces.includes(projectName)) {
namespaces.push(projectName);
}
Cypress.expose('NAMESPACES', namespaces);
app.waitForLoad();
} else {
throw new Error(
`Failed to select project "${projectName}" and user lacks permission to create it. ` +
`Please pre-create the project or grant self-provisioner role.`,
);
}
});
- }
- });
+ }
+ });🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@frontend/packages/dev-console/integration-tests/support/pages/app.ts` around
lines 334 - 360, The current code calls .contains(projectName).click() which
throws when the project isn't present, making the create-permission fallback
unreachable; change the selection logic in the namespace dropdown (the
cy.get('[data-test="namespace-dropdown-menu"]').find('[data-test="dropdown-menu-item-link"]')
block) to first query the items and check for an element whose text includes
projectName (e.g., using a .then($items => { if ($items.filter(...) or
Array.from($items).some(...) }) ) and only call .click() when found; otherwise
proceed into the existing fallback that checks for the create action, calls
cy.byTestDropDownMenu('#CREATE_RESOURCE_ACTION#').click(), uses
projectNameSpace.enterProjectName(projectName), clicks
cy.byTestID('confirm-action'), updates Cypress.expose('NAMESPACES'), and calls
app.waitForLoad(); ensure you reference and update the same variables/commands
(projectNameSpaceDropdown alias, projectNameSpace.enterProjectName,
cy.byTestDropDownMenu, cy.byTestID, Cypress.expose, app.waitForLoad) so the
fallback can execute when the project item is absent.
|
@rhamilto: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Summary by CodeRabbit