{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/remote-newtab/pulls/comments/45216556","id":45216556,"diff_hunk":"@@ -0,0 +1,297 @@\n+#! /usr/bin/env node\n+/* This Source Code Form is subject to the terms of the Mozilla Public\n+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,\n+ * You can obtain one at http://mozilla.org/MPL/2.0/. */\n+/**\n+ * Moves the site files, and performs localization on a per release branch basis.\n+ * How it works, for each of the release train branches:\n+ *\n+ *    1. it checks out the appropriate branch (e.g., nightly).\n+ *\n+ *    2. it sets up the appropriate directory structure:\n+ *      ./build/version/branch/locale/\n+ *\n+ *    3. it copies over the files:\n+ *      - the service worker.\n+ *      - the js and css folders\n+ *\n+ *    4. Performs localization on HTML template (src/lang-tag/index.html)\n+ *       using Handlebars.\n+ *\n+ *    5. Copies the localized HTML to the appropriate version/branch/locale\n+ *       directory.\n+ *\n+ *  Best of all, files that don't need to be localized are just placed at the\n+ *  \"branch\" level, so to avoid duplication. For example, there sw.js:\n+ *   ./build/v2/nightly/sw.js\n+ *\n+ *  Localized HTML and the string.json files, then gets place in:\n+ *    ./build/v2/nightly/ach/index.html\n+ *    ./build/v2/aurora/ach/locale/strings.json\n+ *\n+ */\n+/*jshint node:true, esnext: true*/\n+\"use strict\";\n+const async = require(\"marcosc-async\");\n+const path = require(\"path\");\n+const fetch = require(\"node-fetch\"); // jshint ignore:line\n+const fse = require(\"fs-extra\");\n+const handlebars = require(\"handlebars\");\n+const baseSrcDir = path.resolve(`${__dirname}/../src`);\n+const outBaseDir = path.resolve(`${__dirname}/../build`);\n+const l10nBaseDir = path.resolve(`${__dirname}/../l10n`);\n+const exec = require(\"child_process\").exec;\n+const version = \"v2\";\n+let workingBranch = \"gh-pages\";\n+\n+/**\n+ * Basic wrapper for performing Git operations asynchronously.\n+ *\n+ * @type {Object}\n+ */\n+const Git = {\n+  /**\n+   * Checks out a git branch.\n+   *\n+   * @param  {String} branch The branch to checkout out.\n+   * @return {Promise} Resolves when command is done executing.\n+   */\n+  checkout(branch) {\n+    return this.promisedExec(`git checkout ${branch}`);","path":"bin/movesrcfiles.js","position":60,"original_position":60,"commit_id":"7a7ad3df27b3c9c45eb4176b1b41fdfd79484d5b","original_commit_id":"7a7ad3df27b3c9c45eb4176b1b41fdfd79484d5b","user":{"login":"marcoscaceres","id":870154,"avatar_url":"https://avatars.githubusercontent.com/u/870154?v=3","gravatar_id":"","url":"https://api.github.com/users/marcoscaceres","html_url":"https://github.com/marcoscaceres","followers_url":"https://api.github.com/users/marcoscaceres/followers","following_url":"https://api.github.com/users/marcoscaceres/following{/other_user}","gists_url":"https://api.github.com/users/marcoscaceres/gists{/gist_id}","starred_url":"https://api.github.com/users/marcoscaceres/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcoscaceres/subscriptions","organizations_url":"https://api.github.com/users/marcoscaceres/orgs","repos_url":"https://api.github.com/users/marcoscaceres/repos","events_url":"https://api.github.com/users/marcoscaceres/events{/privacy}","received_events_url":"https://api.github.com/users/marcoscaceres/received_events","type":"User","site_admin":false},"body":"\n> On Nov 19, 2015, at 1:46 AM, Olivier Yiptong <notifications@github.com> wrote:\n> \n> In bin/movesrcfiles.js:\n> \n> > +let workingBranch = \"gh-pages\";\n> > +\n> > +/**\n> > + * Basic wrapper for performing Git operations asynchronously.\n> > + *\n> > + * @type {Object}\n> > + */\n> > +const Git = {\n> > +  /**\n> > +   * Checks out a git branch.\n> > +   *\n> > +   * @param  {String} branch The branch to checkout out.\n> > +   * @return {Promise} Resolves when command is done executing.\n> > +   */\n> > +  checkout(branch) {\n> > +    return this.promisedExec(`git checkout ${branch}`);\n> Notwithstanding the errors when running the script, I think doing a git checkout from the script might not be what we want to do.\n> \n> We want to use the branches for version numbers, not release branches just yet.\n> I know we have 2 dimensions of complexity: version number and release channel.\n> \n\nWe could only have one tho. If we start a new version, that's like a totally new project, no? \n\nI'm really worried that having two dimensions of complexity across X number of release channels will be extremely difficult to manage. \n\n> We have agreed to use branches for version numbers, however, we still need to figure out how to layer the channel dimension in the branching process.\n> \n> Let's not worry about release channels just yet.\n> \nOk, np. Let's sit on this till Orlando. Would be best we look at the various different approaches while we are all together. \n\nSound good? \n\n\n> —\n> Reply to this email directly or view it on GitHub.\n> \n","created_at":"2015-11-18T15:51:07Z","updated_at":"2015-11-18T15:51:07Z","html_url":"https://github.com/mozilla/remote-newtab/pull/146#discussion_r45216556","pull_request_url":"https://api.github.com/repos/mozilla/remote-newtab/pulls/146","_links":{"self":{"href":"https://api.github.com/repos/mozilla/remote-newtab/pulls/comments/45216556"},"html":{"href":"https://github.com/mozilla/remote-newtab/pull/146#discussion_r45216556"},"pull_request":{"href":"https://api.github.com/repos/mozilla/remote-newtab/pulls/146"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/remote-newtab/pulls/146","id":51062524,"html_url":"https://github.com/mozilla/remote-newtab/pull/146","diff_url":"https://github.com/mozilla/remote-newtab/pull/146.diff","patch_url":"https://github.com/mozilla/remote-newtab/pull/146.patch","issue_url":"https://api.github.com/repos/mozilla/remote-newtab/issues/146","number":146,"state":"open","locked":false,"title":"Tool for moving site files into place (l10n - Part 4)","user":{"login":"marcoscaceres","id":870154,"avatar_url":"https://avatars.githubusercontent.com/u/870154?v=3","gravatar_id":"","url":"https://api.github.com/users/marcoscaceres","html_url":"https://github.com/marcoscaceres","followers_url":"https://api.github.com/users/marcoscaceres/followers","following_url":"https://api.github.com/users/marcoscaceres/following{/other_user}","gists_url":"https://api.github.com/users/marcoscaceres/gists{/gist_id}","starred_url":"https://api.github.com/users/marcoscaceres/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcoscaceres/subscriptions","organizations_url":"https://api.github.com/users/marcoscaceres/orgs","repos_url":"https://api.github.com/users/marcoscaceres/repos","events_url":"https://api.github.com/users/marcoscaceres/events{/privacy}","received_events_url":"https://api.github.com/users/marcoscaceres/received_events","type":"User","site_admin":false},"body":" Moves the site files, and performs localization on a per release branch basis. How it works, for each of the release train branches:\r\n\r\n 1. it checks out the appropriate branch (e.g., nightly).\r\n 1. it sets up the appropriate directory structure:\r\n   ./build/version/branch/locale/\r\n 1. it copies over the files:\r\n   - the service worker.\r\n   - the js and css folders\r\n 1. Performs localization on HTML template (src/lang-tag/index.html)\r\n    using Handlebars.\r\n 1. Copies the localized HTML to the appropriate version/branch/locale\r\n    directory.\r\n\r\nBest of all, files that don't need to be localized are just placed at the \"branch\" level, so to avoid duplication. For example, there sw.js:\r\n * :file_folder: ./build/v2/nightly/sw.js\r\n\r\nLocalized HTML and the string.json files, then gets place in:\r\n * :file_folder: ./build/v2/nightly/ach/index.html\r\n * :file_folder: ./build/v2/aurora/ach/locale/strings.json\r\n\r\nHere is the folder structure: \r\n<img width=\"1217\" alt=\"screenshot 2015-11-18 21 23 31\" src=\"https://cloud.githubusercontent.com/assets/870154/11238665/53a4c9ce-8e3b-11e5-8026-7aa308876cbd.png\">\r\n","created_at":"2015-11-18T09:52:13Z","updated_at":"2015-11-18T15:51:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"71318f52e6090b6260f24a28bb2e519df0e86be9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/remote-newtab/pulls/146/commits","review_comments_url":"https://api.github.com/repos/mozilla/remote-newtab/pulls/146/comments","review_comment_url":"https://api.github.com/repos/mozilla/remote-newtab/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/remote-newtab/issues/146/comments","statuses_url":"https://api.github.com/repos/mozilla/remote-newtab/statuses/7a7ad3df27b3c9c45eb4176b1b41fdfd79484d5b","head":{"label":"mozilla:move_site_files","ref":"move_site_files","sha":"7a7ad3df27b3c9c45eb4176b1b41fdfd79484d5b","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":40678245,"name":"remote-newtab","full_name":"mozilla/remote-newtab","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/remote-newtab","description":"Remotely-hosted New Tab Page","fork":false,"url":"https://api.github.com/repos/mozilla/remote-newtab","forks_url":"https://api.github.com/repos/mozilla/remote-newtab/forks","keys_url":"https://api.github.com/repos/mozilla/remote-newtab/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/remote-newtab/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/remote-newtab/teams","hooks_url":"https://api.github.com/repos/mozilla/remote-newtab/hooks","issue_events_url":"https://api.github.com/repos/mozilla/remote-newtab/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/remote-newtab/events","assignees_url":"https://api.github.com/repos/mozilla/remote-newtab/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/remote-newtab/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/remote-newtab/tags","blobs_url":"https://api.github.com/repos/mozilla/remote-newtab/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/remote-newtab/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/remote-newtab/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/remote-newtab/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/remote-newtab/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/remote-newtab/languages","stargazers_url":"https://api.github.com/repos/mozilla/remote-newtab/stargazers","contributors_url":"https://api.github.com/repos/mozilla/remote-newtab/contributors","subscribers_url":"https://api.github.com/repos/mozilla/remote-newtab/subscribers","subscription_url":"https://api.github.com/repos/mozilla/remote-newtab/subscription","commits_url":"https://api.github.com/repos/mozilla/remote-newtab/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/remote-newtab/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/remote-newtab/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/remote-newtab/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/remote-newtab/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/remote-newtab/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/remote-newtab/merges","archive_url":"https://api.github.com/repos/mozilla/remote-newtab/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/remote-newtab/downloads","issues_url":"https://api.github.com/repos/mozilla/remote-newtab/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/remote-newtab/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/remote-newtab/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/remote-newtab/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/remote-newtab/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/remote-newtab/releases{/id}","created_at":"2015-08-13T19:37:51Z","updated_at":"2015-11-18T09:48:01Z","pushed_at":"2015-11-18T10:23:23Z","git_url":"git://github.com/mozilla/remote-newtab.git","ssh_url":"git@github.com:mozilla/remote-newtab.git","clone_url":"https://github.com/mozilla/remote-newtab.git","svn_url":"https://github.com/mozilla/remote-newtab","homepage":"https://mozilla.github.io/remote-newtab/src/","size":860,"stargazers_count":10,"watchers_count":10,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3,"mirror_url":null,"open_issues_count":34,"forks":3,"open_issues":34,"watchers":10,"default_branch":"gh-pages"}},"base":{"label":"mozilla:gh-pages","ref":"gh-pages","sha":"133f1e0d057d66f398e5331720b29b5974fab078","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":40678245,"name":"remote-newtab","full_name":"mozilla/remote-newtab","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/remote-newtab","description":"Remotely-hosted New Tab Page","fork":false,"url":"https://api.github.com/repos/mozilla/remote-newtab","forks_url":"https://api.github.com/repos/mozilla/remote-newtab/forks","keys_url":"https://api.github.com/repos/mozilla/remote-newtab/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/remote-newtab/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/remote-newtab/teams","hooks_url":"https://api.github.com/repos/mozilla/remote-newtab/hooks","issue_events_url":"https://api.github.com/repos/mozilla/remote-newtab/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/remote-newtab/events","assignees_url":"https://api.github.com/repos/mozilla/remote-newtab/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/remote-newtab/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/remote-newtab/tags","blobs_url":"https://api.github.com/repos/mozilla/remote-newtab/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/remote-newtab/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/remote-newtab/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/remote-newtab/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/remote-newtab/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/remote-newtab/languages","stargazers_url":"https://api.github.com/repos/mozilla/remote-newtab/stargazers","contributors_url":"https://api.github.com/repos/mozilla/remote-newtab/contributors","subscribers_url":"https://api.github.com/repos/mozilla/remote-newtab/subscribers","subscription_url":"https://api.github.com/repos/mozilla/remote-newtab/subscription","commits_url":"https://api.github.com/repos/mozilla/remote-newtab/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/remote-newtab/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/remote-newtab/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/remote-newtab/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/remote-newtab/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/remote-newtab/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/remote-newtab/merges","archive_url":"https://api.github.com/repos/mozilla/remote-newtab/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/remote-newtab/downloads","issues_url":"https://api.github.com/repos/mozilla/remote-newtab/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/remote-newtab/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/remote-newtab/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/remote-newtab/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/remote-newtab/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/remote-newtab/releases{/id}","created_at":"2015-08-13T19:37:51Z","updated_at":"2015-11-18T09:48:01Z","pushed_at":"2015-11-18T10:23:23Z","git_url":"git://github.com/mozilla/remote-newtab.git","ssh_url":"git@github.com:mozilla/remote-newtab.git","clone_url":"https://github.com/mozilla/remote-newtab.git","svn_url":"https://github.com/mozilla/remote-newtab","homepage":"https://mozilla.github.io/remote-newtab/src/","size":860,"stargazers_count":10,"watchers_count":10,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3,"mirror_url":null,"open_issues_count":34,"forks":3,"open_issues":34,"watchers":10,"default_branch":"gh-pages"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/remote-newtab/pulls/146"},"html":{"href":"https://github.com/mozilla/remote-newtab/pull/146"},"issue":{"href":"https://api.github.com/repos/mozilla/remote-newtab/issues/146"},"comments":{"href":"https://api.github.com/repos/mozilla/remote-newtab/issues/146/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/remote-newtab/pulls/146/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/remote-newtab/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/remote-newtab/pulls/146/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/remote-newtab/statuses/7a7ad3df27b3c9c45eb4176b1b41fdfd79484d5b"}}}}