From 3e4f71d8730191f901f9d69a938252227e374854 Mon Sep 17 00:00:00 2001 From: Raul Ochoa Date: Wed, 11 May 2016 18:24:47 +0200 Subject: [PATCH 1/5] Nicer error message when missing sql from layer options Fixes #446 --- NEWS.md | 3 ++ lib/cartodb/api/overviews_metadata_api.js | 2 +- test/acceptance/regressions.js | 40 +++++++++++++++++++++++ 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 test/acceptance/regressions.js diff --git a/NEWS.md b/NEWS.md index c1405f11..95bd17f4 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,6 +4,9 @@ Released 2016-mm-dd +Bug fixes: + - Nicer error message when missing sql from layer options #446 + ## 2.41.0 diff --git a/lib/cartodb/api/overviews_metadata_api.js b/lib/cartodb/api/overviews_metadata_api.js index af3a1294..2cec6bbb 100644 --- a/lib/cartodb/api/overviews_metadata_api.js +++ b/lib/cartodb/api/overviews_metadata_api.js @@ -13,7 +13,7 @@ var affectedTableRegexCache = { }; function prepareSql(sql) { - return sql + return sql && sql .replace(affectedTableRegexCache.bbox, 'ST_MakeEnvelope(0,0,0,0)') .replace(affectedTableRegexCache.scale_denominator, '0') .replace(affectedTableRegexCache.pixel_width, '1') diff --git a/test/acceptance/regressions.js b/test/acceptance/regressions.js new file mode 100644 index 00000000..43dad070 --- /dev/null +++ b/test/acceptance/regressions.js @@ -0,0 +1,40 @@ +require('../support/test_helper'); + +var assert = require('../support/assert'); +var TestClient = require('../support/test-client'); + +describe('regressions', function() { + + var ERROR_RESPONSE = { + status: 400, + headers: { + 'Content-Type': 'application/json; charset=utf-8' + } + }; + + it('should expose a nice error when missing sql option', function(done) { + var mapConfig = { + version: '1.5.0', + layers: [ + { + "type": "cartodb", + "options": { + "cartocss": '#polygons { polygon-fill: red; }', + "cartocss_version": "2.3.0" + } + } + ] + }; + + var testClient = new TestClient(mapConfig, 1234); + + testClient.getLayergroup(ERROR_RESPONSE, function(err, layergroupResult) { + assert.ok(!err, err); + + assert.equal(layergroupResult.errors.length, 1); + assert.equal(layergroupResult.errors[0], 'Missing sql for layer 0 options'); + + testClient.drain(done); + }); + }); +}); From 2482accb4265002252d6448b8a658b588d3c5154 Mon Sep 17 00:00:00 2001 From: Raul Ochoa Date: Wed, 11 May 2016 18:39:07 +0200 Subject: [PATCH 2/5] Upgrades camshaft to 0.8.0 --- NEWS.md | 3 +++ npm-shrinkwrap.json | 16 ++++++++-------- package.json | 2 +- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/NEWS.md b/NEWS.md index 95bd17f4..121fc14c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,6 +4,9 @@ Released 2016-mm-dd +Announcements: + - Upgrades camshaft to [0.8.0](https://github.com/CartoDB/camshaft/releases/tag/0.8.0) + Bug fixes: - Nicer error message when missing sql from layer options #446 diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 3199cd06..24661490 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -90,7 +90,7 @@ }, "mime-types": { "version": "2.1.11", - "from": "mime-types@>=2.1.10 <2.2.0", + "from": "mime-types@>=2.1.2 <2.2.0", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.11.tgz", "dependencies": { "mime-db": { @@ -105,13 +105,13 @@ } }, "camshaft": { - "version": "0.7.0", - "from": "camshaft@0.7.0", - "resolved": "https://registry.npmjs.org/camshaft/-/camshaft-0.7.0.tgz", + "version": "0.8.0", + "from": "camshaft@0.8.0", + "resolved": "https://registry.npmjs.org/camshaft/-/camshaft-0.8.0.tgz", "dependencies": { "async": { "version": "1.5.2", - "from": "async@>=1.0.0 <2.0.0", + "from": "async@>=1.5.2 <2.0.0", "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz" }, "request": { @@ -763,7 +763,7 @@ }, "type-is": { "version": "1.6.12", - "from": "type-is@>=1.6.10 <1.7.0", + "from": "type-is@>=1.6.6 <1.7.0", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.12.tgz", "dependencies": { "media-typer": { @@ -927,7 +927,7 @@ }, "inherits": { "version": "2.0.1", - "from": "inherits@>=2.0.1 <2.1.0", + "from": "inherits@>=2.0.0 <3.0.0", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz" }, "isarray": { @@ -976,7 +976,7 @@ "dependencies": { "async": { "version": "1.5.2", - "from": "async@>=1.0.0 <2.0.0", + "from": "async@>=1.5.2 <2.0.0", "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz" } } diff --git a/package.json b/package.json index b67aae84..6b1c28ee 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ ], "dependencies": { "body-parser": "~1.14.0", - "camshaft": "0.7.0", + "camshaft": "0.8.0", "cartodb-psql": "~0.6.1", "cartodb-query-tables": "~0.1.0", "cartodb-redis": "~0.13.0", From c5afc0dc94e0a72de0cc9b258c0a1d9a5c3d2d05 Mon Sep 17 00:00:00 2001 From: Raul Ochoa Date: Wed, 11 May 2016 18:51:05 +0200 Subject: [PATCH 3/5] Release 2.41.1 --- NEWS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 121fc14c..5bdb567f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,7 +2,7 @@ ## 2.41.1 -Released 2016-mm-dd +Released 2016-05-11 Announcements: - Upgrades camshaft to [0.8.0](https://github.com/CartoDB/camshaft/releases/tag/0.8.0) From e0ade855654a17c36a044efdfde85438209469fb Mon Sep 17 00:00:00 2001 From: Raul Ochoa Date: Wed, 11 May 2016 18:53:17 +0200 Subject: [PATCH 4/5] Stubs next version --- NEWS.md | 5 +++++ npm-shrinkwrap.json | 2 +- package.json | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/NEWS.md b/NEWS.md index 5bdb567f..5d68fc9a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,10 @@ # Changelog +## 2.41.2 + +Released 2016-mm-dd + + ## 2.41.1 Released 2016-05-11 diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 24661490..ab22f47f 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "windshaft-cartodb", - "version": "2.41.1", + "version": "2.41.2", "dependencies": { "body-parser": { "version": "1.14.2", diff --git a/package.json b/package.json index 6b1c28ee..aaec3a55 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "windshaft-cartodb", - "version": "2.41.1", + "version": "2.41.2", "description": "A map tile server for CartoDB", "keywords": [ "cartodb" From bfdaf67a9b13c769a757821fc29306a741711450 Mon Sep 17 00:00:00 2001 From: Raul Ochoa Date: Wed, 11 May 2016 19:57:05 +0200 Subject: [PATCH 5/5] Upgrades turbo-carto to 0.8.0 --- NEWS.md | 5 ++++- npm-shrinkwrap.json | 20 ++++++++++---------- package.json | 4 ++-- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/NEWS.md b/NEWS.md index 5d68fc9a..6f61c502 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,9 +1,12 @@ # Changelog -## 2.41.2 +## 2.42.0 Released 2016-mm-dd +Announcements: + - Upgrades turbo-carto to [0.8.0](https://github.com/CartoDB/turbo-carto/releases/tag/0.8.0) + ## 2.41.1 diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index ab22f47f..d0882518 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "windshaft-cartodb", - "version": "2.41.2", + "version": "2.42.0", "dependencies": { "body-parser": { "version": "1.14.2", @@ -90,7 +90,7 @@ }, "mime-types": { "version": "2.1.11", - "from": "mime-types@>=2.1.2 <2.2.0", + "from": "mime-types@>=2.1.10 <2.2.0", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.11.tgz", "dependencies": { "mime-db": { @@ -584,7 +584,7 @@ "dependencies": { "mime-types": { "version": "2.1.11", - "from": "mime-types@>=2.1.6 <2.2.0", + "from": "mime-types@>=2.1.10 <2.2.0", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.11.tgz", "dependencies": { "mime-db": { @@ -773,7 +773,7 @@ }, "mime-types": { "version": "2.1.11", - "from": "mime-types@>=2.1.6 <2.2.0", + "from": "mime-types@>=2.1.10 <2.2.0", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.11.tgz", "dependencies": { "mime-db": { @@ -927,7 +927,7 @@ }, "inherits": { "version": "2.0.1", - "from": "inherits@>=2.0.0 <3.0.0", + "from": "inherits@>=2.0.1 <2.1.0", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz" }, "isarray": { @@ -976,7 +976,7 @@ "dependencies": { "async": { "version": "1.5.2", - "from": "async@>=1.5.2 <2.0.0", + "from": "async@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz" } } @@ -988,7 +988,7 @@ }, "mime-types": { "version": "2.1.11", - "from": "mime-types@>=2.1.2 <2.2.0", + "from": "mime-types@>=2.1.10 <2.2.0", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.11.tgz", "dependencies": { "mime-db": { @@ -1215,9 +1215,9 @@ "from": "step-profiler@>=0.3.0 <0.4.0" }, "turbo-carto": { - "version": "0.7.1", - "from": "turbo-carto@0.7.1", - "resolved": "https://registry.npmjs.org/turbo-carto/-/turbo-carto-0.7.1.tgz", + "version": "0.8.0", + "from": "turbo-carto@0.8.0", + "resolved": "https://registry.npmjs.org/turbo-carto/-/turbo-carto-0.8.0.tgz", "dependencies": { "colorbrewer": { "version": "1.0.0", diff --git a/package.json b/package.json index aaec3a55..0829613f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "windshaft-cartodb", - "version": "2.41.2", + "version": "2.42.0", "description": "A map tile server for CartoDB", "keywords": [ "cartodb" @@ -37,7 +37,7 @@ "request": "~2.62.0", "step": "~0.0.6", "step-profiler": "~0.3.0", - "turbo-carto": "0.7.1", + "turbo-carto": "0.8.0", "underscore": "~1.6.0", "windshaft": "1.19.0" },