Skip to content

Commit a63741b

Browse files
Merge pull request #339 from vikram-raj/fix-CVEs
SRVKP-6587,SRVKP-6246,SRVKP-6280,SRVKP-6382,SRVKP-6649,SRVKP-4558: Fix CVEs
2 parents 98d0971 + c175378 commit a63741b

22 files changed

+4183
-6393
lines changed

integration-tests/cypress/support/commands/app.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ Cypress.Commands.add('checkErrors', () => {
153153

154154
Cypress.Commands.add(
155155
'waitUntilEnabled',
156-
(selector: string, timeout: number = 20000): any => {
156+
(selector: string, timeout = 20000): any => {
157157
const start = new Date().getTime();
158158

159159
return cy.get(selector).then(($el) => {

integration-tests/cypress/support/pages/app.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export const app = {
4949
cy.request(
5050
'/api/kubernetes/apis/project.openshift.io/v1/projects?limit=250',
5151
).then((resp) => {
52-
expect(resp.status).toEqual(200);
52+
expect(resp.status).to.equal(200);
5353
});
5454
app.waitForLoad();
5555
},

integration-tests/cypress/support/pages/functions/createGitWorkload.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ export const createGitWorkload = (
4343
};
4444

4545
export const createGitWorkloadIfNotExistsOnTopologyPage = (
46-
gitUrl: string = 'https://github.com/sclorg/nodejs-ex.git',
47-
componentName: string = 'nodejs-ex-git',
48-
resourceType: string = 'Deployment',
46+
gitUrl = 'https://github.com/sclorg/nodejs-ex.git',
47+
componentName = 'nodejs-ex-git',
48+
resourceType = 'Deployment',
4949
appName?: string,
50-
isPipelineSelected: boolean = false,
51-
isServerlessFunction: boolean = false,
50+
isPipelineSelected = false,
51+
isServerlessFunction = false,
5252
) => {
5353
navigateTo(devNavigationMenu.Topology);
5454
topologyPage.waitForLoad();

integration-tests/cypress/support/pages/functions/installOperatorOnCluster.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ const performPostInstallationSteps = (operator: operators): void => {
194194
cy.request(
195195
'api/kubernetes/apis/operators.coreos.com/v1alpha1/namespaces/openshift-operators/subscriptions/openshift-pipelines-operator-rh',
196196
).then((resp) => {
197-
expect(resp.status).toEqual(200);
197+
expect(resp.status).to.equal(200);
198198
});
199199
waitForCRDs(operators.PipelinesOperator);
200200
waitForDynamicPlugin();

integration-tests/cypress/support/pages/pipelines/pipelineRun-details-page.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ export const pipelineRunDetailsPage = {
4040
`Pipeline Run status is failed, the logs are as follows: ${logSnippet.text()}`,
4141
);
4242
});
43-
expect(actualStatus.text()).toMatch(status);
43+
expect(actualStatus.text()).match(status);
4444
} else {
45-
expect(actualStatus.text()).toMatch(status);
45+
expect(actualStatus.text()).match(status);
4646
}
4747
},
4848
);

integration-tests/cypress/support/pages/pipelines/pipelines-page.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ export const pipelinesPage = {
289289
'Last run status',
290290
'Last run time',
291291
'',
292-
]).toContain($el.text());
292+
]).contains($el.text());
293293
});
294294
},
295295

@@ -305,7 +305,7 @@ export const pipelinesPage = {
305305
cy.get('[title="Pipeline"]')
306306
.next('a')
307307
.then(($el) => {
308-
expect($el.text()).toMatch(pipelineName);
308+
expect($el.text()).match(pipelineName);
309309
});
310310
// wait for the table to render after search
311311
// cy.get('tbody tr')
@@ -319,7 +319,7 @@ export const pipelinesPage = {
319319
cy.get('[title="Namespace"]')
320320
.next('a')
321321
.then(($el) => {
322-
expect($el.text()).toMatch(namespace);
322+
expect($el.text()).match(namespace);
323323
});
324324
},
325325

integration-tests/cypress/support/pages/pipelines/repositories-page.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export const repositoriesPage = {
1717
'Last run time',
1818
'Last run duration',
1919
'',
20-
]).toContain($el.text());
20+
]).contains($el.text());
2121
});
2222
},
2323

