{"push_id":1103788941,"size":1,"distinct_size":1,"ref":"refs/heads/master","head":"3323d0f931ddd11f41abca11425b5e43a6538667","before":"c3350cadb8369ad016f89135bbcbe126705c463c","commits":[{"sha":"3323d0f931ddd11f41abca11425b5e43a6538667","author":{"email":"e5dd8a3899598b2e85930c5ff06b11c053ef654f@databricks.com","name":"Josh Rosen"},"message":"[SPARK-15209] Fix display of job descriptions with single quotes in web UI timeline\n\n## What changes were proposed in this pull request?\n\nThis patch fixes an escaping bug in the Web UI's event timeline that caused Javascript errors when displaying timeline entries whose descriptions include single quotes.\n\nThe original bug can be reproduced by running\n\n```scala\nsc.setJobDescription(\"double quote: \\\" \")\nsc.parallelize(1 to 10).count()\n\nsc.setJobDescription(\"single quote: ' \")\nsc.parallelize(1 to 10).count()\n```\n\nand then browsing to the driver UI. Previously, this resulted in an \"Uncaught SyntaxError\" because the single quote from the description was not escaped and ended up closing a Javascript string literal too early.\n\nThe fix implemented here is to change the relevant Javascript to define its string literals using double-quotes. Our escaping logic already properly escapes double quotes in the description, so this is safe to do.\n\n## How was this patch tested?\n\nTested manually in `spark-shell` using the following cases:\n\n```scala\nsc.setJobDescription(\"double quote: \\\" \")\nsc.parallelize(1 to 10).count()\n\nsc.setJobDescription(\"single quote: ' \")\nsc.parallelize(1 to 10).count()\n\nsc.setJobDescription(\"ampersand: &\")\nsc.parallelize(1 to 10).count()\n\nsc.setJobDescription(\"newline: \\n text after newline \")\nsc.parallelize(1 to 10).count()\n\nsc.setJobDescription(\"carriage return: \\r text after return \")\nsc.parallelize(1 to 10).count()\n```\n\n/cc sarutak for review.\n\nAuthor: Josh Rosen <joshrosen@databricks.com>\n\nCloses #12995 from JoshRosen/SPARK-15209.","distinct":true,"url":"https://api.github.com/repos/apache/spark/commits/3323d0f931ddd11f41abca11425b5e43a6538667"}]}