rzo1 opened a new pull request, #8889:
URL: https://github.com/apache/storm/pull/8889

   Fixes the `cypress-e2e` failure seen on #8855 (js-yaml 4.2.0 → 5.2.0).
   
   ### Root cause
   js-yaml 5.x changed `load('')` to **throw** `YAMLException: expected a 
document, but the input is empty` instead of returning `undefined` (see the 
[v4→v5 migration 
guide](https://github.com/nodeca/js-yaml/blob/master/docs/migrate_v4_to_v5.md)).
 A comment-only string counts as empty.
   
   The Flux Topology Viewer (`flux.html`) calls `parseAndRender()` on page load 
while the textarea contains only `# YAML Definition`, so `jsyaml.load(input)` 
now throws **before** the existing `if (doc == null) return;` guard. That 
surfaces as an uncaught application exception, which Cypress turns into a 
failed test (`flux-page.cy.js`), failing the whole suite.
   
   ### Fix
   - Wrap the `jsyaml.load()` call in `try/catch` and treat empty/comment-only 
(or malformed) input as "no document" — restoring the pre-5.x behavior and also 
hardening against bad user YAML.
   - Broaden `cypress-tests.yml` to also trigger on `2.x`.
   
   ### Note on 2.x
   2.x **already merged** js-yaml 5.2.0 (#8863) and carries the identical 
latent bug — its `cypress-e2e` never ran because the workflow was scoped to 
`master` only. A companion PR applies the same `flux.html` fix to 2.x.
   
   Once this lands, #8855 can be rebased to pick up the fix and go green.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to