Skip to content

Commit

Permalink
Merge branch 'rancher:master' into qa_task_1624
Browse files Browse the repository at this point in the history
  • Loading branch information
a-arias authored Jan 7, 2025
2 parents f15f61a + f980283 commit e2a7b65
Show file tree
Hide file tree
Showing 140 changed files with 3,815 additions and 1,891 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ module.exports = {
'@typescript-eslint/no-var-requires': 'off',
'vue/one-component-per-file': 'off',
'vue/no-deprecated-slot-attribute': 'off',
'vue/v-on-event-hyphenation': 'off'
'vue/v-on-event-hyphenation': 'off',
'jest/no-hooks': 'off',
},
overrides: [
{
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/scripts/pr-check-checklist.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash
set -e

echo "Fetching description..."
PR_BODY=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
"$PR_URL" | jq -r '.body')

echo "Validating checklist..."
CHECKBOXES=$(echo "$PR_BODY" | grep -o '\[.\]')
UNCHECKED=$(echo "$CHECKBOXES" | grep '\[ \]' || true)

if [ -n "$UNCHECKED" ]; then
echo "❌ Checklist has not been completed"
exit 1
else
echo "✅ Checked Checklist, all checks checked and checked"
fi
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
['@manager'],
['@userMenu', '@usersAndAuths'],
['@components'],
# ['@vai'] // https://github.com/rancher/dashboard/issues/12856
['@vai']
]
runs-on: ubuntu-latest
steps:
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/valid-pr-description.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Validate Pull Request Description

on:
pull_request:
types: [opened, edited, synchronize]

jobs:
validate-description:
name: Validate Description
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Validate checklist has been completed
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_URL: ${{ github.event.pull_request.url }}
run: ./.github/workflows/scripts/pr-check-checklist.sh
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ We welcome external contributions - please refer to the internal documentation a

