Skip to content

Commit da2eeca

Browse files
build(deps): bump js-yaml from 4.2.0 to 5.2.0 in /storm-webapp (#8855)
* build(deps): bump js-yaml from 4.2.0 to 5.2.0 in /storm-webapp Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 4.2.0 to 5.2.0. - [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md) - [Commits](nodeca/js-yaml@4.2.0...5.2.0) --- updated-dependencies: - dependency-name: js-yaml dependency-version: 5.2.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): bump netty-tcnative.version (#8821) Bumps `netty-tcnative.version` from 2.0.77.Final to 2.0.80.Final. Updates `io.netty:netty-tcnative` from 2.0.77.Final to 2.0.80.Final - [Release notes](https://github.com/netty/netty-tcnative/releases) - [Commits](netty/netty-tcnative@netty-tcnative-parent-2.0.77.Final...netty-tcnative-parent-2.0.80.Final) Updates `io.netty:netty-tcnative-boringssl-static` from 2.0.77.Final to 2.0.80.Final - [Release notes](https://github.com/netty/netty-tcnative/releases) - [Commits](netty/netty-tcnative@netty-tcnative-parent-2.0.77.Final...netty-tcnative-parent-2.0.80.Final) --- updated-dependencies: - dependency-name: io.netty:netty-tcnative dependency-version: 2.0.80.Final dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.netty:netty-tcnative-boringssl-static dependency-version: 2.0.80.Final dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix(webapp): guard Flux viewer against js-yaml 5.x empty-input throw js-yaml 5.x changed load('') to throw a YAMLException ('expected a document, but the input is empty') instead of returning undefined (see js-yaml migrate_v4_to_v5). The Flux Topology Viewer calls parseAndRender() on page load while the textarea holds only a comment (# YAML Definition), so jsyaml.load() now throws before the existing if(doc==null) guard, surfacing as an uncaught exception that fails the cypress-e2e suite (flux-page.cy.js). Wrap the load in try/catch and treat empty/comment-only or malformed input as 'no document'. Also broaden cypress-tests.yml to run on 2.x so this class of webapp regression is exercised there too (2.x already shipped js-yaml 5.2.0 and carries the same latent bug). --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Richard Zowalla <rzo1@apache.org>
1 parent 73da988 commit da2eeca

4 files changed

Lines changed: 16 additions & 9 deletions

File tree

.github/workflows/cypress-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ name: Cypress E2E Tests
1717

1818
on:
1919
push:
20-
branches: [ "master" ]
20+
branches: [ "master", "2.x" ]
2121
paths:
2222
- 'storm-webapp/**'
2323
pull_request:
24-
branches: [ "master" ]
24+
branches: [ "master", "2.x" ]
2525
paths:
2626
- 'storm-webapp/**'
2727
workflow_dispatch:

storm-webapp/package-lock.json

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

storm-webapp/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"jquery": "4.0.0",
2525
"jquery-blockui": "2.7.0",
2626
"js-cookie": "3.0.8",
27-
"js-yaml": "4.2.0",
27+
"js-yaml": "5.2.0",
2828
"moment": "2.30.1",
2929
"mustache": "4.2.0",
3030
"typeahead.js": "0.11.1",

storm-webapp/src/main/java/org/apache/storm/daemon/ui/WEB-INF/flux.html

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,14 @@
7070

7171
function parseAndRender() {
7272
var input = document.getElementById('taInput').value;
73-
var doc = jsyaml.load(input);
73+
var doc;
74+
try {
75+
doc = jsyaml.load(input);
76+
} catch (e) {
77+
// js-yaml >=5 throws on empty/comment-only input instead of
78+
// returning undefined (see migrate_v4_to_v5); treat as no document.
79+
return;
80+
}
7481
if(doc==null){
7582
return;
7683
}

0 commit comments

Comments
 (0)