Skip to content

Commit bf53ceb

Browse files
Merge pull request #863 from PeterYurkovich/breaking-changes
OU-1175: OCP 4.22 Breaking Changes
2 parents 6691c47 + 2f9945f commit bf53ceb

94 files changed

Lines changed: 3532 additions & 2140 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ENV HUSKY=0
88

99
COPY web/package.json web/package-lock.json web/
1010
COPY Makefile Makefile
11-
RUN make install-frontend
11+
RUN make install-frontend-ci
1212

1313
COPY web/ web/
1414
RUN make build-frontend

Dockerfile.dev-mcp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ RUN make update-plugin-name
1616

1717
ENV I18N_NAMESPACE="plugin__monitoring-console-plugin"
1818

19-
RUN make install-frontend
19+
RUN make install-frontend-ci
2020
RUN make build-frontend
2121

2222
FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_9_golang_1.24 as go-builder

Dockerfile.konflux

Lines changed: 0 additions & 57 deletions
This file was deleted.

devspace.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ dev:
3636
# Use the instance selector that CMO & helm add
3737
app.kubernetes.io/component: monitoring-plugin
3838
# Replace the container image with this dev-optimized image (allows to skip image building during development)
39-
devImage: quay.io/rh-ee-pyurkovi/monitoring-plugin:devspace-2
39+
devImage: quay.io/rh-ee-pyurkovi/monitoring-plugin:v4.19-devspace
4040
# Sync files between the local filesystem and the development container
4141
sync:
4242
- path: ./web/dist:/opt/app-root/web/dist

web/cypress/support/commands/auth-commands.ts

Lines changed: 66 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -175,51 +175,47 @@ function performLogin(
175175
): void {
176176
cy.visit(Cypress.config('baseUrl'));
177177
cy.log('Session - after visiting');
178-
cy.window().then(
179-
(
180-
win: any, // eslint-disable-line @typescript-eslint/no-explicit-any
181-
) => {
182-
// Check if auth is disabled (for a local development environment)
183-
if (win.SERVER_FLAGS?.authDisabled) {
184-
cy.task('log', ' skipping login, console is running with auth disabled');
185-
return;
186-
}
187-
cy.exec(
188-
`oc get node --selector=hypershift.openshift.io/managed --kubeconfig ${Cypress.env(
189-
'KUBECONFIG_PATH',
190-
)}`,
191-
).then((result) => {
192-
cy.log(result.stdout);
193-
cy.task('log', result.stdout);
194-
if (result.stdout.includes('Ready')) {
195-
cy.log(`Attempting login via cy.origin to: ${oauthurl}`);
196-
cy.task('log', `Attempting login via cy.origin to: ${oauthurl}`);
197-
cy.origin(oauthurl, { args: { username, password } }, ({ username, password }) => {
178+
cy.window().then((win: any) => {
179+
// Check if auth is disabled (for a local development environment)
180+
if (win.SERVER_FLAGS?.authDisabled) {
181+
cy.task('log', ' skipping login, console is running with auth disabled');
182+
return;
183+
}
184+
cy.exec(
185+
`oc get node --selector=hypershift.openshift.io/managed --kubeconfig ${Cypress.env(
186+
'KUBECONFIG_PATH',
187+
)}`,
188+
).then((result) => {
189+
cy.log(result.stdout);
190+
cy.task('log', result.stdout);
191+
if (result.stdout.includes('Ready')) {
192+
cy.log(`Attempting login via cy.origin to: ${oauthurl}`);
193+
cy.task('log', `Attempting login via cy.origin to: ${oauthurl}`);
194+
cy.origin(oauthurl, { args: { username, password } }, ({ username, password }) => {
195+
cy.get('#inputUsername').type(username);
196+
cy.get('#inputPassword').type(password);
197+
cy.get('button[type=submit]').click();
198+
});
199+
} else {
200+
cy.task('log', ` Logging in as ${username} using fallback on ${oauthurl}`);
201+
cy.origin(
202+
oauthurl,
203+
{ args: { provider, username, password } },
204+
({ provider, username, password }) => {
205+
cy.get('[data-test-id="login"]').should('be.visible');
206+
cy.get('body').then(($body) => {
207+
if ($body.text().includes(provider)) {
208+
cy.contains(provider).should('be.visible').click();
209+
}
210+
});
198211
cy.get('#inputUsername').type(username);
199212
cy.get('#inputPassword').type(password);
200213
cy.get('button[type=submit]').click();
201-
});
202-
} else {
203-
cy.task('log', ` Logging in as ${username} using fallback on ${oauthurl}`);
204-
cy.origin(
205-
oauthurl,
206-
{ args: { provider, username, password } },
207-
({ provider, username, password }) => {
208-
cy.get('[data-test-id="login"]').should('be.visible');
209-
cy.get('body').then(($body) => {
210-
if ($body.text().includes(provider)) {
211-
cy.contains(provider).should('be.visible').click();
212-
}
213-
});
214-
cy.get('#inputUsername').type(username);
215-
cy.get('#inputPassword').type(password);
216-
cy.get('button[type=submit]').click();
217-
},
218-
);
219-
}
220-
});
221-
},
222-
);
214+
},
215+
);
216+
}
217+
});
218+
});
223219
}
224220