@@ -27,7 +27,7 @@ export const repositoriesPage = {
2727
cy.get('[title="Repository"]')
2828
.next('a')
2929
.then(($el) => {
30-
expect($el.text()).toMatch(repoName);
30+
expect($el.text()).match(repoName);
3131
});
3232
},
3333
};

integration-tests/cypress/support/step-definitions/pipelines/pipelines-runs.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ Then(
9090
'user is able to see the filtered results with pipelineRuns status {string}',
9191
(PipelineStatus: string) => {
9292
cy.get(pipelineRunsPO.pipelineRunsTable.status).each(($el) => {
93-
expect($el.text()).toContain(PipelineStatus);
93+
expect($el.text()).contains(PipelineStatus);
9494
});
9595
},
9696
);
@@ -257,7 +257,7 @@ Then('pipeline run is deleted from pipeline runs page', () => {
257257
.find('tr')
258258
.then(($ele) => {
259259
numOfPipelineRunsAfterDeletion = $ele.length;
260-
expect(numOfPipelineRunsAfterDeletion).toBeLessThan(
260+
expect(numOfPipelineRunsAfterDeletion).to.lessThan(
261261
numOfPipelineRunsBeforeDeletion,
262262
);
263263
});
@@ -611,7 +611,7 @@ Then(
611611
'VolumeClaimTemplate',
612612
];
613613
cy.byLegacyTestID('dropdown-menu').each(($el) => {
614-
expect(options).toContain($el.text());
614+
expect(options).contains($el.text());
615615
});
616616
modal.cancel();
617617
modal.shouldBeClosed();

jest.config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ const config: Config.InitialOptions = {
178178

179179
// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
180180
transformIgnorePatterns: [
181-
'<rootDir>/node_modules/(?!(@patternfly(-\\S+)?|d3(-\\S+)?|delaunator|robust-predicates|internmap|lodash-es|@openshift-console|@novnc|@spice-project|@popperjs|i18next(-\\S+)?|@babel/runtime)/.*)',
181+
'<rootDir>/node_modules/(?!(@patternfly(-\\S+)?|d3(-\\S+)?|delaunator|robust-predicates|internmap|cheerio|lodash-es|@openshift-console|@novnc|@spice-project|@popperjs|i18next(-\\S+)?|@babel/runtime)/.*)',
182182
],
183183

184184
// An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them

package.json

+10-12
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"@testing-library/react": "^12.1.2",
5252
"@types/cypress-axe": "^0.8.0",
5353
"@types/enzyme": "3.10.x",
54-
"@types/jest": "^29.5.12",
54+
"@types/jest": "^29.5.14",
5555
"@types/lodash-es": "4.17.x",
5656
"@types/node": "^18.0.0",
5757
"@types/react": "^17.0.37",
@@ -67,12 +67,11 @@
6767
"babel-loader": "^8.2.1",
6868
"babel-plugin-transform-imports": "1.5.1",
6969
"cache-loader": "^4.1.0",
70-
"copy-webpack-plugin": "^6.4.1",
70+
"copy-webpack-plugin": "^13.0.0",
7171
"css-loader": "^6.7.1",
7272
"cypress": "^13.10.0",
7373
"cypress-axe": "^0.12.0",
7474
"cypress-file-upload": "^5.0.8",
75-
"cypress-jest-adapter": "^0.1.1",
7675
"cypress-multi-reporters": "^1.6.2",
7776
"enzyme": "3.10.x",
7877
"eslint": "^8.10.0",
@@ -85,7 +84,7 @@
8584
"formik": "2.0.3",
8685
"fuzzysearch": "1.0.x",
8786
"i18next-parser": "^3.11.0",
88-
"jest": "^29.7.0",
87+
"jest": "30.0.0-alpha.7",
8988
"jest-canvas-mock": "^2.5.2",
9089
"jest-environment-jsdom": "^29.7.0",
9190
"jest-junit": "^16.0.0",
@@ -98,7 +97,6 @@
9897
"pluralize": "^8.0.0",
9998
"popper.js": "^1.16.1",
10099
"prettier": "^2.7.1",
101-
"prettier-stylelint": "^0.4.2",
102100
"react": "^17.0.1",
103101
"react-copy-to-clipboard": "5.x",
104102
"react-dnd": "^9.4.0",
@@ -114,20 +112,20 @@
114112
"react-router-dom-v5-compat": "^6.11.2",
115113
"react-transition-group": "2.3.x",
116114
"react-virtualized": "9.x",
117-
"resolve-url-loader": "2.x",
115+
"resolve-url-loader": "5.0.0",
118116
"sass": "^1.42.1",
119117
"sass-loader": "^10.1.1",
120118
"style-loader": "^3.3.1",
121-
"stylelint": "^15.3.0",
119+
"stylelint": "16.12.0",
122120
"stylelint-config-standard": "^31.0.0",
123121
"thread-loader": "^3.0.4",
124-
"ts-jest": "^29.1.5",
122+
"ts-jest": "^29.3.1",
125123
"ts-loader": "^9.3.1",
126124
"ts-node": "^10.9.1",
127125
"typescript": "^4.7.4",
128126
"webpack-cli": "^5.1.4",
129-
"webpack-dev-server": "^5.0.4",
130-
"yup": "^0.27.0"
127+
"webpack-dev-server": "^5.2.0",
128+
"yup": "1.6.1"
131129
},
132130
"consolePlugin": {
133131
"name": "pipelines-console-plugin",
@@ -165,10 +163,10 @@
165163
"@types/express": "^4.17.18",
166164
"@types/js-yaml": "^3.10.0",
167165
"classnames": "^2.3.2",
168-
"crypto-browserify": "^3.12.0",
169166
"gherkin-lint": "^4.1.3",
170-
"i18next-conv": "^15.0.0",
167+
"i18next-conv": "^15.1.1",
171168
"lodash-es": "^4.17.21",
169+
"micromatch": "4.0.8",
172170
"path-browserify": "^1.0.1",
173171
"stream-browserify": "^3.0.0"
174172
},

src/components/logs/Logs.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ const Logs: React.FC<LogsProps> = ({
111111
onError: () => void,
112112
retryCount = 0,
113113
) => {
114-
let ws = new WSFactory(watchURL, wsOpts);
114+
const ws = new WSFactory(watchURL, wsOpts);
115115
const handleError = () => {
116116
if (retryCount < 5) {
117117
setTimeout(() => {

src/components/pipeline-builder/CodeEditorSidebar.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const CodeEditorSidebar: React.FC<CodeEditorSidebarProps> = ({
3131
const editor = editorRef.current?.editor;
3232

3333
const insertYamlContent = React.useCallback(
34-
(id: string = 'default', yamlContent: string = '', kind) => {
34+
(id = 'default', yamlContent = '', kind) => {
3535
const yaml = sanitizeYamlContent
3636
? sanitizeYamlContent(id, yamlContent, kind)
3737
: yamlContent;
@@ -73,7 +73,7 @@ const CodeEditorSidebar: React.FC<CodeEditorSidebarProps> = ({
7373
);
7474

7575
const replaceYamlContent = React.useCallback(
76-
(id: string = 'default', yamlContent: string = '', kind: string) => {
76+
(id = 'default', yamlContent = '', kind: string) => {
7777
const yaml = sanitizeYamlContent
7878
? sanitizeYamlContent(id, yamlContent, kind)
7979
: yamlContent;
@@ -83,7 +83,7 @@ const CodeEditorSidebar: React.FC<CodeEditorSidebarProps> = ({
8383
);
8484

8585
const downloadYamlContent = React.useCallback(
86-
(id: string = 'default', yamlContent: string = '', kind: string) => {
86+
(id = 'default', yamlContent = '', kind: string) => {
8787
try {
8888
const yaml = sanitizeYamlContent
8989
? sanitizeYamlContent(id, yamlContent, kind)

0 commit comments

Comments
 (0)