{"action":"created","comment":{"url":"https://api.github.com/repos/azavea/tilegarden/pulls/comments/199842641","pull_request_review_id":134033628,"id":199842641,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5OTg0MjY0MQ==","diff_hunk":"@@ -0,0 +1,63 @@\n+/**\n+ * This script uses carto to compile templated MML files\n+ * to XML that mapnik can understand\n+ */\n+\n+import carto from 'carto'\n+import path from 'path'\n+\n+import { readFile, writeFile } from './fs-promise'\n+\n+const IN_FILE = process.argv[2]\n+const OUT_FILE = process.argv[3]\n+const NODE_ENV = process.env.NODE_ENV === 'production'\n+console.log(`Production mode=${NODE_ENV}`)\n+\n+// Takes in a string and templates in the proper env variables\n+const fillTemplate = (mmlString) => {\n+    return mmlString.replace(/\\$\\{[a-z0-9_]+\\}/gi, (match) => {\n+        const varName = `${(NODE_ENV) ? 'PROD_' : 'DEV_'}${match.slice(2, match.length -1)}`\n+        return `\"${process.env[varName]}\"`\n+    })\n+}\n+\n+// Loads properly formatted MML into an MML object\n+const mmlToJSON = (fullMML) => {","path":"node_lambnik/src/tiler/src/util/build-xml.js","position":25,"original_position":25,"commit_id":"2d3d9fa03533168e763a72beef9d65497338aad5","original_commit_id":"2d3d9fa03533168e763a72beef9d65497338aad5","user":{"login":"KlaasH","id":6598836,"node_id":"MDQ6VXNlcjY1OTg4MzY=","avatar_url":"https://avatars3.githubusercontent.com/u/6598836?v=4","gravatar_id":"","url":"https://api.github.com/users/KlaasH","html_url":"https://github.com/KlaasH","followers_url":"https://api.github.com/users/KlaasH/followers","following_url":"https://api.github.com/users/KlaasH/following{/other_user}","gists_url":"https://api.github.com/users/KlaasH/gists{/gist_id}","starred_url":"https://api.github.com/users/KlaasH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KlaasH/subscriptions","organizations_url":"https://api.github.com/users/KlaasH/orgs","repos_url":"https://api.github.com/users/KlaasH/repos","events_url":"https://api.github.com/users/KlaasH/events{/privacy}","received_events_url":"https://api.github.com/users/KlaasH/received_events","type":"User","site_admin":false},"body":"This isn't converting MML to JSON, it's just converting an MML string to an MML object.  `loadMML` might be a better name.","created_at":"2018-07-03T15:06:09Z","updated_at":"2018-07-03T15:20:59Z","html_url":"https://github.com/azavea/tilegarden/pull/39#discussion_r199842641","pull_request_url":"https://api.github.com/repos/azavea/tilegarden/pulls/39","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/azavea/tilegarden/pulls/comments/199842641"},"html":{"href":"https://github.com/azavea/tilegarden/pull/39#discussion_r199842641"},"pull_request":{"href":"https://api.github.com/repos/azavea/tilegarden/pulls/39"}}},"pull_request":{"url":"https://api.github.com/repos/azavea/tilegarden/pulls/39","id":198794604,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk4Nzk0NjA0","html_url":"https://github.com/azavea/tilegarden/pull/39","diff_url":"https://github.com/azavea/tilegarden/pull/39.diff","patch_url":"https://github.com/azavea/tilegarden/pull/39.patch","issue_url":"https://api.github.com/repos/azavea/tilegarden/issues/39","number":39,"state":"open","locked":false,"title":"Feature/cartocss integration","user":{"login":"mattdelsordo","id":16990679,"node_id":"MDQ6VXNlcjE2OTkwNjc5","avatar_url":"https://avatars2.githubusercontent.com/u/16990679?v=4","gravatar_id":"","url":"https://api.github.com/users/mattdelsordo","html_url":"https://github.com/mattdelsordo","followers_url":"https://api.github.com/users/mattdelsordo/followers","following_url":"https://api.github.com/users/mattdelsordo/following{/other_user}","gists_url":"https://api.github.com/users/mattdelsordo/gists{/gist_id}","starred_url":"https://api.github.com/users/mattdelsordo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattdelsordo/subscriptions","organizations_url":"https://api.github.com/users/mattdelsordo/orgs","repos_url":"https://api.github.com/users/mattdelsordo/repos","events_url":"https://api.github.com/users/mattdelsordo/events{/privacy}","received_events_url":"https://api.github.com/users/mattdelsordo/received_events","type":"User","site_admin":false},"body":"## Overview\r\n\r\nOverhauls the way map configurations are specified. Database connection and map layer definitions are defined in map-config.mml, which is then converted into an xml file that mapnik can read at transpile time. Secrets are templated in from the environment in order to keep them off of version control and separate between development/production.\r\n\r\n\r\n### Notes\r\n\r\nTemplating in environment variables is good for keeping configurations separate between development and production environments, but at the end of the day secrets still end up in an XML file on AWS. This could be changed to happen at runtime avoid having credentials saved to a file but at the cost of performance, or the XML could be encrypted with something like `bcrypt` and then decrypted at runtime.\r\n\r\n\r\n## Testing Instructions\r\n\r\n * Run the development server with `./scripts/update` and `./scripts/server`. \r\n * Open `src/demo/pwd_inlets_index.html` to display an example map.\r\n * Open `src/tiler/src/res/style.mss` and change the `marker-fill` parameter. Wait for the server to restart and refresh the demo page to see the marker color update in your browser.\r\n\r\n\r\nResolves #25, resolves #28 \r\n\r\n","created_at":"2018-07-02T21:31:14Z","updated_at":"2018-07-03T15:20:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5ea1f5e3fbd7b45c0a388ec835b6f7d6b77fa0f8","assignee":{"login":"KlaasH","id":6598836,"node_id":"MDQ6VXNlcjY1OTg4MzY=","avatar_url":"https://avatars3.githubusercontent.com/u/6598836?v=4","gravatar_id":"","url":"https://api.github.com/users/KlaasH","html_url":"https://github.com/KlaasH","followers_url":"https://api.github.com/users/KlaasH/followers","following_url":"https://api.github.com/users/KlaasH/following{/other_user}","gists_url":"https://api.github.com/users/KlaasH/gists{/gist_id}","starred_url":"https://api.github.com/users/KlaasH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KlaasH/subscriptions","organizations_url":"https://api.github.com/users/KlaasH/orgs","repos_url":"https://api.github.com/users/KlaasH/repos","events_url":"https://api.github.com/users/KlaasH/events{/privacy}","received_events_url":"https://api.github.com/users/KlaasH/received_events","type":"User","site_admin":false},"assignees":[{"login":"KlaasH","id":6598836,"node_id":"MDQ6VXNlcjY1OTg4MzY=","avatar_url":"https://avatars3.githubusercontent.com/u/6598836?v=4","gravatar_id":"","url":"https://api.github.com/users/KlaasH","html_url":"https://github.com/KlaasH","followers_url":"https://api.github.com/users/KlaasH/followers","following_url":"https://api.github.com/users/KlaasH/following{/other_user}","gists_url":"https://api.github.com/users/KlaasH/gists{/gist_id}","starred_url":"https://api.github.com/users/KlaasH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KlaasH/subscriptions","organizations_url":"https://api.github.com/users/KlaasH/orgs","repos_url":"https://api.github.com/users/KlaasH/repos","events_url":"https://api.github.com/users/KlaasH/events{/privacy}","received_events_url":"https://api.github.com/users/KlaasH/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/azavea/tilegarden/pulls/39/commits","review_comments_url":"https://api.github.com/repos/azavea/tilegarden/pulls/39/comments","review_comment_url":"https://api.github.com/repos/azavea/tilegarden/pulls/comments{/number}","comments_url":"https://api.github.com/repos/azavea/tilegarden/issues/39/comments","statuses_url":"https://api.github.com/repos/azavea/tilegarden/statuses/2d3d9fa03533168e763a72beef9d65497338aad5","head":{"label":"azavea:feature/cartocss-integration","ref":"feature/cartocss-integration","sha":"2d3d9fa03533168e763a72beef9d65497338aad5","user":{"login":"azavea","id":595231,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU5NTIzMQ==","avatar_url":"https://avatars3.githubusercontent.com/u/595231?v=4","gravatar_id":"","url":"https://api.github.com/users/azavea","html_url":"https://github.com/azavea","followers_url":"https://api.github.com/users/azavea/followers","following_url":"https://api.github.com/users/azavea/following{/other_user}","gists_url":"https://api.github.com/users/azavea/gists{/gist_id}","starred_url":"https://api.github.com/users/azavea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azavea/subscriptions","organizations_url":"https://api.github.com/users/azavea/orgs","repos_url":"https://api.github.com/users/azavea/repos","events_url":"https://api.github.com/users/azavea/events{/privacy}","received_events_url":"https://api.github.com/users/azavea/received_events","type":"Organization","site_admin":false},"repo":{"id":135959961,"node_id":"MDEwOlJlcG9zaXRvcnkxMzU5NTk5NjE=","name":"tilegarden","full_name":"azavea/tilegarden","owner":{"login":"azavea","id":595231,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU5NTIzMQ==","avatar_url":"https://avatars3.githubusercontent.com/u/595231?v=4","gravatar_id":"","url":"https://api.github.com/users/azavea","html_url":"https://github.com/azavea","followers_url":"https://api.github.com/users/azavea/followers","following_url":"https://api.github.com/users/azavea/following{/other_user}","gists_url":"https://api.github.com/users/azavea/gists{/gist_id}","starred_url":"https://api.github.com/users/azavea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azavea/subscriptions","organizations_url":"https://api.github.com/users/azavea/orgs","repos_url":"https://api.github.com/users/azavea/repos","events_url":"https://api.github.com/users/azavea/events{/privacy}","received_events_url":"https://api.github.com/users/azavea/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/azavea/tilegarden","description":null,"fork":false,"url":"https://api.github.com/repos/azavea/tilegarden","forks_url":"https://api.github.com/repos/azavea/tilegarden/forks","keys_url":"https://api.github.com/repos/azavea/tilegarden/keys{/key_id}","collaborators_url":"https://api.github.com/repos/azavea/tilegarden/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/azavea/tilegarden/teams","hooks_url":"https://api.github.com/repos/azavea/tilegarden/hooks","issue_events_url":"https://api.github.com/repos/azavea/tilegarden/issues/events{/number}","events_url":"https://api.github.com/repos/azavea/tilegarden/events","assignees_url":"https://api.github.com/repos/azavea/tilegarden/assignees{/user}","branches_url":"https://api.github.com/repos/azavea/tilegarden/branches{/branch}","tags_url":"https://api.github.com/repos/azavea/tilegarden/tags","blobs_url":"https://api.github.com/repos/azavea/tilegarden/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/azavea/tilegarden/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/azavea/tilegarden/git/refs{/sha}","trees_url":"https://api.github.com/repos/azavea/tilegarden/git/trees{/sha}","statuses_url":"https://api.github.com/repos/azavea/tilegarden/statuses/{sha}","languages_url":"https://api.github.com/repos/azavea/tilegarden/languages","stargazers_url":"https://api.github.com/repos/azavea/tilegarden/stargazers","contributors_url":"https://api.github.com/repos/azavea/tilegarden/contributors","subscribers_url":"https://api.github.com/repos/azavea/tilegarden/subscribers","subscription_url":"https://api.github.com/repos/azavea/tilegarden/subscription","commits_url":"https://api.github.com/repos/azavea/tilegarden/commits{/sha}","git_commits_url":"https://api.github.com/repos/azavea/tilegarden/git/commits{/sha}","comments_url":"https://api.github.com/repos/azavea/tilegarden/comments{/number}","issue_comment_url":"https://api.github.com/repos/azavea/tilegarden/issues/comments{/number}","contents_url":"https://api.github.com/repos/azavea/tilegarden/contents/{+path}","compare_url":"https://api.github.com/repos/azavea/tilegarden/compare/{base}...{head}","merges_url":"https://api.github.com/repos/azavea/tilegarden/merges","archive_url":"https://api.github.com/repos/azavea/tilegarden/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/azavea/tilegarden/downloads","issues_url":"https://api.github.com/repos/azavea/tilegarden/issues{/number}","pulls_url":"https://api.github.com/repos/azavea/tilegarden/pulls{/number}","milestones_url":"https://api.github.com/repos/azavea/tilegarden/milestones{/number}","notifications_url":"https://api.github.com/repos/azavea/tilegarden/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/azavea/tilegarden/labels{/name}","releases_url":"https://api.github.com/repos/azavea/tilegarden/releases{/id}","deployments_url":"https://api.github.com/repos/azavea/tilegarden/deployments","created_at":"2018-06-04T02:21:44Z","updated_at":"2018-07-03T13:02:10Z","pushed_at":"2018-07-03T13:27:05Z","git_url":"git://github.com/azavea/tilegarden.git","ssh_url":"git@github.com:azavea/tilegarden.git","clone_url":"https://github.com/azavea/tilegarden.git","svn_url":"https://github.com/azavea/tilegarden","homepage":null,"size":3880,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":12,"license":null,"forks":0,"open_issues":12,"watchers":0,"default_branch":"develop"}},"base":{"label":"azavea:develop","ref":"develop","sha":"069851739de24e98e926152b3fac9b1ed41e672f","user":{"login":"azavea","id":595231,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU5NTIzMQ==","avatar_url":"https://avatars3.githubusercontent.com/u/595231?v=4","gravatar_id":"","url":"https://api.github.com/users/azavea","html_url":"https://github.com/azavea","followers_url":"https://api.github.com/users/azavea/followers","following_url":"https://api.github.com/users/azavea/following{/other_user}","gists_url":"https://api.github.com/users/azavea/gists{/gist_id}","starred_url":"https://api.github.com/users/azavea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azavea/subscriptions","organizations_url":"https://api.github.com/users/azavea/orgs","repos_url":"https://api.github.com/users/azavea/repos","events_url":"https://api.github.com/users/azavea/events{/privacy}","received_events_url":"https://api.github.com/users/azavea/received_events","type":"Organization","site_admin":false},"repo":{"id":135959961,"node_id":"MDEwOlJlcG9zaXRvcnkxMzU5NTk5NjE=","name":"tilegarden","full_name":"azavea/tilegarden","owner":{"login":"azavea","id":595231,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU5NTIzMQ==","avatar_url":"https://avatars3.githubusercontent.com/u/595231?v=4","gravatar_id":"","url":"https://api.github.com/users/azavea","html_url":"https://github.com/azavea","followers_url":"https://api.github.com/users/azavea/followers","following_url":"https://api.github.com/users/azavea/following{/other_user}","gists_url":"https://api.github.com/users/azavea/gists{/gist_id}","starred_url":"https://api.github.com/users/azavea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azavea/subscriptions","organizations_url":"https://api.github.com/users/azavea/orgs","repos_url":"https://api.github.com/users/azavea/repos","events_url":"https://api.github.com/users/azavea/events{/privacy}","received_events_url":"https://api.github.com/users/azavea/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/azavea/tilegarden","description":null,"fork":false,"url":"https://api.github.com/repos/azavea/tilegarden","forks_url":"https://api.github.com/repos/azavea/tilegarden/forks","keys_url":"https://api.github.com/repos/azavea/tilegarden/keys{/key_id}","collaborators_url":"https://api.github.com/repos/azavea/tilegarden/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/azavea/tilegarden/teams","hooks_url":"https://api.github.com/repos/azavea/tilegarden/hooks","issue_events_url":"https://api.github.com/repos/azavea/tilegarden/issues/events{/number}","events_url":"https://api.github.com/repos/azavea/tilegarden/events","assignees_url":"https://api.github.com/repos/azavea/tilegarden/assignees{/user}","branches_url":"https://api.github.com/repos/azavea/tilegarden/branches{/branch}","tags_url":"https://api.github.com/repos/azavea/tilegarden/tags","blobs_url":"https://api.github.com/repos/azavea/tilegarden/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/azavea/tilegarden/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/azavea/tilegarden/git/refs{/sha}","trees_url":"https://api.github.com/repos/azavea/tilegarden/git/trees{/sha}","statuses_url":"https://api.github.com/repos/azavea/tilegarden/statuses/{sha}","languages_url":"https://api.github.com/repos/azavea/tilegarden/languages","stargazers_url":"https://api.github.com/repos/azavea/tilegarden/stargazers","contributors_url":"https://api.github.com/repos/azavea/tilegarden/contributors","subscribers_url":"https://api.github.com/repos/azavea/tilegarden/subscribers","subscription_url":"https://api.github.com/repos/azavea/tilegarden/subscription","commits_url":"https://api.github.com/repos/azavea/tilegarden/commits{/sha}","git_commits_url":"https://api.github.com/repos/azavea/tilegarden/git/commits{/sha}","comments_url":"https://api.github.com/repos/azavea/tilegarden/comments{/number}","issue_comment_url":"https://api.github.com/repos/azavea/tilegarden/issues/comments{/number}","contents_url":"https://api.github.com/repos/azavea/tilegarden/contents/{+path}","compare_url":"https://api.github.com/repos/azavea/tilegarden/compare/{base}...{head}","merges_url":"https://api.github.com/repos/azavea/tilegarden/merges","archive_url":"https://api.github.com/repos/azavea/tilegarden/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/azavea/tilegarden/downloads","issues_url":"https://api.github.com/repos/azavea/tilegarden/issues{/number}","pulls_url":"https://api.github.com/repos/azavea/tilegarden/pulls{/number}","milestones_url":"https://api.github.com/repos/azavea/tilegarden/milestones{/number}","notifications_url":"https://api.github.com/repos/azavea/tilegarden/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/azavea/tilegarden/labels{/name}","releases_url":"https://api.github.com/repos/azavea/tilegarden/releases{/id}","deployments_url":"https://api.github.com/repos/azavea/tilegarden/deployments","created_at":"2018-06-04T02:21:44Z","updated_at":"2018-07-03T13:02:10Z","pushed_at":"2018-07-03T13:27:05Z","git_url":"git://github.com/azavea/tilegarden.git","ssh_url":"git@github.com:azavea/tilegarden.git","clone_url":"https://github.com/azavea/tilegarden.git","svn_url":"https://github.com/azavea/tilegarden","homepage":null,"size":3880,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":12,"license":null,"forks":0,"open_issues":12,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/azavea/tilegarden/pulls/39"},"html":{"href":"https://github.com/azavea/tilegarden/pull/39"},"issue":{"href":"https://api.github.com/repos/azavea/tilegarden/issues/39"},"comments":{"href":"https://api.github.com/repos/azavea/tilegarden/issues/39/comments"},"review_comments":{"href":"https://api.github.com/repos/azavea/tilegarden/pulls/39/comments"},"review_comment":{"href":"https://api.github.com/repos/azavea/tilegarden/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/azavea/tilegarden/pulls/39/commits"},"statuses":{"href":"https://api.github.com/repos/azavea/tilegarden/statuses/2d3d9fa03533168e763a72beef9d65497338aad5"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"KlaasH"}}