225221
Cypress.Commands.add('validateLogin', () => {
@@ -283,29 +279,25 @@ Cypress.Commands.add('uiLogin', (provider: string, username: string, password: s
283279
cy.log('Commands uiLogin');
284280
cy.clearCookie('openshift-session-token');
285281
cy.visit('/');
286-
cy.window().then(
287-
(
288-
win: any, // eslint-disable-line @typescript-eslint/no-explicit-any
289-
) => {
290-
if (win.SERVER_FLAGS?.authDisabled) {
291-
cy.task('log', 'Skipping login, console is running with auth disabled');
292-
return;
282+
cy.window().then((win: any) => {
283+
if (win.SERVER_FLAGS?.authDisabled) {
284+
cy.task('log', 'Skipping login, console is running with auth disabled');
285+
return;
286+
}
287+
cy.get('h1').should('have.text', 'Login');
288+
cy.get('body').then(($body) => {
289+
if ($body.text().includes(provider)) {
290+
cy.contains(provider).should('be.visible').click();
291+
} else if ($body.find('li.idp').length > 0) {
292+
//Using the last idp if doesn't provider idp name
293+
cy.get('li.idp').last().click();
293294
}
294-
cy.get('h1').should('have.text', 'Login');
295-
cy.get('body').then(($body) => {
296-
if ($body.text().includes(provider)) {
297-
cy.contains(provider).should('be.visible').click();
298-
} else if ($body.find('li.idp').length > 0) {
299-
//Using the last idp if doesn't provider idp name
300-
cy.get('li.idp').last().click();
301-
}
302-
});
303-
cy.get('#inputUsername').type(username);
304-
cy.get('#inputPassword').type(password);
305-
cy.get('button[type=submit]').click();
306-
cy.byTestID('username', { timeout: 120000 }).should('be.visible');
307-
},
308-
);
295+
});
296+
cy.get('#inputUsername').type(username);
297+
cy.get('#inputPassword').type(password);
298+
cy.get('button[type=submit]').click();
299+
cy.byTestID('username', { timeout: 120000 }).should('be.visible');
300+
});
309301
cy.switchPerspective('Administrator');
310302
});
311303

@@ -362,20 +354,16 @@ Cypress.Commands.add('relogin', (provider: string, username: string, password: s
362354
});
363355

364356
Cypress.Commands.add('uiLogout', () => {
365-
cy.window().then(
366-
(
367-
win: any, // eslint-disable-line @typescript-eslint/no-explicit-any
368-
) => {
369-
if (win.SERVER_FLAGS?.authDisabled) {
370-
cy.log('Skipping logout, console is running with auth disabled');
371-
return;
372-
}
373-
cy.log('Log out UI');
374-
cy.byTestID('username').click();
375-
cy.wait(3000);
376-
cy.byTestID('log-out').click({ force: true });
377-
},
378-
);
357+
cy.window().then((win: any) => {
358+
if (win.SERVER_FLAGS?.authDisabled) {
359+
cy.log('Skipping logout, console is running with auth disabled');
360+
return;
361+
}
362+
cy.log('Log out UI');
363+
cy.byTestID('username').click();
364+
cy.wait(3000);
365+
cy.byTestID('log-out').click({ force: true });
366+
});
379367
});
380368

381369
Cypress.Commands.add('cliLogin', (username?, password?, hostapi?) => {

web/cypress/support/commands/operator-commands.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable @typescript-eslint/no-use-before-define */
21
import 'cypress-wait-until';
32
import { operatorAuthUtils } from './auth-commands';
43
import { cooInstallUtils } from './coo-install-commands';

web/cypress/support/commands/perses-commands.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ declare global {
4343
Cypress.Commands.add('setupPersesRBACandExtraDashboards', () => {
4444
if (
4545
`${Cypress.env('LOGIN_USERNAME1')}` !== 'kubeadmin' &&
46-
`${Cypress.env('LOGIN_USERNAME2')}` !== undefined
46+
Cypress.env('LOGIN_USERNAME2') !== undefined
4747
) {
4848
cy.exec('./cypress/fixtures/coo/coo140_perses/rbac/rbac_perses_e2e_ci_users.sh', {
4949
env: {

web/cypress/support/commands/virtualization-commands.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable @typescript-eslint/no-use-before-define */
21
import 'cypress-wait-until';
32
import { operatorHubPage } from '../../views/operator-hub-page';
43
import { nav } from '../../views/nav';

web/cypress/support/selectors.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable @typescript-eslint/no-use-before-define */
21
import Loggable = Cypress.Loggable;
32
import Timeoutable = Cypress.Timeoutable;
43
import Withinable = Cypress.Withinable;

web/eslint.config.ts

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
import { defineConfig } from 'eslint/config';
2+
import { fixupConfigRules, fixupPluginRules } from '@eslint/compat';
3+
import prettier from 'eslint-plugin-prettier';
4+
import react from 'eslint-plugin-react';
5+
import typescriptEslint from '@typescript-eslint/eslint-plugin';
6+
import globals from 'globals';
7+
import tsParser from '@typescript-eslint/parser';
8+
import path from 'node:path';
9+
import { fileURLToPath } from 'node:url';
10+
import js from '@eslint/js';
11+
import { FlatCompat } from '@eslint/eslintrc';
12+
13+
const __filename = fileURLToPath(import.meta.url);
14+
const __dirname = path.dirname(__filename);
15+
const compat = new FlatCompat({
16+
baseDirectory: __dirname,
17+
recommendedConfig: js.configs.recommended,
18+
allConfig: js.configs.all,
19+
});
20+
21+
export default defineConfig([
22+
{
23+
extends: fixupConfigRules(
24+
compat.extends(
25+
'eslint:recommended',
26+
'plugin:react/recommended',
27+
'plugin:react-hooks/recommended',
28+
'plugin:@typescript-eslint/recommended',
29+
'plugin:react/jsx-runtime',
30+
'prettier',
31+
),
32+
),
33+
34+
plugins: {
35+
prettier,
36+
react: fixupPluginRules(react as any),
37+
'@typescript-eslint': fixupPluginRules(typescriptEslint as any),
38+
},
39+
40+
languageOptions: {
41+
globals: {
42+
...globals.browser,
43+
},
44+
45+
parser: tsParser,
46+
ecmaVersion: 2021,
47+
sourceType: 'module',
48+
49+
parserOptions: {
50+
ecmaFeatures: {
51+
jsx: true,
52+
},
53+
},
54+
},
55+
56+
settings: {
57+
react: {
58+
version: 'detect',
59+
},
60+
},
61+
62+
rules: {
63+
'prettier/prettier': ['error'],
64+
65+
'max-len': [
66+
'error',
67+
{
68+
code: 100,
69+
ignoreStrings: true,
70+
ignoreUrls: true,
71+
},
72+
],
73+
74+
'no-console': ['error'],
75+
'react/display-name': 'off',
76+
'react/prop-types': 'off',
77+
'react-hooks/set-state-in-effect': 'off',
78+
'react-hooks/set-state-in-render': 'off',
79+
'react-hooks/incompatible-library': 'off',
80+
'@typescript-eslint/no-explicit-any': 'off',
81+
},
82+
},
83+
]);

0 commit comments

Comments
 (0)