{"action":"created","issue":{"url":"https://api.github.com/repos/moodlehq/moodle-local_ci/issues/75","repository_url":"https://api.github.com/repos/moodlehq/moodle-local_ci","labels_url":"https://api.github.com/repos/moodlehq/moodle-local_ci/issues/75/labels{/name}","comments_url":"https://api.github.com/repos/moodlehq/moodle-local_ci/issues/75/comments","events_url":"https://api.github.com/repos/moodlehq/moodle-local_ci/issues/75/events","html_url":"https://github.com/moodlehq/moodle-local_ci/pull/75","id":135277536,"number":75,"title":"NOBUG: Centralize all the npm install stuff","user":{"login":"stronk7","id":167147,"avatar_url":"https://avatars.githubusercontent.com/u/167147?v=3","gravatar_id":"","url":"https://api.github.com/users/stronk7","html_url":"https://github.com/stronk7","followers_url":"https://api.github.com/users/stronk7/followers","following_url":"https://api.github.com/users/stronk7/following{/other_user}","gists_url":"https://api.github.com/users/stronk7/gists{/gist_id}","starred_url":"https://api.github.com/users/stronk7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stronk7/subscriptions","organizations_url":"https://api.github.com/users/stronk7/orgs","repos_url":"https://api.github.com/users/stronk7/repos","events_url":"https://api.github.com/users/stronk7/events{/privacy}","received_events_url":"https://api.github.com/users/stronk7/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"danpoltawski","id":533249,"avatar_url":"https://avatars.githubusercontent.com/u/533249?v=3","gravatar_id":"","url":"https://api.github.com/users/danpoltawski","html_url":"https://github.com/danpoltawski","followers_url":"https://api.github.com/users/danpoltawski/followers","following_url":"https://api.github.com/users/danpoltawski/following{/other_user}","gists_url":"https://api.github.com/users/danpoltawski/gists{/gist_id}","starred_url":"https://api.github.com/users/danpoltawski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danpoltawski/subscriptions","organizations_url":"https://api.github.com/users/danpoltawski/orgs","repos_url":"https://api.github.com/users/danpoltawski/repos","events_url":"https://api.github.com/users/danpoltawski/events{/privacy}","received_events_url":"https://api.github.com/users/danpoltawski/received_events","type":"User","site_admin":false},"milestone":null,"comments":7,"created_at":"2016-02-21T23:50:06Z","updated_at":"2016-02-24T19:57:24Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/moodlehq/moodle-local_ci/pulls/75","html_url":"https://github.com/moodlehq/moodle-local_ci/pull/75","diff_url":"https://github.com/moodlehq/moodle-local_ci/pull/75.diff","patch_url":"https://github.com/moodlehq/moodle-local_ci/pull/75.patch"},"body":"Right now there are a bunch of jobs requiring the\r\ninstallation of different nodejs stuff with npm.\r\n\r\nA) Chain of jobs by branch.\r\n\r\n- For branches < 29 (without package.json file):\r\n  - The job 'shifter_walk' uses 'shifterbase' to maintain different\r\n    shifter versions per branch. (current value ~/shifter_base)\r\n  - The job 'less_checker' uses 'recessbase' to maintain different\r\n    recess versions per branch. (current value ~/recess_base)\r\n- For branches >= 29 (with package.json file):\r\n  - The job 'grunt_process' uses 'npmbase' to maintain different stuff\r\n    (grunt, shifter, less, jshint...) per branch. (current value\r\n    ~npm_base).\r\n\r\nB) Prechecker.\r\n\r\n  - The job 'remote_branch_checker'' uses 'npmbase' to maintain different\r\n    stuff (grunt, shifter, less, jshint...) per branch. (current value\r\n    ~npm_base_prechecker). Run by 'grunt_process' above.\r\n\r\nC) New uses could also require the installation of npm stuff. For sure\r\n   in a different base from the already used above.\r\n\r\nSo, this new job is a \"universal\" nodejs stuff installer, behaving as\r\nfollows:\r\n\r\n1) npm will be in charge of installing any package.\r\n2) every use above (A, B, C) will use a different 'npmbase'.\r\n3) within every 'npmbase' stuff will be installed per branch, aka:\r\n  - A's own npmbase/branchname/node_modules\r\n  - B's own npmbase/branchname/node_modules\r\n  - ....\r\n\r\n4) If package.json is available, both grunt-cli and package.json stuff\r\n   will be installed. This is the way in 29 and up.\r\n5) If package.json is not available, but shifterversion has been\r\n   specified, shifter@version will be installed. This is for < 29.\r\n5) If package.json is not available, but recessversion has been\r\n   specified, recess@version will be installed. This is for < 29.\r\n6) At the end of the process all the installed binaries @\r\n   node_modules/bin will be listed.\r\n7) Link the correct node_modules directory in the gitdir being used. The\r\n   job using the installer will be in charge, if needed, of deleting the\r\n   link once the job is done.\r\n\r\nImportant note: This job does not perform any git operation (fetch,\r\ncheckout...). Just requires the gitdir and gitbranch params in order to\r\ndecide where packages will be installed and linked to.\r\n\r\nOnce this job is available, the idea is to use it for new uses (C above)\r\nand also, progresively, replace all the current A & B uses above.\r\n\r\nThat's it. Next step, replace, in the A, B jobs above, current partial\r\ninstallers of nodejs stuff by this universal alternative."},"comment":{"url":"https://api.github.com/repos/moodlehq/moodle-local_ci/issues/comments/188430614","html_url":"https://github.com/moodlehq/moodle-local_ci/pull/75#issuecomment-188430614","issue_url":"https://api.github.com/repos/moodlehq/moodle-local_ci/issues/75","id":188430614,"user":{"login":"danpoltawski","id":533249,"avatar_url":"https://avatars.githubusercontent.com/u/533249?v=3","gravatar_id":"","url":"https://api.github.com/users/danpoltawski","html_url":"https://github.com/danpoltawski","followers_url":"https://api.github.com/users/danpoltawski/followers","following_url":"https://api.github.com/users/danpoltawski/following{/other_user}","gists_url":"https://api.github.com/users/danpoltawski/gists{/gist_id}","starred_url":"https://api.github.com/users/danpoltawski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danpoltawski/subscriptions","organizations_url":"https://api.github.com/users/danpoltawski/orgs","repos_url":"https://api.github.com/users/danpoltawski/repos","events_url":"https://api.github.com/users/danpoltawski/events{/privacy}","received_events_url":"https://api.github.com/users/danpoltawski/received_events","type":"User","site_admin":false},"created_at":"2016-02-24T19:57:24Z","updated_at":"2016-02-24T19:57:24Z","body":"The reason I said this originally was just to simplify the script into only two branches \r\na) install npm \r\nb) install shifter/recess"}}