Skip to content

Conversation

@srowen
Copy link
Member

@srowen srowen commented Jun 11, 2019

What changes were proposed in this pull request?

We're using an old-ish jQuery, 1.12.4, and should probably update for Spark 3 to keep up in general, but also to keep up with CVEs. In fact, we know of at least one resolved in only 3.4.0+ (https://nvd.nist.gov/vuln/detail/CVE-2019-11358). They may not affect Spark, but, if the update isn't painful, maybe worthwhile in order to make future 3.x updates easier.

jQuery 1 -> 2 doesn't sound like a breaking change, as 2.0 is supposed to maintain compatibility with 1.9+ (https://blog.jquery.com/2013/04/18/jquery-2-0-released/)

2 -> 3 has breaking changes: https://jquery.com/upgrade-guide/3.0/. It's hard to evaluate each one, but the most likely area for problems is in ajax(). However, our usage of jQuery (and plugins) is pretty simple.

Update jquery to 3.4.1; update jquery blockUI and mustache to latest

How was this patch tested?

Manual testing of docs build (except R docs), worker/master UI, spark application UI.
Note: this really doesn't guarantee it works, as our tests can't test javascript, and this is merely anecdotal testing, although I clicked about every link I could find. There's a risk this breaks a minor part of the UI; it does seem to work fine in the main.

@srowen srowen self-assigned this Jun 11, 2019
@srowen srowen changed the title [SPARK-28004][UI] [SPARK-28004][UI] Update jquery to 3.4.1 Jun 11, 2019
@SparkQA
Copy link

SparkQA commented Jun 11, 2019

Test build #106394 has finished for PR 24843 at commit 185cac1.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

return obj != null && typeof obj === 'object' && (propName in obj);
}