License
=======
Copyright (c) 2014-2024 [Rancher Labs, Inc.](http://rancher.com)
Copyright (c) 2014-2025 [Rancher Labs, Inc.](http://rancher.com)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ jobs:
with:
registry_target: ghcr.io
registry_user: ${{ github.actor }}
tagged_release: ${{ github.ref_name }}
secrets:
registry_token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion creators/extension/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@rancher/create-extension",
"description": "Rancher UI Extension generator",
"version": "3.0.5",
"version": "3.0.7",
"license": "Apache-2.0",
"author": "SUSE",
"packageManager": "[email protected]",
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/blueprints/nav/fake-cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2474,7 +2474,7 @@ function generateFakeNavClusterData(provClusterId = 'some-prov-cluster-id', mgmt
}

export function generateFakeClusterDataAndIntercepts(fakeProvClusterId = 'some-prov-cluster-id', fakeMgmtClusterId = 'some-mgmt-cluster-id', addEditClusterCapabilities = false): {} {
const longClusterDescription = 'this-is-some-really-really-really-really-really-really-long-decription';
const longClusterDescription = 'this-is-some-really-really-really-really-really-really-long-description';
const fakeNavClusterData = generateFakeNavClusterData(fakeProvClusterId, fakeMgmtClusterId, addEditClusterCapabilities);

// add cluster to fleet clusters for testing https://github.com/rancher/dashboard/issues/9984
Expand Down
5 changes: 5 additions & 0 deletions cypress/e2e/po/components/namespace-filter.po.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import ComponentPo from '@/cypress/e2e/po/components/component.po';

export class NamespaceFilterPo extends ComponentPo {
constructor() {
super('[data-testid="namespaces-filter"]');
Expand Down Expand Up @@ -52,6 +53,10 @@ export class NamespaceFilterPo extends ComponentPo {
return this.namespaceDropdown().find('[data-testid="namespaces-values"]');
}

allSelected() {
return this.self().find('[data-testid="namespaces-values-none"]').should('exist');
}

moreOptionsSelected() {
return this.namespaceDropdown().find('.ns-more');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ export default class ClusterManagerCreatePagePo extends ClusterManagerCreateImpo
return this.self().contains('.grid .name', name, { timeout: 10000 }).should(assertion);
}

gridElementGroupTitles() {
return this.self().find('.subtypes-container > div > h4');
}

selectKubeProvider(index: number) {
return this.resourceDetail().cruResource().selectSubType(0, index).click();
}
Expand Down
3 changes: 1 addition & 2 deletions cypress/e2e/po/pages/chart-repositories.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ export default class ChartRepositoriesPagePo extends PagePo {
const burgerMenu = new BurgerMenuPo();
const sideNav = new ProductNavPo();

BurgerMenuPo.toggle();
burgerMenu.clusterNotPinnedList().contains(clusterId).click();
burgerMenu.goToCluster(clusterId);
sideNav.navToSideMenuGroupByLabel('Apps');
sideNav.navToSideMenuEntryByLabel('Repositories');
} else {
Expand Down
3 changes: 1 addition & 2 deletions cypress/e2e/po/pages/explorer/charts/charts.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ export class ChartsPage extends PagePo {
const burgerMenu = new BurgerMenuPo();
const sideNav = new ProductNavPo();

BurgerMenuPo.toggle();
burgerMenu.clusterNotPinnedList().contains(clusterId).click();
burgerMenu.goToCluster(clusterId);
sideNav.navToSideMenuGroupByLabel('Apps');
}

Expand Down
53 changes: 49 additions & 4 deletions cypress/e2e/po/pages/explorer/cluster-dashboard.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import CustomBadgeDialogPo from '@/cypress/e2e/po/components/custom-badge-dialog
import EventsListPo from '@/cypress/e2e/po/lists/events-list.po';
import TabbedPo from '@/cypress/e2e/po/components/tabbed.po';
import CertificatesPo from '@/cypress/e2e/po/components/certificates.po';
import { HeaderPo } from '~/cypress/e2e/po/components/header.po';
import { HeaderPo } from '@/cypress/e2e/po/components/header.po';
import { NamespaceFilterPo } from '@/cypress/e2e/po/components/namespace-filter.po';

export default class ClusterDashboardPagePo extends PagePo {
private static createPath(clusterId: string) {
Expand All @@ -15,15 +16,18 @@ export default class ClusterDashboardPagePo extends PagePo {
return super.goTo(ClusterDashboardPagePo.createPath(clusterId));
}

urlPath(clusterId = 'local') {
return ClusterDashboardPagePo.createPath(clusterId);
}

constructor(clusterId: string) {
super(ClusterDashboardPagePo.createPath(clusterId));
}

static navTo(clusterId = 'local') {
const burgerMenu = new BurgerMenuPo();

BurgerMenuPo.toggle();
burgerMenu.clusterNotPinnedList().contains(clusterId).click();
burgerMenu.goToCluster(clusterId);
}

customizeAppearanceButton() {
Expand Down Expand Up @@ -53,7 +57,7 @@ export default class ClusterDashboardPagePo extends PagePo {
}

fullEventsLink() {
return cy.get('.events-table-link').contains('Full events list');
return cy.get('[data-testid="events-link"]').contains('Full events list');
}

fullSecretsList() {
Expand All @@ -79,4 +83,45 @@ export default class ClusterDashboardPagePo extends PagePo {
controllerManagerStatus() {
return cy.get('[data-testid="k8s-service-controller-manager"]');
}

/**
* Confirm that the ns filter is set correctly before navigating to a page that will use it
* 1. nav to cluster dashboard
* 2. check ns filter values
*/
static goToAndConfirmNsValues(cluster: string, {
nsProject,
all
}: {
nsProject?: {
values: string[]
},
all?: {
is: boolean,
}
}) {
const instance = new ClusterDashboardPagePo(cluster);
const nsfilter = new NamespaceFilterPo();

instance.goTo();
instance.waitForPage();
nsfilter.checkVisible();

if (nsProject) {
for (let i = 0; i < nsProject.values.length; i++) {
nsfilter.selectedValues().contains(nsProject.values[i]);
}
} else if (all) {
nsfilter.allSelected();
} else {
throw new Error('Bad Config');
}
}

static goToAndWait(cluster: string) {
const instance = new ClusterDashboardPagePo(cluster);

instance.goTo();
instance.clusterActionsHeader().checkVisible();
}
}
3 changes: 1 addition & 2 deletions cypress/e2e/po/pages/explorer/config-map.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ export class ConfigMapPagePo extends PagePo {
const burgerMenu = new BurgerMenuPo();
const sideNav = new ProductNavPo();

BurgerMenuPo.toggle();
burgerMenu.clusterNotPinnedList().contains(clusterId).click();
burgerMenu.goToCluster(clusterId);
sideNav.navToSideMenuGroupByLabel('Storage');
sideNav.navToSideMenuEntryByLabel('ConfigMaps');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ export class CustomResourceDefinitionsPagePo extends PagePo {
const burgerMenu = new BurgerMenuPo();
const sideNav = new ProductNavPo();

BurgerMenuPo.toggle();
burgerMenu.clusterNotPinnedList().contains(clusterId).click();
burgerMenu.goToCluster(clusterId);
sideNav.navToSideMenuGroupByLabel('More Resources');
sideNav.navToSideMenuGroupByLabel('API');
sideNav.navToSideMenuEntryByLabel('CustomResourceDefinitions');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ export class HorizontalPodAutoscalersPagePo extends PagePo {
const burgerMenu = new BurgerMenuPo();
const sideNav = new ProductNavPo();

BurgerMenuPo.toggle();
burgerMenu.clusterNotPinnedList().contains(clusterId).click();
burgerMenu.goToCluster(clusterId);
sideNav.navToSideMenuGroupByLabel('Service Discovery');
sideNav.navToSideMenuEntryByLabel('HorizontalPodAutoscalers');
}
Expand Down
3 changes: 1 addition & 2 deletions cypress/e2e/po/pages/explorer/ingress.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ export class IngressPagePo extends PagePo {
const burgerMenu = new BurgerMenuPo();
const sideNav = new ProductNavPo();

BurgerMenuPo.toggle();
burgerMenu.clusterNotPinnedList().contains(clusterId).click();
burgerMenu.goToCluster(clusterId);
sideNav.navToSideMenuGroupByLabel('Service Discovery');
sideNav.navToSideMenuEntryByLabel('Ingresses');
}
Expand Down
3 changes: 1 addition & 2 deletions cypress/e2e/po/pages/explorer/network-policy.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ export class NetworkPolicyPagePo extends PagePo {
const burgerMenu = new BurgerMenuPo();
const sideNav = new ProductNavPo();

BurgerMenuPo.toggle();
burgerMenu.clusterNotPinnedList().contains(clusterId).click();
burgerMenu.goToCluster(clusterId);
sideNav.navToSideMenuGroupByLabel('Policy');
sideNav.navToSideMenuEntryByLabel('Network Policies');
}
Expand Down
3 changes: 1 addition & 2 deletions cypress/e2e/po/pages/explorer/persistent-volume-claims.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ export class PersistentVolumeClaimsPagePo extends PagePo {
const burgerMenu = new BurgerMenuPo();
const sideNav = new ProductNavPo();

BurgerMenuPo.toggle();
burgerMenu.clusterNotPinnedList().contains(clusterId).click();
burgerMenu.goToCluster(clusterId);
sideNav.navToSideMenuGroupByLabel('Storage');
sideNav.navToSideMenuEntryByLabel('PersistentVolumeClaims');
}
Expand Down
3 changes: 1 addition & 2 deletions cypress/e2e/po/pages/explorer/persistent-volumes.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ export class PersistentVolumesPagePo extends PagePo {
const burgerMenu = new BurgerMenuPo();
const sideNav = new ProductNavPo();

BurgerMenuPo.toggle();
burgerMenu.clusterNotPinnedList().contains(clusterId).click();
burgerMenu.goToCluster(clusterId);
sideNav.navToSideMenuGroupByLabel('Storage');
sideNav.navToSideMenuEntryByLabel('PersistentVolumes');
}
Expand Down
12 changes: 12 additions & 0 deletions cypress/e2e/po/pages/explorer/service-accounts.po.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import PagePo from '@/cypress/e2e/po/pages/page.po';
import BaseResourceList from '@/cypress/e2e/po/lists/base-resource-list.po';
import BurgerMenuPo from '@/cypress/e2e/po/side-bars/burger-side-menu.po';
import ProductNavPo from '@/cypress/e2e/po/side-bars/product-side-nav.po';

export class ServiceAccountsPagePo extends PagePo {
private static createPath(clusterId: string) {
Expand All @@ -14,6 +16,16 @@ export class ServiceAccountsPagePo extends PagePo {
return super.goTo(ServiceAccountsPagePo.createPath(clusterId));
}

static navTo(clusterId = 'local') {
const burgerMenu = new BurgerMenuPo();
const sideNav = new ProductNavPo();

burgerMenu.goToCluster(clusterId);
sideNav.navToSideMenuGroupByLabel('More Resources');
sideNav.navToSideMenuGroupByLabel('Core');
sideNav.navToSideMenuEntryByLabel('ServiceAccount');
}

constructor(clusterId = 'local') {
super(ServiceAccountsPagePo.createPath(clusterId));
}
Expand Down
5 changes: 2 additions & 3 deletions cypress/e2e/po/pages/explorer/services.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ export class ServicesPagePo extends PagePo {
const burgerMenu = new BurgerMenuPo();
const sideNav = new ProductNavPo();

BurgerMenuPo.toggle();
burgerMenu.clusterNotPinnedList().contains(clusterId).click();
burgerMenu.goToCluster(clusterId);
sideNav.navToSideMenuGroupByLabel('Service Discovery');
sideNav.navToSideMenuEntryByLabel('Ingresses');
sideNav.navToSideMenuEntryByLabel('Service');
}

constructor(clusterId = 'local') {
Expand Down
3 changes: 1 addition & 2 deletions cypress/e2e/po/pages/explorer/storage-classes.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ export class StorageClassesPagePo extends PagePo {
const burgerMenu = new BurgerMenuPo();
const sideNav = new ProductNavPo();

BurgerMenuPo.toggle();
burgerMenu.clusterNotPinnedList().contains(clusterId).click();
burgerMenu.goToCluster(clusterId);
sideNav.navToSideMenuGroupByLabel('Storage');
sideNav.navToSideMenuEntryByLabel('StorageClasses');
}
Expand Down
3 changes: 1 addition & 2 deletions cypress/e2e/po/pages/explorer/workloads-pods.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ export class WorkloadsPodsListPagePo extends PagePo {
const burgerMenu = new BurgerMenuPo();
const sideNav = new ProductNavPo();

BurgerMenuPo.toggle();
burgerMenu.clusterNotPinnedList().contains(clusterId).click();
burgerMenu.goToCluster(clusterId);
sideNav.navToSideMenuGroupByLabel('Workloads');
sideNav.navToSideMenuEntryByLabel('Pods');
}
Expand Down
8 changes: 7 additions & 1 deletion cypress/e2e/po/side-bars/burger-side-menu.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,13 @@ export default class BurgerMenuPo extends ComponentPo {
return this.self().find('.body .cluster.selector.option');
}

goToCluster(clusterId = 'local') {
goToCluster(clusterId = 'local', toggleOpen = true) {
if (toggleOpen) {
BurgerMenuPo.toggle();
}

this.self().find('.cluster-name').contains(clusterId).should('exist');

return this.self().find('.cluster-name').contains(clusterId).click();
}

Expand Down
5 changes: 4 additions & 1 deletion cypress/e2e/tests/navigation/side-nav/main-side-menu.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import PagePo from '@/cypress/e2e/po/pages/page.po';
import ProductNavPo from '@/cypress/e2e/po/side-bars/product-side-nav.po';
import { generateFakeClusterDataAndIntercepts } from '@/cypress/e2e/blueprints/nav/fake-cluster';

const longClusterDescription = 'this-is-some-really-really-really-really-really-really-long-decription';
const longClusterDescription = 'this-is-some-really-really-really-really-really-really-long-description';
const fakeProvClusterId = 'some-fake-cluster-id';
const fakeMgmtClusterId = 'some-fake-mgmt-id';

Expand All @@ -29,6 +29,9 @@ describe('Side Menu: main', () => {
pagePoFake.navToClusterMenuEntry(fakeProvClusterId);
sideNav.navToSideMenuEntryByLabel('Projects/Namespaces');

BurgerMenuPo.burgerMenuGetNavClusterbyLabel('local').should('exist');
BurgerMenuPo.burgerMenuGetNavClusterbyLabel(fakeProvClusterId).should('exist');

// press key combo
cy.get('body').focus().type('{alt}', { release: false });

Expand Down
Loading

0 comments on commit e2a7b65

Please sign in to comment.