/**
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes are all from the source jquery.mustache.js, not custom modifications

Copy link
Member

@dongjoon-hyun dongjoon-hyun Jun 15, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also checked this. This file is identical with mustache.js v3.0.1. Only the trailing spaces are removed in a few lines.

// Scroll now too in case we had opened the page on a hash, but wait a bit because some browsers
// will try to do *their* initial scroll after running the onReady handler.
$(window).load(function() { setTimeout(function() { maybeScrollToHash(); }, 25); });
$(window).on('load', function() { setTimeout(function() { maybeScrollToHash(); }, 25); });
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually the only change I seemed to need to make to the Spark javascript.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. This is the correct update based on the upgrade-guide.

@srowen
Copy link
Member Author

srowen commented Jun 12, 2019

Ah right. The history server. There's a problem there. I'll look into it.

@SparkQA
Copy link

SparkQA commented Jun 12, 2019

Test build #106400 has finished for PR 24843 at commit 8fe52eb.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jun 12, 2019

Test build #106441 has finished for PR 24843 at commit 48d3ca4.

  • This patch fails to build.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jun 12, 2019

Test build #106443 has finished for PR 24843 at commit 3ea4db7.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jun 13, 2019

Test build #106465 has finished for PR 24843 at commit ebe85ba.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@srowen
Copy link
Member Author

srowen commented Jun 13, 2019

Hm, for anyone following along, these tests pass locally. Maybe I'm doing something wrong running locally. Looks like an httpclient version mismatch that I'll have to run down: Cannot locate declared field class : org.apache.http.impl.client.HttpClientBuilder.dnsResolver

@SparkQA
Copy link

SparkQA commented Jun 13, 2019

Test build #106471 has finished for PR 24843 at commit f1e02e4.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.


var historySummary = $("#history-summary");
var searchString = historySummary["context"]["location"]["search"];
var searchString = window.location.search;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also verified that this works in the same way.

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, LGTM. Thank you, @srowen !

This should be tested in the browser's private mode to avoid old javascript cache.
I verified this PR with the followings.

  1. Spark shell application UI
  2. Thrift JDBC/ODBC Server application UI
  3. Spark History Server UI on my several Spark history logs.

All tabs look working correctly. I might miss a few tiny UI features like hover info, but the navigation and the info looks correct in general. I hope we can merge this and proceed.

Merged to master.

@dongjoon-hyun
Copy link
Member

cc @gatorsmile and @gengliangwang

emanuelebardelli pushed a commit to emanuelebardelli/spark that referenced this pull request Jun 15, 2019
## What changes were proposed in this pull request?

We're using an old-ish jQuery, 1.12.4, and should probably update for Spark 3 to keep up in general, but also to keep up with CVEs. In fact, we know of at least one resolved in only 3.4.0+ (https://nvd.nist.gov/vuln/detail/CVE-2019-11358). They may not affect Spark, but, if the update isn't painful, maybe worthwhile in order to make future 3.x updates easier.

jQuery 1 -> 2 doesn't sound like a breaking change, as 2.0 is supposed to maintain compatibility with 1.9+ (https://blog.jquery.com/2013/04/18/jquery-2-0-released/)

2 -> 3 has breaking changes: https://jquery.com/upgrade-guide/3.0/. It's hard to evaluate each one, but the most likely area for problems is in ajax(). However, our usage of jQuery (and plugins) is pretty simple.

Update jquery to 3.4.1; update jquery blockUI and mustache to latest

## How was this patch tested?

Manual testing of docs build (except R docs), worker/master UI, spark application UI.
Note: this really doesn't guarantee it works, as our tests can't test javascript, and this is merely anecdotal testing, although I clicked about every link I could find. There's a risk this breaks a minor part of the UI; it does seem to work fine in the main.

Closes apache#24843 from srowen/SPARK-28004.

Authored-by: Sean Owen <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
implicit val webDriver: WebDriver = new HtmlUnitDriver(true) {
getWebClient.getOptions.setThrowExceptionOnScriptError(false)
}
implicit val webDriver: WebDriver =
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One last clarifying comment: This change slightly improves the test to not ignore javascript errors, and as part of that, needed to test as a modern browser (IE 11 vs IE 8).

@gengliangwang
Copy link
Member

A late LGTM. I also tried grep -r "jquery-1.12.4.min.js" * and there is no matched results.

@srowen srowen deleted the SPARK-28004 branch June 19, 2019 13:55
@gabrieljones
Copy link

any chance this will be back ported to 2.3? 2.3 is currently quarantined at my site because of this.

@srowen
Copy link
Member Author

srowen commented Oct 7, 2019

No, 2.3 is EOL. You should update to 2.4.x

n-marion added a commit to n-marion/spark that referenced this pull request Oct 1, 2020
We're using an old-ish jQuery, 1.12.4, and should probably update for Spark 3 to keep up in general, but also to keep up with CVEs. In fact, we know of at least one resolved in only 3.4.0+ (https://nvd.nist.gov/vuln/detail/CVE-2019-11358). They may not affect Spark, but, if the update isn't painful, maybe worthwhile in order to make future 3.x updates easier.

jQuery 1 -> 2 doesn't sound like a breaking change, as 2.0 is supposed to maintain compatibility with 1.9+ (https://blog.jquery.com/2013/04/18/jquery-2-0-released/)

2 -> 3 has breaking changes: https://jquery.com/upgrade-guide/3.0/. It's hard to evaluate each one, but the most likely area for problems is in ajax(). However, our usage of jQuery (and plugins) is pretty simple.

Update jquery to 3.4.1; update jquery blockUI and mustache to latest

Manual testing of docs build (except R docs), worker/master UI, spark application UI.
Note: this really doesn't guarantee it works, as our tests can't test javascript, and this is merely anecdotal testing, although I clicked about every link I could find. There's a risk this breaks a minor part of the UI; it does seem to work fine in the main.

Closes apache#24843 from srowen/SPARK-28004.

Authored-by: Sean Owen <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants